This problem was used in the following GFU competitions:
GFU 2024 D3 Q4
You have been moved to tableside service tonight for the dinner rush. You will be responsible for serving soup, salads, and freshly cut steaks to each table as requested. The issue is, you need to determine how much of each thing you need to bring out into the service, as too much will make the cart too heavy to push, and Ramsey Gordon will fire you.
The first line will contain a single integer n that represents the number of data sets that follow. Each data set will contain 3 integers, denoting the number of salads, soups, and steaks to be served from this round of tableside service. The ingredients required for each kind of food are outlined below:
Salads:
Every 2 salads needs a head of lettuce.
Every 3 salads need a bag of croutons.
Every 10 salads need a bottle of dressing.
Soups:
Every 15 soups need a pot of soup
Every 3 soups need a pack of crackers.
Steaks:
Every 3 orders requires a full steak.
Every steak order requires a plate.
Every salad or soup requires a bowl.
Every 15 salads and soups (combined) need a block of parmesan.Â
Any items that will not need to be added to the cart should be left out of the list entirely, not listed as 0.
Output a comma-separated, list of all the items you will need on the cart for this round of tableside service, in the order listed above, all on one line.
Example Input:
3
0 3 4
1 0 5
2 2 2
Example Output:
(note: each dataset's output will appear on 1 line, not multiple, and no blank lines will separate them)
1 pot(s) of soup, 1 bag(s) of crackers, 2 steak(s), 4 plate(s), 3 bowl(s), 1 block(s) of parmesan
1 head(s) of lettuce, 1 bag(s) of croutons, 1 bottle(s) of dressings, 2 steak(s),
5 plate(s), 1 bowl(s), 1 block(s) of parmesan
1 head(s) of lettuce, 1 bag(s) of croutons, 1 bottle(s) of dressings, 1 pot(s) of soup, 1 bag(s) of crackers, 1 steak(s), 2 plate(s), 4 bowl(s), 1 block(s) of
parmesan