Filter

AtCoder
IDabc294_a
Time2000ms
Memory256MB
Difficulty
You are given a sequence of $N$ integers: $A=(A _ 1,A _ 2,\ldots,A _ N)$. Print all even numbers in $A$ without changing the order. ## Constraints * $1\leq N\leq 100$ * $1\leq A _ i\leq 100\ (1\leq i\leq N)$ * $A$ contains at least one even number. * All values in the input are integers. ## Input The input is given from Standard Input in the following format: $N$ $A _ 1$ $A _ 2$ $\ldots$ $A _ N$ [samples]
Samples
Input #1
5
1 2 3 5 6
Output #1
2 6

We have $A=(1,2,3,5,6)$. Among them are two even numbers, $A _ 2=2$ and $A _ 5=6$, so print $2$ and $6$ in this order, with a space in between.
Input #2
5
2 2 2 3 3
Output #2
2 2 2

$A$ may contain equal elements.
Input #3
10
22 3 17 8 30 15 12 14 11 17
Output #3
22 8 30 12 14
API Response (JSON)
{
  "problem": {
    "name": "Filter",
    "description": {
      "content": "You are given a sequence of $N$ integers: $A=(A _ 1,A _ 2,\\ldots,A _ N)$. Print all even numbers in $A$ without changing the order.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc294_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a sequence of $N$ integers: $A=(A _ 1,A _ 2,\\ldots,A _ N)$.\nPrint all even numbers in $A$ without changing the order.\n\n## Constraints\n\n*   $1\\leq N\\leq 100$\n*   $1\\leq A _ i\\leq 100\\ (1\\...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments