409418: GYM103535 F Link with Grenade

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Link with Grenadetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

"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 $$$v_0$$$ m/s and explode time $$$t$$$ s, which was thrown in a random direction. When the grenade explodes, it will hurt anyone whose distance to it is no more than $$$r$$$. 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 $$$10^9+7$$$.

Note1: This is a 3D game. In this game, the acceleration of gravity is $$$10$$$ $$$m/s^2$$$.

Note2: It can be proved that the answer can always be represented as $$$\frac{p}{q}$$$, where the greatest common factor between $$$p$$$ and $$$q$$$ is $$$1$$$. When outputting the answer modulo $$$M$$$, you should output such an integer $$$x$$$ that $$$0 \leq x < M$$$ and $$$ x \cdot q \equiv p (mod\ M) $$$.

Input

The input consists of multiple test cases.

The first line contains an integer $$$T$$$ ($$$1 \leq T \leq 10^5$$$) – the number of test cases.

Each test case contains three integers $$$t_0,v_0$$$ and $$$R$$$ ($$$1 \leq t_0,v_0,R \leq 100$$$).

Output

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

ExampleInput
5
1 10 10
1 16 10
1 15 10
1 4 10
1 5 10
Output
625000005
1
1
0
0

加入题单

上一题 下一题 算法标签: