Calendar 2

AtCoder
IDs8pc_4_c
Time1000ms
Memory256MB
Difficulty
We have a grid with $n$ rows and $7$ columns. We call it a calendar. The cell at $i$\-th row and $j$\-th column is denoted $(i, j)$. ![image](https://atcoder.jp/img/s8pc-4/1bef402eeaddb846eb2ea4d386a1ed3d.png) Initially, each cell at $(i, j)$ contains the integer $7i + j - 8$, and each cell is white. Snuke likes painting, so he decided integer $m$, and did $q$ operations with a calendar. ・In $i$\-th operation, he paint black on the cell in which an integer is written such remainder of dividing by $m$ is $a_i$. Please count the number of connected white parts. Note that if two adjacent cells are white, the cells belong to the same connected part. ## Input Format The input format is following: $n$ $m$ $q$ $a_1$ $a_2$ ... $a_q$ [samples]
API Response (JSON)
{
  "problem": {
    "name": "Calendar 2",
    "description": {
      "content": "We have a grid with $n$ rows and $7$ columns. We call it a calendar. The cell at $i$\\-th row and $j$\\-th column is denoted $(i, j)$.   ![image](https://atcoder.jp/img/s8pc-4/1bef402eeaddb846eb2ea4d38",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "s8pc_4_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We have a grid with $n$ rows and $7$ columns. We call it a calendar. The cell at $i$\\-th row and $j$\\-th column is denoted $(i, j)$.  \n\n![image](https://atcoder.jp/img/s8pc-4/1bef402eeaddb846eb2ea4d38...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments