内存限制:1024 MB
时间限制:1 S
题面:Markdown
评测方式:文本比较
上传者:
提交:4
通过:3
Grammy bought a big cake. The shape of the cake is a regular polygon. That is, a convex polygon whose all interior angles are equal and all edges are equal.
Grammy wants to cut the cake into a pretty pattern and share the cake with her friends. She indexed the vertices $0$ through $n-1$ in counterclockwise order and chooses an integer $k$. After that, she cuts the cake through $n$ straight lines connecting vertex $i$ and vertex $(i+k)\bmod n$ for each $i$.
Grammy wants to know the number of pieces after cutting the cake. Please calculate it for her.
Output a single integer in a line, denoting the number of pieces after cutting the cake.
For the sample test case, the final cake is shown below:
