Polynomial Game
InterviewTime limit1sMemory limit256 MB
For each test case, compute the coefficient of x^N in the product of (1+x+...+x^i) for i from 1 to k.
- Level
Medium4 of 10
- Topics
- Dynamic programming, Combinatorics
- Solved
- No attempts yet
Problem
Heehyun and Jugyeong like the polynomial game.
In the polynomial game you are given an integer and the polynomial
The first player to say the coefficient of in wins.
Help Heehyun beat Jugyeong.
Input
The first line contains the number of test cases ().
Each of the next lines contains two integers and separated by a space (, ).
Output
For each test case, print the coefficient of in on its own line.