[Help] How to solve this problem?

Revision en1, by Ibrahim-Elsayed, 2023-09-06 11:51:34

You are given three integers $$$n$$$, $$$l$$$, and $$$r$$$, count the number of arrays of size $$$n + 1$$$ that have the first element as the average of the whole array and every element of the array is between $$$l$$$ and $$$r$$$ inclusive. print the number of arrays modulo $$$10^9 + 7$$$.

constraints: $$$1 <= n <= 3000$$$, $$$1 <= l <= r <= 10^{18}$$$

samples: Input: $$$5$$$ $$$1$$$ $$$2$$$, Output: $$$20000$$$ Input: $$$4$$$ $$$2$$$ $$$7$$$, Output: $$$322$$$

Tags help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Ibrahim-Elsayed 2023-09-06 11:51:34 440 Initial revision (published)