Codeforces Beta Round 78 (Div. 1 Only)
B
Help King
Codeforces
2200
原题
← AC →
翻译中…

This is the modification of the problem used during the official round. Unfortunately, author's solution of the original problem appeared wrong, so the problem was changed specially for the archive.

翻译中…

Once upon a time in a far away kingdom lived the King. The King had a beautiful daughter, Victoria. They lived happily, but not happily ever after: one day a vicious dragon attacked the kingdom and stole Victoria. The King was full of grief, yet he gathered his noble knights and promised half of his kingdom and Victoria's hand in marriage to the one who will save the girl from the infernal beast.

翻译中…

Having travelled for some time, the knights found the dragon's lair and all of them rushed there to save Victoria. Each knight spat on the dragon once and, as the dragon had quite a fragile and frail heart, his heart broke and poor beast died. As for the noble knights, they got Victoria right to the King and started brawling as each one wanted the girl's hand in marriage.

翻译中…

The problem was that all the noble knights were equally noble and equally handsome, and Victoria didn't want to marry any of them anyway. Then the King (and he was a very wise man and didn't want to hurt anybody's feelings) decided to find out who will get his daughter randomly, i.e. tossing a coin. However, there turned out to be $*n*$ noble knights and the coin only has two sides. The good thing is that when a coin is tossed, the coin falls on each side with equal probability. The King got interested how to pick one noble knight using this coin so that all knights had equal probability of being chosen (the probability in that case should always be equal to $1 / *n*$). First the King wants to know the expected number of times he will need to toss a coin to determine the winner. Besides, while tossing the coin, the King should follow the optimal tossing strategy (i.e. the strategy that minimizes the expected number of tosses). Help the King in this challenging task.

翻译中…

Input

翻译中…

The first line contains a single integer $*n*$ from the problem's statement ($1 ≤ *n* ≤ 10000$).

翻译中…

Output

翻译中…

Print the sought expected number of tosses as an irreducible fraction in the following form: "$*a*$/$*b*$" (without the quotes) without leading zeroes.

翻译中…

样例

Input #1
2
Output #1
1/1
InputCopy OutputCopy
Input #2
3
Output #2
8/3
InputCopy OutputCopy
Input #3
4
Output #3
2/1
InputCopy OutputCopy
题目信息
题号
98B
时间限制
2 s
内存限制
256 MB
标签
模拟
概率论
树

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。