{"problem":{"name":"Count Subtractions","description":{"content":"You are given positive integers $A$ and $B$. You will repeat the following operation until $A=B$: *   compare $A$ and $B$ to perform one of the following two:     *   if $A > B$, replace $A$ with $A-","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc297_d"},"statements":[{"statement_type":"Markdown","content":"You are given positive integers $A$ and $B$.\nYou will repeat the following operation until $A=B$:\n\n*   compare $A$ and $B$ to perform one of the following two:\n    *   if $A > B$, replace $A$ with $A-B$;\n    *   if $A < B$, replace $B$ with $B-A$.\n\nHow many times will you repeat it until $A=B$? It is guaranteed that a finite repetition makes $A=B$.\n\n## Constraints\n\n*   $1 \\le A,B \\le 10^{18}$\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$A$ $B$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc297_d","tags":[],"sample_group":[["3 8","4\n\nInitially, $A=3$ and $B=8$. You repeat the operation as follows:\n\n*   $A<B$, so replace $B$ with $B-A=5$, making $A=3$ and $B=5$.\n*   $A<B$, so replace $B$ with $B-A=2$, making $A=3$ and $B=2$.\n*   $A>B$, so replace $A$ with $A-B=1$, making $A=1$ and $B=2$.\n*   $A<B$, so replace $B$ with $B-A=1$, making $A=1$ and $B=1$.\n\nThus, you repeat it four times."],["1234567890 1234567890","0\n\nNote that the input may not fit into a 32-bit integer type."],["1597 987","15"]],"created_at":"2026-03-03 11:01:14"}}