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.