5347 - 数论:威尔逊定理:求和
Time Limit : 2 秒
Memory Limit : 128 MB
Input
The first line contains the number of queries t (t <= 10^6). Each query consist of one natural number n (1 <= n <= 10^6).
Output
For each n given in the input output the value of Sn.
Examples
Input复制
13 1 2 3 4 5 6 7 8 9 10 100 1000 10000
Output复制
0 1 1 2 2 2 2 3 3 4 28 207 1609
Source
hdu2973 YAPTCHA