You've purchased a ready-meal from the supermarket.

The packaging says that you should microwave it for 4 minutes and 20 seconds, based on a 600W microwave.

Oh no, your microwave is 800W! How long should you cook this for?!

___

# Input

You'll be given 4 arguments:

## 1. needed power
The power of the needed microwave.  
Example: `"600W"`

## 2. minutes
The number of minutes shown on the package.  
Example: `4`

## 3. seconds
The number of seconds shown on the package.  
Example: `20`

## 4. power
The power of your microwave.  
Example: `"800W"`

___

# Output
The amount of time you should cook the meal for formatted as a string.  
Example: `"3 minutes 15 seconds"`

Note: the result should be rounded up.
```
59.2 sec  -->  60 sec  -->  return "1 minute 0 seconds"
```

___


## All comments/feedback/translations appreciated.

Difficulty: introductory

Starter code:

def cooking_time(needed_power, minutes, seconds, power):
	

Solutions:
import math

def cooking_time(needed_power, minutes, seconds, power):
    t = math.ceil((60 * minutes + seconds) * int(needed_power[:-1]) / int(power[:-1]))
    return '%d minutes %d seconds' %(t // 60, t - t // 60 * 60)

cooking_time=lambda n,m,s,p:'{} minutes {} seconds'.format(*divmod(-(-(m*60+s)*int(n[:-1])//int(p[:-1])),60))

from math import ceil


def cooking_time(n_pow, n_min, n_sec, pow):
    m, s = divmod(ceil((60 * n_min + n_sec) * int(n_pow[:-1]) / int(pow[:-1])), 60)
    return f"{m} minutes {s} seconds"

import math

def cooking_time(needed_power, minutes, seconds, power):
    needed_power = int(needed_power[:-1])
    power = int(power[:-1])
    time = minutes * 60 + seconds
    res_time = math.ceil(time * needed_power / power)
    return "{0} minutes {1} seconds".format(res_time // 60, res_time % 60)


from math import ceil
def cooking_time(needed_power, minutes, seconds, power):
    q = float(needed_power[:-1]) / float(power[:-1])
    t = minutes * 60 + seconds
    return '{} minutes {} seconds'.format(*divmod(ceil(q * t), 60))

from math import ceil


def cooking_time(needed_power, minutes, seconds, power):
    total_seconds = ceil(int(needed_power[:-1]) * (minutes * 60 + seconds) / int(power[:-1]))
    m, s = total_seconds // 60, total_seconds % 60
    return "{} minutes {} seconds".format(m, s)

from math import ceil
def cooking_time(n_p,m,s,p):
    n_p,p=map(int,(n_p[:-1],p[:-1]))
    return "{} minutes {} seconds".format(*divmod(ceil((m*60+s)/p*n_p),60))

from math import ceil

def cooking_time(needed_power, minutes, seconds, power):
    totsec=minutes*60+seconds
    nd_pw,pw=int(needed_power.split('W')[0]),int(power.split('W')[0])
    res=ceil(nd_pw/pw*totsec)
    return '{:g} minutes {} seconds'.format(res//60,ceil(res-(res//60)*60))

import math
def cooking_time(needed_power, minutes, seconds, power):
    in_seconds = 60 * minutes + seconds
    increase = int(needed_power[:-1]) / int(power[:-1])
    new_seconds = in_seconds * increase
    output_minutes = int(new_seconds/60)
    output_seconds = new_seconds % 60
    if math.ceil(output_seconds) == 60:
        output_seconds = 0
        output_minutes += 1
    return str(math.ceil(output_minutes)) + ' minutes ' + str(math.ceil(output_seconds)) + ' seconds'

from math import ceil

def cooking_time(n,m,s,p):
    return '{0} minutes {1} seconds'.format(*divmod(ceil((m*60+s)*int(n[:-1])/int(p[:-1])),60))