计算系数
代码:
MOD = 10007
a, b, k, n, m = [int(x) for x in input().split()]
def pow(a, n):
r = 1 % MOD
while n:
if n & 1: r = r * a % MOD
a = a * a % MOD
n >>= 1
return r
def C(n, m):
r = 1 % MOD
for i, j in zip(range(n, -1, -1), range(1, m + 1)):
r = r * i * pow(j, MOD - 2) % MOD
return r
print(C(k, n) * pow(a, n) * pow(b, m) % MOD)