hdu 2843 I Will Win求助!!!!!!
2009-08-15 13:52
253 查看
hdu 2843 I Will Win
请哪位高手来帮我看一下这一题没大明白
他的测试数据是怎么得来的
Problem Description
Dumbear likes to play table tennis with his daughter – Quan. But Dumbear found that Quan played table tennis better and better recently, Dumbear wondered that Quan would defeat him someday. So he wants to know if he will win in the next match.
To simplify the problem, you can assume that the probability of Dumbear’s winning in each match is a constant number P (But Dumbear and you don’t know the number exactly). Of course 0 ≤ P ≤ 1. Dumbear had already taken N matches with Quan. And he won for M matches. He wants to know the expected probability of his winning for the next match. But Dumbear is very dumb, so he wants you to help him.
Input
Each line of the input file contains two numbers N and M (0 ≤ M ≤ N) indicate the number of the matches Dumbear had taken and the number of matches Dumbear had won. The last line of the input file contains two numbers "0 0".
Output
For each line, output two integers A and B indicates the expected probability of Dumbear’s winning for the next match is A / B. Make sure that gcd(A, B) = 1!
Sample Input
1 1 2 1 0 0
Sample Output
2 3 1 2
相关文章推荐
- HDU 2843 I Will Win(概率题?,怨念颇深,简单)
- SDUT第一届ACM知识挑战赛Fire Emblem [You Will Win - Special Version]
- 思想在改变,生活也在改变,我要变, I WILL WIN ,TOO
- LintCode 394: First Will Win
- Fire Emblem [You Will Win - Special Version]
- 坚持不懈,直到成功-I will persist. I will win.
- Cellular Networks vs Custom M2M Networks – Who will win in the IoT space?
- 坚持不懈,直到成功-I will persist. I will win.
- 求助:Note: log switch off, only log_main and log_events will have logs!
- Infographic: Spain Will Win the World Cup, Science Says
- The WinHTTP Web Proxy Auto-Discovery Service has been idle for 15 minutes,it will be shut down.
- i will win the world
- LintCode 395: First Will Win 2
- 求助:ccc_win的使用??
- Win mobile will be dead by 2011?
- hdu 1026:Ignatius and the Princess I(优先队列 + bfs广搜。ps:广搜AC,深搜超时,求助攻!)
- I will win inux
- HDU 5307 He is Flying ——FFT
- HDU 3790 最短路径问题
- HDU - 5812 Distance 数学 + 思维