{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv style\u003d\"width:30.00%\" class\u003d\"illustration\"\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/87598d106b1636996e7d16ee98bc5e88?v\u003d1715800047\" alt\u003d\"/problems/diagonalcut/file/statement/en/img-0001.jpg\" class\u003d\"illustration\"\u003e\n \n \u003c/div\u003e\n \u003cp\u003eQuido and Hugo are making a chocolate cake. The central\n ingredient of the cake is a large chocolate bar, lying\n unwrapped on the kitchen table. The bar is an \u003cspan class\u003d\"tex2jax_process\"\u003e$M \\times N$\u003c/span\u003e rectangular grid of\n chocolate blocks. All of the \u003cspan class\u003d\"tex2jax_process\"\u003e$MN$\u003c/span\u003e blocks are rectangles of\n identical shape and size. The chocolate bar is of top quality\n and the friends want to eat part of it, before the rest is used\n in the cake.\u003c/p\u003e\n \u003cp\u003e“OK,” says Quido, “let’s divide the whole bar into two\n triangular chunks by a straight diagonal cut from its\n upper-left corner to its lower-right corner. We will then eat\n all of the blocks which have been cut exactly in half, into two\n equal-area pieces. You will eat one half and I will eat the\n other half of each such block. All other blocks, that is, the\n blocks which are either uncut or cut into two parts of\n different sizes, will go directly into the cake. Of course, we\n will make sure the cut is perfectly precise.\u003c/p\u003e\n \u003cp\u003eLet’s see how much chocolate we get to eat!”\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eThe input consists of two space-separated integers\n \u003cspan class\u003d\"tex2jax_process\"\u003e$M$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e given on a single line, (where\n \u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq M, N \\leq\n 10^{18}$\u003c/span\u003e). The numbers \u003cspan class\u003d\"tex2jax_process\"\u003e$M$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e denote the number of blocks in one\n column and in one row, respectively, in the chocolate bar.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003ePrint the number of blocks of the chocolate bar which are\n cut into exactly two pieces of equal area.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e6 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e75206452536745713 10322579177493903\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e40318322589\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}