F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Integral Calculus

Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 532768/532768 K (Java/Others)
Total Submission(s): 76    Accepted Submission(s): 28


Problem Description
Ely has just faced a complicated math problem. So she now needs assistance of you ¨C a talented programmer. The problem is as below.

Given a positive integer N, calculate the following value:

We can prove that it is a rational number. Let¡¯s denote it by $Q/P$, where gcd(P,Q)=1 and P,Q>0. Since these numbers can be very huge for large N, you are only to print the value $Q \cdot P^{-1}$ mod ($10^9$+9). Here $P^{-1}$ is multiplicative inverse of P modulo $10^9$+9.
 

Input
The first line of the input contains a single integer T(1¡ÜT¡Ü$10^5$), the number of test cases.

Each of the next T lines contains an integer N(1¡ÜN¡Ü$10^5$ ), which is described above.
 

Output
For each test case, you should print the answer in a single line.
 

Sample Input
1 1
 

Sample Output
400000006
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-19 16:31:01, Gzip enabled