Codeforces Round 101 (Div. 2)
B
Hopscotch
Codeforces
1400
原题
← AC →
翻译中…

So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game. The game field, the court, looks as is shown in the figure (all blocks are square and are numbered from bottom to top, blocks in the same row are numbered from left to right). Let us describe the hopscotch with numbers that denote the number of squares in the row, staring from the lowest one: 1-1-2-1-2-1-2-(1-2)..., where then the period is repeated (1-2).

翻译中…

image

翻译中…

The coordinate system is defined as shown in the figure. Side of all the squares are equal and have length $*a*$.

翻译中…

Maria is a very smart and clever girl, and she is concerned with quite serious issues: if she throws a stone into a point with coordinates $(*x*, *y*)$, then will she hit some square? If the answer is positive, you are also required to determine the number of the square.

翻译中…

It is believed that the stone has fallen into the square if it is located strictly inside it. In other words a stone that has fallen on the square border is not considered a to hit a square.

翻译中…

Input

翻译中…

The only input line contains three integers: $*a*$, $*x*$, $*y*$, where $*a*$ ($1 ≤ *a* ≤ 100$) is the side of the square, $*x*$ and $*y*$ ($- 10^{6} ≤ *x* ≤ 10^{6}, 0 ≤ *y* ≤ 10^{6}$) are coordinates of the stone.

翻译中…

Output

翻译中…

Print the number of the square, inside which the stone fell. If the stone is on a border of some stone or outside the court, print "-1" without the quotes.

翻译中…

样例

Input #1
1 0 0
Output #1
-1
InputCopy OutputCopy
Input #2
3 1 1
Output #2
1
InputCopy OutputCopy
Input #3
3 0 10
Output #3
5
InputCopy OutputCopy
Input #4
3 0 7
Output #4
-1
InputCopy OutputCopy
Input #5
3 4 0
Output #5
-1
InputCopy OutputCopy
题目信息
题号
141B
时间限制
2 s
内存限制
256 MB
标签
计算几何
数学

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