NOIP '99 Junior P1 - Cantor Table

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 1.0s
Memory limit: 64M

Problem type

Georg Cantor proved that rational numbers are enumerable. He uses the following table to prove this proposition:

1/1, 1/2, 1/3, 1/4, 1/5, …

2/1, 2/2, 2/3, 2/4, …

3/1, 3/2, 3/3, …

4/1, 4/2, …

5/1, …

We number each term in the above table along the anti-diagonals, going back and forth. That is, the first term is 1/1, then 1/2, 2/1, then 3/1, 2/2, 1/3, then 1/4

Input Specification

The input contains an integer N (1 \leq N \leq 10^7).

Output Specification

Output the N^\text{th} term in the table.

Sample Input

7

Sample Output

1/4

Problem translated to English by Tommy_Shan.


Comments

There are no comments at the moment.