OI Problems   关于

#31edyx. On Sum of Fractions

时间限制:2 s       空间限制:256 MiB       标签: 数学 素数 代数 CodeForces 

算法难度等级:3       思维难度等级:4       实现难度等级:3


本题来源于:Codeforces Round 232 (Div. 1) Problem B

题目大意

u(n)u(n) 为不超过 nn 的最大素数,v(n)v(n) 为超过 nn 的最小素数。

给定 nn,求 i=2n1u(i)v(i)\sum\limits_{i=2}^{n}\dfrac 1{u(i)v(i)}

1T5001\leq T\leq 5001n1091\leq n\leq 10^9

题目描述

Let's assume that

  • v(n)v(n) is the largest prime number, that does not exceed nn;
  • u(n)u(n) is the smallest prime number strictly greater than nn.

Find i=2n1u(n)v(n)\sum\limits_{i=2}^n\dfrac 1{u(n)v(n)}.

输入格式

The first line contains integer t(1t500)t(1\leq t\leq 500) — the number of testscases.

Each of the following tt lines of the input contains integer nn (2n1092\leq n\leq 10^9).

输出格式

Print tt lines: the ii-th of them must contain the answer to the ii -th test as an irreducible fraction p/q, where p, qp,\ q are integers, q>0q>0.

样例输入输出

2
2
3
1/6
7/30