Not Too Hard

AtCoder
IDabc328_a
Time2000ms
Memory256MB
Difficulty
There is a programming contest with $N$ problems. For each $i = 1, 2, \ldots, N$, the score for the $i$\-th problem is $S_i$. Print the total score for all problems with a score of $X$ or less. ## Constraints * All input values are integers. * $4 \leq N \leq 8$ * $100 \leq S_i \leq 675$ * $100 \leq X \leq 675$ ## Input The input is given from Standard Input in the following format: $N$ $X$ $S_1$ $S_2$ $\ldots$ $S_N$ [samples]
Samples
Input #1
6 200
100 675 201 200 199 328
Output #1
499

Three problems have a score of $200$ or less: the first, fourth, and fifth, for a total score of $S_1 + S_4 + S_5 = 100 + 200 + 199 = 499$.
Input #2
8 675
675 675 675 675 675 675 675 675
Output #2
5400
Input #3
8 674
675 675 675 675 675 675 675 675
Output #3
0
API Response (JSON)
{
  "problem": {
    "name": "Not Too Hard",
    "description": {
      "content": "There is a programming contest with $N$ problems. For each $i = 1, 2, \\ldots, N$, the score for the $i$\\-th problem is $S_i$. Print the total score for all problems with a score of $X$ or less.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc328_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There is a programming contest with $N$ problems. For each $i = 1, 2, \\ldots, N$, the score for the $i$\\-th problem is $S_i$.\nPrint the total score for all problems with a score of $X$ or less.\n\n## Co...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments