{"scoring":null,"notes":"","legend":"Alice likes building toy walls. She has a lot of $1 \\times 2$ bricks and a limited supply of $1 \\times 3$ bricks. Both types of bricks have a height of 1 and can not be rotated.\r\n\r\nAlice is going to build a one unit thick wall of length $l$ and height $h$ out of these bricks. A wall is \\textit{solid} if there are no seams directly above another seam.\r\n\r\n\r\n\\newcommand\\anotherImage[2]{ % {caption}{image}\r\n    \\begin{minipage}[b]{5cm}\\begin{center}\r\n         \\begin{tikzpicture}[scale=0.5]#2\\end{tikzpicture}\r\n\r\n         #1\r\n    \\end{center}\\end{minipage}\r\n\r\n}\r\n\r\n\\newcommand\\anotherBrick{}\r\n\\def\\anotherBrick(#1, #2, #3){\\draw (#2, #1) rectangle ({#2 + #3}, {#1 + 1});}\r\n\r\n\\begin{center}\\begin{tabular}{c c c}\r\n    \\anotherImage{Good seam placement}{\r\n        \\foreach \\y in {1,...,2} {\r\n            \\foreach \\x in {1,3,...,6} {\r\n                \\draw ({mod(\\y + 1, 2) + \\x - 1}, \\y) rectangle ({mod(\\y + 1, 2) + \\x + 1}, \\y - 1);\r\n            }\r\n        }\r\n    } &\r\n    \\anotherImage{Bad seam placement}{\r\n        \\anotherBrick(2, 0, 3) \\anotherBrick(2, 3, 2) \\anotherBrick(2, 5, 2)\r\n        \\anotherBrick(1, 0, 2) \\anotherBrick(1, 2, 3) \\anotherBrick(1, 5, 2)\r\n        \\anotherBrick(0, 0, 2) \\anotherBrick(0, 2, 2) \\anotherBrick(0, 4, 3)\r\n\r\n        \\draw[ultra thick] (2, 1) ellipse (0.4 and 0.8);\r\n        \\draw[ultra thick] (5, 2) ellipse (0.4 and 0.8);\r\n    } &\r\n    \\anotherImage{Solid $7 \\times 4$ wall}{\r\n        \\pgfmathsetmacro{\\l}{7}\r\n        \\pgfmathsetmacro{\\h}{4}\r\n        \\pgfmathsetmacro{\\c}{\\l - 3}\r\n        \\foreach \\y in {1,...,\\h} {\r\n            \\foreach \\x in {1,3,...,\\c} {\r\n                 \\draw ({mod(\\y + 1, 2) * 3 + \\x - 1}, \\y) rectangle ({mod(\\y + 1, 2) * 3 + \\x + 1}, \\y - 1);\r\n            }\r\n        }\r\n        \\draw[ultra thick] (0, 0) rectangle (\\l, \\h);\r\n    } \\\\\r\n\\end{tabular}\\end{center}\r\n\r\n\r\nHelp Alice determine the minimum number of $1 \\times 3$ bricks required to build a solid wall of length $l$ and height $h$.","authorLogin":"tourist","language":"english","timeLimit":2000,"output":"Print the minimum number of $1 \\times 3$ bricks required to build a solid $l \\times h$ wall.\r\n\r\nIt can be shown that it is always possible to build a solid wall of length $l$ and height $h$.","inputFile":"stdin","outputFile":"stdout","input":"The only line contains two integers $l$ and $h$, denoting the length and the height of the wall ($5 \\le l \\le 1000$; $2 \\le h \\le 1000$).\r\n","authorName":"Gennady Korotkevich","sampleTests":[{"output":"4\r\n","input":"7 4\r\n","inputFile":"example.01","outputFile":"example.01.a"}],"name":"Another Brick in the Wall","interaction":null,"memoryLimit":1073741824,"tutorial":"{\r\n    \\parindent=1cm\r\n    \\begin{tabular}{l@{\\extracolsep{1cm}}l}\r\n         Идея: & Георгий Корнеев\\\\\r\n         Разработка: & Георгий Корнеев\\\\\r\n     \\end{tabular}\r\n}\r\n\r\nЕсли $l$ нечетно, то в каждом ряду кирпичей как минимум один должен быть $1 \\times 3$, и этого достаточно. В этом случае ответ $h$.\r\n\r\nЕсли $l$ четно, то в рядах поочерёдно нужно делать либо все кирпичи $1 \\times 2$, либо два крайних кирпича $1 \\times 3$. Нам потребуется как минимум $\\lfloor \\frac{h}{2} \\rfloor$ рядов с двумя кирпичами $1 \\times 3$. Ответ в этом случае будет $2 \\lfloor \\frac{h}{2} \\rfloor$.\r\n"}