Math is Simple

TimeLimit:6000MS  MemoryLimit:524288KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
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.
SampleInput
3
2
3
4
SampleOutput
499122177
1
831870295

 Hint Real answer for sample test cases are 1/2,1,5/6 respectively.
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: