#Lutece0323. Evil QQ
Evil QQ
Migrated from Lutece 323 Evil QQ
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Long long ago when there was a place where some strange kinds of creature such as MonsterQQ, RabbitQQ live in. One day you just woke up and found your friend QQ spell some strange incantation and transport you there. See what a evil your friend QQ is. So you have to face the situation that MonsterQQ is so dangerous and hungary and if you meet anyone of them someday, it will eat you immediately.
Suppose there are MonsterQQs and RabbitQQs and you lived there now.So there are creatures there initially. Everyday only a pair of them would meet each other, and which would be chosen to meet another would have the same probability and what happened then is as following:
- If you meet a RabbitQQ, then nothing would happen that day.
- If two RabbitQQ meet each other, then nothing would happen that day.
- If a MonsterQQ meet you, then the MonsterQQ eat you and you die.
- If a MonsterQQ meet a RabbitQQ, then the MonsterQQ eat the RabbitQQ, too.
- If two MonsterQQ meet each other, then they will fight with each other and both of them will die.
Here is my question: what's the probability you would survive eventually?
Input
The first line of the input contains a single integer () indicates the number of cases that follow.Next lines each contains two interger and () indicates the number of MonsterQQ and the number of RabbitQQ.
Output
For each test case, output one line. First ,output Case #C:
, where is the number of test case, from to . Then, output the answer to this question, which should be printed accurately rounded to six decimals.
Samples
2
2 0
3 0
Case #1: 0.333333
Case #2: 0.000000
Resources
totalfrank