405561: GYM101992 I A sky full of stars

Memory Limit:1024 MB Time Limit:15 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. A sky full of starstime limit per test15 secondsmemory limit per test1024 megabytesinputpoints.inoutputstandard output

Badry and the ECPC judges travelled to Wadi El-Hitan, a beautiful place in Egypt with clear view of the sky to enjoy looking at the stars, and have fun after working for many consecutive days on the contest.

The judges finally thought they could get a break, but given Mostafa's unconditional love for Mathematics, he couldn't spend the night without challenging them to count how many triplets of stars form a right angled triangle with an area in range [L, R].

To simplify the situation, he told them to consider the sky as a 2D plane where each star is a point.

Given N distinct stars, count the number of these triangles, and help the poor judges!

Input

The first line of the input is the number of test cases T.

Each test case starts with a line containing three integers N, L and R, where 1 ≤ N ≤ 1000, 1 ≤ L ≤ R ≤ 1018.

Each of the following N lines represent a point (star) and contains two integers xi and yi, where |xi|, |yi| ≤ 109.

Output

For each test case output a single integer in a separate line, the answer to the problem.

ExampleInput
4
7 1 100
0 0
2 0
0 2
10 0
0 10
3 3
3 -3
7 5 15
0 0
2 0
0 2
10 0
0 10
3 3
3 -3
7 7 9
0 0
2 0
0 2
10 0
0 10
3 3
3 -3
7 10 15
0 0
2 0
0 2
10 0
0 10
3 3
3 -3
Output
5
3
1
2

加入题单

算法标签: