Problem: Polycarp is an organizer of a Berland ICPC regional event. There are universities in Berland numbered from to . Polycarp knows all competitive programmers in the region. There are students: the -th student is enrolled at a university and has a programming skill .
Polycarp has to decide on the rules now. In particular, the number of members in the team.
Polycarp knows that if he chooses the size of the team to be some integer , each university will send their strongest (with the highest programming skill ) students in the first team, the next strongest students in the second team and so on. If there are fewer than students left, then the team can't be formed. Note that there might be universities that send zero teams.
The strength of the region is the total skill of the members of all present teams. If there are no teams present, then the strength is .
Help Polycarp to find the strength of the region for each choice of from to .
Input Format: The first line contains a single integer () — the number of testcases.
The first line of each testcase contains a single integer () — the number of universities and the number of students.
The second line of each testcase contains integers () — the university the -th student is enrolled at.
The third line of each testcase contains integers () — the programming skill of the -th student.
The sum of over all testcases doesn't exceed .
Output Format: For each testcase print integers: the strength of the region — the total skill of the members of the present teams — for each choice of team size .
Note: In the first testcase the teams from each university for each are:
- : university : ; university : ;
- : university : ; university : ;
- : university : ; university : ;
- : university : ;