You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
232 B

#include<bits/stdc++.h>
using namespace std;
int main()
{
const int MOD = 1000000;
int i, n;
int S = 0;
scanf("%d", &n);
if(n > 25) n = 25;
for( i = n; i >= 1; i-- )
S = (S + 1) * i % MOD;
printf("%d\n", S);
return 0;
}