mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
7a5dfb949b
3000-3099
30 lines
536 B
C++
30 lines
536 B
C++
#include <iostream>
|
|
#include <cstring>
|
|
int main()
|
|
{
|
|
using namespace std;
|
|
long long n;
|
|
long long sum;
|
|
int len;
|
|
int i;
|
|
int p=4*9999;
|
|
char num[110];
|
|
while(scanf("%s",num)!=EOF)
|
|
{
|
|
n=0;
|
|
len=strlen(num);
|
|
for(i=0; i<len; i++)
|
|
{
|
|
n=n*10+num[i]-'0';
|
|
if(n>p)
|
|
{
|
|
n=n%p;
|
|
}
|
|
}
|
|
n=n%p;
|
|
sum=n*(n+1)*(n+2)*(n+3)%p;
|
|
cout<<sum/4<<endl;
|
|
}
|
|
return 0;
|
|
}
|