Write the method, minutesNeeded, that returns the shortest time needed to cook m pancakes in
a pan that holds n pancakes at once. In other words, given two
integer values, m and n, determine the smallest number of minutes
needed to cook the pancakes.
int, int
int
public int minutesNeeded (int m, int n)
m is a non-negative number less than 1000
(i.e., 0 ≤ m < 1000).
n is a positive number less than 100
(i.e., 1 ≤ m < 100).
0 4
Returns: 0
It takes no time to cook 0 pancakes.
2 2
Returns: 10
You cook both pancakes on one side for five minutes, then flip them over and cook the other side for another five minutes.
3 2
Returns: 15
You cook pancakes 1 and 2 on one side for five minutes, then you take pancake 2 out of the pan, flip pancake 1 and cook pancake 3. After 10 minutes, pancake 1 is done and we can then cook pancakes 2 and 3 for 5 minutes on their uncooked side