P21457 [HackerEarth] "We have a holiday tomorrow, its Ambedkar Jayanti" says Chotu.
普及-
题目描述

"We have a holiday tomorrow, its Ambedkar Jayanti" says Chotu.
"I will sleep and eat whole day!!" exclaims Motu.
"Also we don't have to attend the two class of B.S.S :p" says Chotu cheerfully.
Chotu and Motu have no idea that their chat has been overheard by a third year senior. As they love troubling the first years. They made a plan to ruin their holiday.
The plan is very naive - just take a class the next day, also they decide that the class will start at 03:00 PM so that the first years have to face the scorching heat on
their way to class.

Yes they are pretty evil :p

Late night the first years receives a mail with the subject "Regarding Competitive Coding Classes". An urgent meeting has been arranged to counter this evil move of the seniors.

"After that boring lecture on Heaps who will attend the lectures" shouts someone
"No it's a new topic we should go"
The students were confused whether to attend the class or not.
Chotu has been observing all this chaos and comes forward to explain his plan, so that each student can independently decide whether to attend the lecture or not.
"Just calculate your Willingness factor (W), it will help you decide" says Chotu.
Everyone agrees with Chotu's plan.
Now Willingness factor is pretty hard to calculate so only a good programmar can calculate it.
Hence you are given the responsiblility to calculate the Willingness factor for each of the student.

Each of the T student has following three attributes.
1) Energy denoted by N.
2) Patience denoted by M.
3) Current Codechef rating K.

Let W(N, M, K) be the willingness factor.

W(N, M, K) = (Numerator / Denominator) % K
Numerator = Fac(N + M) * Fac(N + M + 1)
Denominator = Fac(N) * Fac(N + 1) * Fac(M) * Fac(M + 1)

Note - W(N, M, K) will always be integral i.e, (Numerator % Denominator = 0) .
Note - Fac(X) = X! = 1 * 2 * 3 * 4 * 5 .. . .. . .* X.
Can you calculate the Willingness factor for each student.

INPUT
First line of input contains T the number of the first year students.
Next T lines contain 3 integers each N, M, K, denoting the energy, patience and the ranking of the student.
OUTPUT
For each student print the willingness factor W.

CONSTRAINTS
1 ≤ T ≤ 20
1 ≤ N ≤ M ≤ 10^5
1 ≤ K ≤ 10^9 + 7

SAMPLE INPUT
5
3 3 1000000007
3 3 5
5 5 12
5 5 87
5 5 95

SAMPLE OUTPUT
175
0
0
3
24

输入格式

见题面

输出格式

见题面

样例输入
20 100000 30000 9999995 99999 29999 9999994 99998 29998 9999993 99997 29997 9999992 99996 29996 9999991 99995 29995 9999990 99994 29994 9999989 99993 29993 9999988 99992 29992 9999987 99991 29991 9999986 99990 29990 9999985 99989 29989 9999984 99988 29988 9999983 99987 29987 9999982 99986 29986 9999981 99985 29985 9999980 99984 29984 9999979 99983 29983 9999978 99982 29982 9999977 99981 29981 9999976
样例输出
1 0 0 0 0 0 35 0 0 0 70 0 0 0 0 0 45 0 0 50