P10781 [MX-J1-T1] "FLA - III" Spectral
Background
Original link: .
---
> Did not see the Pleiades.
Description
There is a flame. At the beginning, its temperature is $0$. Next to the flame there are $n$ pieces of charcoal, and each piece has $k$ energy points.
Let $T_i$ denote the temperature of the flame after burning $i$ 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 $T$, the number of test cases.
For each test case, input one line with two positive integers $n, k$.
Output Format
For each test case, output one line with a real number representing the maximum temperature the flame can reach, rounded to $1$ digit after the decimal point.
Explanation/Hint
**Sample Explanation #1**
For the first test case, there is $1$ piece of charcoal. Before burning any charcoal, the flame temperature is $0$. After burning $1$ piece of charcoal, the flame temperature is $6$, so the answer is $6.0$. For the second test case, there are $2$ pieces of charcoal. Before burning any charcoal, the flame temperature is $0$. After burning $1$ piece of charcoal, the flame temperature is $7$. After burning $2$ pieces of charcoal, the flame temperature is $10.5$, so the answer is $10.5$.
**Constraints**
|Test Point ID|$T \leq$|$n \leq$|$k \leq$|
|:---:|:---:|:---:|:---:|
|$1 \sim 2$|$5$|$2$|$10$|
|$3 \sim 4$|$5$|$10^7$|$10^9$|
|$5$|$10^5$|$10^9$|$10^9$|
For $100\%$ of the testdata, $1 \leq T \leq 10^5$ and $1 \leq n, k \leq 10^9$.
Translated by ChatGPT 5