You have a cassette with seconds of length, and songs with lengths . Your aim is to store the maximal number of whole songs in the cassette. You must consider that songs must be recorded with a second of separation between them.
The input consists of a series of cases separated with a line in white. Each case consists of two lines: The first one has and . The second one has numbers: . You can assume , , and that for each , .
For each case of the input, your program must print the maximal number of whole songs that fit in the cassette, bearing that they must be separated by a second in mind.
TestA: In some test cases will be fulfilled.
TestB: Other test cases will include cases with .
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T11:26:21.105Z
© Jutge.org, 2006–2026.
https://jutge.org