Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- p = [12001] * 144
- a = 12001
- b = 12001
- for i in range(n):
- x = int(input())
- k = (144 - x % 144) % 144
- if(p[k] < 12001 and x + p[k] < a + b and x > p[k]):
- a = x;
- b = p[k]
- p[x % 144] = min(p[x % 144], x)
- if(a + b < 24002):
- print(a, b)
- else:
- print(0)
Advertisement
Add Comment
Please, Sign In to add comment