From 7c4fc5880b8724cad3c9c25b0aefc6b2eabed0cc Mon Sep 17 00:00:00 2001 From: Jethro Stapelbroek Date: Sat, 24 Jun 2023 22:31:18 +0200 Subject: [PATCH] Dice Cup --- dicecup.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 dicecup.py diff --git a/dicecup.py b/dicecup.py new file mode 100644 index 0000000..14a92b5 --- /dev/null +++ b/dicecup.py @@ -0,0 +1,9 @@ +d1, d2 = map(int, input().split()) +scores = [x + y for x in range(1, d1 + 1) for y in range(1, d2 + 1)] +x = 0 +for i in range(2, d1 + d2 + 1): + if scores.count(i) > x: + x = scores.count(i) +for i in range(2, d1 + d2 + 1): + if scores.count(i) == x: + print(i)