Connected Checkerboard

AtCoder
IDrelay_j
Time2000ms
Memory256MB
Difficulty
We have an $N×N$ checkerboard. From the square at the upper left corner, a square that is $i$ squares to the right and $j$ squares below is denoted as $(i, j)$. Particularly, the square at the upper left corner is denoted as $(0, 0)$. Each square $(i, j)$ such that $i+j$ is even, is colored black, and the other squares are colored white. We will satisfy the following condition by painting some of the white squares: * Any black square can be reached from square $(0, 0)$ by repeatedly moving to a black square that shares a side with the current square. Achieve the objective by painting at most $170000$ squares black. ## Constraints * $1 \leq N \leq 1,000$ ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
2
Output #1
1
1 0
Input #2
4
Output #2
3
0 1
2 1
2 3
API Response (JSON)
{
  "problem": {
    "name": "Connected Checkerboard",
    "description": {
      "content": "We have an $N×N$ checkerboard. From the square at the upper left corner, a square that is $i$ squares to the right and $j$ squares below is denoted as $(i, j)$. Particularly, the square at the upper l",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "relay_j"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We have an $N×N$ checkerboard.\nFrom the square at the upper left corner, a square that is $i$ squares to the right and $j$ squares below is denoted as $(i, j)$. Particularly, the square at the upper l...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments