Welcome to the Internet Connection Practice Competition (ICPC) this year! In the competition, you and your teammates will fight against the Obstacle Maker System (OMS) to connect to the server successfully! Be careful with every refresh operation, as the system may assign you unknown obstacles.
To simplify the problem, we model the competition process into the following form:
Each team has a timer during the competition, and the goal is to get the remaining time to $$$0$$$ as quickly as possible. At the beginning of the $$$0$$$-th second, the OMS will uniformly and randomly generate an integer $$$t_0$$$ in $$$[1, T]$$$ and initialize the remaining time of your timer to $$$t_0$$$ seconds. Next, at the end of each second (starting with the $$$0$$$-th second), the following events occur in order:
Your goal is to minimize your penalty. Please calculate the expected penalty using the optimal strategy. During the contest, you always know the remaining time of the timer, and the value of $$$T$$$.
The first line contains a single integer $$$n\ (1\le n\le 10^6)$$$, representing the number of test cases.
For the following $$$n$$$ lines, each line contains a single integer $$$T_i\ (1\le T_i\le 10^9)$$$, representing the interval for generating random numbers is $$$[1,T_i]$$$ for the $$$i$$$-th test case.
For each test case, output a single line with two positive integers $$$x_i,y_i$$$ where $$$\text{gcd}(x_i,y_i)=1$$$, representing the expected penalty using the optimal strategy is $$$x_i/y_i$$$. It can be proved that the answer can always be described as a fraction.
3123
1 1 3 2 2 1
| Название |
|---|


