405856: GYM102135 I Happy triangles
Description
There are non-degenerate obtuse triangles where shortest sides differ by no more than q times from each other. Let us call them happy triangles. Find the number of happy triangles that can be formed with angles at the indicated points for the given set of points.
InputThe first line contains two numbers n and q (1 ≤ n ≤ 1 000, 1 ≤ q ≤ 30 000) — the number of points and the factor for the sides comparison respectively. The factor q is given with exactly two decimal places.
Each of the following n rows contains two integers xi yi (|xi|, |yi| ≤ 104) — coordinates of the i-th point.
It is guaranteed that any two given points are distinct and that for any triple of different points A B C the condition |D(A, B) - D(A, C) * Q| > 10 - 6 is fulfilled. D(A, B) is Euclidean distance between points A and B.
OutputA single line contains the number of happy triangles.
ExamplesInput6 2.01Output
0 2
2 4
-1 3
0 0
1 3
1 2
6Input
9 2.64Output
10 -7
0 -6
-1 8
9 -3
-1 10
-3 -1
9 9
-1 -5
4 -3
42