{"raw_statement":[{"iden":"statement","content":"Alice is playing the Game of Corners. She is given a rectangular grid with n rows and m columns. During one move, Alice can choose any two previously unused cell borders that have a common point and join them in a corner (pictured). A corner can be oriented in any way.\n\nInitially the grid is clear of corners. How many moves can Alice possibly make?\n\nThe only line of the input contains two integers n and m (1 ≤ n, m ≤ 109) — the number of rows and the number of columns in the grid.\n\nOutput a single integer — the maximum number of moves Alice can make.\n\nTwo corners can share a point on the grid, but cannot share a cell border.\n\nFor the first given sample, one possible arrangement of corners is: \n\n"},{"iden":"input","content":"The only line of the input contains two integers n and m (1 ≤ n, m ≤ 109) — the number of rows and the number of columns in the grid."},{"iden":"output","content":"Output a single integer — the maximum number of moves Alice can make."},{"iden":"examples","content":"Input2 3Output8Input1 1Output2"},{"iden":"note","content":"Two corners can share a point on the grid, but cannot share a cell border.For the first given sample, one possible arrangement of corners is:   "}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ denote the number of rows and columns of a rectangular grid, respectively.\n\n**Constraints**  \n$ 1 \\leq n, m \\leq 10^9 $\n\n**Objective**  \nCompute the maximum number of non-overlapping corners that can be formed, where each corner is formed by joining two adjacent unused cell borders sharing a common grid point, and no two corners may share a cell border.\n\nEach corner occupies exactly one internal grid point and uses two of its four incident cell borders. The maximum number of such corners is constrained by the number of internal grid points and the bipartite nature of border usage.\n\nThe grid has $ (n+1) \\times (m+1) $ grid points.  \nEach corner uses one grid point and consumes two of its four borders.  \nEach cell border is shared between at most two adjacent cells, but each border segment can be used in at most one corner.\n\nThe maximum number of corners is limited by the total number of available 90-degree turns at internal grid points, under the constraint that no two corners share a border.\n\nIt is known that the maximum number of non-overlapping corners in such a grid is:\n\n$$\n(n - 1)(m - 1)\n$$\n\n**Answer**  \n$$\n(n - 1)(m - 1)\n$$","simple_statement":"Alice can place a corner at every internal grid point where two borders meet. Each corner uses two adjacent borders that share a corner point. The maximum number of such points is (n-1) * (m-1).  \n\nAnswer: (n - 1) * (m - 1)","has_page_source":false}