Codeforces Round 296 (Div. 2)
A
Playing with Paper
Codeforces
1100
原题
←B →
翻译中…

One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular $*a*$ mm $×$ $*b*$ mm sheet of paper ($*a* > *b*$). Usually the first step in making an origami is making a square piece of paper from the rectangular sheet by folding the sheet along the bisector of the right angle, and cutting the excess part.

翻译中…

image

翻译中…

After making a paper ship from the square piece, Vasya looked on the remaining $(*a* - *b*)$ mm $×$ $*b*$ mm strip of paper. He got the idea to use this strip of paper in the same way to make an origami, and then use the remainder (if it exists) and so on. At the moment when he is left with a square piece of paper, he will make the last ship from it and stop.

翻译中…

Can you determine how many ships Vasya will make during the lesson?

翻译中…

Input

翻译中…

The first line of the input contains two integers $*a*$, $*b*$ ($1 ≤ *b* < *a* ≤ 10^{12}$) — the sizes of the original sheet of paper.

翻译中…

Output

翻译中…

Print a single integer — the number of ships that Vasya will make.

翻译中…

Note

翻译中…

Pictures to the first and second sample test.

翻译中…

image

翻译中…

样例

Input #1
2 1
Output #1
2
InputCopy OutputCopy
Input #2
10 7
Output #2
6
InputCopy OutputCopy
Input #3
1000000000000 1
Output #3
1000000000000
InputCopy OutputCopy
题目信息
题号
527A
时间限制
2 s
内存限制
256 MB
标签
模拟
数学

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