Pagini recente » Cod sursa (job #2592221) | Cod sursa (job #2375032) | Cod sursa (job #1481436) | Cod sursa (job #1036493) | Cod sursa (job #2397684)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("diamant.in");
ofstream fout("diamant.out");
const int DPMAX = 44105;
const int MOD = 10000;
int dp[DPMAX];
int main()
{
int n,m,X;
fin >> n >> m >> X;
long long sum=0;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
sum+=i*j;
if(sum==X)
{
fout << 1;
return 0;
}
if(sum<X)
{
fout << 0;
return 0;
}
sum-=X;
dp[0]=1;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
for(int t=sum;t>=i*j;t--)
{
dp[t]+=dp[t-i*j];
if(t>=2*i*j) dp[t]+=dp[t-2*i*j];
dp[t]%=MOD;
}
}
}
fout << dp[sum];
return 0;
}