{"problem":{"name":"Coprime Pair","description":{"content":"You are given integers $L,R$ ($L < R$). Snuke is looking for a pair of integers $(x,y)$ that satisfy both of the conditions below. *   $L \\leq x < y \\leq R$ *   $\\gcd(x,y)=1$ Find the maximum possib","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc137_a"},"statements":[{"statement_type":"Markdown","content":"You are given integers $L,R$ ($L < R$).\nSnuke is looking for a pair of integers $(x,y)$ that satisfy both of the conditions below.\n\n*   $L \\leq x < y \\leq R$\n*   $\\gcd(x,y)=1$\n\nFind the maximum possible value of $(y-x)$ in a pair that satisfies the conditions. It can be proved that at least one such pair exists under the Constraints.\n\n## Constraints\n\n*   $1 \\leq L < R \\leq 10^{18}$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$L$ $R$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc137_a","tags":[],"sample_group":[["2 4","1\n\nFor $(x,y)=(2,4)$, we have $\\gcd(x,y)=2$, which violates the condition. For $(x,y)=(2,3)$, the conditions are satisfied. Here, the value of $(y-x)$ is $1$. There is no such pair with a greater value of $(y-x)$, so the answer is $1$."],["14 21","5"],["1 100","99"]],"created_at":"2026-03-03 11:01:13"}}