#P1291. [SHOI2002] 百事世界杯之旅
[SHOI2002] 百事世界杯之旅
Description
You turn off the TV and think: assuming there are different star names and each name appears with equal probability, on average how many bottles do you need to buy to collect all the names?
Input Format
The input contains a single integer on one line, representing the number of different star names .
Output Format
Output the average number of bottles needed to collect all the names. If it is an integer, print it directly. Otherwise, print it directly in fractional format. For example, five and three twentieths should be printed as:
3
5--
20
The first line is the numerator of the fractional part. The second line contains the integer part first, followed by a bar made of minus signs. The third line is the denominator. The number of minus signs should equal the number of digits in the denominator. The first digit of the numerator and the first digit of the denominator must align with the first minus sign. The fraction must be in lowest terms.
2
3
17
340463
58------
720720
Hint
Constraints
For all testdata, it is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号