Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = int(input())
- n = int(input())
- a = [int(input()) for i in range(n)]
- cnt = 0
- while a != []:
- _max = max(a)
- _min = min(a)
- if _max + _min <= m:
- a.remove(_max)
- a.remove(_min)
- else:
- a.remove(_max)
- cnt += 1
- print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement