Nuts

AtCoder
IDabc204_b
Time2000ms
Memory256MB
Difficulty
There are $N$ trees. The $i$\-th tree bears $A_i$ nuts. Chipmunk will harvest nuts from the trees in the following manner: * From a tree with $10$ or fewer nuts, she does not take nuts. * From a tree with more than $10$ nuts, she takes all but $10$ nuts. Find the total number of nuts Chipmunk will take from the trees. ## Constraints * $1 \leq N \leq 1000$ * $0 \leq A_i \leq 1000$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $A_1$ $\ldots$ $A_N$ [samples]
Samples
Input #1
3
6 17 28
Output #1
25

From the three trees, Chipmunk will take $0$, $7$, and $18$ nuts, for a total of $25$ nuts.
Input #2
4
8 9 10 11
Output #2
1
API Response (JSON)
{
  "problem": {
    "name": "Nuts",
    "description": {
      "content": "There are $N$ trees. The $i$\\-th tree bears $A_i$ nuts. Chipmunk will harvest nuts from the trees in the following manner: *   From a tree with $10$ or fewer nuts, she does not take nuts. *   From a ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc204_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are $N$ trees. The $i$\\-th tree bears $A_i$ nuts.\nChipmunk will harvest nuts from the trees in the following manner:\n\n*   From a tree with $10$ or fewer nuts, she does not take nuts.\n*   From a ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments