#include #include #include using namespace std; using namespace atcoder; using mint = modint1000000007; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 1000000000000000001 vector mul(vector a,vector b){ vector c(a.size()+b.size()-1,0); rep(i,a.size()){ rep(j,b.size()){ c[i+j] += a[i]*b[j]; } } return c; } mint Bostan_Mori(vector a,vector c,long long n){ while(a.size()>=c.size())c.push_back(0); while(n!=0){ auto cinv = c; for(int i=1;i na; for(int i=(n&1LL);i nc; for(int i=0;i>=1; } return a[0]; } int main(){ long long n,p,c; cin>>n>>p>>c; vector x= {2,3,5,7,11,13},y = {4,6,8,9,10,12}; vector dp(p+1,vector(6,vector(13*p+1))); dp[0][0][0] = 1; rep(i,p+1){ rep(j,6){ rep(k,13*p+1){ if(dp[i][j][k].val()==0)continue; if(j!=5)dp[i][j+1][k] += dp[i][j][k]; if(i!=p)dp[i+1][j][k+x[j]] += dp[i][j][k]; } } } { vector ndp(c+1,vector(6,vector(13*p+12*c+1))); rep(i,13*p+1){ ndp[0][0][i] = dp[p][5][i]; } dp = ndp; } rep(i,c+1){ rep(j,6){ rep(k,13*p+12*c+1){ if(dp[i][j][k].val()==0)continue; if(j!=5)dp[i][j+1][k] += dp[i][j][k]; if(i!=c)dp[i+1][j][k+y[j]] += dp[i][j][k]; } } } vector C(13*p+12*c+1,0); rep(i,13*p+12*c+1)C[i] = dp[c][5][i]; vector a(C.size(),0); for(int i=C.size()-1;i>=1;i--){ a[i] = C[i]; if(i!=C.size()-1)a[i] += a[i+1]; } rep(i,C.size())C[i] *= -1; C[0] = 1; cout<