Codeforces Round 482 (Div. 2)
A
Pizza, Pizza, Pizza!!!
Codeforces
1000
原题
←B →
翻译中…

Katie, Kuro and Shiro are best friends. They have known each other since kindergarten. That's why they often share everything with each other and work together on some very hard problems.

翻译中…

Today is Shiro's birthday. She really loves pizza so she wants to invite her friends to the pizza restaurant near her house to celebrate her birthday, including her best friends Katie and Kuro.

翻译中…

She has ordered a very big round pizza, in order to serve her many friends. Exactly $n$ of Shiro's friends are here. That's why she has to divide the pizza into $n + 1$ slices (Shiro also needs to eat). She wants the slices to be exactly the same size and shape. If not, some of her friends will get mad and go home early, and the party will be over.

翻译中…

Shiro is now hungry. She wants to cut the pizza with minimum of straight cuts. A cut is a straight segment, it might have ends inside or outside the pizza. But she is too lazy to pick up the calculator.

翻译中…

As usual, she will ask Katie and Kuro for help. But they haven't come yet. Could you help Shiro with this problem?

翻译中…

Input

翻译中…

A single line contains one non-negative integer $n$ ($0 \le n \leq 10^{18}$) — the number of Shiro's friends. The circular pizza has to be sliced into $n + 1$ pieces.

翻译中…

Output

翻译中…

A single integer — the number of straight cuts Shiro needs.

翻译中…

Note

翻译中…

To cut the round pizza into quarters one has to make two cuts through the center with angle $90^{\circ}$ between them.

翻译中…

To cut the round pizza into five equal parts one has to make five cuts.

翻译中…

样例

Input #1
3
Output #1
2
InputCopy OutputCopy
Input #2
4
Output #2
5
InputCopy OutputCopy
题目信息
题号
979A
时间限制
1 s
内存限制
128 MB
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。