~/algor $ cat problems/while-garmonik-qator-a-dan-kichik
Harmonic series up to a
Easy
1000 ms
64 MB
27%
A real number $a$ is given ($a \gt 1$). Find the largest positive integer $k$ for which the sum of the harmonic series does not exceed $a$ ($S \le a$), and the sum itself:
$$S = 1 + \frac{1}{2} + \frac{1}{3} + \dots + \frac{1}{k}$$
Input
One real number $a$.
Output
One line with two numbers separated by a space: the integer $k$ and $S$ with exactly 4 digits after the decimal point (for example, 2 1.5000).
Note
$1.1 \le a \le 5.0$
Examples
Input #1
1.5
Output #1
2 1.5000
Input #2
2.0
Output #2
3 1.8333