{"raw_statement":[{"iden":"statement","content":"Hi ICPCer, welcome to Xi'an.\n\nBeing a beautiful ancient city, Xi'an is the capital city of Zhou, Qin, Han, and Tang Dynasties. With a long history, the streets in Xi'an have a grid pattern. \n\nAttracted by the streets' structure, Coach _Pang_ would like to conduct his research on them. He draws an $n times m$ grid on the board. The grid consists $n + 1$ vertical line segments and $m + 1$ horizontal line segments. The vertical and horizontal line segments intersect at exactly $(n + 1) times (m + 1)$ points, forming $n times m$ unit squares. We call the $(n + 1) times (m + 1)$ intersections _grid point_s. Output the number of line segments(not only vertical or horizontal) $l$ satisfying the following three conditions: \n\nThe only line contains two integers $n, m$($1 <= n, m <= 1000$).\n\nPrint the answer in a single line.\n\n"},{"iden":"input","content":"The only line contains two integers $n, m$($1 <= n, m <= 1000$)."},{"iden":"output","content":"Print the answer in a single line."},{"iden":"examples","content":"Input1 1\nOutput0\nInput2 3\nOutput14\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ with $ 1 \\leq n, m \\leq 1000 $.  \nConsider a grid with $ (n+1) \\times (m+1) $ grid points, arranged in a rectangular lattice.\n\n**Objective**  \nCount the total number of line segments $ l $ (not restricted to axis-aligned) such that:  \n- Both endpoints of $ l $ are grid points.  \n- The line segment connects two distinct grid points.  \n- The segment lies entirely within the grid (i.e., no restriction on direction beyond endpoint constraints).\n\n**Formulation**  \nThe number of such line segments is the number of unordered pairs of distinct grid points:  \n$$\n\\binom{(n+1)(m+1)}{2}\n$$","simple_statement":"Count all possible line segments (not just horizontal or vertical) that connect two grid points in an n×m grid.","has_page_source":false}