report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Binomial coefficient 2 - MarisaOJ: Marisa Online Judge

Binomial coefficient 2

Time limit: 1000 ms
Memory limit: 256 MB
There are $q$ queries, each of the form $(n, k)$, calculate the binomial coefficient: $${n\choose k}=\frac{n!}{k!(n-k)!}$$ ### Input - The first line contains an integer $q$. - Each line in the next $q$ lines contains 2 integers $n, k$. ### Output - Print each binominal coefficient modulo $10^9+7$. ### Constraints - $1 \le q \le 1000$. - $1 \le n \le 10^9$. - $1 \le k \le 100$. ### Example Input: ``` 2 6 4 5 3 ``` Output: ``` 15 10 ```
Introduction to combinatorics
Binomial coefficient
Fork and knife
Binomial coefficient 2
Equation
Array rearrangement
Value of subsequences
Inequation
Growing mushrooms
Binary matrix
Broken board
Triangles counting
Minecraft graph
Restricted path
Heavenly Peach Garden
Topic
Combinatorics
Rating 1100
Solution (0) Solution