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

Equation

Time limit: 1000 ms
Memory limit: 256 MB
Find the number of positive integers solutions $(x_1, x_2,..., x_k)$ for the following equation: $$ \begin{equation} \begin{cases} x_1 < x_2 < ... < x_k \\\\ x_1 + x_2 + ... + x_k=n \end{cases} \end{equation} $$ ### Input - A single line contains two integers $n, k$. ### Output - Print the number of solutions, modulo $10^9+7$. ### Constraints - $1 \le n \le 10^9$. - $1 \le k \le 5$. ### Example Input: ``` 10 3 ``` Output: ``` 4 ```
Digit DP
Unlucky number
Digit Sum
Divisible
Prime digit sum
Non-palindrome number
Yet another XOR problem
Taboo substring
Balanced number
Equation
Beautiful number
Constructing numbers
Topic
Dynamic Programming
Rating 2100
Solution (1) Solution