Pied Piper has returned to the town of Hamelin in Germany near the head office of Endurance and has decided to take away the town's children to his cave.
He knows that the total number of children in the town are S. As today is a special occasion, the Hamelinites are in church and the piper dressed in green starts playing his pipe.
This time he has a more sophisticated plan. He has a total of C caves and his target is to take away exactly Z children to any of his caves. By the magical power in his pipe he can instruct any child to move to any cave.
Each cave has the capacity of only one child.
He wants to send Z children to the cave as soon as possible. More formally, he wants the first Z children to reach the destination in minimum time. As children are in a trance , all of them start moving at the same time with same pace i.e unit distance per second.
Consider city of Hamelin as a 2D plane.
Let x1,y1 and x2,y2 be two points in the plane. Distance between the points is given as:
(x2-x1) ^ 2 + (y2-y1) ^ 2
He wants to know the minimum time in which he can accomplish his plan.
First line of input contains S,C and Z which denotes number of children in town, number of caves and number of children that he requires respectively.
Next S lines contains the coordinates xi and yi of the children
Following C lines contains coordinates of cave.
Output the minimum time as explained above.
0 < S ,C, Z < 2000
0 <= xi,yi <= 10^8
It is guaranteed that Z is always less than or equal to minimum of S and C.
Setter : Akshat Dua
Since Pied Piper needs only 2 children, he can instruct child at :
(0,1) to move to (1,1) (distance = 1)
(0,3) to move to (2,2) (distance = 5).
Hence the total time by which 2 children would have reached the cave is 5, as both of them start moving at the same time with same pace.