QOJ.ac

QOJ

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

#18659. Beautiful sums

Statistics

Beautiful sums are the sums of several consequent positive integers. For example, the sums $7 + 8$ and $4 + 5 + 6$ are beautiful, and the sum $3 + 5 + 7$ is not beautiful even though the value in all cases equals $15$. (The sum of single summand $15$ also considered beautiful.)

Given this, the beauty index of integer is the number of its representations as a beautiful sum. For example, the beauty index of number $15$ equals $4$ as $15$ is represented by a beautiful sum in four ways: $15 = 7 + 8 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5$.

One number is more beautiful than another if its beauty index is higher. If numbers have equal beauty indexes the smaller one is considered more beautiful. For example, $15$ is the smallest integer having beauty index $4$.

You have to find the smallest integer for given beauty index $n$.

Input

Single line contains an integer $n$ ($1 \le n \le 10^5$).

Output

Output the smallest integer for given beauty index $n$ modulo $(10^9 + 9)$.

Examples

Input 1

3

Output 1

9

Input 2

4

Output 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.