Rectangle Cutting
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given an rectangle, your task is to cut it into squares. On each move you can select a rectangle and cut it into two rectangles in such a way that all side lengths remain integers. What is the minimum possible number of moves?
Input
Two integers and .
Output
Print the minimum number of moves.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 160
Acceptance rate 8%