QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 256 MB Total points: 100

#18659. Красиві суми

Statistics

Красиві суми — це суми кількох послідовних додатних цілих чисел. Наприклад, суми $7 + 8$ і $4 + 5 + 6$ красиві, а сума $3 + 5 + 7$ некрасива, хоча в усіх випадках значення дорівнює $15$. (Сума з єдиним доданком $15$ також вважається красивою.)

Отже, індекс краси цілого числа — це кількість його подань у вигляді красивої суми. Наприклад, індекс краси числа $15$ дорівнює $4$, оскільки $15$ можна подати красивою сумою чотирма способами: $15 = 7 + 8 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5$.

Одне число красивіше за інше, якщо його індекс краси вищий. Якщо числа мають однакові індекси краси, красивішим вважається менше число. Наприклад, $15$ — найменше ціле число з індексом краси $4$.

Потрібно знайти найменше ціле число із заданим індексом краси $n$.

Вхідні дані

Єдиний рядок містить ціле число $n$ ($1 \le n \le 10^5$).

Вихідні дані

Виведіть найменше ціле число із заданим індексом краси $n$ за модулем $(10^9 + 9)$.

Приклади

Вхідні дані 1

3

Вихідні дані 1

9

Вхідні дані 2

4

Вихідні дані 2

15

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.