荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: huhaiming (一生只爱她), 信区: Program
标  题: 1004 Present
发信站: 荔园晨风BBS站 (Sun Jun  8 19:27:56 2003), 站内信件

Present

Time limit: 1 Seconds   Memory limit: 32768K
Total Submit: 367   Accepted Submit: 94

There are N friends who has bought one present each. They mix their
presents together and then each person takes one randomly. What is the
probability that exactly M people got their own present.


Input

Each line is one case and contains two integers N (0 < N < 100), M (0 <=
 M <= N).


Output

For each case, output the result in one line.

The result are exact to 8 decimal places.


Sample Input

3 1
4 2


Sample Output

0.50000000
0.25000000


Author: ZHANG, Zheng



--

菩提本无树,明镜亦非台

本来无一物,何处惹尘埃

※ 修改:·huhaiming 於 Jun  8 20:55:25 修改本文·[FROM: 192.168.0.200]
※ 来源:·荔园晨风BBS站 bbs.szu.edu.cn·[FROM: 192.168.0.200]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店