#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 00. Next to the flame there are nn pieces of charcoal, and each piece has kk energy points.

Let TiT_i denote the temperature of the flame after burning ii 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 TT, the number of test cases.

For each test case, input one line with two positive integers n,kn, k.

Output Format

For each test case, output one line with a real number representing the maximum temperature the flame can reach, rounded to 11 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 11 piece of charcoal. Before burning any charcoal, the flame temperature is 00. After burning 11 piece of charcoal, the flame temperature is 66, so the answer is 6.06.0. For the second test case, there are 22 pieces of charcoal. Before burning any charcoal, the flame temperature is 00. After burning 11 piece of charcoal, the flame temperature is 77. After burning 22 pieces of charcoal, the flame temperature is 10.510.5, so the answer is 10.510.5.

Constraints

Test Point ID TT \leq nn \leq kk \leq
121 \sim 2 55 22 1010
343 \sim 4 10710^7 10910^9
55 10510^5 10910^9

For 100%100\% of the testdata, 1T1051 \leq T \leq 10^5 and 1n,k1091 \leq n, k \leq 10^9.

Translated by ChatGPT 5