You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $n$ consecutive days. During the $i$-th day you have to write exactly $a_i$ names.". You got scared (of course you got scared, who wouldn't get scared if he just receive a notebook which is named Death Note with a some strange rule written in it?).

Of course, you decided to follow this rule. When you calmed down, you came up with a strategy how you will write names in the notebook. You have calculated that each page of the notebook can contain exactly $m$ names. You will start writing names from the first page. You will write names on the current page as long as the limit on the number of names on this page is not exceeded. When the current page is over, you turn the page. Note that you always turn the page when it ends, it doesn't matter if it is the last day or not. If after some day the current page still can hold at least one name, during the next day you will continue writing the names from the current page.

Now you are interested in the following question: how many times will you turn the page during each day? You are interested in the number of pages you will turn each day from $1$ to $n$.


-----Input-----

The first line of the input contains two integers $n$, $m$ ($1 \le n \le 2 \cdot 10^5$, $1 \le m \le 10^9$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook.

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^9$), where $a_i$ means the number of names you will write in the notebook during the $i$-th day.


-----Output-----

Print exactly $n$ integers $t_1, t_2, \dots, t_n$, where $t_i$ is the number of times you will turn the page during the $i$-th day.


-----Examples-----
Input
3 5
3 7 9

Output
0 2 1 

Input
4 20
10 9 19 2

Output
0 0 1 1 

Input
1 100
99

Output
0 



-----Note-----

In the first example pages of the Death Note will look like this $[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during the second day and the third page during the third day.

Difficulty: EASY
Tags: Mathematics

Implementation

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
(n, m) = map(int, input().split())
(c, v) = (0, [None] * n)
for (i, ai) in enumerate(map(int, input().split())):
	v[i] = str((c + ai) // m - c // m)
	c += ai
print(' '.join(v))


(n, k) = map(int, input().split())
arr = map(int, input().split())
names = 0
for num in arr:
	names += num
	if names >= k:
		print(names // k, end=' ')
		names = names % k
	else:
		print(0, end=' ')


(p, q) = map(int, input().split())
temp = int(0)
line = list(map(int, input().split()))
for i in range(len(line)):
	temp += int(line[i])
	if temp < q:
		print(int(0), end=' ')
	elif temp == q:
		print(int(1), end=' ')
		temp -= q
	else:
		ans = int(temp // q)
		temp -= int(q * ans)
		print(ans, end=' ')


from sys import stdin, stdout, setrecursionlimit
from gc import disable
gets = input
puts = print
input = stdin.readline
print = stdout.write

def main() -> int:
	disable()
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	y = 0
	for i in range(n):
		y += a[i]
		ans = y // m
		y %= m
		print('%i ' % ans)
	return 0
main()


import math
(n, m) = [int(x) for x in input().split()]
a = [int(num) for num in input().split(' ', n - 1)]
extra = 0
ans = []
for i in range(0, n):
	counter = 0
	if a[i] >= extra and extra != 0:
		a[i] = a[i] - extra
		counter = 1 + counter
		extra = 0
	if a[i] < extra:
		extra = extra - a[i]
		a[i] = 0
	if a[i] >= m:
		counter = a[i] // m + counter
		extra = m - a[i] % m
	if a[i] < m and a[i] != 0:
		extra = m - a[i]
	ans.append(counter)
print(*ans)


(n, m) = map(int, input().split())
t = list(map(int, input().split()))
s = 0
for i in range(n):
	a = (s + t[i]) / m
	s = (s + t[i]) % m
	print(int(a))


(n, m) = map(int, input().split())
s = list(map(int, input().split()))
resto = m
for k in range(0, n):
	if s[k] < resto:
		t = 0
		resto = resto - s[k]
		print(t)
	else:
		t = 1 + (s[k] - resto) // m
		dif = (s[k] - resto) % m
		resto = m - dif
		print(t)


import math
(n, m) = map(int, input().split())
a = map(int, input().split())
s = 0
for i in a:
	prev = int(math.floor(s / m))
	s += i
	curr = int(math.floor(s / m))
	print(curr - prev, end=' ')


t = list(map(int, input().split()))
n = t[0]
m = t[1]
t = list(map(int, input().split()))
rem = 0
l1 = []
for i in t:
	r = int((rem + i) / m)
	rem = (rem + i) % m
	l1.append(str(r))
print(' '.join(l1))


(n, m) = map(int, input().split())
li = list(map(int, input().split()))
ans = 0
for i in li:
	ans += i
	print(ans // m, end=' ')
	ans %= m


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
ost = m
for i in range(n):
	today = l[i]
	if today > ost:
		today -= ost
		print(today // m + 1)
		ost = m - today % m
	elif today == ost:
		print(1)
		ost = m
	else:
		print(0)
		ost -= today


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
temp = 0
for el in a:
	if el + temp < m:
		temp += el
		print(0, end=' ')
	elif el + temp >= m:
		print((el + temp) // m, end=' ')
		temp = (el + temp) % m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
cr = 0
for i in range(n):
	cnt = 0
	if cr > a[i]:
		cr -= a[i]
		a[i] = 0
	elif cr > 0:
		cnt += 1
		a[i] -= cr
		cr = 0
	if a[i]:
		cnt += a[i] // m
		cr = m - a[i] % m
	print(cnt)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
b = []
j = 0
for i in range(n):
	j = j + a[i]
	x = j // m
	b.append(x)
for i in range(n - 1, 0, -1):
	b[i] = b[i] - b[i - 1]
for i in range(n):
	print(b[i], end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
p = []
c = 0
for i in range(n):
	p.append((c + a[i]) // m)
	c = (c + a[i]) % m
print(*p)


(n, m) = [int(x) for x in input().split()]
lst = [int(x) for x in input().split()]
s = ''
z = 0
for i in range(n):
	z += lst[i]
	s += str(z // m) + ' '
	if z >= m:
		z = z % m
print(s)


(no_days, page_limit) = [*map(int, input().split())]
page_day = [*map(int, input().split())]
total = 0
total1 = 0
for a in page_day:
	total += a
	print(total // page_limit - total1, end=' ')
	total1 = total // page_limit


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
for i in a:
	print((s + i) // m, end=' ')
	s = (s + i) % m


import sys
fir = list(map(int, input().split()))
day = fir[0]
volume = fir[1]
note = list(map(int, input().split()))
d = 0
dd = 0
for a in range(day):
	d = note[a] + d
	note[a] = d
for a in range(day):
	note[a] = int(note[a] / volume)
for a in range(1, day):
	note[day - a] = note[day - a] - note[day - a - 1]
for a in range(day):
	sys.stdout.write(str(note[a]))
	if a != day:
		sys.stdout.write(' ')


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)
(n, m) = map(int, z().split())
l = list(map(int, z().split()))
lx = []
t = 0
for i in l:
	t += i
	p = t // m
	t = t % m
	lx.append(p)
print(*lx)


from itertools import accumulate

def bin_search(x, left, right, num_list):
	if right - left <= 1:
		if x <= num_list[left]:
			return left + 1
		else:
			return right + 1
	else:
		middle = (left + right) // 2
		if x < num_list[middle]:
			return bin_search(x, left, middle, num_list)
		elif x > num_list[middle]:
			return bin_search(x, middle + 1, right, num_list)
		else:
			return middle + 1
(n, m) = map(int, input().split())
names = 0
turns = 0
for num in map(int, input().split()):
	turns = (names + num) // m
	names = (names + num) % m
	print(turns, end=' ')


from sys import stdin
from math import *
line = stdin.readline().rstrip().split()
n = int(line[0])
m = int(line[1])
numbers = list(map(int, stdin.readline().rstrip().split()))
indexP = 0
for num in numbers:
	pages = 0
	pages += floor(num / m)
	rest = num % m
	indexP += rest
	if indexP >= m:
		pages += 1
	indexP = indexP % m
	print(pages, end=' ')


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
res = [0] * n
c = 0
for i in range(len(a)):
	res[i] = (c + a[i]) // m
	c = (c + a[i]) % m
print(*res)


(n, m) = map(int, input().split())
A = [int(x) for x in input().split()]
ans = []
c = 0
p = 0
for a in A:
	c += a
	(d, r) = divmod(c, m)
	ans.append(d - p)
	p = d
print(*ans)


rd = lambda : list(map(int, input().split()))
(n, m) = rd()
a = rd()
p = 0
r = []
for x in a:
	r.append((x + p) // m)
	p += x
	p %= m
print(*r)


(n, m) = input().split()
n = int(n)
m = int(m)
aQuantinty = []
a = input()
res = ''
rest = 0
for ai in a.split():
	resI = (rest + int(ai)) // m
	rest = (rest + int(ai)) % m
	res += str(resI) + ' '
print(res)


(N, M) = map(int, input().split())
curname = 0
arr = map(int, input().split())
for a in arr:
	curname += a
	cnt = curname // M
	curname = curname % M
	print(cnt, end=' ')


a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
z = 0
d = 0
for i in range(a[0]):
	z = z + b[i]
	c.append(z // a[1] - d)
	d = z // a[1]
print(*c)


inp = input().split(' ')
number_of_names = input().split(' ')
days = int(inp[0])
names = int(inp[1])
result = 0
npages = 0
n = 0
for i in range(days):
	result += int(number_of_names[i])
	npages = int(result / names)
	print(npages - n)
	n = npages


ar = [int(i) for i in input().split()]
n = ar[0]
m = ar[1]
ar2 = [int(i) for i in input().split()]
nip = 0
rem = 0
far = []
for i in ar2:
	nip += i
	far.append(nip // m - rem)
	rem = nip // m
for i in far:
	print(i, end=' ')


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s)
	sys.stdout.write('\n')

def wi(n):
	sys.stdout.write(str(n))
	sys.stdout.write('\n')

def wia(a, sep=' '):
	sys.stdout.write(sep.join([str(x) for x in a]))
	sys.stdout.write('\n')

def main():
	(n, m) = ria()
	a = ria()
	res = []
	offset = 0
	for i in range(n):
		t = (offset + a[i]) // m
		offset = (offset + a[i]) % m
		res.append(t)
	wia(res)
main()


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
k = 0
for i in range(n):
	k += a[i]
	c = k // m
	k %= m
	if k == 0:
		print(c, end=' ')
	else:
		print(c, end=' ')


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
k = 0
ans = 0
for i in a:
	k += i
	ans = k // m
	k = k % m
	print(ans, end=' ')


def calc(m: int, arr: list):
	r: int = 0
	for i in arr:
		r += i
		(day, r) = divmod(r, m)
		print(day, end=' ')
	print()

def main():
	(_, m) = map(int, input().split())
	arr: list = list(map(int, input().split()))
	calc(m, arr)
main()


(n, m) = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
cur = 0
s = ''
for i in a:
	if cur + i >= m:
		s += str((cur + i) // m) + ' '
		cur = (cur + i) % m
	else:
		s += str(0) + ' '
		cur += i
print(s)


nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]
a = [int(i) for i in input().split()]
x = 0
per = 0
pers = []
for i in a:
	per = (i + x) // m
	x = (i + x) % m
	pers.append(str(per))
print(' '.join(pers))


m = [int(x) for x in input().split(' ')][1]
each_day = [int(x) for x in input().split(' ')]
page = m
ans = ''
for x in each_day:
	if x < page:
		ans += ' 0'
		page -= x
	elif x == page:
		ans += ' 1'
		page = m
	else:
		ppp = 1
		x -= page
		ppp += x // m
		page = m - x % m
		ans += ' ' + str(ppp)
print(ans[1:])


import sys

def main():
	(n, m) = map(int, input().strip().split())
	nums = map(int, input().strip().split())
	ans = []
	remain = m
	for num in nums:
		if num < remain:
			ans.append(0)
			remain -= num
			continue
		cur_ans = 1
		num -= remain
		cur_ans += num // m
		remain = m - num % m
		ans.append(cur_ans)
	print(' '.join(map(str, ans)))
	return 0

def test(i):
	with open('test_{}.txt'.format(i)) as fin:
		sys.stdin = fin
		main()
sys.exit(main())


(n, m) = map(int, input().split())
data = list(map(int, input().split()))
answer = [0 for i in range(n)]
ind = 0
prev = 0
for el in data:
	val = prev + el
	t = val // m
	prev = val % m
	answer[ind] = t
	ind += 1
print(' '.join((str(el) for el in answer)))


def main():
	first = input()
	first = first.split()
	n = int(first[0])
	m = int(first[1])
	turns = [0] * n
	second = input()
	second = second.split()
	rem = 0
	for i in range(len(second)):
		if rem != 0:
			second[i] = int(second[i]) - (m - rem)
			turns[i] += 1
		turns[i] += int(second[i]) // m
		rem = int(second[i]) % m
	print(' '.join(map(str, turns)))
main()


(n, m) = list(map(int, input().split()))
arr = list(map(int, input().split()))
total = sum(arr)
page = 0
rem = 0
li = []
sum1 = 0
for i in arr:
	if i + sum1 < m:
		sum1 = sum1 + i
		li.append(0)
	elif i + sum1 >= m:
		page = (i + sum1) // m
		sum1 = i + sum1 - page * m
		li.append(page)
print(*li)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
(n, m) = map(int, input().split(' '))
c = 0
l = list(map(int, input().split(' ')))
ll = []
for i in l:
	if c == 0:
		ll.append(i // m)
		c = m - i % m
	elif c > i:
		ll.append(0)
		c = c - i
	else:
		i = i - c
		ll.append(1 + i // m)
		c = m - i % m
print(*ll)


__author__ = 'Dilshod'
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
res = 0
for i in range(n):
	res += a[i]
	print(res // m, end=' ')
	res %= m


import collections, atexit, math, sys, bisect
sys.setrecursionlimit(1000000)

def getIntList():
	return list(map(int, input().split()))
try:
	import numpy

	def dprint(*args, **kwargs):
		print(*args, **kwargs, file=sys.stderr)
	dprint('debug mode')
except ModuleNotFoundError:

	def dprint(*args, **kwargs):
		pass
inId = 0
outId = 0
if inId > 0:
	dprint('use input', inId)
	sys.stdin = open('input' + str(inId) + '.txt', 'r')
if outId > 0:
	dprint('use output', outId)
	sys.stdout = open('stdout' + str(outId) + '.txt', 'w')
	atexit.register(lambda : sys.stdout.close())
(N, M) = getIntList()
za = getIntList()
res = []
c = 0
for i in range(N):
	t = c + za[i]
	x = t // M
	c = t % M
	res.append(str(x))
print(' '.join(res))


(n, m) = list(map(int, input().split()))
n1 = list(map(int, input().split()))[:n]
c = 0
for i in n1:
	ans = (c + i) // m
	c = (c + i) % m
	print(ans)


(n, m) = tuple(map(int, input().split()))
nums = list(map(int, input().split()))
amount = 0
num_str = 0
for i in nums:
	num_str = 0
	amount += i
	if amount >= m:
		num_str += amount // m
		amount = amount % m
	print(num_str, end=' ')


def solve(names, days, limit):
	res = []
	cur = 0
	for name in names:
		cur += name
		if cur < limit:
			res.append(0)
		else:
			res.append(cur // limit)
			cur = cur % limit
	return ' '.join([str(x) for x in res])
(days, limit) = [int(x) for x in input().split()]
names = [int(x) for x in input().split()]
print(solve(names, days, limit))


(n, m) = map(int, input().split())
a = [int(x) for x in input().split()]
temp = 0
ans = []
for x in a:
	temp += x
	ans.append(temp // m)
	if temp >= m:
		temp = temp % m
for x in ans:
	print(x, end=' ')


(x, y) = map(int, input().split())
a = list(map(int, input().split()))
b = []
p = 0
for i in a:
	p = p + i
	b.append(p // y)
	p = p % y
print(*b)


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for x in range(a):
	e = (l[x] + c) // b
	c = (l[x] + c) % b
	print(e, end=' ')


(n, m) = map(int, input().split())
x = 0
for a in map(int, input().split()):
	(a, x) = divmod(x + a, m)
	print(a, end=' ')


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
k = 0
for i in a:
	if m > i + k:
		k += i
		print(0, end=' ')
	else:
		i -= m - k
		print(i // m + 1, end=' ')
		k = i % m


def main():
	first = input()
	first = first.split()
	counter = int(first[1])
	cumulative = 0
	second = input()
	second = second.split()
	for i in range(len(second)):
		cumulative += int(second[i])
		print(int(cumulative) // counter, end=' ')
		cumulative = cumulative % counter
main()


k = list(map(int, input().split()))
l = list(map(int, input().split()))
m = k[1]
n = k[0]
h = 0
for i in range(n):
	h = h + l[i]
	p = int(h / m)
	h = h % m
	print(p, end=' ')


def DeathNote(n, m):
	turnPage = []
	kill = 0
	for i in days:
		kill += int(i)
		if kill >= int(m):
			pages = int(kill / int(m))
			turnPage.append(pages)
			kill -= pages * int(m)
		else:
			turnPage.append(0)
	return turnPage
(n, m) = input().split()
days = input().split()
print(*DeathNote(int(n), int(m)))


def GetInputNumber():
	return [int(x) for x in input().split()]
(n, m) = GetInputNumber()
a = GetInputNumber()
rest = m
ans = ''
for x in a:
	if rest > x:
		rest -= x
		ans += '0 '
	else:
		x -= rest
		ans += '%d ' % (x // m + 1)
		rest = m - x % m
print(ans)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
ans = [a[0] // m]
for i in range(1, n):
	a[i] += a[i - 1]
	if i == 1:
		ans.append(a[i] // m - ans[0])
	else:
		ans.append(a[i] // m - a[i - 1] // m)
print(*ans, sep=' ')


(a, b) = map(int, input().split())
c = [int(x) for x in input().split()]
d = []
n = 0
i = 0
while 1:
	m = (n + c[i]) // b
	n = (n + c[i]) % b
	d.append(m)
	i += 1
	if i == a:
		break
print(*d)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
tmp = 0
lis = []
for i in a:
	lis.append((tmp + i) // m)
	tmp = (tmp + i) % m
print(*lis)


(n, capacity) = map(int, input().split())
l = list(map(int, input().split()))
m = []
lit = 0
for i in l:
	lit += i
	k = lit // capacity
	lit -= k * capacity
	m.append(str(k))
print(*m)


firstline = input()
(numofinput, totalperpage) = firstline.split(' ')
numofinput = int(numofinput)
totalperpage = int(totalperpage)
secondline = input()
inputs = secondline.split(' ')
for i in range(numofinput):
	inputs[i] = int(inputs[i])
turnover = []
temp = 0
for names in inputs:
	temp += names
	turnover.append(temp // totalperpage)
	temp = temp % totalperpage
for page in turnover:
	print(page, end=' ')


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
l = []
k = 0
for i in a:
	k += i
	if k < m:
		l.append(0)
	else:
		l.append(k // m)
		k = k % m
print(*l)


(n, m) = list(map(int, input().split()))
s = list(map(int, input().split()))
ans = []
for i in range(n):
	ans.append(s[i] // m)
	if i == n - 1:
		continue
	s[i + 1] += s[i] % m
print(' '.join(map(str, ans)))


import sys
from array import array

def readline():
	return sys.stdin.buffer.readline().decode('utf-8')
(n, m) = map(int, readline().split())
a = list(map(int, readline().split()))
rem = 0
ans = [0] * n
for (i, x) in enumerate(a):
	ans[i] = (rem + x) // m
	rem = (rem + x) % m
print(*ans)


def main():
	(n, m) = map(int, input().split())
	a_string = input()
	a = map(int, a_string.split())
	t = []
	used = 0
	for ai in a:
		used += ai
		t.append(used // m)
		used %= m
	print(*t)
main()


(n, m) = map(int, input().split())
(ctr1, ctr2) = (0, 0)
ls = [int(a) for a in input().split()]
for i in range(n):
	ctr1 += ls[i]
	ctr2 = ctr1 // m
	ctr1 = ctr1 % m
	print(ctr2, end=' ')


t = 1
for test in range(1, t + 1):
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	t = []
	rem = 0
	for i in a:
		if i >= rem:
			if rem > 0:
				t.append((i - rem) // m)
				t[-1] += 1
			else:
				t.append(i // m)
		else:
			t.append(0)
		rem = m - (i - rem) % m
	print(*t)


(n, m) = (int(x) for x in input().split())
count = 0
ans = 0
a = [int(x) for x in input().split()]
for i in range(n):
	ans = 0
	count += a[i]
	if count > m:
		dl = count // m
		ans += dl
		count -= dl * m
		print(ans, end=' ')
	elif count < m:
		print(ans, end=' ')
	else:
		ans += 1
		count = 0
		print(ans, end=' ')


(n, k) = list(map(int, input().split()))
d = list(map(int, input().split()))
acc = 0
for dd in d:
	print((dd + acc) // k, end=' ')
	acc = (dd + acc) % k


(n, m) = [int(t) for t in input().split()]
now = 0
arr = [int(t) for t in input().split()]
for a in arr:
	n -= 1
	c = a // m
	a %= m
	now += a
	if now >= m:
		c += 1
		now -= m
	print(c, end=' ' if n else '\n')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
b = 0
for i in range(n):
	b += a[i]
	print(b // m, end=' ')
	b %= m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
w = []
c = 0
for i in range(n):
	if (a[i] + c) // m == 0:
		c += a[i]
		w.append(0)
	else:
		w.append((a[i] + c) // m)
		c = (a[i] + c) % m
print(*w)


(n, m) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
s = 0
for c in a:
	print((s + c) // m - s // m)
	s += c


i = lambda : [*map(int, input().split())]
l = m = i()[1]
a = []
for x in i():
	if l > x:
		a += [0]
		l -= x
	else:
		x -= l
		a += [0 - -x // m]
		l = m - x % m
	a[-1] += l == m
print(*a)


def strToInt(arr):
	n = len(arr)
	for i in range(n):
		arr[i] = int(arr[i])

def printOneLine(arr):
	length = len(arr)
	for i in range(length):
		if i < length - 1:
			print(str(arr[i]), end=' ')
		else:
			print(arr[i])
dayPage = input()
dayPage = dayPage.split()
strToInt(dayPage)
numOfDays = dayPage[0]
maxNamePerPage = dayPage[1]
namesPerDay = input()
namesPerDay = namesPerDay.split()
strToInt(namesPerDay)
numberOfPageTurned = []
remainingNameSlots = maxNamePerPage
for i in range(numOfDays):
	cont = False
	pagesTurned = 0
	if remainingNameSlots != maxNamePerPage:
		if remainingNameSlots <= namesPerDay[i]:
			namesPerDay[i] -= remainingNameSlots
			pagesTurned += 1
			remainingNameSlots = maxNamePerPage
		else:
			remainingNameSlots -= namesPerDay[i]
			numberOfPageTurned.append(0)
			cont = True
	if cont == False:
		pagesTurned += int(namesPerDay[i] / maxNamePerPage)
		numberOfPageTurned.append(pagesTurned)
		if namesPerDay[i] % maxNamePerPage != 0:
			if namesPerDay[i] > maxNamePerPage:
				remainingNameSlots -= namesPerDay[i] % maxNamePerPage
			else:
				remainingNameSlots -= namesPerDay[i]
printOneLine(numberOfPageTurned)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
b = 0
s = []
for i in range(n):
	b += a[i]
	s.append(b // m)
	b = b % m
print(*s, sep=' ')


(n, m) = map(int, input().split())
arr = []
str_arr = input().split(' ')
arr = [int(num) for num in str_arr]
rem = 0
for i in range(int(n)):
	ans = (arr[i] + rem) // m
	rem = (arr[i] + rem) % m
	print(ans, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
rec = []
pre = 0
for i in range(n):
	rec.append((a[i] + pre) // m)
	pre = (a[i] + pre) % m
print(' '.join(map(str, rec)))


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
ans = [l[0] // m]
s = l[0]
prev = l[0] // m
for i in range(1, n):
	s += l[i]
	ans.append(s // m - prev)
	prev += ans[-1]
print(*ans)


(n, m) = map(int, input().split())
a = map(int, input().split())
wots = wot = 0
for x in a:
	wots += x
	print(wots // m - wot, end=' ')
	wot = wots // m


(n, m) = map(int, input().split())
a = map(int, input().split())
cur = 0
cnt = 0
for elem in a:
	cur += elem
	print(cur // m - cnt, end=' ')
	cnt = cur // m


import math
(n, m) = map(int, input().split())
s = list(map(int, input().split()))
avail = m
days = []
for i in range(n):
	pages = math.ceil(max(s[i] - avail, 0) / m)
	if s[i] <= avail:
		avail -= s[i]
	else:
		avail = m - (s[i] - avail) % m
	if avail == 0 or avail == m:
		avail = m
		days.append(pages + 1)
	else:
		days.append(pages)
print(' '.join(map(str, days)))


(n, m) = map(int, input().split())
list_of_count_name = list(map(int, input().split()))
sum_name = 0
page_turned = 0
ans = ''
for i in range(n):
	sum_name += list_of_count_name[i]
	turning = sum_name // m - page_turned
	page_turned += turning
	if i == n - 1:
		ans += str(turning)
	else:
		ans += str(turning)
		ans += ' '
print(ans)


from sys import stdin, stdout
import math
(n, m) = map(int, stdin.readline().rstrip().split())
A = [int(x) for x in stdin.readline().rstrip().split()]

def memodict(f):

	class memodict(dict):

		def __missing__(self, key):
			ret = self[key] = f(key)
			return ret
	return memodict().__getitem__

@memodict
def sum(n):
	if n == 0:
		return A[0]
	return sum(n - 1) + A[n]

@memodict
def f(n):
	if n == 0:
		return math.floor(A[0] / m)
	return math.floor(sum(n) / m) - math.floor(sum(n - 1) / m)
days = []
for x in range(n):
	days.append(str(f(x)))
stdout.write(' '.join(days))


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
(x, y) = (0, 0)
for i in range(n):
	x += l[i]
	print(x // m - y)
	y = x // m


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
r = 0
for i in range(n):
	r += l[i]
	print(r // m, end=' ')
	r %= m


(n, m) = list(map(int, input().split()))
arr = list(map(int, input().split()))
ans = [0] * n
coun = 0
for i in range(n):
	if coun > arr[i]:
		coun -= arr[i]
	elif coun == arr[i]:
		ans[i] += 1
		coun = 0
	else:
		if coun > 0:
			ans[i] += 1
		ans[i] += (arr[i] - coun) // m
		coun = m - (arr[i] - coun) % m
for j in range(n):
	print(ans[j], end=' ')


import sys, math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
t = 1
for tt in range(t):
	(n, m) = invr()
	a = inlt()
	q = 0
	for i in range(len(a)):
		print((q + a[i]) // m, end=' ')
		q = (q + a[i]) % m


(x, y) = input().split()

def deathnote(x, y):
	pages = []
	kill = 0
	kill1 = input().split()
	for i in kill1:
		kill += int(i)
		if kill >= int(y):
			page = int(kill / int(y))
			pages.append(page)
			kill -= int(y) * page
		else:
			pages.append(0)
	return pages
print(*deathnote(int(x), int(y)))


(n, m) = map(int, input().split())
daf = list(map(int, input().split()))
sisa = 0
has = []
for i in range(n):
	total = sisa + daf[i]
	has.append(total // m)
	sisa = total % m
print(*has)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
ost = 0
ans = list()
for el in a:
	ans.append((el + ost) // m)
	ost = (el + ost) % m
print(' '.join(map(str, ans)))


(n, m) = list(map(int, input().split()))
t = list(map(int, input().split()))
l = []
p = 0
for j in range(len(t)):
	p += t[j]
	if p < m:
		l.append(0)
	elif p >= m:
		l.append(p // m)
		p = p % m
print(*l)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
na = 0
for i in range(n):
	p = 0
	p += (a[i] + na) // m
	na = (a[i] + na) % m
	print(p, end=' ')


R = lambda : map(int, input().split())
(n, m) = R()
arr = list(R())
ans = []
last = 0
for i in arr:
	last += i
	remainder = last % m
	if remainder == 0:
		print(last // m, end=' ')
		last = 0
	else:
		print(last // m, end=' ')
		last = remainder


from collections import defaultdict
(n, m) = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
r = 0
s = ''
for i in x:
	r += i
	s += str(r // m) + ' '
	r %= m
print(s)


(n, m) = [int(x) for x in input().split()]
li = [int(x) for x in input().split()]
r = 0
ans = []
for i in range(n):
	li[i] += r
	ans.append(str(li[i] // m))
	r = li[i] % m
if len(ans) > 1:
	print(' '.join(ans))
else:
	print(ans[0])


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
x = 0
for i in range(n):
	x += a[i]
	c = x // m
	x = x % m
	print(c)


(n, m) = map(int, input().split())
days = [int(x) for x in input().split()]
page = 1
names = 0
outs = []
for i in range(n):
	start = page
	names += days[i]
	if names >= m:
		page += names // m
		names %= m
	outs.append(page - start)
print(' '.join([str(x) for x in outs]))


nim = input().split()
n = int(nim[0])
m = int(nim[1])
mass = input().split()
mass = list(map(int, mass))
otv = []
b = m
for k in range(n):
	e = mass[k]
	if b - e > 0:
		b -= e
		otv.append(0)
	else:
		a = 1
		t = e - b
		a += t // m
		b = m - t % m
		otv.append(a)
print(*otv)


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
turns = []
for i in range(0, n - 1):
	turns.append(int(a[i] / m))
	a[i + 1] += int(a[i] % m)
turns.append(int(a[n - 1] / m))
print(*turns)


i = input().split()
n = int(i[0])
m = int(i[1])
turnarr = []
total_names = 0
a = input().split()
for j in range(0, n):
	page = 0
	if int(a[j]) < m:
		total_names += int(a[j])
	elif int(a[j]) >= m:
		total_names += int(a[j])
		if total_names % m == 0:
			page += total_names // m
			total_names = 0
		elif total_names % m != 0:
			gap = total_names % m
			page += (total_names - gap) // m
			total_names = gap
	if int(a[j]) < m and total_names >= m:
		total_names = total_names - m
		page += 1
		while total_names > m:
			page += 1
			total_names = total_names - m
	turnarr.append(page)
print(*turnarr, sep=' ')


def DeathNote(nDays, nNames, n):
	num = prev = 0
	for i in range(nDays):
		num += int(n[i])
		result = int(num / nNames) - prev
		prev += result
		print(result, end=' ')
(nDays, nNames) = input().split()
n = input().split()
DeathNote(int(nDays), int(nNames), n)


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
names_on_current_sheet = 0
answer = []
for i in range(n):
	answer.append(str((names_on_current_sheet + a[i]) // m))
	names_on_current_sheet = (names_on_current_sheet + a[i]) % m
print(' '.join(answer))


b = int(input().split()[1])
s = 0
for i in map(int, input().split()):
	i += s
	print(i // b)
	s = i % b


(n, m) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
s = 0
for i in range(n):
	s += a[i]
	print(s // m, end=' ')
	s = s % m


(n, m) = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
sum = [a[0]]
for i in range(1, n):
	sum.append(a[i] + sum[i - 1])
ans = [int(sum[0] / m)]
for i in range(1, n):
	ans.append(int(sum[i] / m) - int(sum[i - 1] / m))
for i in range(n):
	print(f'{ans[i]} ', end='')
print()


inp = input().split(' ')
pages = input().split(' ')
days = inp[0]
names = int(inp[1])
result = 0
npages = 0
np = 0
for i in range(int(days)):
	result += int(pages[i])
	npages = int(result / names)
	print(npages - np)
	np = npages


(n, m) = map(int, input().split())
ds = map(int, input().split())
q = 0
result = [None] * n
for i in range(n):
	nd = next(ds)
	after = q + nd
	result[i] = str(after // m)
	q = after % m
print(' '.join(result))


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
page = m
for elem in a:
	t = 0
	if elem <= page:
		page -= elem
		if page == 0:
			page = m
			t += 1
		print(t, end=' ')
		continue
	else:
		elem -= page
		page = m
		t += 1
		t += elem // m
		page -= elem % m
		print(t, end=' ')
		continue


import sys
(n, m) = map(int, input().split())
anznamen = map(int, input().split())
rest = 0
lsg = []
for anz in anznamen:
	(nr, rest) = divmod(anz + rest, m)
	lsg.append(nr)
print(' '.join(map(str, lsg)))


(days, page_names) = list(map(int, input().split(' ')))
names = list(map(int, input().split(' ')))
res = [0] * days
total = [0] * days
for i in range(days):
	res[i] = res[i - 1] + names[i]
	print(res[i] // page_names - total[i - 1], end=' ')
	total[i] = res[i] // page_names


f = lambda : map(int, input().split())
(n, m) = f()
a = list(f())
sum_names = a[0]
print(a[0] // m, end=' ')
for i in range(1, n):
	sum_names %= m
	sum_names += a[i]
	print(sum_names // m, end=' ')


(n, m) = map(int, input().split())
li = list(map(int, input().split()))
s = 0
counts = []
for ele in li:
	s += ele
	c = int(s / m)
	s = s % m
	counts.append(c)
print(' '.join([str(ele) for ele in counts]))


insert = input()
insert = insert.split()
noOfDays = int(insert[0])
pageNameNo = int(insert[1])
insert = input()
insert = insert.split()
totalName = 0
totalPageSoFar = 0
totalPage = 0
for i in range(0, noOfDays):
	totalName += int(insert[i])
	totalPage = int(totalName / pageNameNo)
	print(str(totalPage - totalPageSoFar))
	totalPageSoFar = totalPage


(a, b) = map(int, input().split())
data = map(int, input().split())
output = []
temp = b
for x in data:
	num = 0
	if x >= b:
		x = x - temp
		num += 1
		temp = b
		num += int(x / b)
		temp = b - x % b
	elif x >= temp:
		x = x - temp
		num += 1
		temp = b - x
	else:
		temp = temp - x
	output.append(num)
print(*output, sep=' ')


import sys
data = sys.stdin.readlines()
m = int(data[0].split()[1])
a = list(map(int, data[1].split()))
page = m
for i in a:
	count = 0
	if i < page:
		page -= i
	elif i == page:
		count += 1
		page = m
	else:
		i -= page
		page = m
		count += 1 + i // m
		page = m - i % m
	print(count, end=' ')


import math
(n, m) = map(int, input().split())
l = list(map(int, input().split()))
s = 0
ans = []
for i in range(n):
	s = s + l[i]
	ans.append(int(s / m))
t = 0
for i in ans:
	print(i - t, end=' ')
	t = i


(m, n) = map(int, input().split(' '))
a = map(int, input().split(' '))
left = n
trns = []
for i in a:
	trns.append(((i - left) // n + 1) * (i >= left))
	left = (left - i) * (left > i) + (n - (i - left) % n) * (left <= i)
print(' '.join(map(str, trns)))


(day, pages) = list(map(int, input().split(' ')))
names = list(map(int, input().split(' ')))
temp = [0] * day
totals = [0] * day
for i in range(day):
	temp[i] = temp[i - 1] + names[i]
	print(temp[i] // pages - totals[i - 1], end=' ')
	totals[i] = temp[i] // pages


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
written_on_page = 0
for i in range(n):
	written_on_page += a[i]
	pages = written_on_page // m
	written_on_page %= m
	print(pages, end=' ')


from sys import stdin, exit

def listInput():
	return list(map(int, stdin.readline().rstrip().split()))
(n, m) = listInput()
li = listInput()
rem = 0
ans = []
for i in li:
	ans.append((i + rem) // m)
	rem = (i + rem) % m
print(' '.join([str(i) for i in ans]))


(n, m) = map(int, input().split())
words = list(map(int, input().strip().split()))[:n]
l = 0
lis = []
i = 0
for i in range(n):
	lis.append((l + words[i]) // m)
	l = (l + words[i]) % m
print(*lis)


(n, m) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
for i in range(1, n):
	a[i] += a[i - 1]
current = 1
for i in range(n):
	page = a[i] // m + 1
	print(page - current, end=' ')
	current = page
print()


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
total = 0
count = 0
for j in range(a):
	total += l[j]
	print(total // b - count, end=' ')
	count = total // b


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
r = 0
for j in range(n):
	if j != 0:
		print(' ', end='')
	t = 0
	r += a[j]
	if r >= m:
		t += int(r / m)
		r %= m
	print(t, end='')


(n, m) = map(int, input().split(' '))
global a
a = input().split(' ')
global sum
sum = 0
b = []
q = 0
r = 0
for i in range(n - 1):
	q = int(int(a[i]) / m)
	b.append(q)
	r = int(int(a[i]) % m)
	a[i + 1] = int(int(a[i + 1]) + r)
q = int(int(a[-1]) / m)
b.append(q)
print(*b)


b = [int(x) for x in input().split()]
n = b[0]
m = b[1]
a = [int(x) for x in input().split()]
res = [0 for i in range(n)]
s = 0
w = 0
for i in range(len(a)):
	w += a[i]
	if w < m:
		res[i] = 0
	elif w >= m:
		res[i] = w // m
		w %= m
for i in res:
	print(i, end=' ')


(n, m) = map(int, input().split())
L = [int(el) for el in input().split()]
su = 0
for i in range(len(L)):
	su += L[i]
	if su >= m:
		print(su // m, end=' ')
		su = su % m
	else:
		print(0, end=' ')


def death_note():
	(total_days, page_limit) = input().split(' ')
	total_days = int(total_days)
	page_limit = int(page_limit)
	current_names = 0
	flipped = 0
	names_written = input().split(' ')
	for i in range(0, total_days):
		flipped += int(names_written[i]) // page_limit
		current_names += int(names_written[i]) % page_limit
		if current_names >= page_limit:
			flipped += current_names // page_limit
			current_names -= (flipped - int(names_written[i]) // page_limit) * page_limit
		print(flipped, end=' ')
		flipped = 0
death_note()


def read():
	return int(input())

def readlist():
	return list(map(int, input().split()))

def readmap():
	return map(int, input().split())
(n, m) = readmap()
A = readlist()
T = [0] * n
res = 0
for i in range(n):
	res += A[i]
	T[i] = res // m
	res = res % m
print(' '.join(list(map(str, T))))


def main():
	(numDays, namesperPage) = list(map(int, input().split(' ')))
	pages = 0
	names = list(map(int, input().split(' ')))
	for j in range(numDays):
		pages += names[j]
		print(pages // namesperPage)
		pages %= namesperPage
main()


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
res = 0
for i in range(n):
	print((res + a[i]) // m)
	res = (res + a[i]) % m


(n, m) = map(int, input().split())
names = list(map(int, input().split()))
res = []
pos = 0
for i in names:
	res.append((pos + i) // m)
	pos = (pos + i) % m
[print(i, end=' ') for i in res]


(n, m) = map(int, input().split())
res = 0
for a in list(map(int, input().split())):
	print((res + a) // m, end=' ')
	res = (res + a) % m


import sys
(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
pos = int(0)
page = int(0)
for i in a:
	pf = page
	page += (pos + i) // k
	pos = (pos + i) % k
	sys.stdout.write(str(page - pf) + ' ')


(n, m) = map(int, input().split())
tab = list(map(int, input().split()))
zapisane = 0
index = 0
for i in tab:
	if index == n - 1 and zapisane + i >= m:
		print((zapisane + i) // m, end=' ')
		break
	if zapisane + i < m:
		zapisane += i
		print(0, end=' ')
	else:
		zapisane + i >= m
		zapisane += i
		print(zapisane // m, end=' ')
		zapisane %= m
	index += 1


def main():
	from sys import stdin, stdout
	import math
	(n, m) = map(int, stdin.readline().rstrip().split())
	A = [int(x) for x in stdin.readline().rstrip().split()]
	days = []
	s = 0
	for x in range(n):
		v = math.floor((s + A[x]) / m) - math.floor(s / m)
		days.append(str(v))
		s = s + A[x]
	stdout.write(' '.join(days))
main()


import math
(days, page) = map(int, input().split())
l = list(map(int, input().split()))
current_pov = 0
for i in range(len(l)):
	current_pov += l[i]
	print(current_pov // page, end=' ')
	current_pov %= page


(number_days, names_on_page) = input().split()
r = 0
l = []
a = list(map(int, input().split()))
c = 0
p = 0
while r < int(number_days):
	a[r] = c + a[r]
	b = a[r] // int(names_on_page)
	l.append(b)
	c = abs(a[r] // int(names_on_page) * int(names_on_page) - a[r])
	r = r + 1
while p < int(number_days):
	print(l[p], end=' ')
	p = p + 1


(n, m) = [int(i) for i in input().split()]
T = [int(i) for i in input().split()]
a = []
cnt = 0
for i in range(n):
	cnt += T[i]
	a.append(cnt // m)
	if cnt >= m:
		cnt %= m
print(*a)


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
s = 0
for el in range(n):
	i = a[el]
	k = 0
	r = i // m
	o = i % m
	k += r
	s += o
	if s >= m:
		s -= m
		k += 1
	print(k, end=' ')


(n, m) = map(int, input().split(' '))
arr = list(map(int, input().split(' ')))
ans = []
cnt = 0
for i in range(n):
	t = cnt + arr[i]
	if t < m:
		cnt = t
		ans.append(0)
	else:
		q = t
		t = arr[i] - (m - cnt)
		aa = 1
		cnt = q % m
		aa += t // m
		ans.append(aa)
for i in ans:
	print(i, end=' ')


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for i in l:
	c += i
	print(c // m, end=' ')
	c = c % m


(ndays, npages) = input().split()
nnames = input().split()
num = 0
for i in range(int(ndays)):
	num += int(nnames[i])
	if num >= int(npages):
		print(int(num / int(npages)), end=' ')
		num -= int(num / int(npages)) * int(npages)
	else:
		print(0, end=' ')


(n, m) = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
suma = 0
days = []
for i in range(n):
	suma += a[i]
	page = 0
	if suma >= m:
		page = suma // m
		suma -= page * m
	days.append(str(page))
print(' '.join(days))


input_1 = input()
inputs = input_1.split()
day = int(inputs[0])
max_page = int(inputs[1])
count = 0
name = input()
name_string = name.split()
names = []
answer = []
for i in range(day):
	names.append(int(name_string[i]))
for i in range(day):
	ans = 0
	count = count + names[i]
	answer.append(count // max_page)
	count = count % max_page
for i in range(day - 1):
	print(answer[i], end=' ')
print(answer[day - 1])


inp = input().split()
n = inp[0]
m = int(inp[1])
days = list(map(int, input().split()))
prev = 0
page = 0
residue = 0
for day in days:
	if day + residue >= m:
		page += (day + residue) // m
		residue = (day + residue) % m
		print(str(page - prev), end=' ')
		prev = page
	else:
		residue += day
		print(str(0), end=' ')


from math import ceil

def solve(n, m, a):
	(i, t, r) = (0, 0, [])
	for k in a:
		r.append(str((i + k) // m))
		i = (i + k) % m
	return ' '.join(r)

def main():
	(n, m) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	print(solve(n, m, a))
main()


import sys
data = sys.stdin.readlines()
m = int(data[0].split()[1])
a = list(map(int, data[1].split()))
n = m
for i in a:
	w = 0
	if n < m:
		if i >= n:
			i -= n
			w += 1
			n = m
		else:
			n -= i
			i = 0
	if i > 0:
		w += i // n
		n -= i % n
	print(w)


(days, maxnames) = input().split()
names = input().split()

def turns(days, maxnames):
	turn = 0
	for i in range(int(days)):
		turn += int(names[i])
		if turn >= int(maxnames):
			pages = int(turn) / int(maxnames)
			print(int(pages), end=' ')
			turn -= int(pages) * int(maxnames)
		else:
			print(0, end=' ')
turns(days, maxnames)


R = lambda : map(int, input().strip().split())
(n, m) = R()
ttl = 0
pgs = 0
for i in R():
	ttl += i
	print(ttl // m - pgs, end=' ')
	pgs = ttl // m


def main():
	s = list(map(int, input().split()))
	n = s[0]
	m = s[1]
	i = 1
	a = list(map(int, input().split()))
	last = m
	i = 0
	while i < n:
		if a[i] < last:
			last -= a[i]
			print('0')
		else:
			a[i] -= last
			print('%d' % (a[i] / m + 1))
			last = m - a[i] % m
		i += 1
main()


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
line = 0
answer = [-1] * n
for i in range(n):
	names = line + arr[i]
	pages = int(names / m)
	answer[i] = pages
	line = names % m
for i in answer:
	print(i, end=' ')


(n, m) = map(int, input().split())
x = [int(w) for w in input().split()]
t = []
s = 0
for i in range(len(x)):
	s += x[i]
	t.append(s // m)
	s = s % m
print(*t)


def next_paging(x):
	global m
	return (x // m + 1) * m

def previous_paging(x):
	global m
	return x // m * m
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
for i in range(n):
	first = next_paging(s)
	s += a[i]
	last = previous_paging(s)
	print((last - first) // m + 1, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
ans = [0] * (n + 1)
d = 0
j = 1
for i in a:
	k = (d + i) // m
	ans[j] = k
	j += 1
	d = (d + i) % m
print(*ans[1:])


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
ans = []
for i in a:
	sum += i
	day = sum // m
	sum = sum % m
	ans.append(day)
for v in ans:
	print(v, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
ans = []
left = 0
for i in range(n):
	print(int((left + a[i]) / m), end=' ')
	left = (left + a[i]) % m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
cum = 0
for i in a:
	cum = sum // m
	sum += i
	print(sum // m - cum)


import math
(n, m) = map(int, input().split())
mas = list(map(int, input().split()))
i = 0
ost = 0
while True:
	print(math.floor(mas[i] / m), end=' ')
	ost = ost + mas[i] - m * math.floor(mas[i] / m)
	i += 1
	if i == n:
		break
	mas[i] += ost
	ost = 0


(n, m) = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
s = 0
ans = []
for a in A:
	s += a
	ans.append(s // m)
	s %= m
print(*ans)


from math import ceil, floor
(N, M) = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
cnt = 0
ans = ''
for i in range(N):
	t = 0
	if cnt == 0:
		t = floor(float(A[i]) / M)
		cnt += A[i]
		cnt %= M
	else:
		t += 1
		t += floor(float(A[i] - M + cnt) / M)
		cnt += A[i]
		cnt %= M
	ans += str(t) + ' '
print(ans)


mynum = list(map(int, input().split()))
m = mynum[1]
l = list(map(int, input().split()))

def turn_pages(m, l):
	k = m
	t = 0
	L = ''
	for i in range(len(l)):
		if l[i] - k >= 0:
			t = 1 + (l[i] - k) // m
			k = m - (l[i] - k) % m
			if i == len(l) - 1:
				L += str(t)
			else:
				L += str(t) + ' '
		elif l[i] - k < 0:
			t = 0
			k = k - l[i]
			if i == len(l) - 1:
				L += str(t)
			else:
				L += str(t) + ' '
	return print(L)
turn_pages(m, l)


def day_limit(n):
	if n >= 1 and n <= 200000:
		return True
	else:
		return False

def page_limit(m):
	if m >= 1 and m <= 1000000000:
		return True
	else:
		return False

def name_limit(a):
	if a >= 1 and a <= 1000000000:
		return True
	else:
		return False
limit_in = input()
parse = limit_in.split(' ')
n = int(parse[0])
m = int(parse[1])
name_in = input()
parse2 = name_in.split()
page = []
namelim = 0
numofpage = 0
for i in range(0, n):
	namelim += int(parse2[i])
	numofpage = namelim // m
	if numofpage != 0:
		namelim = namelim % m
	page.append(numofpage)
for j in range(0, len(page)):
	print(page[j], end=' ')


(n, m) = [int(x) for x in input().strip().split()]
names_count = [int(x) for x in input().strip().split()]
rem = m
page_turns = []
for i in range(n):
	page_turn = 0
	count = names_count[i]
	if count <= m:
		if rem > count:
			page_turns.append('0')
			rem -= count
		elif rem == count:
			page_turns.append('1')
			rem = m
		else:
			page_turns.append('1')
			rem = m - count + rem
	else:
		count -= rem
		(page_count, rem2) = divmod(count, m)
		rem = m - rem2
		page_turns.append(str(page_count + 1))
print(' '.join(page_turns))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
l = []
i = 0
c = 0
while True:
	c += a[i]
	if c >= m:
		l.append(c // m)
		c = c % m
	else:
		l.append(0)
	if i == n - 1:
		break
	i += 1
print(*l)


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
rest = m
for day in range(n):
	turns = 0
	if arr[day] < rest:
		rest -= arr[day]
	else:
		if rest > 0:
			arr[day] -= rest
			turns += 1
		turns += arr[day] // m
		rest = m - arr[day] % m
	print(turns, end=' ')


IL = lambda : list(map(int, input().split()))
(n, m) = IL()
A = IL()
ans = []
s = 0
for a in A:
	ans.append((s + a) // m - s // m)
	s = (s + a) % m
print(*ans)


death = list(map(int, input().split()))
note = list(map(int, input().split()))
n = death[0]
m = death[1]
page = []
names = 0
for i in range(n):
	names += note[i]
	page.append(names // m)
each = [0] * n
each[0] = page[0]
for i in range(1, n):
	each[i] = page[i] - page[i - 1]
print(*each)


(n, m) = list(map(int, input().strip().split(' ')))
arr = list(map(int, input().strip().split(' ')))
s = 0
prev = 0
ans = []
for a in arr:
	s += a
	ans.append(s // m - prev)
	prev = s // m
print(*ans, sep=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
c = []
for i in range(len(a) - 1):
	c.append(a[i] // m)
	a[i + 1] += a[i] % m
c.append(a[-1] // m)
print(*c)


m_n = map(int, input().split())
l = list(m_n)
n = l[0]
m = l[1]
array = list(map(int, input().split()))
Sum = 0
print_list = list()
for curr_a in array:
	currPos = int(Sum / m)
	Sum = Sum + curr_a
	nextPos = int(Sum / m)
	print_list.append(nextPos - currPos)
for elem in print_list:
	print(elem, end=' ')


input_list = list(map(int, input().split()))
days = input_list[0]
max_name = input_list[1]
name_count = list(map(int, input().split()))
total_name_on_page = 0
ans = ''
for i in name_count:
	total_name_on_page = total_name_on_page + i
	if total_name_on_page < max_name:
		if len(ans) != 0:
			ans = ans + ' '
		ans = ans + str(0)
	else:
		if len(ans) != 0:
			ans = ans + ' '
		ans = ans + str(int(total_name_on_page / max_name))
		total_name_on_page = total_name_on_page % max_name
print(ans)


(n, m) = map(int, input().split())
b = list(map(int, input().split()))
s = 0
c = []
p = 0
for j in range(n):
	s += b[j]
	c.append(int(s / m) - p)
	p += int(s / m) - p
print(*c)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
x = 0
j = 0
for i in a:
	x += i
	p = 0
	if x >= m:
		p = int(x / m)
		x -= m * p
	print(p, end=' ')


(n, m) = map(int, input().split())
x = list(map(int, input().split()))
ans = []
rest = m
for i in range(n):
	if rest > x[i]:
		rest -= x[i]
		ans.append(0)
	else:
		ans.append(1 + (x[i] - rest) // m)
		rest = m - (x[i] - rest) % m
print(*ans)


(n, m) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
count = 0
res = []
for i in range(n):
	count += a[i]
	res.append(count // m)
	if count >= m:
		count = count % m
print(*res)


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
ans = [0] * n
now = 0
for i in range(n):
	now += a[i]
	ans[i] = now // m
	now %= m
print(*ans)


def f(l, m):
	n = len(l)
	for i in range(1, n):
		l[i] += l[i - 1]
	bl = [x // m for x in l]
	for i in range(n - 1, 0, -1):
		bl[i] -= bl[i - 1]
	return bl
(_, m) = list(map(int, input().split()))
l = list(map(int, input().split()))
print(*f(l, m))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
z = 0
for x in a:
	print((z + x) // m, end=' ')
	z = (x + z) % m


(n, m) = map(int, input().split())
arrayOfN = list(map(int, input().split()))
answerList = list()
res = 0
for i in range(n):
	res += arrayOfN[i]
	answerList.append(res // m)
	res %= m
answerStr = ' '.join(map(str, answerList))
print(answerStr)


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
p = 0
t = 0
for i in range(n):
	t += a[i]
	r = t // m - p
	print(r, '', end='')
	p += r


ar_count = input().split()
days = int(ar_count[0])
pageSize = int(ar_count[1])
needed = list(map(int, input().rstrip().split()))
filled = 0
for i in range(days):
	flip = 0
	muat = pageSize - filled
	if muat > needed[i]:
		filled = filled + needed[i]
		print(0, end=' ')
	else:
		temp = needed[i] - muat
		divid = temp // pageSize
		if divid >= 0:
			filled = temp % pageSize
			print(divid + 1, end=' ')
		else:
			filled = temp
			print(1, end=' ')


cur = 0
(n, m) = map(int, input().split())
ans = []
for a in map(int, input().split()):
	cur += a
	ans += [cur // m]
	cur %= m
print(' '.join(map(str, ans)))


(n, m) = [int(x) for x in input().split()]
ns = [int(x) for x in input().split()]
r = 0
for i in ns:
	ans = (r + i) // m
	r = (r + i) % m
	print(ans)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
res = 0
answer = []
for i in range(n):
	t = res + a[i]
	answer.append(t // m)
	res = t % m
print(*answer, end=' ')


def main():
	(n, m) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	cpage = m
	for i in a:
		t = 0
		if i < cpage:
			cpage = cpage - i
		else:
			t = (i - cpage) // m + 1
			cpage = m - (i - cpage) % m
		print(t, end=' ')
main()


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
d = 0
e = 0
f = 0
while d < a:
	e += c[d]
	print(e // b - f, end=' ')
	f = e // b
	d += 1


(n, m) = input().split()
a = list(map(int, input().split()))
result = []
sum = 0
for i in a:
	sum += i
	result.append(str(int(sum / int(m))))
	sum = sum % int(m)
result = ' '.join(result)
print(result)


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
s = 0
res = []
for i in range(n):
	s += a[i]
	if s // m > 0:
		res.append(s // m)
		s = s % m
	else:
		res.append(0)
res = [str(x) for x in res]
print(' '.join(res))


(n, m) = list(map(int, input().split()))
names = list(map(int, input().split()))
nc = 0
for i in range(n):
	turned = 0
	nc += names[i]
	if nc >= m:
		turned = nc // m
		nc -= m * (nc // m)
	print(turned, '', end='')


(n, m) = map(int, input().split())
a = [int(x) for x in input().split()]
r = 0
ans = [0] * n
for i in range(n):
	r += a[i]
	if r >= m:
		ans[i] += r // m
		r = r % m
print(' '.join([str(x) for x in ans]))


(n, m) = list(map(int, input().split()))
t = list(map(int, input().split()))
c = 0
out = []
for i in t:
	out.append((c + i) // m)
	c = (c + i) % m
print(' '.join(map(str, out)))


l = input().split()
n = int(l[0])
m = int(l[1])
a = list(map(int, input().split()))
current = 0
c = []
for i in range(n):
	temp = (a[i] + current) // m
	current = (a[i] + current) % m
	c.append(temp)
print(*c)


(n, m) = [int(j) for j in input().split()]
a = [int(j) for j in input().split()]
t = [0] * n
c = 0
for i in range(n):
	c += a[i]
	p = c // m
	t[i] = p
	c %= m
print(*t)


(n, m) = map(int, input().split(' '))
arr = list(map(int, input().split(' ')))
r = 0
for i in range(0, n):
	r += arr[i]
	print(r // m)
	r = r % m


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
ans = []
remaining = 0
for i in l:
	i = i + remaining
	ans.append(i // m)
	remaining = i % m
print(*ans)


(x, y) = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
res = [0] * x
total = [0] * x
for i in range(x):
	res[i] = res[i - 1] + a[i]
	print(res[i] // y - total[i - 1], end=' ')
	total[i] = res[i] // y


(n, m) = map(int, input().split())
s = list(map(int, input().split()))
t = 0
k = 0
for i in range(len(s)):
	k = (t + s[i]) // m
	print(k, end=' ')
	t = (t + s[i]) % m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
mo = a[0] % m
b = [a[0] // m]
for i in range(1, n):
	b.append((a[i] + mo) // m)
	mo = (a[i] + mo) % m
if mo != 0:
	a[-1] += 1
print(*b)


(arrLen, pageSize) = [int(x) for x in input().split(' ')]
nameFilled = [int(x) for x in input().split(' ')]
temp = 0
for i in range(arrLen):
	temp += nameFilled[i]
	print(temp // pageSize, end=' ')
	temp = temp % pageSize


(n, m) = map(int, input().split())
c = 0
li = list(map(int, input().split()))
for i in range(n):
	c += li[i]
	print(c // m, end=' ')
	c %= m


(N, M) = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
page_turns = [0] * N
names_on_current_page = 0
for i in range(N):
	page_turns[i] = (A[i] + names_on_current_page) // M
	names_on_current_page = (A[i] + names_on_current_page) % M
print(' '.join(map(str, page_turns)))


s = input().split()
(n, m) = (int(s[0]), int(s[1]))
s = input().split()
r = 0
for i in range(n):
	val = int(s[i]) + r
	print(val // m, end=' ')
	r = val % m
print('')


t = list(map(int, input().split()))
n = list(map(int, input().split()))
j = 0
for i in range(t[0]):
	w = n[j] // t[1]
	r = pow(n[j], 1, t[1])
	try:
		n[j + 1] = n[j + 1] + r
	except:
		q = 0
	print(w, end=' ')
	j = j + 1


a = input().split(' ')
days = int(a[0])
numNames = int(a[1])
e = 0
b = input().split(' ')
c = []
for i in range(days):
	c.append(int(b[i]))
for i in range(days):
	c[i] = c[i] + e
	d = c[i] // numNames
	print(d, end=' ')
	e = c[i] % numNames


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
z = 0
v = []
for i in l:
	z += i
	x = z // b
	v.append(x)
n = [v[0]]
for i in range(1, len(v)):
	n.append(v[i] - v[i - 1])
for i in n:
	print(i, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
res = 0
for i in range(n):
	x = (res + a[i]) // m
	res = (res + a[i]) % m
	print(x, end=' ', sep=' ')


(a, b) = map(int, input().split())
count = 0
ar = []
ar1 = []
ar = list(map(int, input().split()))
for i in ar:
	count += i
	if count < b:
		ar1.append(0)
	else:
		ar1.append(count // b)
		count = count % b
print(*ar1)


(n, m) = list(map(int, input().split()))
li = list(map(int, input().split()))[:n]
sum = 0
prev = 0
for i in range(len(li)):
	sum += li[i]
	d = int(sum / m)
	count = d - prev
	prev += count
	print(count)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
(a2, answer) = (0, [])
for i in range(n):
	a1 = a2
	a2 += a[i]
	answer.append(a2 // m - a1 // m)
print(*answer)


def solve(n, m, seq):
	rem = 0
	for a in seq:
		pages = (a + rem) // m
		yield pages
		rem = (a + rem) % m

def main():
	(n, m) = map(int, input().strip().split())
	seq = [int(x) for x in input().strip().split()]
	print(' '.join([str(x) for x in solve(n, m, seq)]))
main()


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
l = 0
for ai in a:
	l += ai
	print(l // m, end=' ')
	l = l % m


I = lambda : list(map(int, input().split()))
MOD = 1000000007
(n, m) = I()
l = I()
count = 0
pages = 0
i = 0
while i < n:
	count = 0
	pages += l[i]
	if pages >= m:
		count += pages // m
		pages = pages - m * (pages // m)
	print(count, end=' ')
	i += 1


import math
(n, m) = map(int, input().split())
a = [int(x) for x in input().split()]
ansL = []
for i in range(n):
	if i == 0:
		if a[i] < m:
			ansL.append(0)
		elif a[i] % m == 0:
			ansL.append(int(a[i] / m))
		else:
			ansL.append(int(math.floor(a[i] / m)))
		currentRemainder = a[i] % m
	elif a[i] + currentRemainder < m:
		ansL.append(0)
		currentRemainder += a[i]
	elif (a[i] + currentRemainder) % m == 0:
		ansL.append(int((a[i] + currentRemainder) / m))
		currentRemainder = 0
	else:
		ansL.append(int(math.floor((a[i] + currentRemainder) / m)))
		currentRemainder = (a[i] + currentRemainder) % m
print(*ansL)


def main():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	(ans, curr) = ([0] * n, 0)
	for i in range(n):
		curr += a[i]
		if m <= curr:
			ans[i] = curr // m
			curr %= m
	print(' '.join([str(i) for i in ans]))
main()


(n, m) = map(int, input().split())
A = [*map(int, input().split())]
pg = 0
T = [0]
for a in A:
	pg += a
	d = pg // m
	T[-1] += d
	pg -= d * m
	T.append(0)
print(' '.join(map(str, T[:n])))


userin = input().split(' ')
n = int(userin[0])
m = int(userin[1])
a = [int(ai) for ai in input().split(' ')]
res = 0
currnameinpage = 0
for i in range(n):
	print((a[i] + currnameinpage) // m, sep=' ')
	currnameinpage = (a[i] + currnameinpage) % m


(n, m) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
page = 1
names = 0
for i in range(n):
	ans = 0
	names += a[i]
	ans = names // m
	names = names % m
	print(ans, end=' ')


(n, m) = list(map(int, input().split()))
arr = list(map(int, input().split()))
ans = [0] * n
now = 0
for i in range(n):
	ans[i] = (now + arr[i]) // m
	now += arr[i]
	now %= m
print(*ans)


(n, k) = [int(__) for __ in input().strip().split()]
arr = [int(__) for __ in input().strip().split()]
cur = 0
ans = []
for i in range(n):
	cur += arr[i]
	an = 0
	if cur >= k:
		an += cur // k
		cur = cur % k
	ans.append(an)
print(*ans)


(n, m) = map(int, input().split())
s = list(map(int, input().split()))
ans = [0 for i in range(n)]
sm = 0
for i in range(n):
	sm += s[i]
	ans[i] = sm // m
	sm = sm % m
	print(ans[i], end=' ')


L = list(map(int, input().split()))
K = list(map(int, input().split()))
R = 0
S = 0
N = 0
for i in range(L[0]):
	S += K[i]
	if S < L[1]:
		R = 0
		print(R, end=' ')
	else:
		N = S / L[1]
		N = int(N)
		S = S - N * L[1]
		R = R = N
		print(R, end=' ')
		N = 0


(n, m) = map(int, input().split())
test = [0] * (n + 5)
pos = 1
sum1 = 0
arr = list(map(int, input().split()))
for i in range(n):
	sum1 += arr[i]
	val = sum1 // m
	test[pos] = val
	pos += 1
	print(test[pos - 1] - test[pos - 2], end=' ')
print('')


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
d = []
r = 0
for i in range(n):
	s = 0
	s = s + (l[i] + r) // m
	r = (l[i] + r) % m
	d.append(s)
print(*d)


(n, m) = [int(x) for x in input().split()]
rem = 0
turn = []
for day in input().split():
	page = 0
	d = int(day)
	if rem > 0:
		d -= rem
		page += 1
	page += d // m
	rem = m - d % m
	turn.append(page)
print(*turn)


(n, m) = map(int, input().split())
res = 0
cur = 0
for el in map(int, input().split()):
	res = 0
	cur += el
	if cur >= m:
		res += cur // m
		cur %= m
	print(res, end=' ')


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
r = 0
l2 = []
for x in l:
	r += x
	l2.append(r // k)
	r = r % k
for x in l2:
	print(x, end=' ')
print()


a = list(input().split(' '))
(n, m) = (int(a[0]), int(a[1]))
a = list(input().split(' '))
a = list((int(x) for x in a))
sum = 0
for i in range(n):
	sum += a[i]
	res = sum // m
	sum = sum % m
	print(res, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
ans = [0] * n
page = 0
for i in range(n):
	tmp = (a[i] + page) // m
	ans[i] += tmp
	page = (a[i] + page) % m
print(*ans)


(n, m) = map(int, input().split())
a = map(int, input().split())
ans = []
pages = 0
for i in a:
	pages += i
	ans.append(pages // m)
	pages %= m
print(*ans)


(n, m) = map(int, input().split())
l = [int(x) for x in input().split()]
a = 0
day_work = []
for i in l:
	a += i
	print(a // m)
	a = a % m


I = lambda : map(int, input().split())
(n, m) = I()
crr = 0
for i in I():
	if i + crr >= m:
		print((i + crr) // m, end=' ')
	else:
		print(0, end=' ')
	crr = (i + crr) % m


(n, m) = map(int, input().strip().split())
l = [int(i) for i in input().split()]
sum = 0
for i in range(n):
	count = 0
	sum += l[i]
	if sum >= m:
		count += sum // m
		if sum % m == 0:
			sum = 0
		else:
			sum -= count * m
	print(count, end=' ')


def go(n, m, days):
	res = []
	free_slots = m
	for i in range(n):
		today = days[i]
		if today < free_slots:
			free_slots -= today
			res.append(0)
		elif today == free_slots:
			free_slots = m
			res.append(1)
		else:
			total = 1 + (today - free_slots) // m
			free_slots = m - (today - free_slots) % m
			if free_slots == 0:
				free_slots = m
			res.append(total)
	return ' '.join([str(x) for x in res])
(n, m) = [int(x) for x in input().split(' ')]
days = [int(x) for x in input().split(' ')]
print(go(n, m, days))


(n, m) = input().strip().split(' ')
n = int(n)
m = int(m)
a = input().strip().split(' ')
a = [int(x) for x in a]
pos = 0
for i in range(n):
	page_turns = 0
	left = m - pos
	if a[i] <= left:
		pos += a[i]
		if pos == m:
			pos = 0
			page_turns += 1
	else:
		pos = 0
		a[i] = a[i] - left
		page_turns += a[i] // m
		a[i] -= m * (a[i] // m)
		pos = a[i]
		page_turns += 1
	print(page_turns, end=' ')


import sys
(n, m) = map(int, sys.stdin.readline().strip().split())
a = list(map(int, sys.stdin.readline().strip().split()))
rta = 0
cont = 0
for i in range(n):
	na = a[i] + cont
	rta = na // m
	cont = na % m
	print(rta, end=' ')


R = lambda : map(int, input().split())
(n, m) = R()
s = p = 0
r = []
for x in R():
	s += x
	r += [s // m - p // m]
	p = s
print(*r)


from math import *
(n, m) = map(int, input().split())
ls = list(map(int, input().split()))
left = 0
for i in ls:
	if i >= m - left:
		i -= m - left
		print(i // m + 1, end=' ')
		left = i % m
	else:
		print(0, end=' ')
		left += i
print()


(n, m) = map(int, input().split())
l = [int(i) for i in input().split()]
pr = 0
for i in l:
	curr = pr + i
	print(curr // m, end=' ')
	pr = curr % m


from itertools import accumulate
from sys import stdin, stdout
input = lambda : stdin.readline().rstrip()
write = stdout.write

def main():
	(N, M) = map(int, input().split())
	A = tuple(map(int, input().split()))
	a = [0] + list(accumulate(A))
	ans = [0] * N
	for i in range(1, N + 1):
		ans[i - 1] = a[i] // M - a[i - 1] // M
	print(*ans)
main()


(n, m) = map(int, input().split())
x = list(map(int, input().split()))
r = 0
for each in x:
	r += each
	print(r // m, end=' ')
	r %= m


import sys
import itertools
input = sys.stdin.readline

def main():
	(N, M) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	c = 0
	acc = list(itertools.accumulate(A))
	for a in acc:
		x = a // M
		print(x - c, end=' ')
		c = x
main()


(n, m) = map(int, input().split(' '))
l = list(map(int, input().split(' ')))
s = 0
for i in l:
	ss = s
	s += i
	print(s // m - ss // m, end=' ')


(n, m) = map(int, input().split())
res = 0
x = list(map(int, input().split()))
y = ''
for i in range(n):
	res += x[i]
	y += str(res // m) + ' '
	res = res % m
print(y)


import math
(n, m) = map(int, input().split())
days = list(map(int, input().split()))
res = []
ost = m
for (i, day) in enumerate(days):
	ind = ost - day
	r = 0
	if ind > 0:
		r = 0
		ost -= day
	elif ind < 0:
		day -= ost
		r += 1
		y = math.ceil(day / m) if day >= m else 1
		ost = y * m - day
		if ost == 0:
			ost = m
			r += y
		else:
			r += y - 1
	elif ind == 0:
		r += 1
		ost = m
	res.append(r)
print(' '.join(map(str, res)))


(n, m) = list(map(int, input().strip().split()))
nums = list(map(int, input().strip().split()))
res = []
pre = 0
for i in range(n):
	cur = nums[i]
	if cur + pre < m:
		res.append('0')
		pre += cur
	else:
		z1 = (cur + pre) // m
		z2 = (cur + pre) % m
		res.append(str(z1))
		pre = z2
print(' '.join(res))


l1 = [int(x) for x in input().split()]
l2 = [int(x) for x in input().split()]
n = l1[0]
m = l1[1]
stack = 0
l3 = []
for x in range(n):
	stack += l2[x]
	pages = 0
	if stack >= m:
		pages = int(stack / m)
		stack = stack % m
	l3.append(pages)
print(*l3)


def mi():
	return map(int, input().split())
(n, m) = mi()
a = list(mi())
s = 0
t = []
for i in a:
	s += i
	t.append(s // m)
for i in range(n):
	if i == 0:
		print(t[i], end=' ')
	else:
		print(t[i] - t[i - 1], end=' ')


(n, m) = list(map(int, input().split()))
aa = list(map(int, input().split()))
r = 0
for a in aa:
	r += a
	print(r // m, sep=' ')
	r %= m


(n, m) = list(map(int, input().strip().split(' ')))
a = list(map(int, input().strip().split(' ')))
total = 0
prev = 0
out = []
for i in range(n):
	total += a[i]
	curr = int(total / m)
	out.append(str(curr - prev))
	prev = curr
print(' '.join(out))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
flag = 0
for i in range(n):
	sum += a[i]
	temp = sum // m
	print(temp - flag, end=' ')
	flag = temp


x = list(map(int, input().split()))
page = 0
sum = 0
t = list(map(int, input().split()))
for i in range(x[0]):
	sum += t[i]
	if sum // x[1] > 0:
		print(sum // x[1], end=' ')
		sum = sum % x[1]
	else:
		print('0', end=' ')


(_, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
counter = 0
for item in a:
	(div, mod) = divmod(counter + item, m)
	print(div, end=' ')
	counter = mod
print()


def pages(arr, m):
	rem = 0
	ans = []
	for i in arr:
		tmp = (rem + i) // m
		rem = (rem + i) % m
		ans.append(tmp)
	return ans
(n, m) = list(map(int, input().split()))
arr = list(map(int, input().split()))
print(*pages(arr, m))


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
for i in range(n):
	if i == 0:
		print(l[i] // m, end=' ')
	else:
		l[i] += l[i - 1] % m
		print(l[i] // m, end=' ')


(n, m) = map(int, input().split())
qlist = list(map(int, input().split()))
pos = 0
for i in range(n):
	pages = 0
	pos += qlist[i] % m
	if pos >= m:
		pos = abs(pos - m)
		pages += 1
	pages += int(qlist[i] / m)
	print(pages, end=' ')


(n, m) = list(map(int, input().split()))
nar = list(map(int, input().split()))
ost = 0
answ = ''
for i in nar:
	answ += ' '
	answ += str((ost + i) // m)
	ost = (ost + i) % m
print(answ[1:])


def mmhaxor(a, n, m):
	if m == 1:
		print(*a, sep=' ')
	else:
		ans = []
		p = 0
		q = 0
		for i in range(n):
			p += a[i]
			if i == 0:
				ans.append(p // m)
			if i != 0:
				q += ans[i - 1]
				ans.append(p // m - q)
		print(*ans, sep=' ')
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
mmhaxor(a, n, m)


inp1 = input().split()
inp2 = input().split()
x = 0
y = 0
for i in range(int(inp1[0])):
	x += int(inp2[i])
	if x >= int(int(inp1[1])):
		y = int(x) / int(int(inp1[1]))
		print(int(y), end=' ')
		x -= int(y) * int(int(inp1[1]))
	else:
		print(0, end=' ')


(n, m) = map(int, input().split())
a = [int(x) for x in input().split()]
ans = [0] * n
count = 0
for i in range(n):
	count += a[i]
	ans[i] += count // m
	count %= m
print(*ans)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
alles = 0
for i in a:
	alles += i
	print(alles // m)
	alles %= m


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
names = 0
for i in range(n):
	names += arr[i]
	print(names // m, end=' ')
	names = names % m


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def ceildiv(x, y):
	return (x + y - 1) // y
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
prev = 0
ans = []
for i in range(n):
	temp = 0
	if prev > 0:
		if a[i] >= prev:
			a[i] -= prev
			temp += 1
		else:
			prev -= a[i]
			ans.append(temp)
			continue
	temp += a[i] // m
	prev = math.ceil(a[i] / m) * m - a[i]
	ans.append(temp)
print(*ans)


(n, m) = [int(x) for x in input().split(' ')]
a = [int(x) for x in input().split(' ')]
s = 0
p = []
for b in a:
	p.append(int((s + b) % m < s % m) + b // m)
	s += b
print(*p)


tz = list(map(int, input().split()))
t = tz[0]
z = tz[1]
pqr = list(map(int, input().split()))
rem = 0
count = 0
l = 0
for i in range(t):
	count = pqr[i] + count
	pg = count // z - l
	print(pg, end=' ')
	l += pg


M = lambda : list(map(int, input().split()))
(n, m) = M()
a = M()
t = []
s = []
sm = 0
nex = a[0]
b = 0
for i in range(0, len(a)):
	c = b + a[i]
	s.append(c // m)
	b = c % m
print(*s)


(n, m) = map(int, input().split())
A = list(map(int, input().split()))
D = []
prev = []
if A[0] < m:
	D.append(0)
	prev.append(m - A[0])
else:
	D.append(A[0] // m)
	prev.append(m - A[0] % m)
i = A[0] // m
j = 1
while j < n:
	if A[j] < prev[-1]:
		D.append(0)
		prev.append(prev[-1] - A[j])
	else:
		A[j] -= prev[-1]
		D.append(A[j] // m + (prev[-1] != 0))
		prev.append(m - A[j] % m)
		i += A[j] // m + 1
	j += 1
print(*D)


(n, m) = map(int, input().split())
mas = list(map(int, input().split()))
q = m
gas = []
for i in range(n):
	if q > mas[i]:
		q -= mas[i]
		gas.append('0')
	else:
		mas[i] -= q
		q = m - mas[i] % m
		gas.append(str(mas[i] // m + 1))
print(' '.join(gas))


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
a_sum = [0]
for i in a:
	a_sum.append(i + a_sum[-1])
a_sum.remove(0)
output = [0]
accumulate = 0
for i in a_sum:
	page = i // m - accumulate
	output.append(page)
	accumulate += page
output.remove(0)
print(' '.join(list(map(str, output))))


(n, m) = input().split()

def deathtot(n, m):
	turnpage = []
	kill = 0
	killing = input().split()
	for i in killing:
		kill += int(i)
		if kill >= int(m):
			pages = int(kill / int(m))
			turnpage.append(pages)
			kill -= int(m) * pages
		else:
			turnpage.append(0)
	return turnpage
print(*deathtot(int(n), int(m)))


(n, m) = input().split()
n = int(n)
m = int(m)
arr = [int(x) for x in input().split()]
s = 0
for i in range(n):
	s += arr[i]
	print(s // m, ' ')
	s %= m


import sys
import math
import bisect
import itertools

def main():
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	for i in range(1, n):
		A[i] += A[i - 1]
	B = []
	for i in range(n):
		if i == 0:
			l = 1
		else:
			l = A[i - 1] + 1
		r = A[i]
		p1 = math.ceil(l / m)
		p2 = math.ceil(r / m)
		if r % m == 0:
			p2 += 1
		B.append(p2 - p1)
	print(' '.join(list((str(a) for a in B))))
main()


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
for i in range(a):
	n = 0
	n = l[i] // b
	l[i] = l[i] % b
	print(n, end=' ')
	if i != a - 1:
		l[i + 1] = l[i + 1] + l[i]


(a, b) = map(int, input().split())
l = [int(i) for i in input().split()]
cnt = 0
for i in range(a):
	cnt += l[i]
	print(cnt // b, end=' ')
	cnt %= b


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
s = 0
b = 0
for i in range(n):
	s += arr[i]
	now = s // m
	print(now - b, end=' ')
	b = now


p = list(map(int, input().split()))
n = p[0]
m = p[1]
s = list(map(int, input().split()))
sums = 0
for i in range(0, len(s)):
	sums += s[i]
	print(sums // m - (sums - s[i]) // m, end=' ')


from math import floor
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
busy = 0
t = []
for item in a:
	busy += item
	t.append(floor(busy / m))
	busy %= m
for item in t:
	print(item, end=' ')


(n, m) = map(int, input().split())
s = [int(elem) for elem in input().split()]
k = 0
anses = []
for i in range(n):
	anses.append((k + s[i]) // m)
	k = (k + s[i]) % m
for i in range(n):
	print(anses[i], end=' ')


(N, M) = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
count = 0
if A[0] < M:
	print('0', end=' ')
else:
	ans = int(A[0] / M)
	print(ans, end=' ')
	A[0] = A[0] % M
for i in range(1, len(A)):
	sum1 = A[i] + A[i - 1]
	res = int(sum1 / M)
	if res == 0:
		A[i] = sum1
	print(res, end=' ')
	if res >= 1:
		A[i] = sum1 % M


(n, m) = map(int, input().split())
N = list(map(int, input().split()))
x = m
for i in range(n):
	a = N[i]
	z = 1
	if a < x:
		x -= a
		print(0, end=' ')
		continue
	a -= x
	z += a // m
	x = m - a % m
	print(z, end=' ')


(n, m) = map(int, input().split())
a = map(int, input().split())
r = 0
t = []
for x in a:
	t.append((x + r) // m)
	r = (x + r) % m
print(*t)


(n, m) = map(int, input().split())
a = input().strip().split()[:n]
a = list(map(int, a))
sobras = 0
pags = 0
sum = 0
resul = []
for w in a:
	sum = sobras + w
	pags = sum // m
	resul.append(pags)
	sobras = sum % m
for i in resul:
	print(i, end=' ')


(amount, y) = map(int, input().split())
z = map(int, input().split())
total = total2 = 0
for x in z:
	total += x
	print(total // y - total2, end=' ')
	total2 = total // y


(n, m) = input().split(' ')
num_days = int(n)
names_limit = int(m)
days = [int(i) for i in input().split()]
names = 0
for i in range(0, num_days):
	names += days[i]
	pages = names // names_limit
	names %= names_limit
	if i == num_days - 1:
		print(pages)
	else:
		print(pages, end=' ')


import sys
(n, m) = map(int, sys.stdin.readline().split())
a = list(map(int, sys.stdin.readline().split()))
for i in range(1, n):
	a[i] += a[i - 1]
ans = [0] * n
x = 0
for i in range(n):
	c = a[i] // m
	ans[i] = c - x
	x += ans[i]
print(*ans)


(n, m) = list(map(int, input().split()))
names_days = list(map(int, input().split()))
output = []
names_before = 0
names_after = 0
for names_day in names_days:
	no_times_turned = 0
	names_after += names_day
	output.append(str(names_after // m - names_before // m))
	names_before += names_day
print(' '.join(output))


(c, p_n) = [int(i) for i in input().split()]
m = [int(i) for i in input().split()]
summ = 0
ans = []
g = 0
for i in m:
	ans.append((i + g) // p_n)
	g = (i + g) % p_n
print(*ans)


(n, m) = map(int, input().split())
A = [int(x) for x in input().split()]
p = 0
t = 0
R = []
for i in range(n):
	op = p
	t += A[i]
	dp = (t - p * m) // m
	R.append(dp)
	p += dp
print(*R)


def death(n, m, lst):
	(s, result) = (0, list())
	for i in range(n):
		s += lst[i]
		result.append(s // m)
		s %= m
	return result
(N, M) = [int(j) for j in input().split()]
a = [int(j) for j in input().split()]
print(*death(N, M, a))


import sys
import io
stream_enable = 0
inpstream = '\n3 5\n3 7 9\n\n'
if stream_enable:
	sys.stdin = io.StringIO(inpstream)
	input()

def inpmap():
	return list(map(int, input().split()))
(n, m) = inpmap()
arr = inpmap()
s = 0
for x in arr:
	s += x
	print(s // m, end=' ')
	s %= m
print()


def fun(x, y, k):
	return int(y / k) - int(x / k)
(n, m) = map(int, input().split())
p = [int(x) for x in input().split()]
s = 0
t = 0
q = [0] * n
for i in range(0, n):
	t = s
	s += p[i]
	q[i] = fun(t, s, m)
for i in range(0, n):
	print(q[i], end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
t1 = 0
s = 0
for i in range(n):
	s += a[i]
	t = s // m
	if t == 0:
		print(t, end=' ')
	else:
		print(t - t1, end=' ')
		t1 += t - t1


def solve(N, M, A):
	ans = []
	rem = 0
	for a in A:
		rem += a
		ans.append(rem // M)
		rem %= M
	return ans

def main():
	(N, M) = [int(e) for e in input().split(' ')]
	A = [int(e) for e in input().split(' ')]
	assert len(A) == N
	print(*solve(N, M, A))
main()


import sys
input = sys.stdin.readline
out = sys.stdout
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
current = 0
for i in range(n):
	k = 0
	if current != 0:
		z = m - current
		current = 0
		k += 1
		a[i] -= z
		if a[i] != 0:
			k += a[i] // m
			current += a[i] % m
	elif a[i] <= m:
		current += a[i]
		if a[i] == m:
			k += 1
			current = 0
	else:
		k += a[i] // m
		current += a[i] % m
	out.write(str(k) + ' ')


(days, page) = map(int, input().split())
n_names = list(map(int, input().split()))
used_space = 0
for i in range(days):
	print((n_names[i] + used_space) // page, end=' ')
	used_space = (n_names[i] + used_space) % page
print()


x = input()
a = []
for n in x.split():
	a.append(int(n))
days = a[0]
limit = a[1]
a = []
answer = []
totalSum = 0
page = input()
for n in page.split():
	a.append(int(n))
counter = 0
sum = 0
if len(a) != days:
	exit()
else:
	for i in range(len(a)):
		if counter != 0:
			totalSum += limit
			if answer[-1] == 0:
				sum += a[i]
			else:
				sum += a[i]
				sum = sum - limit * answer[-1]
		else:
			totalSum = limit
			sum = a[i]
			counter += 1
		if sum < limit:
			answer.append(int(0))
		else:
			x = sum // limit
			answer.append(int(x))
for i in range(len(answer)):
	print(answer[i], end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
sl = m
j = 0
pt = []
for i in range(n):
	if a[i] < sl:
		sl -= a[i]
		pt.append(0)
	elif sl == a[i]:
		sl = m
		pt.append(1)
	else:
		a[i] -= sl
		x = 1
		x += a[i] // m
		y = a[i] % m
		sl = m - y
		pt.append(x)
s = ''
for i in pt:
	s += '{} '.format(i)
print(s[:len(s) - 1])


(n, m) = map(int, input().split())
A = list(map(int, input().split()))
Ans = [0] * n
s = 0
for i in range(n):
	s += A[i]
	if s >= m:
		Ans[i] += s // m
		s = s % m
print(*Ans)


(n, m) = input().split()
n = int(n)
m = int(m)
l = [int(x) for x in input().split()]
s = 0
arr = []
for i in range(n):
	s += l[i]
	arr.append(s // m)
	if s >= m:
		s %= m
print(*arr)


(n, m) = input().split()
n = int(n)
m = int(m)
summation = list(range(n + 1))
page = list(range(n + 1))
result = list(range(n + 1))
val = list(range(n + 1))
summation[0] = 0
page[0] = 0
val[1:n + 1] = input().split()
for i in range(1, n + 1):
	val[i] = int(val[i])
	summation[i] = summation[i - 1] + val[i]
	page[i] = summation[i] // m
	result[i] = page[i] - page[i - 1]
print(*result[1:n + 1])


(m, k) = map(int, input().split())
name = list(map(int, input().split()))
turn = []
count = 0
for i in name:
	count = count + i
	turn.append(count // k)
	count = count % k
print(*turn)


import math
(n, m) = input().split()
a = input().split()
n = int(n)
m = int(m)
turn = 0
extra = 0
for i in range(n):
	names = int(a[i])
	turn = str(math.floor((names + extra) / m))
	extra = (names + extra) % m
	print(turn + ' ', end='')


def main():
	(n, m) = map(int, input().split(' '))
	ts = map(int, input().split(' '))
	r = m
	ans = []
	for t in ts:
		if t < r:
			r -= t
			ans.append(0)
		else:
			a = 1
			t -= r
			a += t // m
			r = m - t % m
			ans.append(a)
	print(' '.join(map(str, ans)))
main()


s = list(map(int, input().split()))
e = list(map(int, input().split()))
q = 0
for i in range(0, s[0]):
	summa = q + e[i]
	print(summa // s[1], end=' ')
	q = summa % s[1]


Input = lambda : map(int, input().split())
(n, m) = Input()
l = list(Input())
now = 0
ans = []
for x in l:
	ans.append((now + x) // m)
	now = (x + now) % m
print(' '.join(map(str, ans)))


nm = input().split()
n = int(nm[0])
m = int(nm[1])
a = input().split()
b = list()
for i in a:
	b.append(int(i))
sol = 0
for i in range(n):
	sol += b[i]
	print(sol // m)
	sol %= m


import math
b = [int(x) for x in input().split()]
(n, m) = (b[0], b[1])
a = [int(x) for x in input().split()]
res = m
t = []
for i in range(n):
	if res > 0:
		if a[i] < res:
			t.append(0)
			res = res - a[i]
		elif res == a[i]:
			t.append(1)
			res = m
		else:
			after_fill_res = a[i] - res
			x = int(after_fill_res / m)
			res = m - after_fill_res % m
			t.append(x + 1)
	else:
		x = int(a[i] / m)
		res = m - a[i] % m
		t.append(x - 1)
print(' '.join([str(x) for x in t]))


import sys
(N, M) = tuple(map(int, input().split()))
A = sys.stdin.readline()
t = len(A)

def NextNum(A, count, t):
	p = count
	Num = ''
	while p < t and A[p] != ' ':
		Num = Num + A[p]
		p = p + 1
	return (int(Num), p + 1)
(Num, strt) = NextNum(A, 0, t)
ans = Num // M
rm = Num - M * ans
print(ans, end=' ')
for i in range(N - 1):
	(Num, strt) = NextNum(A, strt, t)
	rm = Num + rm
	ans = rm // M
	rm = rm - M * ans
	print(ans, end=' ')


def main():
	[n, m] = [int(_) for _ in input().split()]
	n_names = [int(_) for _ in input().split()]
	turns = [0] * n
	places = m
	for i in range(n):
		names = n_names[i]
		if names < places:
			turns[i] = 0
			places -= names
		else:
			names -= places
			turn = 1
			if names > 0:
				turn += names // m
				places = m - names % m
				if places == 0:
					places = m
			else:
				places = m
			turns[i] = turn
	print(' '.join([str(x) for x in turns]))
main()


def main():
	(n, m) = map(int, input().split())
	(l, r) = ([], 0)
	for a in map(int, input().split()):
		r += a
		l.append(str(r // m))
		r %= m
	print(' '.join(l))
main()


(n, m) = map(int, input().split())
list = [int(i) for i in input().split()]
(s, i) = (list[0], 0)
while i < n:
	print(int(s // m), end=' ')
	s %= m
	i += 1
	if i < n:
		s += list[i]


(n, m) = map(int, input().split())
arr = [int(i) for i in input().split()]
x = m
for i in arr:
	if i >= x:
		if i < m:
			i = i - x
			print(1, end=' ')
			x = m - i
		else:
			i = i - x
			print(i // m + 1, end=' ')
			x = m - i % m
	else:
		x = x - i
		print(0, end=' ')


(n, m) = input().split()
days = input().split()
arr = []
written = 0
for i in days:
	written += int(i)
	if written >= int(m):
		pages = int(written / int(m))
		arr.append(pages)
		written -= pages * int(m)
	else:
		arr.append(0)
print(*arr)


(n, m) = map(int, input().split(' '))
names = list(map(int, input().split(' ')))
total = 0
acc = 0
result = []
for i in range(0, n):
	total += names[i]
	open_page = total // m - acc
	result.append(open_page)
	acc += open_page
print(' '.join(map(str, result)))


def main():
	(n, m) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	delim = 0
	for (i, e) in enumerate(a):
		e += delim
		(p, delim) = divmod(e, m)
		print(p, end=' ')
	print()

def __starting_point():
	main()
__starting_point()


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
pages = 0
names = 0
page = 0
for i in range(n):
	names += a[i]
	page += pages
	pages = names // m - page
	print(pages, end=' ')


(n, m) = map(int, input().split())
z = list(map(int, input().split()))
l = []
sum = 0
for i in range(n):
	sum += z[i]
	l.append(sum // m)
	sum = sum % m
print(*l)


(n, m) = map(int, input().split())
sl = list(map(int, input().split()))
prev = 0
tl = []
for i in sl:
	count = 0
	count += (prev + i) // m
	tl += [str(count)]
	ss = (prev + i) % m
	prev = ss
print(' '.join(tl))


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
rem = m
turn = 0
for i in range(n):
	if rem > a[i]:
		print(0, end=' ')
		rem = rem - a[i]
	else:
		temp = a[i] - rem
		temp2 = temp // m + 1
		print(temp2, end=' ')
		rem = m - temp % m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
result = [0] * n
pg = 0
for i in range(0, n):
	result[i] = (pg + a[i]) // m
	pg = (pg + a[i]) % m
for i in result:
	print(i, end=' ')


inp = input()
(n, m) = inp.split()
n = int(n)
m = int(m)
inp = input()
a = inp.split()
remainder = 0
for aith in a:
	names = int(aith)
	if names == 0:
		print(0, end=' ')
	else:
		pages = int((names + remainder) / m)
		remainder = (names + remainder) % m
		print(pages, end=' ')


(n, m) = [int(mem) for mem in input().split()]
cap = 0
a = [int(num) for num in input().split()]
for i in a:
	print((cap + i) // m, end=' ')
	cap = (cap + i) % m


(n, m) = map(int, input().split())
p = [*map(int, input().split())]
re = list()
tmp = 0
for i in range(n):
	if tmp > 0:
		re.append((p[i] + tmp) // m)
		tmp = (p[i] + tmp) % m
	else:
		tmp = p[i] % m
		re.append(p[i] // m)
print(*re)


(n, m) = map(int, input().split())
lis = list(map(int, input().split()))
x = ''
dum = 0
for i in lis:
	dum += i
	a = dum // m
	dum -= m * a
	x += str(a) + ' '
print(x[:-1])


def main():
	(days, m) = map(int, input().split())
	a = map(int, input().split())
	space = m
	for i in range(days):
		names = next(a)
		turns = names // m
		extra = names % m
		left = space - extra
		if left > 0:
			space = left
		else:
			space = m + left
			turns += 1
		print(turns, end=' ')
main()


(n, m) = map(int, input().split())
a = [i for i in map(int, input().split())]
s = []
z = 0
for i in range(n):
	z += a[i]
	z1 = int(z / m)
	s.append(z1)
s1 = []
for i in range(n - 1):
	a1 = s[i + 1] - s[i]
	s1.append(a1)
s1.insert(0, s[0])
print(*s1, sep=' ')


c = list(map(int, input().split()))
n = c[0]
m = c[1]
x = []
a = list(map(int, input().split()))
b = 0
for i in range(0, n):
	d = a[i] + b
	print('%d' % (d / m), end=' ')
	b = d % m


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
	s += l[i]
	print(s // m)
	s = s % m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
ans = []
for i in range(len(a)):
	cnt += a[i]
	ans.append(cnt // m)
	cnt = cnt % m
print(*ans)


import sys
(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
res = m
for x in arr:
	if x < res:
		print(0, ' ', end='')
		res -= x
	elif x == res:
		print(1, ' ', end='')
		res = m
	else:
		print(int((x - res) / m) + 1, ' ', end='')
		res = m - (x - res) % m


(n, m) = map(int, input().split())
p = list(map(int, input().split()))
a = []
left = m
for i in range(n):
	if left > p[i]:
		left -= p[i]
		a.append(0)
	elif left == p[i]:
		left = m
		a.append(1)
	else:
		a.append(1 + (p[i] - left) // m)
		left = m - (p[i] - left) % m
print(*a)


A = input()
B = input()
listA = A.split()
listB = B.split()
rA = []
c = 0
for i in range(len(listB)):
	rA.append(int(listB[i]))
for i in range(int(listA[0])):
	rA[i] = rA[i] + c
	d = rA[i] // int(listA[1])
	print(d, end=' ')
	c = rA[i] % int(listA[1])


(n, m) = map(int, input().split())
(ost, ans) = (0, '')
for x in map(int, input().split()):
	ost += x
	if ost < m:
		ans += '0 '
	else:
		ans += str(ost // m) + ' '
		ost %= m
print(ans)


v = list(map(int, input().split()))
z = list(map(int, input().split()))
n = v[0]
m = v[1]
zap = 0
for i in range(n):
	a = z[i]
	zap += a
	per = zap // m
	zap -= m * (zap // m)
	print(str(per), end=' ')


(n, m) = tuple(map(int, input().split(' ')))
x = list(map(int, input().split(' ')))
nib = 0
ans = []
cou = 0
for i in x:
	nib += i
	if nib < m:
		ans.append(nib // m)
	else:
		ans.append(nib // m)
		nib -= nib // m * m
print(*ans)


X = list(map(int, input().split()))
Now = 0
Previous = 0
Names = list(map(int, input().split()))
for i in Names:
	Now += i
	print(int(Now / X[1]) - Previous)
	Previous = int(Now / X[1])


f = lambda : map(int, input().split())
(n, m) = f()
l = list(f())
pg = 0
for i in range(n):
	print((pg + l[i]) // m, end=' ')
	pg = (pg + l[i]) % m


(n, m) = map(int, input().split())
nameCount = list(map(int, input().split()))
spare = 0
for num in nameCount:
	print((num + spare) // m, end=' ')
	spare = (num + spare) % m


gi = lambda : list(map(int, input().split(' ')))
(n, m) = gi()
line = gi()
acc = 0
for k in range(n):
	acc += line[k]
	print(acc // m, end=' ')
	acc %= m


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
presum = [0] * n
presum[0] = arr[0]
for i in range(1, n):
	presum[i] = presum[i - 1] + arr[i]
ans = []
for i in range(n):
	ans.append(presum[i] // m)
x = []
x.append(ans[0])
for i in range(1, n):
	x.append(ans[i] - ans[i - 1])
for i in range(n):
	print(x[i], end=' ')
print()


(n, m) = map(int, input().split())
L = list(map(int, input().split()))
resto = 0
L1 = [0] * n
for k in range(n):
	resto += L[k]
	L1[k] = resto // m
	resto = resto % m
print(' '.join([str(k) for k in L1]))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
k = []
ps = 0
s_k = 0
for i in a:
	ps += i
	if not k:
		k.append(ps // m)
		s_k = k[0]
		continue
	k.append(ps // m - s_k)
	s_k += k[-1]
print(' '.join([str(x) for x in k]))


from collections import defaultdict
import sys, heapq, bisect, math, itertools, string, queue, datetime
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)
AtoZ = [chr(i) for i in range(65, 65 + 26)]
atoz = [chr(i) for i in range(97, 97 + 26)]

def inpl():
	return list(map(int, input().split()))

def inpl_str():
	return list(input().split())
(N, M) = inpl()
aa = inpl()
ans = []
SUM = 0
for a in aa:
	SUM += a
	ans.append(SUM // M)
	if SUM >= M:
		SUM %= M
print(' '.join(map(str, ans)))


(n, m) = map(int, input().split())
L = list(map(int, input().split()))
A = [L[0] // m]
r = m - L[0] % m
for c in L[1:]:
	A.append(1 + (c - r) // m)
	r = m - (c - r) % m
print(' '.join(map(str, A)))


def main():
	[n, m] = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	b = [0]
	prev_sum = 0
	new_sum = 0
	for i in range(n):
		prev_sum = new_sum
		new_sum += a[i]
		num = int(new_sum / m) - int(prev_sum / m)
		b.append(num)
	b.pop(0)
	print(' '.join(list(map(str, b))))
main()


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
n_name = 0
pages = []
for x in a:
	(page, n_name) = divmod(x + n_name, m)
	pages.append(page)
print(*pages)


firstinput = []
input_string = input()
list_a = input_string.split()
count = 0
while count < 2:
	firstinput.append(int(list_a[count]))
	count += 1
input_string2 = input()
list_b = input_string2.split()
count = 0
pagesperday = []
while count < firstinput[0]:
	pagesperday.append(int(list_b[count]))
	count += 1
pagelimit = firstinput[1]
pageleft = 0
pagereadperday = []
for i in pagesperday:
	pages = i + pageleft
	pagesread = int(pages / pagelimit)
	pagereadperday.append(pagesread)
	pageleft = pages - pagesread * pagelimit
for i in pagereadperday:
	print(i, '')


(n, m) = map(int, input().split())
if n < 1 or n > 200000 or m < 1 or (m > 1000000000):
	raise Exception('no')
words = list(map(int, input().strip().split()))[:n]
for x in range(n):
	if words[x] < 1 or words[x] > 1000000000:
		raise Exception('no')
l = 0
lis = []
for i in range(n):
	lis.append((l + words[i]) // m)
	l = (l + words[i]) % m
print(*lis)


import math
(n, m) = map(int, input().split())
acum = 0
for x in map(int, input().split()):
	acum += x
	print(math.floor(acum / m), end=' ')
	acum %= m


(days, pageLimit) = input().split(' ')
days = int(days)
pageLimit = int(pageLimit)
currPageNames = 0
flippedToday = 0
namesWrittenList = input().split(' ')
for i in range(0, days):
	flippedToday += int(namesWrittenList[i]) // pageLimit
	currPageNames += int(namesWrittenList[i]) % pageLimit
	if currPageNames >= pageLimit:
		flippedToday += currPageNames // pageLimit
		currPageNames -= (flippedToday - int(namesWrittenList[i]) // pageLimit) * pageLimit
	print(flippedToday, end=' ')
	flippedToday = 0


firstinput = input()
(n, m) = firstinput.split(' ')
n = int(n)
m = int(m)
turn = []
temp = 0
secondinput = input()
secondinputs = secondinput.split(' ')
for x in range(n):
	secondinputs[x] = int(secondinputs[x])
for data in secondinputs:
	temp += data
	turn.append(temp // m)
	temp = temp % m
for pages in turn:
	print(pages, end=' ')


n = list(map(int, input().rstrip().split()))
time = n[1]
days = list(map(int, input().rstrip().split()))
ans = [0] * (n[0] + 1)
Sum = 0
sum_ans = 0
for i in range(1, len(days) + 1):
	Sum += days[i - 1]
	ans[i] = Sum // time - sum_ans
	sum_ans += ans[i]
print(' '.join(map(str, ans[1:])))


import sys
sys.setrecursionlimit(2000)
from collections import Counter
from functools import reduce
(n, m) = [int(val) for val in sys.stdin.readline().split()]
a = [int(val) for val in sys.stdin.readline().split()]
summ = 0
divs = 0
for val in a:
	divs1 = divs
	summ += val
	divs = summ // m
	print(divs - divs1, end=' ')
print('')


(m, n) = map(int, input().split())
a = [int(i) for i in input().split()]
z = 0
for k in range(m):
	u = a[k] + z
	print(u // n, end=' ')
	z = u % n


(days, names) = map(int, input().split())
lofnames = list(map(int, input().split()))
pages = [0] * days
written = [0] * days
for i in range(days):
	pages[i] = pages[i - 1] + lofnames[i]
	written[i] = pages[i] // names - written[i - 1]
	print(written[i], end=' ')
	written[i] = pages[i] // names


nm = input().split(' ')
l = input().split(' ')
m = int(nm[1])
d = list()
s = 0
for i in l:
	d.append(str(int((int(i) + s) / m)))
	s = (int(i) + s) % m
print(' '.join(d))


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
mList = list()
t = list()
lp = 0
for i in range(0, n):
	a[i] += lp
	lp = a[i] % m
	t.append(int(a[i] / m))
print(*t)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
current_fill = 0
t = []
for i in a:
	turns = 0
	current_fill = current_fill + i
	turns += current_fill // m
	current_fill %= m
	t.append(turns)
print(*t)


(n, m) = [int(i) for i in input().split()]
arr = [int(i) for i in input().split()]
sum = 0
for i in range(n):
	sum = sum + arr[i]
	count = int(sum / m)
	print(count, end=' ')
	sum %= m


(n, m) = map(int, input().split())
l = [int(x) for x in input().split()]
p = 0
a = []
for i in range(n):
	p += l[i]
	a.append(p // m)
	if p >= m:
		p = p % m
print(*a)


def main():
	(n, m) = [int(c) for c in input().split()]
	a = [int(c) for c in input().split()]
	pages_day = []
	_sum = 0
	for i in range(n):
		_sum += a[i]
		pages = _sum // m
		pages_day.append(pages)
	prev = 0
	res = []
	for (i, p) in enumerate(pages_day):
		turn = p - prev
		res.append(str(turn))
		prev = p
	print(' '.join(res))
main()


(n, m) = tuple(map(int, input().split()))
a = tuple(map(int, input().split()))
p = 0
res = []
for i in range(n):
	res.append((a[i] + p) // m)
	p = (a[i] + p) % m
print(' '.join(map(str, res)))


(n, m) = list(map(int, input().split()))
lists = list(map(int, input().split()))
res = 0
arr = []
for i in lists:
	res += i
	arr.append(str(int(res / m)))
	res = res % m
print(' '.join((a for a in arr)))


(n, m) = map(int, input().split())
t = list(map(int, input().split()))
ost = 0
for i in t:
	print((i + ost) // m, end=' ')
	ost = (i + ost) % m


(days, max_name) = [int(x) for x in input().split()]
names = [int(x) for x in input().split()]
ends = 0
for i in range(days):
	ends += names[i]
	(p, r) = divmod(ends, max_name)
	print(p, end=' ')
	ends = ends - p * max_name


(n, m) = map(int, input().split())
number = list(map(int, input().split()))
z = 0
for i in number:
	z += i
	print(z // m, end=' ')
	z %= m


s = input().split(' ')
(n, m) = [int(s[i]) for i in range(0, 2)]
s = input().split(' ')
A = [int(s[i]) for i in range(0, n)]
c = 0
for i in range(0, n):
	c += A[i]
	print(c // m, end=' ')
	c = c % m


(n, m) = map(int, input().split())
l = [int(x) for x in input().split()]
c = []
remaining = m
for i in range(n):
	if l[i] < remaining:
		c.append(0)
		remaining -= l[i]
	elif l[i] == remaining:
		c.append(1)
		remaining = m
	elif l[i] > remaining:
		foo = l[i] - remaining
		c.append(1 + foo // m)
		remaining = m - foo % m
print(*c)


(x, y) = map(int, input().split())
(z, p) = (list(map(int, input().split())), 0)
for i in z:
	p += i
	print(p // y, end=' ')
	p %= y


(x, y) = map(int, input().split())
r = list(map(int, input().split()))
t = 0
k = 0
r1 = 0
for i in range(x):
	r1 = t % y
	t = t + r[i]
	if r[i] >= y - r1:
		print(int((r[i] - y + r1) / y) + 1, end=' ')
	else:
		print('0', end=' ')


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
c_page = 1
t_names = 0
lp = []
for i in l:
	t_names += i
	page = t_names // m + 1
	lp.append(page - c_page)
	if page > c_page:
		c_page = page
print(*lp, sep=' ')


(n, m) = input().split(' ')
n = int(n)
m = int(m)
a = input().split(' ')
rem = 0
for num in a:
	rem += int(num)
	print(str(rem // m), end=' ')
	rem = rem % m


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
sum = 0
cnt = 0
for i in l:
	sum += i
	print(sum // m - (sum - i) // m, end=' ')


(n, m) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
currentpage = m
for i in range(n):
	t = 0
	if currentpage > a[i]:
		print(0, end=' ')
		currentpage = currentpage - a[i]
	elif currentpage == a[i]:
		print(1, end=' ')
		currentpage = m
	else:
		if currentpage < m:
			t = t + 1
			a[i] = a[i] - currentpage
		j = a[i] // m
		t = t + j
		currentpage = m * (j + 1) - a[i]
		print(t, end=' ')


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
turned = 0
sum = 0
for x in l:
	sum += x
	if sum >= m:
		turned = sum // m
		sum = sum - turned * m
	else:
		turned = 0
	print(turned, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
x = a[0]
y = 0
for i in range(n - 1):
	print(x // m - y // m, end=' ')
	x += a[i + 1]
	y += a[i]
print(x // m - y // m, end=' ')


number = input()
(days, pages) = number.split()
days = int(days)
pages = int(pages)
number1 = input()
listnum = number1.split()
numlist = []
for i in range(len(listnum)):
	numlist.append(int(listnum[i]))
modulo = 0
for i in range(days):
	numlist[i] += modulo
	total = numlist[i] // pages
	modulo = numlist[i] % pages
	print(total, end=' ')


(n, m) = map(int, input().split())
a = map(int, input().split())
sum = sum2 = 0
for x in a:
	sum += x
	print(sum // m - sum2, end=' ')
	sum2 = sum // m


(n, m) = map(int, input().split())
a = [int(k) for k in input().split()]
res = []
z = 0
t = 0
for i in range(n):
	if a[i] >= z:
		t = (a[i] - z) // m
		if z != 0:
			res.append(t + 1)
		else:
			res.append(t)
		a[i] -= z
		if a[i] % m == 0:
			z = 0
		else:
			z = m - a[i] % m
	else:
		z -= a[i]
		res.append(0)
print(*res)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
cur = 0
t = ['0'] * n
for i in range(n):
	cur += a[i]
	if cur >= m:
		t[i] = str(cur // m)
		cur %= m
print(' '.join(t))


(n, m) = map(int, input().split())
a = [int(s) for s in input().split()]
r = 0
ost = 0
b = []
for i in range(n):
	ost += a[i]
	b.append(str(ost // m))
	ost %= m
print(' '.join(b))


(n, k) = map(int, input().split())
d = list(map(int, input().split()))
c = 0
for i in d:
	print((i + c) // k, end=' ')
	c = (i + c) % k


n = str(input())
n = n.split()
limit = int(n[1])
names = str(input())
names = names.split()
count = 0
pages_list = []
if int(n[0]) >= 1 and int(n[0]) <= 200000:
	if limit >= 1 and limit <= 1000000000:
		for i in names:
			page = 0
			if int(i) < limit:
				count += int(i)
			elif int(i) >= limit:
				count += int(i)
				if count % limit == 0:
					page += count // limit
					count = 0
				else:
					gap = count % limit
					page += (count - gap) // limit
					count = gap
			if count >= limit and int(i) < limit:
				count = count - limit
				page += 1
				while count > limit:
					page += 1
					count = count - limit
			pages_list.append(page)
print(*pages_list, sep=' ')


import math
(n, m) = map(int, input().split())
A = list(map(int, input().split()))
score = [A[0]] * n
for i in range(1, n):
	score[i] = score[i - 1] + A[i]
for i in range(n):
	score[i] = score[i] // m
score = [0] + score
for i in range(1, n + 1):
	print(score[i] - score[i - 1], end=' ')


(n, m) = map(int, input().split())
an = list(map(int, input().split()))
days = []
temp = 0
for i in an:
	temp += i
	days.append(str(temp // m))
	temp %= m
print(' '.join(days))


inp1 = input()
pydg = inp1.split(' ', 2)
ndays = int(pydg[0])
npage = int(pydg[1])
inp2 = input()
pydg2 = list(map(int, inp2.split()))
totalflip = 0
totalnames = 0
for i in range(ndays):
	totalnames += pydg2[i]
	flip = totalnames // npage - totalflip
	totalflip += flip
	print(flip, end=' ')


from math import ceil
(n, m) = input().split()
n = int(n)
m = int(m)
a = input().split()
a = list(map(int, a))
c = m
for i in range(n):
	if c > a[i]:
		c = c - a[i]
		print(0, end=' ')
	elif c == a[i]:
		c = c - a[i] + m
		print(1, end=' ')
	elif c < a[i]:
		p = ceil((a[i] - c) / m)
		c = c + p * m - a[i]
		if c == 0:
			c = c + m
			print(p + 1, end=' ')
		else:
			print(p, end=' ')


(n, m) = map(int, input().split())
v = list(map(int, input().split()))
x = 0
for i in range(n):
	x += v[i]
	print(x // m, end=' ')
	x %= m


inp = input()
spl = inp.split()
x = int(spl[0])
raw = input()
namesperday = raw.split()
maxi = int(spl[1])
current = 0
array = []
result = ''
for i in range(x):
	current = current + int(namesperday[i])
	f = int(current / maxi)
	array.append(f)
	current = current - maxi * f
	result = result + str(array[i])
	if i != x - 1:
		result = result + ' '
print(result)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
x = 0
t = []
for y in a:
	x += y
	t.append(x // m)
	x %= m
print(*t)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
k = 0
for day in a:
	print((k + day) // m, end=' ')
	k = (day + k) % m


from math import ceil
(n, m) = map(int, input().split())
l = [*map(int, input().split())]
Stor = m
Ans = []
for i in range(n):
	if l[i] >= Stor:
		a = 1
		a += (l[i] - Stor) // m
		Stor = m - (l[i] - Stor) % m
		Ans.append(a)
	else:
		Ans.append(0)
		Stor -= l[i]
print(*Ans)


(n, m) = [int(i) for i in input().split(' ')]
l = [int(i) for i in input().split(' ')]
r = [0] * n
r[0] = l[0]
for i in range(1, n):
	r[i] = l[i] + r[i - 1]
cur = 0
for i in range(n):
	print(r[i] // m - cur // m, end=' ')
	cur = r[i]


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
pref = 0
page = 0
for i in l:
	pref += i
	temp = pref // m
	print(temp - page, end=' ')
	page = temp


(n, m) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
c = 0
d = 0
e = m
f = 0
for i in range(n):
	f = a[i]
	c = 0
	while f:
		if f < e:
			e = e - f
			print(c + 0, end=' ')
			break
		elif f == e:
			print(c + 1, end=' ')
			e = m
			break
		elif e == m:
			c = c + f // e
			e = m - f % e
			print(c, end=' ')
			break
		else:
			f = f - e
			e = m
			c = c + 1


(a, b) = map(int, input().split())
x = list(map(int, input().split()))
for i in range(len(x) - 1):
	x[i + 1] += x[i] % b
	print(x[i] // b)
print(x[-1] // b)


import math
import sys
FILE_IO = False
if FILE_IO:
	input_stream = open('input_test.txt')
	sys.stdout = open('current_output.txt', 'w')
else:
	input_stream = sys.stdin
(n, m) = map(int, input_stream.readline().split())
pages = list(map(int, input_stream.readline().split()))
sums = []
sums.append(pages[0])
for index in range(1, len(pages)):
	result = sums[index - 1] + pages[index]
	sums.append(result)
result = []
current_elem_div = None
for ind in range(0, len(sums)):
	elem = sums[ind]
	prev_elem_div = current_elem_div
	current_elem_div = math.floor(elem / m)
	if prev_elem_div is None:
		result = current_elem_div
	else:
		result = current_elem_div - prev_elem_div
	print(result, end=' ')


str = input()
(n, m) = str.split()
n = int(n)
m = int(m)
sum = 0
flag = 0
start = 0
str = input()
for i in str.split():
	i = int(i)
	start = flag
	sum += i
	flag = int(sum / m)
	print(flag - start)


(numDays, m) = map(int, input().split())
a = list(map(int, input().split()))
t = []
numOnPage = 0
for i in range(numDays):
	pages = (numOnPage + a[i]) // m
	t.append(pages)
	numOnPage = (numOnPage + a[i]) % m
print(' '.join(map(str, t)))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
ostatok = m
for i in range(n):
	if ostatok - a[i] <= 0:
		if ostatok > 0:
			print((a[i] - ostatok) // m + 1, end=' ')
		else:
			print(a[i] // m, end=' ')
		ostatok = m - (a[i] - ostatok) % m
	else:
		print(0, end=' ')
		ostatok -= a[i]


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
tmp = 0
arr1 = []
for i in range(n):
	tmp += arr[i]
	arr1.append(str(tmp // m))
	tmp %= m
print(' '.join(arr1))


(N, M) = map(int, input().split())
L = list(map(int, input().split()))
prev = 0
for i in range(N):
	prev = prev + L[i]
	print(int(prev / M))
	prev = prev % M


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
for i in a:
	c = c + i
	if c >= m:
		print(c // m, end=' ')
		c = c % m
	else:
		print(0, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
left = m
for x in a:
	turn = 0
	if x < left:
		left -= x
	else:
		x -= left
		turn = 1 + x // m
		left = m - x % m
	print(turn, end=' ')
print()


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
p = 0
for i in range(n):
	count = 0
	p += l[i]
	if p >= m:
		r = int(p / m)
		p = p - m * r
		count += r
		print(count, end=' ')
	else:
		print('0', end=' ')


def test_1():
	import math
	from collections import Counter
	(n, m) = list(map(int, input().split(' ')))
	data_1 = list(map(int, input().split(' ')))
	a = 0
	for i in range(n):
		a += data_1[i]
		b = a // m
		print(b)
		a = a % m
test_1()


a = input()
b = input()
a = a.split(' ')
b = b.split(' ')
for i in range(len(a)):
	a[i] = int(a[i])
for i in range(len(b)):
	b[i] = int(b[i])
c = 0
for i in range(a[0]):
	c += b[i]
	print(c // a[1])
	c = c % a[1]


(n, m) = map(int, input().split())
a = [int(x) for x in input().split()]
pages = 0
for i in a:
	pages += i
	print(pages // m, end=' ')
	if pages >= m:
		pages %= m


data = input().split(' ')
n_days = int(data[0])
max_name_perpage = int(data[1])
n_names = []
data = input().split(' ')
for i in data:
	n_names.append(int(i))
total_names = 0
total_days = 0
total_turn = 0
for i in n_names:
	total_days += 1
	total_names += i
	cur = int(total_names / max_name_perpage) - total_turn
	total_turn += cur
	if total_days == n_days:
		print(cur, end='')
	else:
		print(cur, end=' ')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, m) = LI()
	a = LI()
	r = []
	t = 0
	s = 0
	for c in a:
		s += c
		p = s // m
		r.append(p - t)
		t = p
	return ' '.join(map(str, r))
print(main())


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
cnt = 0
for day in range(n):
	cnt += a[day]
	print(cnt // m, end=' ')
	cnt %= m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
b = [0] * n
j = 0
flag = 0
d = 0
for i in range(n):
	s += a[i]
	if s < m:
		b[j] = 0
		j += 1
	else:
		b[j] = s // m
		j += 1
		s = s % m
for i in b:
	print(i, end=' ')


nm = input().split()
n = int(nm[0])
m = int(nm[1])
a = list(map(int, input().split()))
sum = 0
for i in range(n):
	sum += a[i]
	print(sum // m, end=' ')
	if sum // m != 0:
		sum = sum % m


(a, b) = map(int, input().split())
c = [int(i) for i in input().split()]
x = 0
day = list()
for i in range(a):
	x += c[i]
	if x >= b:
		day.append(str(x // b))
		x = x % b
	else:
		day.append('0')
print(' '.join(day))


string = input().split(' ')
n = int(string[0])
m = int(string[1])
names = input().split(' ')
currentTotal = 0
turnedPages = 0
string = ''
for num in names:
	currentTotal += int(num)
	string += str(currentTotal // m - turnedPages) + ' '
	turnedPages = currentTotal // m
print(string[:-1])


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
(n, m) = get_int_list()
lst = get_int_list()
ans = [0] * n
res = 0
for i in range(n):
	ans[i] = (res + lst[i]) // m
	res = (res + lst[i]) % m
print(*ans)


(n, m) = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
c = 0
res = []
for x in a:
	res.append((c + x) // m - c // m)
	c += x
print(' '.join([str(x) for x in res]))


(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
res = [0] * n
cur = 0
prev = 0
for (i, x) in enumerate(a):
	cur += x
	nextm = (prev // m + 1) * m
	if cur >= nextm:
		res[i] += 1
		res[i] += (cur - nextm) // m
	prev = cur
print(' '.join(map(str, res)))


from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import sys
sys.setrecursionlimit(10 ** 9)
(n, m) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
z = 0
prev = 0
for i in range(n):
	z += l[i]
	print(z // m - prev, end=' ')
	prev = z // m


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [0] * n
summ = [0] * n
ans = [0] * n
for i in range(n):
	summ[i] = a[i] + summ[i - 1]
for i in range(n):
	if summ[i] < m:
		b[i] = 0
	else:
		b[i] = summ[i] // m * m
for i in range(n):
	if i == 0:
		ans[i] = b[i] // m
	elif b[i] == 0:
		ans[i] = 0
	else:
		ans[i] = (b[i] - b[i - 1]) // m
print(*ans)


(n, m) = map(int, input().split())
l = [int(x) for x in input().split()]
g = []
tot = 0
for i in range(n):
	ans = 0
	tot += l[i]
	if tot >= m:
		ans += tot // m
		tot = tot % m
	g.append(ans)
print(*g)


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
ansarr = []
sumx = 0
sumy = 0
for i in range(n):
	sumx += arr[i]
	ansarr.append(sumx // m - sumy)
	sumy += ansarr[-1]
print(*ansarr)


def death_note():
	first_input = input().split()
	num_days = int(first_input[0])
	max_names = int(first_input[1])
	e = 0
	second_input = input().split()
	ans = []
	for i in range(num_days):
		ans.append(int(second_input[i]))
	for i in range(num_days):
		ans[i] = ans[i] + e
		d = ans[i] // max_names
		print(d)
		e = ans[i] % max_names
death_note()


(n, m) = map(int, input().split(' '))
a = map(int, input().split(' '))
buf = 0
for el in a:
	buf += el
	s = buf // m
	if buf >= m:
		buf -= s * m
	print(s, end=' ')
	s = 0


(n, m) = map(int, input().split())
d = []
s = [int(i) for i in input().split()]
r = 0
c = 0
for i in range(n):
	r += s[i]
	if r >= m:
		c += r // m
		r = r % m
	d.append(c)
	c = 0
print(*d)


(a, b) = map(int, input().split())
lst = list(map(int, input().split()))
Sum = 0
res = 0
for i in range(0, a):
	Sum += lst[i]
	res = Sum // b
	print(str(res) + ' ', end='')
	Sum %= b


from operator import itemgetter
(n, m) = map(int, input().split())
ai = list(map(int, input().split()))
num = 0
for i in range(n):
	num += ai[i]
	print(num // m, end=' ')
	num %= m


count = 0
(n, m) = input().split(' ')
n = int(n)
m = int(m)
tp = [0] * n
arr = input().split(' ')
for i in range(n):
	arr[i] = int(arr[i])
	count += arr[i]
	if count >= m:
		tp[i] = int(count / m)
		count = count % m
print(*tp, sep=' ')


(a, b) = map(int, input().strip().split()[:2])
s = list(map(int, input().strip().split()[:a]))
name = 0
for x in range(len(s)):
	if s[x] + name < b:
		name += s[x]
		s1 = 0
	elif s[x] + name >= b:
		name += s[x]
		s1 = name // b
		name = name % b
	print(s1, end=' ')


import math as mt
(n, m) = map(int, input().split())
(*l,) = map(int, input().split())
ans = []
x = 0
for i in l:
	x += i
	ans.append(x // m)
	x %= m
print(*ans)


(a, b) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()][:a]
l1 = []
s = 0
for i in l:
	s += i
	d = s // b
	if d >= 1:
		p = s // b
		s = s % b
		if s % b == 0:
			s = 0
	else:
		p = 0
	l1.append(str(p))
print(' '.join(l1))


try:
	while True:
		(n, m) = list(map(int, input().split()))
		arr = list(map(int, input().split()))
		for i in range(len(arr)):
			if i == 0:
				continue
			else:
				arr[i] = arr[i] + arr[i - 1]
		ans = [item // m for item in arr]
		for i in range(len(ans)):
			if i == 0:
				print(ans[0], end='')
			else:
				print(' ', end='')
				print(ans[i] - ans[i - 1], end='')
		print('')
except Exception as e:
	pass


(n, m) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
tmp = 0
for i in a:
	tmp += i
	print(tmp // m, end=' ')
	tmp %= m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in range(len(a)):
	cnt += a[i]
	print(cnt // m, end=' ')
	cnt = cnt % m


x = input()
xx = x.split()
n = int(xx[0])
m = int(xx[1])
x = input()
a = x.split()
s = []
q = 0
for i in a:
	t = 0
	q += int(i)
	if q >= m:
		f = q // m
		t += f
		q -= f * m
	s.append(t)
for i in s:
	print(i, end=' ')


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(1, len(a)):
	a[i] += a[i - 1]
b = []
for i in a:
	p = i // m
	p += 1
	b.append(p)
ans = [b[0] - 1]
for i in range(1, len(b)):
	ans.append(b[i] - b[i - 1])
print(' '.join(list(map(str, ans))))


import math
in1 = input().split()
(n, m) = (int(in1[0]), int(in1[1]))
in2 = input().split()
(bef, aft) = (0, 0)
ret = []
for i in range(n):
	nd = int(in2[i])
	aft = bef + nd
	ret.append(aft // m - bef // m)
	bef = aft
print(' '.join(map(lambda x: str(x), ret)))


def main():
	(n, m) = map(int, input().split())
	data = list(map(int, input().split()))
	extra = 0
	for i in range(n):
		extra = int(extra + data[i])
		if i == n - 1:
			print(int(extra / m))
		else:
			print(int(extra / m), end=' ')
		extra = extra % m
main()


(n, m) = map(int, input().split())
a = map(int, input().split())
d = 0
for i in a:
	c = d != 0
	i -= d
	c += i // m
	i -= i // m * m
	d = m - i
	print(c, end=' ')


(n, m) = map(int, input().split())
remain = 0
aa = list(map(int, input().split()))
res = list()
for i in range(n):
	res.append((aa[i] + remain) // m)
	remain = (aa[i] + remain) % m
print(' '.join(map(str, res)))


(n, m) = (int(z) for z in input().split())
massiv = [int(z) for z in input().split()]
ostatok = 0
otvet = []
for i in range(n):
	now = ostatok
	now += massiv[i]
	otvet += [now // m]
	ostatok = now % m
for i in otvet:
	print(i, end=' ')


(n, m) = [int(a) for a in input().split()]
a = [int(a) for a in input().split()]
sum1 = 0
res = 0
for i in range(n):
	sum1 += a[i]
	res = int(sum1 / m)
	print(res, end=' ')
	sum1 %= m


from sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
(n, m) = rint()
a = list(rint())
mm = m
ans = []
for i in range(n):
	cnt = 0
	while a[i] > 0:
		if a[i] >= mm:
			if mm != m:
				a[i] -= mm
				cnt += 1
				mm = m
			else:
				x = a[i] // mm
				y = a[i] % mm
				cnt += x
				a[i] -= x * mm
				mm = m
		else:
			mm -= a[i]
			a[i] = 0
	ans.append(cnt)
print(*ans)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
b = []
c = 0
for i in range(n):
	t = (a[i] + c) // m
	c = (c + a[i]) % m
	b.append(t)
print(*b)


(n, m) = map(int, input().split())
arr = list(map(int, input().split()))
brr = []
brr.append(arr[0] // m)
if arr[0] // m == 0:
	page = arr[0]
else:
	page = arr[0] % m
for i in range(1, n):
	if page == 0:
		page += arr[i]
		brr.append(arr[i] // m)
		page = page % m
	else:
		x = m - page
		page += arr[i]
		if page < m:
			brr.append(arr[i] // m)
		else:
			brr.append((arr[i] - x) // m + 1)
		page = page % m
print(*brr)


import math
(n, m) = map(int, input().split())
l = list(map(int, input().split()))
k = 0
for i in range(n):
	j = (l[i] - m + k) // m
	print(1 + j, end=' ')
	k += l[i]
	k %= m


(n, m) = input().split()
n = int(n)
m = int(m)
s = 0
words = input().split()
words = [int(word) for word in words]
for x in words:
	print((x + s) // m)
	s = (x + s) % m


a1 = list(map(int, input().split(' ')[:2]))
a2 = list(map(int, input().split(' ')[:a1[0]]))
rest = 0
for i in range(a1[0]):
	stran = 0
	if rest > a2[i]:
		print(0)
		rest -= a2[i]
	elif rest == a2[i] and rest != 0:
		print(1)
		rest = 0
	else:
		if rest != 0:
			a2[i] -= rest
			stran += 1
		tmp = a2[i] // a1[1]
		rest = -a2[i] + (1 + tmp) * a1[1]
		stran += tmp
		print(stran)


(n, m) = map(int, input().split())
a = map(int, input().split())
sol = []
cur = 0
for x in a:
	n_turns = 0
	if cur + x < m:
		cur += x
	else:
		n_turns += 1
		x -= m - cur
		n_turns += x // m
		cur = x % m
	sol.append(str(n_turns))
print(' '.join(sol))


(n, k) = map(int, input().split())
mat = list(map(int, input().split()))
rem = 0
for i in mat:
	step = i + rem
	print(step // k, end=' ')
	rem = step % k


(x, y) = input().split()

def deathnote(x, y):
	nextpage = []
	eliminate = 0
	eliminating = input().split()
	for i in eliminating:
		eliminate += int(i)
		if eliminate >= int(y):
			pages = int(eliminate / int(y))
			nextpage.append(pages)
			eliminate -= int(y) * pages
		else:
			nextpage.append(0)
	return nextpage
print(*deathnote(int(x), int(y)))


import math
(n, m) = map(int, input().split())
a = list(map(int, input().split()))
r = 0
b = [0] * n
for i in range(n):
	b[i] = (r + a[i]) // m
	r = (r + a[i]) % m
s = ''
for i in range(n):
	s += str(b[i])
	s += ' '
print(s)


(n, m) = tuple(map(int, input().split()))
A = list(map(int, input().split()))
count = 0
for i in range(n):
	count += A[i]
	print(count // m, end=' ')
	count = count % m


(pages, maxKill) = map(int, input().split())
a = map(int, input().split())
sum = sum2 = 0
for x in a:
	sum += x
	print(sum // maxKill - sum2, end=' ')
	sum2 = sum // maxKill


(nd, np) = map(int, input().split())
ls = list(map(int, input().split()))
pls = []
aga = 0
afa = 0
c = 0
for i in range(nd):
	c = 0
	if aga and ls[i] >= np - aga:
		c += 1
		ls[i] -= np - aga
		afa = 0
	if afa and afa > ls[i]:
		afa = afa - ls[i]
		pls.append(0)
		continue
	elif afa:
		c += 1
		ls[i] -= afa
	c += ls[i] // np
	ls[i] = ls[i] % np
	pls.append(c)
	if ls[i] // np:
		aga = ls[i] % np
	else:
		afa = np - ls[i]
print(*pls)


(n, m) = map(int, input().split())
a = [int(a) for a in input().split()]
rem = 0
for i in a:
	print((i + rem) // m, end=' ')
	rem = (i + rem) % m


(n, m) = map(int, input().split())
u = list(map(int, input().split()))
d = 0
ans = 0
for i in range(n):
	d += u[i]
	print(d // m, end=' ')
	d = d % m


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
q = m
x = 0
p = 0
w = 0
while x < n:
	nw = a[x]
	if m < q:
		nw = nw - m
		m = q
		p = 1
	w = nw // m
	m = (w + 1) * m - nw
	w = w + p
	if m == 0:
		m = q
		w = w + 1
	print(w, end=' ')
	x = x + 1
	p = 0


(n, m) = map(int, input().split(' '))
rez = [0] * n
q = 0
a = [0] * n
a = list(map(int, input().split(' ')))
for i in range(0, n):
	q += a[i]
	rez[i] = q // m
	q %= m
for i in range(0, n):
	print(rez[i])


(n, m) = map(int, input().split())
names = [int(x) for x in input().split()]
cur = 0
for i in range(n):
	cnt = 0
	cur += names[i]
	if cur >= m:
		cnt += cur // m
		cur = cur % m
	print(cnt, end=' ')


(n, d) = map(int, input().split())
A = list(map(int, input().split()))
le = d
an = []
for a in A:
	if a < le:
		le -= a
		an += [0]
	else:
		add = 1
		a -= le
		if a % d == 0:
			add += a // d
			le = d
		else:
			add += a // d
			le = d - a % d
		an += [add]
for a in an:
	print(a, end=' ')


(n, m) = [int(i) for i in input().split()]
s = [int(i) for i in input().split()]
x = 0
for i in range(len(s)):
	print((x + s[i]) // m, end=' ')
	x = (x + s[i]) % m


TN = 1

def solution():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = []
	cur = 0
	ln = 0
	sm = 0
	for i in range(n):
		ln += a[i]
		ans.append(ln // m - sm)
		sm += ans[i]
	print(*ans)
while TN != 0:
	solution()
	TN -= 1


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
for d in range(n):
	c += a[d]
	print(c // m, end=' ')
	c %= m


(days, page_capacity) = input().split(' ')
days = int(days)
page_capacity = int(page_capacity)
num_of_names_per_page = input().split(' ')
counter = 0
for num in num_of_names_per_page:
	swap = 0
	counter += int(num)
	if counter >= page_capacity:
		swap = int(counter / page_capacity)
		counter -= swap * page_capacity
	print(swap, end=' ')


(n, m) = map(int, input().split())
a = [int(i) for i in input().split()]
g = m
res = []
t = 0
for i in range(n):
	if g <= a[i]:
		a[i] -= g
		t += 1
		g = m
		if a[i] != 0:
			if a[i] >= m:
				t += a[i] // m
				g = m - a[i] % m
			else:
				g = m - a[i]
	else:
		g -= a[i]
	res += [t]
	t = 0
for i in range(n):
	print(res[i], end=' ')