水题。
#include <cstdio>
#include <cstdlib>
#include <cstring> #define MAXN 25
int dp[MAXN][MAXN*]; void init() {
int i, j, k; memset(dp, , sizeof(dp));
dp[][] = dp[][] = dp[][] = dp[][] = ;
for (i=; i<MAXN; ++i) {
for (j=; j<MAXN*; ++j) {
dp[i][j] += dp[i-][j-];
if (j >= )
dp[i][j] += dp[i-][j-];
if (j >= )
dp[i][j] += dp[i-][j-];
}
}
} int main() {
int a, b, t;
int i, j, k, tmp;
int mmin, mmax;
__int64 ans; #ifndef ONLINE_JUDGE
freopen("data.in", "r", stdin);
#endif init(); while (scanf("%d %d %d", &a, &b, &t) != EOF) {
i = t / ;
j = (i+) / ;
if (b < a) {
tmp = a - b;
mmin = j;
mmax = j * ;
} else {
tmp = b - a;
mmin = tmp + i - j + ;
mmax = j * ;
}
ans = ;
for (k=mmin; k<=mmax; ++k)
ans += dp[j][k];
printf("%I64d\n", ans);
} return ;
}