{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e \n \u003cp\u003e Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point \u003ci\u003eN\u003c/i\u003e (0 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 100,000) on a number line and the cow is at a point \u003ci\u003eK\u003c/i\u003e (0 ≤ \u003ci\u003eK\u003c/i\u003e ≤ 100,000) on the same number line. Farmer John has two modes of transportation: walking and teleporting.\u003c/p\u003e \n \u003cp\u003e * Walking: \u003cspan\u003eFJ\u003c/span\u003e can move from any point \u003ci\u003eX\u003c/i\u003e to the points \u003ci\u003eX \u003c/i\u003e- 1 or \u003ci\u003eX \u003c/i\u003e+ 1 in a single minute\u003cbr\u003e * Teleporting: \u003cspan\u003eFJ\u003c/span\u003e can move from any point \u003ci\u003eX\u003c/i\u003e to the point 2 × \u003ci\u003eX\u003c/i\u003e in a single minute.\u003c/p\u003e \n \u003cp\u003e If the cow, unaware of its pursuit, does not move at all, how long does it take for Farmer John to retrieve it?\u003c/p\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv\u003e\n Line 1: Two space-separated integers: \n \u003ci\u003eN\u003c/i\u003e and \n \u003ci\u003eK\u003c/i\u003e\n\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv\u003e\n Line 1: The least amount of time, in minutes, it takes for Farmer John to catch the fugitive cow.\n\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n5 17\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\n4\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cdiv\u003e\n 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.\n\u003c/div\u003e"}}]}