问题1383--N!Again

1383: N!Again

时间限制: 1 Sec  内存限制: 128 MB
提交: 225  解决: 90
[状态] [讨论版] [提交] [命题人:]
题目描述

WhereIsHeroFrom:             Zty, what are you doing ?
Zty:                                     I want to calculate N!......
WhereIsHeroFrom:             So easy! How big N is ?
Zty:                                    1 <=N <=1000000000000000000000000000000000000000000000
WhereIsHeroFrom:             Oh! You must be crazy! Are you Fa Shao?
Zty:                                     No. I haven's finished my saying. I just said I want to calculate N! mod 2009


Hint : 0! = 1, N! = N*(N-1)!



输入

Each line will contain one integer N(0 <= N<=10^9). Process to end of file.

输出

For each case, output N! mod 2009

样例输入 Copy
4
5
样例输出 Copy
24
120
来源/分类