using
System;
using
System.Collections.Generic;
using
System.Linq;
class
GFG
{
static
int
mod = 1000000007;
static
int
RUNMAX = 300;
static
int
BALLMAX = 50;
static
int
WICKETMAX = 10;
static
int
CountWays(
int
r,
int
b,
int
l,
int
R,
int
B,
int
W,
int
[,,]dp)
{
if
(l > W)
return
0;
if
(r > R)
return
0;
if
(b == B && r == R)
return
1;
if
(b == B)
return
0;
if
(dp[r, b, l] != -1)
return
dp[r, b, l];
int
ans = 0;
ans += CountWays(r, b + 1, l, R, B, W, dp);
ans = ans % mod;
ans += CountWays(r + 1, b + 1, l, R, B, W, dp);
ans = ans % mod;
ans += CountWays(r + 2, b + 1, l, R, B, W, dp);
ans = ans % mod;
ans += CountWays(r + 3, b + 1, l, R, B, W, dp);
ans = ans % mod;
ans += CountWays(r + 4, b + 1, l, R, B, W, dp);
ans = ans % mod;
ans += CountWays(r + 6, b + 1, l, R, B, W, dp);
ans = ans % mod;
ans += CountWays(r, b + 1, l + 1, R, B, W, dp);
ans = ans % mod;
return
dp[r, b, l] = ans;
}
static
void
Main()
{
int
R = 40, B = 10, W = 4;
int
[,,] dp =
new
int
[RUNMAX, BALLMAX, WICKETMAX];
for
(
int
i = 0; i < RUNMAX;i++)
for
(
int
j = 0; j < BALLMAX; j++)
for
(
int
k = 0; k < WICKETMAX; k++)
dp[i, j, k]=-1;
Console.WriteLine(CountWays(0, 0, 0, R, B, W, dp));
}
}