#abc328a. A - Not Too Hard

A - Not Too Hard

Score : 100100 points

问题描述

存在一场包含 NN 道题目的编程竞赛。对于每个 i=1,2,,Ni = 1, 2, \ldots, N,第 ii 道题目的分数为 SiS_i

请输出所有分数不大于 XX 的题目总分。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

There is a programming contest with NN problems. For each i=1,2,,Ni = 1, 2, \ldots, N, the score for the ii-th problem is SiS_i.

Print the total score for all problems with a score of XX or less.

Constraints

  • All input values are integers.
  • 4N84 \leq N \leq 8
  • 100Si675100 \leq S_i \leq 675
  • 100X675100 \leq X \leq 675

Input

The input is given from Standard Input in the following format:

NN XX

S1S_1 S2S_2 \ldots SNS_N

Output

Print the answer.

Sample Input 1

6 200
100 675 201 200 199 328

Sample Output 1

499

Three problems have a score of 200200 or less: the first, fourth, and fifth, for a total score of S1+S4+S5=100+200+199=499S_1 + S_4 + S_5 = 100 + 200 + 199 = 499.

Sample Input 2

8 675
675 675 675 675 675 675 675 675

Sample Output 2

5400

Sample Input 3

8 674
675 675 675 675 675 675 675 675

Sample Output 3

0

update @ 2024/3/10 01:52:12