logo AlgoBeat OnlineJudge
登录 注册

#217656. [ECNA 2025] Fractional Sequence

内存限制:2048 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Consider the following increasing sequence, , of rational numbers:

is composed of an infinite set of blocks, , where block is i,;; i+1/i,;; i+2/i,;; \ldots, ;; i+(i-1)/i . So , etc. Write a program which takes as input an integer and outputs .

输入格式

Input is a single line containing an integer, ().

输出格式

Output as a single integer if the answer is a whole number. Otherwise, output the integer part, a single space and a proper fraction in lowest terms (i.e. and ). See the sample outputs.

样例

样例输入 1

326

样例输出 1

26

样例输入 2

448

样例输出 2

30 2/5

样例输入 3

4000000000

样例输出 3

89443 19596/89443