014 Overcooked!
You are a cook trying to make as many burgers as possible.
Making a burger requires these steps:
- Put patty in frying pan
- Remove patty from frying pan
- Chop tomato
- Chop lettuce
- Assemble burger
Each burger requires one patty, one tomato, and one lettuce.
- You can perform only one step at a time, and once started, a step cannot be interrupted.
- You can stockpile ingredients — for example, chop two tomatoes and save one for later.
The frying pan runs unattended: while the patty fries, you can prepare other ingredients. Frying time starts when the put step ends and stops when the remove step begins. The patty must fry for at least 20 seconds, but if it fries for 30 seconds or more it burns and cannot be used. You can only fry one patty at a time.
Given the following steps and durations, what is the maximum number of burgers you can fully prepare in 100 seconds?
- Put patty in frying pan (1 s)
- Chop tomato (5 s)
- Chop lettuce (7 s)
- Remove patty from frying pan (1 s)
- Assemble burger (2 s)