We are given a pair of circles in 2D. We have the centre point of both the circles in 2D and its radius. We have to find 2 points P1, P2 such that P1 is on the perimeter of circle A and P2 is on the perimeter of circle B and the distance between them is K.
I came up with an idea of constructing a triangle between C1, P1 and C2 where C1 is centre point of Circle 1, P1 is point on Circle 1 and C2 is centre point of circle 2. But it didn't work.
I guess this is a problem from live contest . But still I'll give you some hints.
Try to find Minimum and Maximum distance for 3 cases:
Now all Integer Points in the range [min,max] are points of the circle , so just check the Euclidean distance for each pair in the range and count such points simultaneously.