[Help] How to solve this problem?

Правка en1, от 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$$$

Теги help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Ibrahim-Elsayed 2023-09-06 11:51:34 440 Initial revision (published)