{"problem":{"name":"+1-1x2","description":{"content":"Takahashi has written an integer $X$ on a blackboard. He can do the following three kinds of operations any number of times in any order: *   increase the value written on the blackboard by $1$; *   ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc188_f"},"statements":[{"statement_type":"Markdown","content":"Takahashi has written an integer $X$ on a blackboard. He can do the following three kinds of operations any number of times in any order:\n\n*   increase the value written on the blackboard by $1$;\n*   decrease the value written on the blackboard by $1$;\n*   multiply the value written on the blackboard by $2$.\n\nFind the minimum number of operations required to have $Y$ written on the blackboard.\n\n## Constraints\n\n*   $1 \\le X \\le 10^{18}$\n*   $1 \\le Y \\le 10^{18}$\n*   $X$ and $Y$ are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$X$ $Y$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc188_f","tags":[],"sample_group":[["3 9","3\n\nInitially, $3$ is written on the blackboard. The following three operations can make it $9$:\n\n*   increase the value by $1$, which results in $4$;\n*   multiply the value by $2$, which results in $8$;\n*   increase the value by $1$, which results in $9$."],["7 11","3\n\nThe following procedure can make the value on the blackboard $11$:\n\n*   decrease the value by $1$, which results in $6$;\n*   multiply the value by $2$, which results in $12$;\n*   decrease the value by $1$, which results in $11$."],["1000000000000000000 1000000000000000000","0\n\nIf the value initially written on the blackboard equals $Y$, print $0$."]],"created_at":"2026-03-03 11:01:14"}}