{"problem":{"name":"Tiling","description":{"content":"Takahashi has an $N \\times M$ grid, with $N$ horizontal rows and $M$ vertical columns. Determine if we can place $A$ $1 \\times 2$ tiles ($1$ vertical, $2$ horizontal) and $B$ $2 \\times 1$ tiles ($2$ v","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc021_c"},"statements":[{"statement_type":"Markdown","content":"Takahashi has an $N \\times M$ grid, with $N$ horizontal rows and $M$ vertical columns. Determine if we can place $A$ $1 \\times 2$ tiles ($1$ vertical, $2$ horizontal) and $B$ $2 \\times 1$ tiles ($2$ vertical, $1$ horizontal) satisfying the following conditions, and construct one arrangement of the tiles if it is possible:\n\n*   All the tiles must be placed on the grid.\n*   Tiles must not stick out of the grid, and no two different tiles may intersect.\n*   Neither the grid nor the tiles may be rotated.\n*   Every tile completely covers exactly two squares.\n\n## Constraints\n\n*   $1 \\leq N,M \\leq 1000$\n*   $0 \\leq A,B \\leq 500000$\n*   $N$, $M$, $A$ and $B$ are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$ $A$ $B$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc021_c","tags":[],"sample_group":[["3 4 4 2","YES\n<><>\n^<>^\nv<>v\n\nThis is one example of a way to place four $1 \\times 2$ tiles and three $2 \\times 1$ tiles on a $3 \\times 4$ grid."],["4 5 5 3","YES\n<>..^\n^.<>v\nv<>.^\n<><>v"],["7 9 20 20","NO"]],"created_at":"2026-03-03 11:01:13"}}