The space between us X13839


Statement
 

pdf   zip

html

Input

The input consists of a variable number of lines: - The first line contains an integer bigger than 0 that represents the number of people that entered into the emergency room. - The next lines contain three fields separated by spaces: patient name, arrival and leaving times expressed in 24h format (HH:MM)

Output

The output should be a series of lines like this:

Max capacity of *X* people during *Y* minutes with following people: *list of names present in the room*

where *X* is the maximum number of people present in the room, *Y* is the number of minutes that the *X* persons stay in the room together and the list of the names of people present in the room ordered by arrival time and separated by commas.

Public test cases
  • Input

    3
    Alexandra 09:30 10:30
    Bob 09:50 10:20
    Carol 09:45 10:15
    

    Output

    Max capacity of 3 people during 25 minutes with following people: Alexandra, Carol, Bob
    
  • Input

    6
    Ann 07:31 09:36
    Billy 07:53 09:19
    Charles 07:45 09:15
    David 10:20 13:45
    Esther 11:30 19:33
    Frances 10:55 11:52
    

    Output

    Max capacity of 3 people during 82 minutes with following people: Ann, Charles, Billy
    Max capacity of 3 people during 22 minutes with following people: David, Frances, Esther
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    Python