The purpose of this kata is to work out just how many bottles of duty free whiskey you would have to buy such that the saving over the normal high street price would effectively cover the cost of your holiday. 

You will be given the high street price (normPrice), the duty free discount (discount) and the cost of the holiday. 

For example, if a bottle cost £10 normally and the discount in duty free was 10%, you would save £1 per bottle. If your holiday cost £500, the answer you should return would be 500.

All inputs will be integers. Please return an integer. Round down.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Mathematics

Starter code: def duty_free(price, discount, holiday_cost):
	

Solutions:
def duty_free(price, discount, holiday_cost):
	saving = price * discount / 100.0
	return int(holiday_cost / saving)


def duty_free(price, discount, holiday_cost):
	return holiday_cost * 100 // price // discount


def duty_free(p, d, h):
	return int(h / (p / 100 * d))


duty_free = lambda p, d, h: h // (p * d / 100)


def duty_free(price, disc, h_c):
	return int(h_c / (price * (disc / 100)))


def duty_free(price, discount, holiday_cost):
	savings = price * (discount / 100)
	numberNeeded = holiday_cost / savings
	return int(numberNeeded)


def duty_free(price, discount, holiday_cost):
	return int(round(holiday_cost // (price * discount * 0.01)))


def duty_free(price, discount, holiday_cost):
	x = price * (discount * 0.01)
	return int(holiday_cost / x)


def duty_free(p, d, cost):
	return cost // (p * (d / 100))


def duty_free(price, discount, holiday_cost):
	result = holiday_cost // (price * discount * 0.01)
	return round(result)


from math import floor

def duty_free(price: int, discount: int, holiday_cost: int) -> int:
	return floor(holiday_cost / (price * (discount / 100)))


def duty_free(price, discount, holiday_cost):
	a = price * (discount / 100)
	b = holiday_cost // a
	return b


duty_free = lambda price, discount, holiday_cost: int(holiday_cost / (price * (float(discount) / 100)))


import math

def duty_free(price, discount, holiday_cost):
	percent = discount / 100 * price
	bottles = holiday_cost / percent
	return math.floor(bottles)


from math import *

def duty_free(price, discount, holiday_cost):
	discount_multiplyer = discount / 100
	return floor(holiday_cost / (price * discount_multiplyer))


import math

def duty_free(price, discount, holiday_cost):
	discount = discount * 0.01
	savings_per_bottle = price * discount
	number_of_bottles_needed = holiday_cost / savings_per_bottle
	return math.floor(number_of_bottles_needed)


import math

def duty_free(price, discount, holiday_cost):
	x = holiday_cost / (price - (price - price * (discount / 100)))
	return math.floor(x)


def duty_free(price, discount, holiday_cost):
	economia = price - price * (100 - discount) * 0.01
	s = holiday_cost // economia
	return s


def duty_free(price, discount, holiday_cost):
	per_bottle = discount / 100 * price
	saving = holiday_cost // per_bottle
	return saving


import unittest
PERCENT = 0.01

def duty_free(price, discount, holiday_cost):
	return holiday_cost // (price * discount * PERCENT)

class TestDutyFree(unittest.TestCase):

	def test_duty_free(self):
		self.assertEqual(duty_free(price=12, discount=50, holiday_cost=1000), 166)


def duty_free(price, discount, holiday_cost):
	duty_free_cost = price - (price - price * discount * 0.01)
	cost = holiday_cost // duty_free_cost
	return cost


def duty_free(price, discount, holiday_cost):
	a = price * (discount / 100)
	b = holiday_cost // a
	b = int(b)
	return b
print(duty_free(12, 50, 1000))


def duty_free(price, discount, holiday_cost):
	bottles = holiday_cost / (price * discount)
	return int(bottles * 100)


def duty_free(price, discount, holiday_cost):
	ma = price / 100 * discount
	return int(holiday_cost / ma)


def duty_free(price, discount, holiday_cost):
	spare = price / 100 * discount
	return int(holiday_cost / spare)


def duty_free(price, discount, holiday_cost):
	newprc = price * (1 - discount / 100)
	saving = price - newprc
	return holiday_cost // saving


def duty_free(price, discount, holiday_cost):
	output = price * discount / 100
	result = int(holiday_cost / output)
	return result


def duty_free(price, discount, holiday_cost):
	discount_total = price / 100 * discount
	result = holiday_cost // discount_total
	return result


import math

def duty_free(price, discount, holiday_cost):
	i = discount / 100 * price
	return math.floor(holiday_cost / i)


import math

def duty_free(price, discount, holiday_cost):
	leftover = price * (discount / 100)
	num = holiday_cost / leftover
	return math.floor(num)


def duty_free(price, discount, holiday_cost):
	discount /= 100
	price_with_discount = price * discount
	finish_price = 0
	count = 0
	while finish_price < holiday_cost:
		finish_price += price_with_discount
		if finish_price > holiday_cost:
			break
		count += 1
	return count


def duty_free(price, discount, holiday_cost):
	proc = discount / 100
	price_new = proc * price
	final = holiday_cost / price_new
	return int(final)


def duty_free(price, discount, holiday_cost):
	amount_discount = price / 100 * discount
	result = holiday_cost // amount_discount
	return result


def duty_free(price, discount, holiday_cost):
	money = price * (discount / 100)
	return int(holiday_cost / money)


def duty_free(price, discount, holiday_cost):
	q = 0
	w = 0
	p = 0
	q = price * discount / 100
	w = holiday_cost / q * 10
	return w // 10


def duty_free(price, discount, holiday_cost):
	a = int(price) * int(discount) / 100
	return int(holiday_cost / a)


import math

def duty_free(price, discount, holiday_cost):
	percent = price / 100 * discount
	return math.floor(holiday_cost / percent)
print(duty_free(12, 50, 1000))


def duty_free(price, discount, holiday_cost):
	savings = price * discount / 100
	sol = holiday_cost / savings
	return int(sol)


def duty_free(p, d, c):
	r = c // (p * d / 100)
	return r


def duty_free(price, discount, holiday_cost):
	print(price, discount, holiday_cost)
	return holiday_cost // (discount * 0.01 * price)


def duty_free(price, discount, holiday_cost):
	d = discount / 100
	p = price * d
	return holiday_cost // p


def duty_free(price, discount, holiday_cost):
	discount_amount = discount / 100.0 * price
	if discount_amount:
		return holiday_cost // discount_amount
	return holiday_cost


def duty_free(price, discount, holiday_cost):
	sale_price = price * discount / 100
	return int(holiday_cost / sale_price)


def duty_free(price, discount, holiday_cost):
	actual_price = price * discount / 100
	count = 0
	total = 0
	while total < holiday_cost:
		total += actual_price
		count += 1
	return count - 1


def duty_free(price, discount, holiday_cost):
	savings = price - discount / 100 * price
	print(price, discount, holiday_cost, savings, holiday_cost // savings)
	return holiday_cost // (price - savings)


def duty_free(price, discount, holiday_cost):
	return holiday_cost // (price - price * (1 - 0.01 * discount))


def duty_free(price, discount, holiday_cost):
	x = price / 100 * discount
	return int(holiday_cost / x)


def duty_free(price, discount, holiday_cost):
	price2 = price * (discount / 100)
	cost = holiday_cost / price2
	return int(cost)


def duty_free(price, discount, holiday_cost):
	economy_nom = price * discount / 100
	return int(holiday_cost / economy_nom)


def duty_free(price, discount, holiday_cost):
	dut_price = price - discount / 100 * price
	saving = price - dut_price
	bottles = holiday_cost / saving
	return int(bottles)


def duty_free(price, discount, holiday_cost):
	first = price * discount / 100
	second = holiday_cost // first
	return second


import math

def duty_free(price, discount, holiday_cost):
	return round(int(holiday_cost / (discount * (price / 100))))


def duty_free(price, discount, holiday_cost):
	return int(holiday_cost // (price - price * (1 - discount / 100)))


import math

def duty_free(price, discount, holiday_cost):
	count_bottle = price / 100 * discount
	result = holiday_cost / count_bottle
	return math.floor(result)


duty_free = lambda price, discount, holiday_cost: holiday_cost // (price * 0.01 * discount)


def duty_free(price, discount, holiday_cost):
	save = price * discount / 100.0
	return int(holiday_cost / save)


def duty_free(price, discount, holiday_cost):
	dsc_price = price * (1 - discount)
	diff = price - dsc_price
	return int(holiday_cost / diff * 100)


def duty_free(price, discount, holiday_cost):
	saved_money = price * (discount / 100)
	return int(holiday_cost / saved_money)


def duty_free(price, discount, holiday_cost):
	amount_saved = discount / 100 * price
	return int(holiday_cost / amount_saved)


import math

def duty_free(price, discount, holiday_cost):
	actual_discount = discount / 100 * price
	no_of_bottles = holiday_cost / actual_discount
	return math.floor(no_of_bottles)


def duty_free(price, discount, holiday_cost):
	n = int(holiday_cost / (price * (discount / 100)))
	return n


def duty_free(normPrice, discount, holiday_cost):
	return int(holiday_cost / (normPrice * discount / 100))


def duty_free(price, discount, holiday_cost):
	savings = price * (discount / 100)
	bottles = 0
	suma = savings
	while suma < holiday_cost:
		bottles += 1
		suma += savings
	return bottles


def duty_free(price, discount, holiday_cost):
	x = discount / 100
	y = price * x
	z = holiday_cost // y
	return int(z)


def duty_free(a, b, c):
	pr = int(c / (a * b * 0.01))
	return pr


import math

def duty_free(price, discount, holiday_cost):
	save = price * (discount / 100)
	price = holiday_cost / save
	return math.floor(price)