diff --git a/challenges/cakes-swerc-2020-2021/README.md b/challenges/cakes-swerc-2020-2021/README.md new file mode 100644 index 0000000..a7865b8 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/README.md @@ -0,0 +1,73 @@ +# cakes-swerc-2020-2021 + +Created by [@Divlo](https://github.com/Divlo) on 23 April 2022. + +## Instructions + +This summer, you plan to organize a large party and invite many +friends. They have a sweet tooth, so you plan to bake nice cakes for them. +You know the recipe for a nice chocolate cake, and you want to cook as +many of them as possible. + +Given the `N` ingredients needed to make a single cake and the +ingredients that you have in your kitchen, how many cakes can you +make? + +### Input + +- **Line 1:** Single integer `N` for the number of ingredients +- **`n` next lines:**, One for each ingredient. Each of these lines contains two positive integers: +the first one is the required quantity of this ingredient per cake, the second one is the quantity of +this ingredient you have in your kitchen. + +### Output + +The output should contain a single integer: the maximum number of cakes you can make using the +available ingredients. + +### Limits + +- 1 <= `N` <= 10 +- All ingredient quantities will be integers between 1 and 10 000 + +## Source + +- [SWERC 2020–2021 - Problem E: Cake](https://swerc.eu/2020/problems/) + +## Examples + +See the `test` folder for examples of input/output. + +### Example 1 + +#### Input + +```txt +3 +100 500 +2 5 +70 1000 +``` + +#### Output + +```txt +2 +``` + +### Example 1 + +#### Input + +```txt +3 +100 50 +2 5 +70 1000 +``` + +#### Output + +```txt +0 +``` diff --git a/challenges/cakes-swerc-2020-2021/solutions/.gitkeep b/challenges/cakes-swerc-2020-2021/solutions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/challenges/cakes-swerc-2020-2021/test/1/input.txt b/challenges/cakes-swerc-2020-2021/test/1/input.txt new file mode 100644 index 0000000..b7a1850 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/1/input.txt @@ -0,0 +1,4 @@ +3 +100 500 +2 5 +70 1000 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/1/output.txt b/challenges/cakes-swerc-2020-2021/test/1/output.txt new file mode 100644 index 0000000..d8263ee --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/1/output.txt @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/2/input.txt b/challenges/cakes-swerc-2020-2021/test/2/input.txt new file mode 100644 index 0000000..b10cce1 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/2/input.txt @@ -0,0 +1,4 @@ +3 +100 50 +2 5 +70 1000 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/2/output.txt b/challenges/cakes-swerc-2020-2021/test/2/output.txt new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/2/output.txt @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/3/input.txt b/challenges/cakes-swerc-2020-2021/test/3/input.txt new file mode 100644 index 0000000..f2be0f0 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/3/input.txt @@ -0,0 +1,2 @@ +1 +1 1 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/3/output.txt b/challenges/cakes-swerc-2020-2021/test/3/output.txt new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/3/output.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/4/input.txt b/challenges/cakes-swerc-2020-2021/test/4/input.txt new file mode 100644 index 0000000..c69e4db --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/4/input.txt @@ -0,0 +1,3 @@ +2 +1 5000 +5 10000 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/4/output.txt b/challenges/cakes-swerc-2020-2021/test/4/output.txt new file mode 100644 index 0000000..9463411 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/4/output.txt @@ -0,0 +1 @@ +2000 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/5/input.txt b/challenges/cakes-swerc-2020-2021/test/5/input.txt new file mode 100644 index 0000000..1300e1e --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/5/input.txt @@ -0,0 +1,3 @@ +2 +1 5000 +6 10000 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/5/output.txt b/challenges/cakes-swerc-2020-2021/test/5/output.txt new file mode 100644 index 0000000..773de0f --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/5/output.txt @@ -0,0 +1 @@ +1666 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/6/input.txt b/challenges/cakes-swerc-2020-2021/test/6/input.txt new file mode 100644 index 0000000..1cd2d24 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/6/input.txt @@ -0,0 +1,11 @@ +10 +173 1561 +416 3733 +449 3063 +1207 7353 +520 3024 +910 6063 +687 4589 +1779 9402 +1115 5874 +819 5083 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/6/output.txt b/challenges/cakes-swerc-2020-2021/test/6/output.txt new file mode 100644 index 0000000..7813681 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/6/output.txt @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/7/input.txt b/challenges/cakes-swerc-2020-2021/test/7/input.txt new file mode 100644 index 0000000..07eebd7 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/7/input.txt @@ -0,0 +1,11 @@ +10 +336 3217 +923 6730 +568 5620 +154 1446 +1069 9055 +976 5941 +561 3259 +474 3121 +983 7153 +739 4827 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/7/output.txt b/challenges/cakes-swerc-2020-2021/test/7/output.txt new file mode 100644 index 0000000..7813681 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/7/output.txt @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/8/input.txt b/challenges/cakes-swerc-2020-2021/test/8/input.txt new file mode 100644 index 0000000..549afac --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/8/input.txt @@ -0,0 +1,11 @@ +10 +660 5741 +983 9463 +518 4992 +1096 9177 +713 6122 +509 3658 +463 3259 +242 2284 +195 1609 +1130 8178 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/8/output.txt b/challenges/cakes-swerc-2020-2021/test/8/output.txt new file mode 100644 index 0000000..c793025 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/8/output.txt @@ -0,0 +1 @@ +7 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/9/input.txt b/challenges/cakes-swerc-2020-2021/test/9/input.txt new file mode 100644 index 0000000..a8fb73a --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/9/input.txt @@ -0,0 +1,11 @@ +10 +2 2815 +1 1438 +3 4158 +5 6799 +5 6638 +3 5753 +5 9420 +2 4404 +1 2165 +1 2136 \ No newline at end of file diff --git a/challenges/cakes-swerc-2020-2021/test/9/output.txt b/challenges/cakes-swerc-2020-2021/test/9/output.txt new file mode 100644 index 0000000..4db8f57 --- /dev/null +++ b/challenges/cakes-swerc-2020-2021/test/9/output.txt @@ -0,0 +1 @@ +1327 \ No newline at end of file