An Interesting combination problem

Revision en1, by Yubai, 2022-07-31 10:00:32

Try to solve the following problem, only by combining meaning but not the generating function.

$$$\sum_x \binom{2x+k}{x}\binom{P-2x-k}{a-x}$$$

There are q times inquiries, Given k, P, a, each time, print the value of this sum, $$$q,k,P,a \leq 1e5$$$.

I'll give an answer in 24 hours. If solved, please write the method in the comments and try the harder problems below, which replace 2 by t, t will be given before all queries.

$$$\sum_x \binom{tx+k}{x}\binom{P-tx-k}{a-x}$$$

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Yubai 2022-07-31 10:00:32 513 Initial revision (published)