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-katta

Harmonic series above a

Easy 1000 ms 64 MB 27%
Share

A real number $a$ is given ($a \gt 1$). Find the smallest positive integer $k$ for which the sum of the harmonic series is greater than $a$, and the sum itself:

$$S = 1 + \frac{1}{2} + \frac{1}{3} + \dots + \frac{1}{k}$$

The smallest term at which the harmonic sum exceeds 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, 3 1.8333).

Note

$1.1 \le a \le 5.0$

Examples

Input #1
1.5
Output #1
3 1.8333
Input #2
2.0
Output #2
4 2.0833

Sign in to submit a solution

Signing up is free and takes a minute.