Hello everyone,
I am trying to solve the practice problem : CAMPON
My code works on the sample test case. However, I cannot think of the test cases which are not passing.
Can some please help me figure it out. TIA
t = int(input())
for _ in range(t):
d = int(input())
schedule = []
for i in range(d):
a,b = map(int,(input().split()))
schedule.append([a,b])
schedule = sorted(schedule)
for i in range(1,len(schedule)):
schedule[i][1] = schedule[i][1]+schedule[i-1][1]
q = int(input())
scenarios = {}
for j in range(q):
a,b = map(int,(input().split()))
scenarios[a]=b
for q in scenarios:
flag = 0
for elem in schedule:
if elem[0]<=q:
if elem[1]>=scenarios[q]:
flag=1
if flag == 1:
print("Go Camp")
else:
print("Go Sleep")