Binomial Coefficients
Your task is to calculate n binomial coefficients modulo 10^9+7. A binomial coefficient {a \choose b} can be calculated using the formula \frac{a!}{b!(a-b)!}. We assume that a and b are integers and 0 \le b \le a. Input The first input line contains an integer n: the number of calculations. After this, there are n lines, each of which contains two integers a and b. Output Print each binomial
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start