Welcome Kit
InterviewTime limit0.1sMemory limit1024 MB
Find the fewest T-shirt bundles of size T that cover each size's requests, and the maximum pen bundles of size P with the leftover single pens.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The welcome kit for participants at the on-site Grand Arena event on February 3, 2024 includes one T-shirt and one pen. The vendor accepts orders only under the following conditions.
- T-shirts come in six sizes: S, M, L, XL, XXL, and XXXL. T-shirts can only be ordered in bundles of shirts of the same size.
- The pen is a single type. Pens can be ordered in bundles of or one at a time.
Of the participants, people requested T-shirts of sizes S, M, L, XL, XXL, and XXXL, respectively. Extra T-shirts are allowed, but there must not be a shortage, and each shirt must be given out in the requested size. The number of pens must match the number of participants exactly, with no surplus and no shortage.
Find the minimum number of bundles of T-shirts to order, and the maximum number of bundles of pens that can be ordered, along with the number of single pens to order in that case.
Input
The first line contains the number of participants .
The second line contains the number of requests for each T-shirt size, , separated by spaces.
The third line contains the integers and , the bundle sizes for T-shirts and pens, separated by a space.
Output
On the first line, print the minimum number of bundles of T-shirts to order.
On the next line, print the maximum number of bundles of pens that can be ordered, followed by the number of single pens to order in that case.