{"trustable":false,"sections":[{"title":"题面","value":{"format":"MD","content":"Farmer John 已获悉一头逃亡奶牛的位置,并希望立即抓住她。 他从数轴上的点 N (0 ≤ N ≤ 100,000) 开始,而奶牛在同一数轴上的点 K (0 ≤ K ≤ 100,000) 处。 Farmer John 有两种交通方式:步行和传送。\n\n* 步行:FJ可以在一分钟内从任意点 X 移动到点 X - 1 或 X + 1\n* 传送:FJ可以在一分钟内从任意点 X 移动到点 2 × X。\n\n如果母牛没有意识到它的追赶,根本不动,农夫约翰需要多长时间才能找回它?"}},{"title":"输入格式","value":{"format":"MD","content":"仅一行,输入N (0 ≤ N ≤ 100,000) 和 K (0 ≤ K ≤ 100,000) ."}},{"title":"输出格式","value":{"format":"MD","content":"仅一行,输出FJ抓到奶牛所需分钟数."}},{"title":"样例","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e样例输入\u003c/th\u003e\n \u003cth\u003e样例输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 17\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例分析","value":{"format":"MD","content":"The fastest way for Farmer John to reach the fugitive cow is to move along the following path: 5-10-9-18-17, which takes 4 minutes."}},{"title":"提示","value":{"format":"MD","content":"使用BFS"}}]}