{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003e农夫约翰获知了一头逃走的牛的位置,想要将它立即抓住。他从数轴上的一个点 \u003ci\u003eN\u003c/i\u003e (0 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 100,000) 出发,牛位于相同数轴上的点 \u003ci\u003eK\u003c/i\u003e (0 ≤ \u003ci\u003eK\u003c/i\u003e ≤ 100,000)。农夫约翰有两种前进方式:行走和神行。\u003c/p\u003e\n \u003cp\u003e* 行走:农夫约翰可以从任何 \u003ci\u003eX\u003c/i\u003e 移动到点 \u003ci\u003eX \u003c/i\u003e- 1 或 \u003ci\u003eX \u003c/i\u003e+ 1,只需要一分钟;\n \u003cbr\u003e* 神行:农夫约翰可以从任何点 \u003ci\u003eX\u003c/i\u003e 移动到点 2 × \u003ci\u003eX\u003c/i\u003e,也只需要一分钟。\u003c/p\u003e\n \u003cp\u003e如果那头逃走的牛并不知道对它实施的抓捕行动,因此完全不移动,那么农夫约翰花多少时间可以抓住这头牛?\u003c/p\u003e\n "}},{"title":"Input","value":{"format":"HTML","content":"\n 第一行包含两个以空格分隔的整数:\n \u003ci\u003eN\u003c/i\u003e 和 \n \u003ci\u003eK\u003c/i\u003e\n "}},{"title":"Output","value":{"format":"HTML","content":"\n 第一行输出农夫约翰抓住逃走的牛,所花费的最短时间 (分钟)。\n "}},{"title":"Sample Input","value":{"format":"HTML","content":"\n \u003cpre\u003e5 17\u003c/pre\u003e\n "}},{"title":"Sample Output","value":{"format":"HTML","content":"\n \u003cpre\u003e4\u003c/pre\u003e\n "}},{"title":"Hint","value":{"format":"HTML","content":"\n 农夫约翰抓住逃走的牛的最快方式,是按如下路径移动:5-10-9-18-17,这花费了 4 分钟。\n "}}]}