编程介的小学生 2017-04-16 12:00 采纳率: 0.4%
浏览 816
已采纳

Adjacent Numbers

Recently, a total of 786 girls in Gensokyo sat in a circle, 203 of them were selected as the characters of next Touhou ACT game by draw. Unfortunately, Letty Whiterock didn't win, and she thought it was strange that the nine girls (Reimu, Yukari, Marisa, Alice, Sakuya, Remilia, Youmu, Yuyuko and Sanae) sitting adjacently all won. The expert (proclaimed by herself) Baka⑨ Cirno (チルノ) claimed that "the probability of this kind of combinations is only 0.000,atai,saikyou,...%, so somebody must have cheated!". Of course, nobody trusts the probability claimed by Cirno, but girls do begin to doubt the draw results.

Assume that m girls out of n are selected in eqaul probability, it will be helpful if you can calculate the right probability that there are nine adjacent girls. Remember that the n girls sit in a circle, so the first one is adjacent to the last one.

Input

There are multiple cases. Each cases consists of two integers: 1 ≤ n ≤ 1000 and 1 ≤ m ≤ n.

Output

For each case, output the probability. Answer having an absolute error less than 1e-5 will be accepted. See sample for more details.

Sample Input

10 9
17 15
18 16
786 203
Sample Output

100.000000%
87.500000%
94.117647%
0.263488%

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-05-01 01:20
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?