Divisible

AtCoder
IDabc347_a
Time2000ms
Memory256MB
Difficulty
You are given positive integers $N$ and $K$, and a sequence of length $N$, $A=(A_1,A_2,\ldots,A_N)$. Extract all elements of $A$ that are multiples of $K$, divide them by $K$, and print the quotients. ## Constraints * $1\leq N,K\leq 100$ * $1\leq A_1 < A_2 < \ldots < A_N \leq 100$ * $A$ has at least one multiple of $K$. * All given numbers are integers. ## Input The input is given from Standard Input in the following format: $N$ $K$ $A_1$ $A_2$ $\ldots$ $A_N$ [samples]
Samples
Input #1
5 2
2 5 6 7 10
Output #1
1 3 5

The multiples of $2$ among the elements in $A$ are $2$, $6$, and $10$. Divide them by $2$ to get $1$, $3$, and $5$, and print them in ascending order with spaces in between.
Input #2
3 1
3 4 7
Output #2
3 4 7
Input #3
5 10
50 51 54 60 65
Output #3
5 6
API Response (JSON)
{
  "problem": {
    "name": "Divisible",
    "description": {
      "content": "You are given positive integers $N$ and $K$, and a sequence of length $N$, $A=(A_1,A_2,\\ldots,A_N)$. Extract all elements of $A$ that are multiples of $K$, divide them by $K$, and print the quotients.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc347_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given positive integers $N$ and $K$, and a sequence of length $N$, $A=(A_1,A_2,\\ldots,A_N)$.\nExtract all elements of $A$ that are multiples of $K$, divide them by $K$, and print the quotients....",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments