https://www.luogu.com.cn/problem/CF13A
题目描述
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 AA written in all bases from 22 to A-1A−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 AA ( 3<=A<=10003<=A<=1000 ).
输出格式
Output should contain required average value in format «X/Y», where X is the numerator and Y is the denominator.
L喜欢一写数字,他发现数字123在16进制下第一个数是7第二个数是11这两个数之和为18。现在他想知道数字A在进制2到A-1之下每位数字之和的平均数输出数字用十进制表示
输入一个整数A
输出结果为X/Y,X表示数字之和,Y为分母