#C4574. Max Tasks Employee

    ID: 48127 Type: Default 1000ms 256MiB

Max Tasks Employee

Max Tasks Employee

You are given a list of employees. Each employee has an identifier and a list of tasks assigned to them. For each employee, only the number of tasks matters (the specific details of each task, such as the time required, are irrelevant). Your goal is to determine the employee with the maximum number of tasks. In case of a tie (i.e. when two or more employees have the same number of tasks), output the employee with the smallest identifier.

Note: The input format is designed such that each employee's data is provided on a single line after the initial count of employees. Each employee record begins with the employee's identifier, followed by the number of tasks, and then the task information (which can be ignored apart from counting the tasks). The formula to decide the winner can be summarized as:

[ \text{result} = \min{\text{employee id } i \mid T_i = \max_j T_j} ]

where \(T_i\) is the number of tasks assigned to the \(i\)-th employee.

inputFormat

The first line of input contains an integer \(N\) which represents the number of employees. Each of the following \(N\) lines contains the description for one employee:

  • An integer representing the employee identifier.
  • An integer \(T\) representing the number of tasks assigned to the employee.
  • \(T\) integers follow, each representing the time required for a task (these values are not used in the decision making, only the count is important).

All values are space-separated.

outputFormat

Output a single integer denoting the identifier of the employee who has the maximum number of tasks. If there is a tie, output the smallest identifier among them.

## sample
1
1 1 2
1