def display_timedelta(minutes):
    """Converts timedelta in minutes to human friendly format.

    Parameters
    ----------
    minutes: int

    Returns
    -------
    string
        The timedelta in 'x days y hours z minutes' format.

    Raises
    ------
    ValueError
        If the timedelta is negative.
    """
    def plural(num):
        if num != 1:
            return 's'
        else:
            return ''
    if minutes < 0:
        raise ValueError
    days = minutes // 1440
    hours = minutes // 60 % 24
    minutes = minutes % 60
    time_elements = []
    if days > 0:
        time_elements.append(f'{days} day{plural(days)}')
    if hours > 0:
        time_elements.append(f'{hours} hour{plural(hours)}')
    if minutes > 0 or (days == 0 and hours == 0):
        time_elements.append(f'{minutes} minute{plural(minutes)}')
    time_string = ' '.join(time_elements)
    return time_string