Your Memory Test

0

0 votes
Problem

Akar always wanted to be a part of Indian Intelligence and this time he made his mind to appear for the selection exam and he prepared for it throughout the year and was able to clear it with good rank and was called for further examinations such as physical and mental screening. He was able to clear the physical screening and entered into the mental round in which he had to pass a memory test.

For this test, he was given a coordinate (x,y) to remember for 3 days, but since his memory power was a little week in remembering numbers and he forgot the y-coordinate but he remembered that the point(x,y) given to him was such as that there was no other point that lied on the line joining that point to origin in the integer plane.Also the magnitude of the y coordinate is less than the x-coordinate and is positive in sign.

Now your task is to find the probability that he would pass the memory test.

Note: It can be shown that the expected value of probability can be expressed as an irreducible fraction P/Q, where P and Q are non-negative integers and Q is coprime to (109+7). You should find P⋅Q-1 modulo (109+7), where Q-1 denotes the multiplicative inverse of Q modulo (109+7). 


INPUT: The first line of the input contains a single integer T, denoting the number of test cases and each of the next t lines contains an integer N, denoting the magnitude of x-coordinate.

OUTPUT: Print a single line containing one integer P.Q-1 % (109+7).

CONSTRAINTS:

1<T<100.

1<N<105.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?