Given positive integers $$$n,m,k$$$. Count the number of pairs of arrays $$$(a,b)$$$ consisting of only positive integers, such that:
Since the above is too easy, there are $$$q$$$ queries. Each query specifies a $$$k$$$, and you have to answer the above. The values of $$$n$$$ and $$$m$$$ are fixed throughout the test case.
The first line consists of three integers, $$$n,m,q$$$, $$$1\le n,m\le 9\cdot 10^8$$$ and $$$1\le q\le 10^5$$$.
The second line consists of $$$q$$$ integers, $$$k_1,k_2,\dots,k_q$$$, $$$1\le k_i\le 2\cdot 10^5$$$ denoting the value of $$$k$$$ in each query.
—
Tests in subtasks are numbered from $$$1−20$$$ with samples skipped. Each test is worth $$$\frac{100}{20}=5$$$ points.
Tests $$$1−5$$$ satisfy $$$q=1, k_i\le 2\cdot 10^4$$$.
Tests $$$6-10$$$ satisfy $$$q=1$$$.
Tests $$$11-15$$$ satisfy $$$k_i\le 2\cdot 10^4$$$.
Tests $$$16-20$$$ satisfy no additional constraints.
Output $$$q$$$ integers, the answer to each query, separated by spaces.
2 2 41 2 3 4
4 20 82 320
30624700 30624770 534202 139424 31 40 624
962908989 896508782 487985302 35718864 495214615
—
Problem Idea: culver0412
Problem Preparation: culver0412
Occurrences: Advanced L
| Name |
|---|


