{"problem":{"name":"Make Them Even","description":{"content":"There is a grid of square cells with $H$ horizontal rows and $W$ vertical columns. The cell at the $i$\\-th row and the $j$\\-th column will be denoted as Cell $(i, j)$. In Cell $(i, j)$, $a_{ij}$ coins","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc109_d"},"statements":[{"statement_type":"Markdown","content":"There is a grid of square cells with $H$ horizontal rows and $W$ vertical columns. The cell at the $i$\\-th row and the $j$\\-th column will be denoted as Cell $(i, j)$.\nIn Cell $(i, j)$, $a_{ij}$ coins are placed.\nYou can perform the following operation any number of times:\nOperation: Choose a cell that was not chosen before and contains one or more coins, then move one of those coins to a vertically or horizontally adjacent cell.\nMaximize the number of cells containing an even number of coins.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq H, W \\leq 500$\n*   $0 \\leq a_{ij} \\leq 9$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$H$ $W$\n$a_{11}$ $a_{12}$ $...$ $a_{1W}$\n$a_{21}$ $a_{22}$ $...$ $a_{2W}$\n$:$\n$a_{H1}$ $a_{H2}$ $...$ $a_{HW}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc109_d","tags":[],"sample_group":[["2 3\n1 2 3\n0 1 1","3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n\nEvery cell contains an even number of coins after the following sequence of operations:\n\n*   Move the coin in Cell $(2, 2)$ to Cell $(2, 3)$.\n*   Move the coin in Cell $(1, 1)$ to Cell $(1, 2)$.\n*   Move one of the coins in Cell $(1, 3)$ to Cell $(1, 2)$."],["3 2\n1 0\n2 1\n1 0","3\n1 1 1 2\n1 2 2 2\n3 1 3 2"],["1 5\n9 9 9 9 9","2\n1 1 1 2\n1 3 1 4"]],"created_at":"2026-03-03 11:01:13"}}