Description
Cirno is playing a fighting game called “FXTZ” with Sanae.
Sanae is a ChuShou(master) of the game while Cirno is a ShaBao(noob). Since Cirno is a ShaBao, she just presses a random key on the keyboard for every 0.5 second, expecting to make a BiShaJi.
The battle begins. Having tried exactly 9 times, she finally makes a BiShaJi! She find herself summoned N iceballs!!! Then Sanae's HP decreases to 0 immediately....It should have been like that. But Cirno is too simple, always naïve. She doesn't know how
to handle the iceballs, so she starts to press the keyboard at random, again.
Let's see how the iceball damages. Each iceball has a fixed energy: the first ball's energy is 2^0, the second ball's energy is 2^1, … , and the N-th ball's energy is 2^(N-1). The damage caused by an iceball is equal to its energy. Cirno will shoot N times.
Since Cirno is pressing the keyboard at random, each time Cirno will choose exactly one iceball with equal possibility to shoot out. Once shot out, the iceball can't be chosen again. And even worse, the target may be either her opponent or herself, with equal
possibility(50%). What a big ShaBao she is. =_=
During shooting, once Cirno's HP is less than Sanae's, she will lose the game. Otherwise, she wins.
You may assume Sanae did nothing while Cirno's shooting(all damages are caused by Cirno's iceball), and their original HP are both 2^N (No one will die in the middle of the battle unless Cirno's HP is less than Sanae's).
Here comes the question: Can you calculate the possibility of Cirno's victory?
Input
The first line an integer C (C<=30), the number of test cases.
For each case, the only line contains one integer N(0<N<=500), indicating the number of iceballs.
Output
For each case output a fraction, the possibility of Cirno's victory. The fraction must be reduced.
Sample Input
2
1
4
Sample Output
1/2
35/128
相关推荐
收集的部分HDOJ杭电ACM题的代码 大牛勿下 全是基础供初级acmer使用
杭电acm解题报告 详细解析2000-2099 适合acm初学者
杭电hdu acm资料所用杭电的acm题
hdu acm 教案 搜索入门 hdu acm 教案 搜索入门
杭电oj4405,一道简单的概率dp题目
hdu acm 教案 动态规划(1) hdu acm 教案 动态规划(1)
自己做的HDU ACM已经AC的题目
ACM HDU题目分类,我自己总结的大概只有十来个吧
ACM HDU 2000->2099 解题报告 ACM HDU 2000->2099 解题报告 ACM HDU 2000->2099 解题报告
acm 技术大牛 课件 HDU 自学必备课件 全套齐全 (lecture_01)初识ACM (lecture_02)简单数学题 (lecture_03)递推求解 (lecture_04)动态规划(1)_ (lecture_05)计算几何基础_ (lecture_06)母函数 (lecture_...
杭电 hdu acm 第1084题的解法,ac过了,是一位学长教我的.内有一些中文说明.
杭电ACMhdu1163
hdu-acm源代码(上百题)hdu-acm源代码、hdu-acm源代码hdu-acm源代码
HDU的ACM,非常的好 涉及了很多算法,例如二分匹配、博弈、组合、最小生成树、搜索、动态规划、贪心算法
杭电的ACM课件2014版之(HDUACM201303版_01)初识ACM
杭电ACM课件2014版之 (HDUACM201403版_02)简单数学题
HDU ACM 2005第几天 C++ http://acm.hdu.edu.cn/listproblem.php?vol=11 2005题 第几天?
这是HDU acm 其中一部分题的代码,后续代码会继续上传。
杭电ACM课件2014版之 (HDUACM201303版_07)背包专题