Limits 1s, 512 MB

N students were gathered in front of CSEmpur gate. They wanted to take a tour of the famous CSEmpur city. It was Halum’s day to guard the gate. He noticed that some students were very talkative and thus disturbing others. Although most of the students were very patient and tolerant, some had a very low tolerance level and they became angry with their classmates.

Precisely, each of the N students have a disturbing tendency and a tolerance level. Among two students, if the tolerance level of 1st student is less than the disturbing tendency of the 2nd student, then the 1st student becomes angry. Formally, if among two students A and B, TA < DB, where TA is the tolerance level of A and DB is the disturbing tendency of B, then A becomes angry.

Halum doesn't want any student to get angry inside CSEmpur, he will rather send some home. So, he will let such a group of students to get inside CSEmpur so that no one in that group is angry. That is, there is no student among that group, whose disturbing tendency is greater than someone else’s tolerance level (or even his own tolerance. He might be angry with himself too. Life's tough). The rest of the students are sent back home. Being the kind tiger that he is, Halum wanted to send back the least amount of students.

Now he came to you for help. He gave you the tolerance level and disturbing tendency for each student, write a program to tell him what is the largest possible group where no one is angry.

Input

The first line of input contains T (1 ≤ T ≤ 100000), the number of test cases. Then T test cases follow.

First line of each test case contains an integer N - the number of students. The second line of test case contains N integers D1, D2 ... Dn , where Di is the disturbance tendency of the ith student. The third line of test case contains N integers T1, T2 ... Tn , where Ti is the tolerance level of the ith student.

Constraints

1 ≤ N ≤ 100000

1 ≤ Ti ≤ 100000

1 ≤ Di ≤ 100000

It is guaranteed that the sum of N over all test cases do not exceed 100000 and sum of max(Ti) over all test cases does not exceed 200000.

Output

For each test case, print a single line of the format "Case t: x" without the quotation mark, where t is the case number and x is the size of the largest group of students possible for that case.

Sample

InputOutput
2
4
2 4 1 5
5 6 3 2
5
1 13 11 3 2
4 15 14 12 10
Case 1: 2
Case 2: 3

In the first case, 1st and 2nd students can form a group. Also, 1st and 3rd student can form a group. No groups of size 3 can be formed.

In the second case, student 1,4 and 5 can form a group.


Submit

Login to submit.

Statistics

67% Solution Ratio
any_79Earliest, Mar '20
moiddaFastest, 0.0s
JoytunLightest, 1.4 MB
steinumShortest, 745B
Toph uses cookies. By continuing you agree to our Cookie Policy.