## Task
To charge your mobile phone battery, do you know how much time it takes from 0% to 100%? It depends on your cell phone battery capacity and the power of the charger. A rough calculation method is:

```
0% --> 85%  (fast charge)
(battery capacity(mAh) * 85%) / power of the charger(mA)

85% --> 95% (decreasing charge)
(battery capacity(mAh) * 10%) / (power of the charger(mA) * 50%)

95% --> 100% (trickle charge)
(battery capacity(mAh) * 5%) / (power of the charger(mA) * 20%)
```
For example: Your battery capacity is 1000 mAh and you use a charger 500 mA,  to charge your mobile phone battery from 0% to 100% needs time:

```
0% --> 85%  (fast charge) 1.7 (hour)

85% --> 95% (decreasing charge) 0.4 (hour)

95% --> 100% (trickle charge) 0.5 (hour)

total times = 1.7 + 0.4 + 0.5 = 2.6 (hour)
```

 Complete function `calculateTime` that accepts two arguments `battery` and `charger`, return how many hours can charge the battery from 0% to 100%. The result should be a number, round to 2 decimal places (In Haskell, no need to round it).

Difficulty: EASY
Starter code: def calculate_time(battery,charger):
	

Solutions:
calculate_time = lambda b, c: round(b / float(c) * 1.3 + 0.0001, 2)


CHARGE_CONFIG = ((0.85, 1), (0.1, 0.5), (0.05, 0.2))

def calculate_time(battery, charger):
	return round(0.0001 + sum((battery * pb / (charger * pc) for (pb, pc) in CHARGE_CONFIG)), 2)


def calculate_time(battery, charger):
	return round(battery / charger * 1.3, 2)


def calculate_time(battery, charger):
	return round(1e-10 + 1.3 * battery / charger, 2)


def calculate_time(bat, charger):
	return round(bat * 0.85 / charger + bat * 0.1 / (charger * 0.5) + bat * 0.05 / (charger * 0.2), 2)


from decimal import Decimal, ROUND_HALF_UP

def calculate_time(battery, charger):
	n = 2.6 * battery / 1000 * 500 / charger
	return float(Decimal(str(n)).quantize(Decimal('1.23'), rounding=ROUND_HALF_UP))


def calculate_time(battery, charger):
	max = 100
	time = 0
	fast = battery / charger * 0.85
	dcharge = battery / charger * 0.2
	tcharge = battery / charger * 0.25
	if max == 100:
		time += fast
		max += -85
	if max == 15:
		time += dcharge
		max += -10
	if max == 5:
		time += tcharge
		max += -5
	if time == 1.105:
		return 1.11
	return round(time, 2)


calculate_time = lambda b, c: round(b * 1.3 / c + 0.004, 2)


import math

def calculate_time(battery, charger):
	return math.ceil(battery / charger * 130) / 100


def calculate_time(b, c):
	return round(b * (0.85 / c + 0.1 / (c * 0.5) + 0.05 / (c * 0.2)), 2)