CF13A.Numbers
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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
说明/提示
In the first sample number 5 written in all bases from 2 to 4 looks so: 101, 12, 11. Sums of digits are 2, 3 and 2, respectively.