{"problem":{"name":"GCD Subtraction","description":{"content":"We have variables $a$ and $b$. Initially, $a=A$ and $b=B$. Takahashi will repeat the following operation while both $a$ and $b$ are greater than or equal to $1$. *   Let $g$ be the greatest common di","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc159_b"},"statements":[{"statement_type":"Markdown","content":"We have variables $a$ and $b$. Initially, $a=A$ and $b=B$.\nTakahashi will repeat the following operation while both $a$ and $b$ are greater than or equal to $1$.\n\n*   Let $g$ be the greatest common divisor of $a$ and $b$, and replace $a$ and $b$ with $a-g$ and $b-g$, respectively.\n\nHow many times will he perform the operation?\n\n## Constraints\n\n*   $1 \\leq A,B \\leq 10^{12}$\n*   $A$ and $B$ 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":"arc159_b","tags":[],"sample_group":[["15 9","2\n\nWe start with $a=15,b=9$ and perform the following.\n\n*   Let $g=3$, and replace $a$ and $b$ with $12(=15-3)$ and $6(=9-3)$, respectively.\n*   Let $g=6$, and replace $a$ and $b$ with $6(=12-6)$ and $0(=6-6)$, respectively. $b$ is no longer greater than or equal to $1$, so the iteration terminates."],["1 1","1"],["12345678910 10987654321","36135"]],"created_at":"2026-03-03 11:01:14"}}