Hide

Problem D
Square Peg in a Round Hole

Mr. Johnson likes to build houses. In fact, he likes it so much that he has built a lot of houses that he has not yet placed on plots. He has recently acquired $N$ circular plots. The city government has decided that there can be only one house on each plot, and a house cannot touch the boundary of the plot.

Mr. Johnson has $M$ circular houses and $K$ square houses. Help him figure out how many of the plots he can fill with houses so that he can get some money back on his investments.

Input

The first line of input consists of $3$ space-separated integers $N$, $M$, and $K$. The second line contains $N$ space-separated integers, where the $i^{\text {th}}$ integer denotes the radius $r_ i$ of the $i^{\text {th}}$ plot. The third line contains $M$ space-separated integers, where the $i^{\text {th}}$ integer denotes the radius $r_ i$ of the $i^{\text {th}}$ circular house. The fourth line contains $K$ space-separated integers, where the $i^{\text {th}}$ integer denotes the side length $s_ i$ of the $i^{\text {th}}$ square house.

Output

Output the largest number of plots he can fill with houses.

Limits

  • $1 \leq N, M, K, r_ i, s_ i \leq 100$

Sample Input 1 Sample Output 1
5 3 3
1 2 6 7 8
2 6 7
4 8 9
3

Please log in to submit a solution to this problem

Log in