#P10781. 【MX-J1-T1】『FLA - III』Spectral
【MX-J1-T1】『FLA - III』Spectral
Background
Original link: https://oier.team/problems/J1A.
Did not see the Pleiades.
Problem Description
There is a flame. At the beginning, its temperature is . Next to the flame there are pieces of charcoal, and each piece has energy points.
Let denote the temperature of the flame after burning pieces of charcoal. Then:
$$T_i = \begin{cases} 0 & i = 0 \\ k+ \dfrac{T_{i-1}}{i} & i \neq 0 \end{cases}$$What is the maximum temperature the flame can reach?
Input Format
This problem has multiple test cases.
The first line contains a positive integer , the number of test cases.
For each test case, input one line with two positive integers .
Output Format
For each test case, output one line with a real number representing the maximum temperature the flame can reach, rounded to digit after the decimal point.
2
1 6
2 7
6.0
10.5
Hint
Sample Explanation #1
For the first test case, there is piece of charcoal. Before burning any charcoal, the flame temperature is . After burning piece of charcoal, the flame temperature is , so the answer is . For the second test case, there are pieces of charcoal. Before burning any charcoal, the flame temperature is . After burning piece of charcoal, the flame temperature is . After burning pieces of charcoal, the flame temperature is , so the answer is .
Constraints
| Test Point ID | |||
|---|---|---|---|
For of the testdata, and .
Translated by ChatGPT 5