From 0df7b6620eb5d71462d3118e68191dc557cf7c70 Mon Sep 17 00:00:00 2001 From: Divlo Date: Sat, 23 Apr 2022 20:52:00 +0200 Subject: [PATCH] feat(solutions): add `cakes-swerc-2020-2021/python/function` --- .../solutions/python/function/README.md | 3 +++ .../solutions/python/function/solution.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 challenges/cakes-swerc-2020-2021/solutions/python/function/README.md create mode 100644 challenges/cakes-swerc-2020-2021/solutions/python/function/solution.py diff --git a/challenges/cakes-swerc-2020-2021/solutions/python/function/README.md b/challenges/cakes-swerc-2020-2021/solutions/python/function/README.md new file mode 100644 index 0000000..df5d772 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/solutions/python/function/README.md @@ -0,0 +1,3 @@ +# cakes-swerc-2020-2021/python/function + +Created by [@Divlo](https://github.com/Divlo) on 23 April 2022. diff --git a/challenges/cakes-swerc-2020-2021/solutions/python/function/solution.py b/challenges/cakes-swerc-2020-2021/solutions/python/function/solution.py new file mode 100644 index 0000000..c78a93b --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/solutions/python/function/solution.py @@ -0,0 +1,13 @@ +from typing import List +import sys + +maximum_number_of_cake_possible = None + +next(sys.stdin) +for line in sys.stdin: + quantity_per_cake, quantity_available = list(map(int, line.split(' '))) + cake_possible = quantity_available // quantity_per_cake + if maximum_number_of_cake_possible == None or cake_possible < maximum_number_of_cake_possible: + maximum_number_of_cake_possible = cake_possible + +print(maximum_number_of_cake_possible)