题库练习 Numbers
← 上一题 下一题 →

A7771 | Numbers

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Little Petya likes numbers a lot. He found that number 123 in base 16 consists of two digits: the first is 7 and the second is 11. So the sum of digits of 123 in base 16 is equal to 18.

Now he wonders what is an average value of sum of digits of the number $A$ written in all bases from $2$ to $A-1$ .

Note that all computations should be done in base 10. You should find the result as an irreducible fraction, written in base 10.

输入格式

Input contains one integer number $A$ ( $3<=A<=1000$ ).

输出格式

Output should contain required average value in format «X/Y», where X is the numerator and Y is the denominator.

输入输出样例

输入 #1
5
输出 #1
7/3
输入 #2
3
输出 #2
2/1
C++ 编辑器
输入
输出