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

Math is Simple

Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 636    Accepted Submission(s): 189


Problem Description
Here is a simple math. You are given an integer n. Your task is to calculate the following:
 

Input
The first line contains an integer T (1¡ÜT¡Ü$10^4$), denoting the number of test cases. The only line of each test case contains an integer n (2¡Ün¡Ü$10^8$).
 

Output
In fact, the answer can be represented as a fraction Q/P, where $gcd(P,Q)=1$ and P,Q>0. Since these numbers can be very huge for large n, you are only required to print $Q \cdot P^{-1}$ mod 998244353.

For each test case, print a single line with the calculated value.
 

Sample Input
3 2 3 4
 

Sample Output
499122177 1 831870295
 

Hint

Real answer for sample test cases are 1/2,1,5/6 respectively.
 

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-11-24 23:17:53, Gzip enabled