Блог пользователя Ibrahim-Elsayed

Автор Ibrahim-Elsayed, история, 15 месяцев назад, По-английски

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$$$

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится