-->
当前位置:首页 > 题库

PROGRAMMING:Program storage problem

Luz5年前 (2021-05-10)题库503
There are n programs {1,2,..., n} to be stored on the tape of length L. The length of program I stored on tape is Li, 1 ≤ I ≤ n. The problem of program storage requires to determine a storage scheme of these n programs on tape, so that as many programs as possible can be stored on tape. For a given length of N programs stored on the tape, the maximum number of programs that can be stored on the tape is calculated.
###Input format:
The first line is two positive integers, representing the number of Files N and the length of tape L, respectively. In the next line, there are n positive integers indicating the length of the program stored on the tape.
###Output format:
Output the maximum number of programs that can be stored.
###Input example:
Here is a set of inputs. For example:
```in
6 50
2 3 13 8 80 20
```
###Output example:
The corresponding output is given here. For example:
```out
five
```







answer:If there is no answer, please comment