#P7127. 「RdOI R1」一次函数(function)
「RdOI R1」一次函数(function)
Description
Let be the area of the triangle enclosed by the lines , , and the -axis. Find:
In this problem, there are queries in total. Each query gives , and you need to compute the value of the expression above when .
If , the value of the sum is considered to be .
Input Format
There are lines in total.
The first line contains an integer , meaning there are sets of testdata.
The next lines each contain an integer , with the meaning as described in the statement.
Output Format
There are 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, should be written as 1/2, and should be written as 1/2. Note that you must reduce the fraction.
Note: If the answer is , output 0.
2
0
1
0
1/4
Hint
[Sample Explanation]
When , according to the statement, output .
When , is the area enclosed by , , and the -axis, which is .
[Constraints]
- For of the data, .
- For another of the data, .
- For another of the data, .
- For 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
京公网安备 11011102002149号