1 #include <iostream>
2 #include<cstdio>
3 #include<cstring>
4 #include<algorithm>
5 #include<stdlib.h>
6 #include<cmath>
7 using namespace std;
8 #define LL long long
9 #define mod 1000000007
10 LL dp[52][52][52][52];
11 class VocaloidsAndSongs
12 {
13 public :
14 int count(int S, int gumi, int ia, int mayu)
15 {
16 LL ans=0;
17 int o[4];
18 o[1] = gumi;o[2] =ia;o[3] = mayu;
19 int i,j,k,g;
20 dp[1][2][1][1] = 1;
21 dp[1][1][2][1] = 1;
22 dp[1][1][1][2] = 1;
23 dp[1][2][2][1] = 1;
24 dp[1][2][1][2] = 1;
25 dp[1][1][2][2] = 1;
26 dp[1][2][2][2] = 1;
27 for(i = 2 ;i <= S ; i++)
28 for(j = 1; j <= o[1]+1 ; j++)
29 for(k = 1 ; k <= o[2]+1 ; k++)
30 for(g = 1 ; g <= o[3]+1 ; g++)
31 {
32 // if(j+k+g+3>=i)
33 // {
34 dp[i][j][k][g] = (dp[i][j][k][g]+dp[i-1][j-1][k][g]+dp[i-1][j][k-1][g]+dp[i-1][j][k][g-1])%mod;
35 dp[i][j][k][g] = (dp[i][j][k][g]+dp[i-1][j-1][k-1][g]+dp[i-1][j][k-1][g-1]+dp[i-1][j-1][k][g-1])%mod;
36 dp[i][j][k][g] = (dp[i][j][k][g]+dp[i-1][j-1][k-1][g-1])%mod;
37 //cout<<dp[i][j][k][g]<<" "<<i<<" "<<j<<" "<<k<<" "<<g<<endl;
38 // }
39 }
40 ans = dp[S][o[1]+1][o[2]+1][o[3]+1]%mod;
41 return ans;
42 }
43 };