1820 Ural Steaks Explained - Simply - Accepted Solution - Read it before you start

Lets say there are 5 Steaks and capacity of pan is 4.

Step 1: Cook first 4 one side for 1 minute.

Step 2: Replace 1 one sided cooked steak with completely uncooked (remaining) one and

cook for next 1 minute.

Step 3: Now the chef has 3 completely cooked and 2 Half cooked. Cook the remaining

2 half cooked for another one minute.

so 1 minute at each step, hence 3 minutes total minimal time.

However, story doesn't end here :-). Lets take another example

Now, Lets say there are 7 Steaks and capacity of pan is 4.

Step 1: Cook first 4 one side for 1 minute.

Step 2: Replace 3 one sided cooked steak with completely uncooked (remaining) three

and cook for next 1 minute.

Step 3: Now the chef has 1 completely cooked and 6 Half cooked. Cook 4 steaks from

half cooked six for another one minute.

Step 4: Last cook final 2 half cooked one for another one minute

So total minimum time take is 4 minute. 1 minute at each step.

Please keep in mind the scenarios where 0 steaks or steaks less then cooking capacity of pan.

*Edited by author 08.06.2017 20:19*

*Edited by author 08.06.2017 20:20*

Re: 1820 Ural Steaks Explained - Simply - Accepted Solution - Read it before you start

Posted by

Yongye 13 Nov 2020 14:50

the scenario with n == 0 or k == 0 won't happen as in the statements it says 1 <= n, k <= 1000