#P7952. Link with Grenade

Link with Grenade

Link with Grenade

Problem Description

"We are wasting time, let's go." "Terrorists win." "Form up, let's go." "Terrorists win." ...... After being defeated several times, he was so angry that he decided to cheat. He used some tricks to make himself fly really high so that nobody could hurt him. He started to throw grenades, but he suddenly found that he had only 1 hp, which means he would die if the grenade hurt him. Now, Link wants to know the possibility that he will die. Formally, there is a grenade with initial speed v0v_0 m/s and explode time tt s, which was thrown in a random direction. When the grenade explodes, it will hurt anyone whose distance to it is no more than rr. Supposing that the grenade didn't touch anything before explosion, and the man didn't move after throwing the grenade, you should output the probability that the man will survive . In order to check your answer precisely, you should output it modulo 109+710^9+7. Hint Note1: This is a 3D game. In this game, the acceleration of gravity is 1010 m/s2m/s^2. Note2: It can be proved that the answer can always be represented as pq\frac{p}{q}, where the greatest common factor between pp and qq is 11. When outputting the answer modulo MM, you should output such an integer x that 0x<M0 \leq x < M and xqp(mod M) x \cdot q \equiv p (mod\ M) .

Input

The input consists of multiple test cases. The first line contains an integer TT (1T1051 \leq T \leq 10^5) -- the number of test cases. Each test case contains three integers t0,v0t_0,v_0 and RR (1t0,v0,R1001 \leq t_0,v_0,R \leq 100).

Output

For each test case, print the answer modulo 109+710^9+7 in a single line.

Sample Input

5

1 10 10

1 16 10

1 15 10

1 4 10

1 5 10

Sample Output

625000005

1

1

0

0

Source

2021“MINIEYE杯”中国大学生算法设计超级联赛(7)