### btme's blog

By btme, history, 7 weeks ago,

CAN ANY ONE HELP ME WITH THIS PROBLEM?

There are N people in a country and everyone needs to be given two doses of covid vaccination. The government provided two arrays X and Y, of length M.

*Xi denotes that exactly Xi people should be vaccinated with the first dose on the ith day of vaccination
*Yi denotes that no more than Yi people should be vaccinated with the second dose on the ith day


It is given that if a person is vaccinated with the first dose on a jth day, then the second dose should be on day j or later.

Find the total no of ways in which government can assign day of two doses to each of the n people such that all the people are vaccinated in M days. Since the answer can be very large, return it modulo 10^9+7.

Note: It is given that the sum of all Xi is equal to N. Also it is guaranteed that Xi<=Yi

1<=N<=1000 1<=M<=100 0<=Xi<=100 0<=Yi<=100

Example: N 3 M 2 X-> 1,2 Y-> 2,2

OUTPUT=3

• -24

 » 7 weeks ago, # | ← Rev. 2 →   -7 Ok
•  » » 7 weeks ago, # ^ | ← Rev. 2 →   -11 .
 » 7 weeks ago, # |   -10 Auto comment: topic has been updated by btme (previous revision, new revision, compare).
 » 7 weeks ago, # |   -11 Auto comment: topic has been updated by btme (previous revision, new revision, compare).
 » 7 weeks ago, # |   -16 WHY DOWNVOTE ??????? :-(
 » 7 weeks ago, # |   -13 Auto comment: topic has been updated by btme (previous revision, new revision, compare).
•  » » 7 weeks ago, # ^ |   +1 Bro how much u were able to solve because i found the problems really hard and really got demotivated.