1841: 【例4.19】阶乘之和

Memory Limit:64 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

输入$n$,计算$S=1! + 2! + 3! + … + n!$的末$6$位(不含前导0)。$nle 10^6$, $n!$表示前$n$个正整数之积。

Input

输入$n$。

Output

如题述,之和。

Sample Input Copy

10

Sample Output Copy

37913

Source/Category