Harmonic number
InterviewTime limit1sMemory limit512 MB
Compute the numerator and denominator of the harmonic number H_N as an irreducible fraction for N up to 10000.
- Level
Medium4 of 10
- Topics
- Math, Number theory, Implementation, Greedy
- Solved
- No attempts yet
Problem
For a natural number , consider .
Find the natural numbers and , the numerator and denominator of the irreducible fraction .
Input
The standard input contains the natural number on the first line.
Output
On the standard output, print on the first line and on the second line.