Line of Sight

No attempts yetTime limit1sMemory limit128 MB

Problem

Farmer John's NN cows stand at NN distinct points of his pasture. A large round grain silo sits in the middle of the pasture. Cows on opposite sides of the silo cannot see each other because the silo blocks the view. Count the pairs of cows that can see each other.

Seen from above, the silo is a circle of radius RR centered at the origin (0,0)(0, 0). Two cows can see each other when the segment joining them does not meet this circle, and cannot when it does.

No cow stands inside the circle or on it, and no line through two cows is tangent to the circle.

Input

The first line has the number of cows NN and the silo radius RR (1N500001 \le N \le 50000, 1R10000001 \le R \le 1000000).

Each of the next NN lines has the coordinates xx and yy of one cow (1000000x,y1000000-1000000 \le x, y \le 1000000). All input values are integers.

Output

Print the number of pairs of cows that can see each other.

Hint

In the first example four cows stand at (0,10)(0, 10), (0,10)(0, -10), (10,0)(10, 0) and (10,0)(-10, 0) around a silo of radius 55. There are six ways to pick two of the four cows, and the two pairs that face each other across the silo cannot see each other: (0,10)(0, 10) with (0,10)(0, -10), and (10,0)(10, 0) with (10,0)(-10, 0). The other four pairs can see each other.