1316 组合数末位
Submit solution
Points:
100
Time limit:
1.0s
Memory limit:
32M
Problem types
Allowed languages
C, C++, Java, Python
Description
sasnzy告诉lily,他可以在很短的时间内算出一个组合数的值,lily不相信,但lily也不知道sasnzy算的值对不对,所以他决定只看sasnzy算出来的值的最后一位数,如果这位数正确就算正确,但这也不好计算,所以lily想请大家帮忙计算出这个数。 组合数即C(m,n)=m!/(n!×(m-n)!)
Input
每一行有两个整数m,n(0 ≤ n ≤ m ≤ 10^9)。
Output
对于每一组m,n,输出组合数C(m,n)个位上的数字。
Sample
Input
5 3
4 2
Output
0
6
Source: DK
Comments