SICRANO - Sicrano
Sicrano has a problem ... a geometry problem. He is not a very good in this area,
so he's asking for your help.
Given a set of points and a set of segments, tell, for each segment, how much
points lie in it.
The first integer T (T <= 20) in the input says that there are T test cases in the input. Each test case begins with two integer N and M (1 <= N, M <= 50). N means how many points exists in that test case, and M means how many segments exists in that test case. The next N pairs of integers represents the points. Each pair describes the coordinates x and y of a point. (0 <= x, y <= 100). After that, the segments will be listed. Each segment is described by the coordinates of its two extreme points. All values in the input are integers. See the sample input for clarification.
For each segment, print how many points are in it.
0 0 5 5
3 3 4 4
0 0 1 0 Output: 4
Make sure to make use of a small delta value (~0.000001) for tolerance when comparing two double values especially in Java.
I don't think it was absolutely vital to leave a spoiler in the comments, even with a star studded warning.
ac in one go.....
Good Question, AC finally!
good ques.........finally got AC.........
are same points considrd same or diff..???
Good question, finally AC :) ... no special cases, but consider all possibilities.
1. Is a segment of length 0 a segment?
Don't know why i read the comment before solving it...:(