{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cimg src\u003d\"CDN_BASE_URL/c429a72ff3cc428b55f0ee2be9b35343?v\u003d1714350924\" border\u003d\"0\" alt\u003d\"Problem illustration\" align\u003d\"RIGHT\" class\u003d\"problem_raimage\"\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eA centipede has 40 left feet and 40 right feet. It keeps \u003ci\u003ea\u003c/i\u003e left slippers \r\nand \u003ci\u003eb\u003c/i\u003e right slippers under its bed. Every morning the centipede puts on \r\nthe slippers. It pokes its first left foot under the bed and puts on a \r\nrandom slipper, doing it in one second. If the slipper is left, the \r\ncentipede passes to shoeing the second left foot. Otherwise, it takes off \r\nthe slipper and puts it on any unshod right foot, spending one more \r\nsecond, so that it takes two seconds altogether to put on such a slipper. \r\nIf there are no unshod right feet, the centipede throws the slipper to a \r\ncorner of the room, also in one second, so that two seconds are spent \r\naltogether for this slipper. The process is continued until all the left \r\nfeet are in left slippers. Then the centipede starts shoeing its right \r\nfeet until all of them are shod. \u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eToday the centipede has got out of bed on the wrong side, so it is \r\npreparing for the worst. How many seconds will it need for shoeing? \u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe only line contains the integers \u003ci\u003ea\u003c/i\u003e and \u003ci\u003eb\u003c/i\u003e (40 ≤ \u003ci\u003ea\u003c/i\u003e, \u003ci\u003eb\u003c/i\u003e ≤ 100).\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the number of seconds the centipede will need for shoeing in the \r\nworst case. \u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e40 40\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e120\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}