Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N = input()
- m = int(N[-1])
- N = int(N[0])
- blocks = list(map(int, input().split(" ")))
- if min(blocks) + max(blocks) > N:
- print(0)
- elif sum(blocks *2) < N:
- print(-1)
- else:
- res = []
- for x in blocks:
- if N-x in blocks:
- res.append(x)
- res.append(N-x)
- elif N - x*2 in blocks:
- res.append(x)
- res.append(x)
- res.append(N-2*x)
- print(len(res))
- print(" ".join(map(str, res)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement