-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path16565.cpp
More file actions
39 lines (30 loc) · 658 Bytes
/
Copy path16565.cpp
File metadata and controls
39 lines (30 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<iostream>
#define N 55
#define MOD 10007
using namespace std;
int c[N][N];
int main()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
int i, j, n;
cin >> n;
for(i=0; i<=52; i++){
c[i][0]=1;
c[i][i]=1;
for(j=1; j<=i/2; j++){
c[i][j] = (c[i-1][j-1]+c[i-1][j])%MOD;
c[i][i-j] = c[i][j];
}
}
int ans=0;
for(i=1; i<=n/4; i++){
if(i%2==1) ans += c[13][i]*c[52-i*4][n-i*4];
else ans -= c[13][i]*c[52-i*4][n-i*4];
ans %= MOD;
if(ans<0) ans+=MOD;
}
if(ans<0) ans+=MOD;
cout << ans;
return 0;
}