Processing math: 100%

Problem #288

Stonks

The stocks of a company were valued at N = 123456 on day 0. Every day for the following M = 217127 days, the value either rose by 1 or decreased by 1. Note that the value never remained the same. After M days, the final value was observed to be 172213.

Determine the number of distinct ways in which the stock value could have changed over the M days, such that it never exceeded L = 200000.

Since the number of ways can be huge, print them modulo 10^9+7.

Contributed by Yatin Khanna

Solved by 17 users

Log in to submit answers.

Is something wrong?

Maintaining a collection of high quality questions is our top priority. If, however, you do find an error, report the problem and we'll make sure it is reviewed soon.