Pro.ID22763 TitleIndomie Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22763 AC9 Submit32 Ratio28.13% 时间&空间限制描述During recession, Amjad needs to queue for SembakoPlus. Sembako, as we all know, stands for "Sembilan Bahan Pokok" which consists of 9 kinds of item: Rice, Sugar, Cooking-oil, Meat, Egg, Milk, Corn, Kerosene and Iodized Salt. SembakoPlus consists of Sembako and one more item: Indomie! Amjad's favorite of all time!! (therefore, no wonder why he could stand for this long queue). Each person in the queue is allowed to pick only one item. No need to ask, Amjad wants only Indomie. Unfortunately, they are running out of SembakoPlus stock and currently there are three kinds of item left: Rice, Sugar and Indomie. As he could see from afar, he is quite sure that Rice and Sugar will be enough for everybody. Given the number of remaining Indomie and the number of people queuing in front of Amjad, your task is to count the probability that he will get his Indomie. Amjad can't do programming right now as he is very nervous so he can't think logically. He needs your help! 输入There will be multiple test cases for this problem. Each test case contains two integers N (1 ≤ N ≤ 50) and S (0 ≤ S ≤ 50), where N is the number of people queuing in front of Amjad and S is the remaining number of Indomie. 输出Description During recession, Amjad needs to queue for SembakoPlus. Sembako, as we all know, stands for "Sembilan Bahan Pokok" which consists of 9 kinds of item: Rice, Sugar, Cooking-oil, Meat, Egg, Milk, Corn, Kerosene and Iodized Salt. SembakoPlus consists of Sembako and one more item: Indomie! Amjad's favorite of all time!! (therefore, no wonder why he could stand for this long queue). Each person in the queue is allowed to pick only one item. No need to ask, Amjad wants only Indomie. Unfortunately, they are running out of SembakoPlus stock and currently there are three kinds of item left: Rice, Sugar and Indomie. As he could see from afar, he is quite sure that Rice and Sugar will be enough for everybody. Given the number of remaining Indomie and the number of people queuing in front of Amjad, your task is to count the probability that he will get his Indomie. Amjad can't do programming right now as he is very nervous so he can't think logically. He needs your help! Input There will be multiple test cases for this problem. Each test case contains two integers N (1 ≤ N ≤ 50) and S (0 ≤ S ≤ 50), where N is the number of people queuing in front of Amjad and S is the remaining number of Indomie. Output For each case, print in a single line the probability in percentage that he will get his Indomie with 5 digits precision (he's being paranoid) Sample Input 2 1 Sample Output 50.00000 Hint Explanation for 1st sample test case:There are two peoples queuing in front of Amjad, so those two peoples could pick of thefollowing combination {1st people, 2nd people}: 1. Rice, Rice 2. Rice, Sugar 3. Rice, Indomie 4. Sugar, Rice 5. Sugar, Sugar 6. Sugar, Indomie 7. Indomie, Rice 8. Indomie, Sugar Since there is only one Indomie left, there are only 4 out of 8 combinations that ensure Amjadto get his Indomie (1, 2, 4 and 5), hence the probability is 4/8 = 50%. Source 样例输入2 1 样例输出50.00000 提示Explanation for 1st sample test case:There are two peoples queuing in front of Amjad, so those two peoples could pick of thefollowing combination {1st people, 2nd people}: 1. Rice, Rice 2. Rice, Sugar 3. Rice, Indomie 4. Sugar, Rice 5. Sugar, Sugar 6. Sugar, Indomie 7. Indomie, Rice 8. Indomie, Sugar Since there is only one Indomie left, there are only 4 out of 8 combinations that ensure Amjadto get his Indomie (1, 2, 4 and 5), hence the probability is 4/8 = 50%. |