显示代码纯文本
#include<cstdio>
#include<iostream>
#define syy myson
using namespace std;
typedef long long LL;
const int MOD=10007;
LL a,b,k,n,m,c[1010][1010],i,j;
LL mod(LL x)
{
while(x>=MOD)x-=MOD;
return x;
}
int Main()
{
freopen("factor.in","r",stdin);freopen("factor.out","w",stdout);
cin>>a>>b>>k>>n>>m;
c[1][1]=1;c[1][2]=1;
for(i=1;i<=k+2;i++)
{
c[i][i+2]=0;
c[i][0]=0;
}
for(i=1;i<=k+2;i++)for(j=2;j<=i+1;j++)
{
c[i][j]=c[i-1][j-1]+c[i-1][j];
c[i][j]=mod(c[i][j]);
}
for(i=1;i<=n;i++)
{
c[k+2][m+2]*=a;
c[k+2][m+2]=mod(c[k+2][m+2]);
}
for(i=1;i<=m;i++)
{
c[k+2][m+2]*=b;
c[k+2][m+2]=mod(c[k+2][m+2]);
}
cout<<c[k+2][m+2]<<endl;
return 0;
}
int main(){;}
int syy=Main();