#K14021. Maximum Employee Availability
Maximum Employee Availability
Maximum Employee Availability
You are given the schedules of \( n \) employees for a week. Each schedule is provided on a separate line as a list of integers in groups of three, where each group represents an available time interval. In each group, the first integer is the day of the week (\(0\) for Sunday to \(6\) for Saturday), and the next two integers represent the starting hour and the ending hour (in the range \(0\) to \(24\)) of that interval.
Your task is to determine the day and the starting hour of the one-hour time slot during which the maximum number of employees are available. If multiple time slots have the same number of available employees, choose the earliest one in the week (first by day, then by hour).
inputFormat
The input is read from standard input (stdin). The first line contains a single integer ( n ) denoting the number of employees. Each of the following ( n ) lines describes one employee’s schedule as a space-separated list of integers. Each employee’s schedule consists of one or more groups of three integers: the day (an integer from 0 to 6), the starting hour (an integer from 0 to 23) and the ending hour (an integer from 1 to 24).
outputFormat
Output to standard output (stdout) two integers separated by a space. The first integer is the day of the week, and the second integer is the starting hour of the one-hour time slot with the maximum number of available employees.## sample
1
0 0 24
0 0