Under construction

Still being built. Things may change

Fraction Finding 2

Interview

Time limit1sMemory limit1024 MB

Summary
Given X up to 10^18, find the X-th fraction when the infinite table is read in zigzag diagonal order.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

An infinitely large array contains fractions as shown below.

1/11/21/31/41/5…
2/12/22/32/4……
3/13/23/3………
4/14/2…………
5/1……………
………………

Read these fractions in the zigzag order 1/1 → 1/2 → 2/1 → 3/1 → 2/2 → …, and call them the 1st, 2nd, 3rd, 4th, 5th, … fraction.

Given X, write a program that finds the X-th fraction.

Input

The first line contains X (1≤X≤10181 \le X \le 10^{18}).

Output

The first line prints the fraction.

Examples5

  1. Example 1

    Input
    1
    
    Expected output
    1/1
    
  2. Example 2

    Input
    2
    
    Expected output
    1/2
    
  3. Example 3

    Input
    3
    
    Expected output
    2/1
    
  4. Example 4

    Input
    4
    
    Expected output
    3/1
    
  5. Example 5

    Input
    5
    
    Expected output
    2/2