Type: Default 1000ms 256MiB

平分石头

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

问题描述

给你N颗石头,给出N(0 < N < 200),M( 0 < M < 10000),和N颗石头的质量,质量为不超过300的整数,问从中拿出若干块石头质量和与M最接近,输出石头的质量和。

Input

第一行输入两个整数N和M; 接下来N行,输入N颗石头的质量。

Output

输出最后的结果

Samples

5 10
1
2
3
4
5
10

Limitation

1s, 1024KiB for each test case.

9.27(dfs)

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
7
Start at
2025-9-19 13:00
End at
2025-10-6 5:00
Duration
400 hour(s)
Host
Partic.
4