#P1313. [NOIP 2011 提高组] 计算系数

[NOIP 2011 提高组] 计算系数

Description

Given a polynomial (by+ax)k(by+ax)^k, compute the coefficient of the term xn×ymx^n\times y^m in its expansion.

Input Format

The input contains one line with 55 integers, namely a,b,k,n,ma, b, k, n, m, separated by a single space.

Output Format

Output one line containing a single integer, which is the required coefficient. This coefficient may be large; output the result modulo 1000710007.

1 1 3 1 2

3

Hint

Constraints

  • For 30%30\% of the testdata, 0k100\le k\le 10.
  • For 50%50\% of the testdata, a=1a=1, b=1b=1.
  • For 100%100\% of the testdata, 0k10000\le k\le 1000, 0n,mk0\le n, m\le k, n+m=kn + m = k, 0a,b1060\le a, b\le 10^6.

NOIP 2011 Senior Day 2 Problem 1.

Translated by ChatGPT 5