In the late XIXth century the German mathematician George Cantor
argued that the set of positive fractions
is equipotent to the set of
positive integers
, meaning that they are both infinite,
but of the same class.
To justify this, he exhibited a one-to-one mapping from
to
.
To exhibit such a mapping, consider a traversal of the
plane that covers all the pairs:
The first pairs in this traversal are:
Write a program that finds the
-th Cantor fraction
following the one-to-one mapping outlined above.
Input specification
The inputs consists of a positive integer number
, with
.
Output specification
The output consists of the
-th fraction, with numerator and denominator
separated by a slash (/).
The fraction should be presented in the simplest form, but always with
a denominator (even if it is the unit).
Sample input
5
1/3