P7127 "RdOI R1" Linear Function (function).

Background

**Please use a fast input method.** As everyone knows, the expression of a linear function is as follows: $$y=kx+b$$ Or, we can write it as: $$f(x)=kx+b$$ This is the expression of a linear function. In the following text, all expressions will be written in the form $y=kx+b$. - If you do not know what a linear function is, [click here](https://baike.baidu.com/item/%E4%B8%80%E6%AC%A1%E5%87%BD%E6%95%B0). - If you do not know what a function graph is, [click here](https://baike.baidu.com/item/%E5%87%BD%E6%95%B0%E5%9B%BE%E5%83%8F/514135).

Description

Let $S_k$ be the area of the triangle enclosed by the lines $l_{k1}:y=kx+k-1$, $l_{k2}:y=(k+1)x+k$, and the $x$-axis. Find: $$\sum_{i=1}^nS_i$$ In this problem, there are $t$ queries in total. Each query gives $n_i$, and you need to compute the value of the expression above when $n=n_i$. If $n

Input Format

There are $t+1$ lines in total. The first line contains an integer $t$, meaning there are $t$ sets of testdata. The next $t$ lines each contain an integer $n_i$, with the meaning as described in the statement.

Output Format

There are $t$ lines in total. Each line contains one number, representing the answer you computed. The result may be a fraction. Please **reduce** it to the simplest fraction. Output fractions in the form `xxx/xxx`. For example, $\dfrac{1}{2}$ should be written as `1/2`, and $\dfrac{2}{4}$ should be written as `1/2`. Note that you must reduce the fraction. Note: If the answer is $0$, output `0`.

Explanation/Hint

[Sample Explanation] When $n=0$, according to the statement, output $0$. When $n=1$, $S_1$ is the area enclosed by $y=x$, $y=2x+1$, and the $x$-axis, which is $\dfrac{1}{4}$. --- [Constraints] - For $5\%$ of the data, $t \le 100,n=0$. - For another $20\%$ of the data, $t \le 100,n \le 2020$. - For another $20\%$ of the data, $t \le 5 \times 10^4,n \le 5 \times 10^3$. - For $100\%$ of the data, $1 \le t \le 2 \times 10^6,0 \le n \le 2 \times 10^6$. --- [Notes / Hints] - It is recommended to draw a diagram and think about it. - **Please remember to reduce the answer when outputting**. - **Please use a fast input method**. --- [File Input/Output] **(Simulation, not needed in submitted code)** - Filename: `function.cpp`. - Input filename: `function.in`. - Output filename: `function.out`. Translated by ChatGPT 5