{"problem":{"name":"Avoid Prime Sum","description":{"content":"You are given a positive integer $N$. Fill each square of a grid with $N$ rows and $N$ columns by writing a positive integer not greater than $N^2$ so that all of the following conditions are satisfie","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc149_c"},"statements":[{"statement_type":"Markdown","content":"You are given a positive integer $N$.\nFill each square of a grid with $N$ rows and $N$ columns by writing a positive integer not greater than $N^2$ so that all of the following conditions are satisfied.\n\n*   Two positive integers written in horizontally or vertically adjacent squares never sum to a prime number.\n*   Every positive integer not greater than $N^2$ is written in one of the squares.\n\nUnder the Constraints of this problem, it can be proved that such a way to fill the grid always exists.\n\n## Constraints\n\n*   $3\\leq N\\leq 1000$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc149_c","tags":[],"sample_group":[["4","15 11 16 12\n13 3 6 9\n14 7 8 1\n4 2 10 5\n\nIn this grid, every positive integer from $1$ through $16$ is written once. Additionally, among the sums of two positive integers written in horizontally or vertically adjacent squares are $15+11=26$, $11+16=27$, and $15+13=28$, none of which is a prime number."]],"created_at":"2026-03-03 11:01:14"}}