Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- k, n = map(int, input().split())
- a = list(map(int,input().split()))
- types = 0
- start = []
- current = []
- for i in range(1, n):
- y = a[i - 1] // (a[i - 1] - a[i])
- for j in range(types):
- if current[j] == y:
- current[j] = y - 1
- break
- else:
- types += 1
- start.append(y)
- current.append(y - 1)
- last = a[n - 1]
- for value in current:
- last //= value
- print(" ".join(map(str, start)), end = " ")
- if len(start) < k:
- print(last, '1 ' * (k - 1 - types))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement