def split_time_range(start_time, duration):
    """
    Given a start time and a duration, returns a 3-tuple containing
    the time left for the current day, a number of plain day left, a number of hours left
    for the last day
    """
    if start_time + duration <= 24:
        # end is inside the first day
        return duration, 0, 0

    time_left_first = 24 - start_time
    plain_days = (duration - time_left_first) // 24
    time_left_last = (duration - time_left_first) % 24
    return time_left_first, int(plain_days), time_left_last