No.1128 Wedding Ceremony
レベル :
/ AI推定難易度 : 75
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 295
作問者 :
WrongAccept
/ テスター :
leafirby
タグ : / 解いたユーザー数 295
作問者 :
WrongAccept
/ テスター :
leafirby
問題文最終更新日: 2020-07-26 22:04:49
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Problem Statement
NaN-kun has been invited to a friend's wedding, so he intends to give at least $N$ yen as a monetary wedding gift.
However, the amount he gives must not be divisible by $2$, as that would bring bad luck. Find the minimum possible amount that NaN-kun can give.
Input
$N$
$0\le N\le 10^8$
All inputs are integers.
Output
Output the answer, followed by a newline.
Sample
Sample 1
Input
2
Output
3
Output $3$, which is the smallest integer that is at least $2$ and not divisible by $2$.
Sample 2
Input
11
Output
11
$11$ is not divisible by $2$, so this is the minimum value.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。