5496: F-Link with Grenade

内存限制:256 MB 时间限制:2.000 S
评测方式:文本比较 命题人:
提交:1 解决:1

题目描述

"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 v0 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 109+7.

输入

The input consists of multiple test cases.
The first line contains an integer T (1≤T≤105) -- the number of test cases.
Each test case contains three integers t0,v0 and R (1≤t0,v0,R≤100).

输出

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

样例输入 复制

5
1 10 10
1 16 10
1 15 10
1 4 10
1 5 10

样例输出 复制

625000005
1
1
0
0

提示

Note1: This is a 3D game. In this game, the acceleration of gravity is 10 m/s2.

Note2: It can be proved that the answer can always be represented as 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≤x<M and x⋅q≡p(mod M).