From bb90dfe5b734e6c312aabf1c2b1ee7846644ceaa Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Wed, 15 Jan 2025 13:36:36 +0000 Subject: [PATCH] solutions: 456A --- solutions/python/456A.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 solutions/python/456A.py diff --git a/solutions/python/456A.py b/solutions/python/456A.py new file mode 100644 index 0000000..47dcc08 --- /dev/null +++ b/solutions/python/456A.py @@ -0,0 +1,15 @@ +import sys + +n = int(input()) + +laptops = [] + +for _ in range(n): + laptops.append([int(d) for d in input().split(' ')]) + +laptops = sorted(laptops, key=lambda x: x[0]) + +if any(laptops[i][1] > laptops[i+1][1] for i in range(n-1)): + print('Happy Alex') +else: + print('Poor Alex')