Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/while-garmonik-qator-a-dan-kichik

Harmonic series up to a

Easy 1000 ms 64 MB 27%
Share

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}$$

The largest term at which the harmonic sum does not exceed the bound

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

Sign in to submit a solution

Signing up is free and takes a minute.