#C344. Maximum Employees in a Department
Maximum Employees in a Department
Maximum Employees in a Department
You are given a list of employee IDs and a corresponding list of department numbers. Each employee belongs to exactly one department. Your task is to determine the maximum number of employees in any single department.
Input Format: The input starts with an integer T, the number of test cases. For each test case, the first line contains an integer N representing the number of employees. The second line contains N space‐separated integers denoting the employee IDs (which are not used in computing the answer). The third line contains N space‐separated integers where the ith integer represents the department number for the ith employee.
Your goal is to output, for each test case, a single integer: the maximum number of employees that belong to the same department.
The solution involves counting the frequency of each department and then selecting the maximum count. Mathematically, if \(d_i\) indicates the department of employee \(i\) and \(f(k)=\#\{i: d_i=k\}\), then the answer is \(\max_k f(k)\).
inputFormat
Standard input (stdin) will consist of multiple test cases. The first line contains an integer T denoting the number of test cases. Each test case is described as follows:
- A single integer N representing the number of employees.
- A line with N space-separated integers representing the employee IDs.
- A line with N space-separated integers representing the corresponding department numbers.
outputFormat
For each test case, output on a new line the maximum number of employees in any department. The output should be written to standard output (stdout).
## sample2
5
101 102 103 104 105
1 2 1 3 1
6
201 202 203 204 205 206
2 2 3 3 3 4
3
3
</p>