Another Codeforces Round has just finished! It has gathered $n$ participants, and according to the results, the expected rating change of participant $i$ is $a_i$. These rating changes are perfectly balanced — their sum is equal to $0$.

Unfortunately, due to minor technical glitches, the round is declared semi-rated. It means that all rating changes must be divided by two.

There are two conditions though:   For each participant $i$, their modified rating change $b_i$ must be integer, and as close to $\frac{a_i}{2}$ as possible. It means that either $b_i = \lfloor \frac{a_i}{2} \rfloor$ or $b_i = \lceil \frac{a_i}{2} \rceil$. In particular, if $a_i$ is even, $b_i = \frac{a_i}{2}$. Here $\lfloor x \rfloor$ denotes rounding down to the largest integer not greater than $x$, and $\lceil x \rceil$ denotes rounding up to the smallest integer not smaller than $x$.  The modified rating changes must be perfectly balanced — their sum must be equal to $0$. 

Can you help with that?


-----Input-----

The first line contains a single integer $n$ ($2 \le n \le 13\,845$), denoting the number of participants.

Each of the next $n$ lines contains a single integer $a_i$ ($-336 \le a_i \le 1164$), denoting the rating change of the $i$-th participant.

The sum of all $a_i$ is equal to $0$.


-----Output-----

Output $n$ integers $b_i$, each denoting the modified rating change of the $i$-th participant in order of input.

For any $i$, it must be true that either $b_i = \lfloor \frac{a_i}{2} \rfloor$ or $b_i = \lceil \frac{a_i}{2} \rceil$. The sum of all $b_i$ must be equal to $0$.

If there are multiple solutions, print any. We can show that a solution exists for any valid input.


-----Examples-----
Input
3
10
-5
-5

Output
5
-2
-3

Input
7
-7
-29
0
3
24
-29
38

Output
-3
-15
0
2
12
-15
19



-----Note-----

In the first example, $b_1 = 5$, $b_2 = -3$ and $b_3 = -2$ is another correct solution.

In the second example there are $6$ possible solutions, one of them is shown in the example output.

Difficulty: EASY
Tags: Mathematics

Implementation

Starter code:

Solutions:
def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
n = rint()
d = True
for _ in range(n):
	ai = rint()
	if ai % 2 == 0:
		print(ai // 2)
		continue
	if d:
		print(ai // 2)
	else:
		print((ai + 1) // 2)
	d = not d


n = int(input())
a = []
cnt = 0
for i in range(n):
	a.append(int(input()))
	cnt += a[i] % 2
p = 0
for i in range(n):
	if a[i] % 2 == 0:
		print(a[i] // 2)
	elif a[i] % 2 == 1 and p * 2 < cnt:
		print(a[i] // 2 + 1)
		p += 1
	else:
		print(a[i] // 2)


n = int(input())
higher = True
for _ in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif higher:
		print(a // 2 + 1)
		higher = not higher
	else:
		print(a // 2)
		higher = not higher


from math import ceil, floor
n = int(input())
ori = []
fin = []
s = 0
lower = False
for i in range(n):
	e = int(input())
	ori.append(e)
	if e >= 0:
		if e % 2 == 0:
			to_add = e // 2
			s += to_add
			fin.append(to_add)
		else:
			if lower:
				to_add = floor(e / 2)
				fin.append(to_add)
				s += to_add
			else:
				to_add = ceil(e / 2)
				fin.append(to_add)
				s += to_add
			lower = not lower
	else:
		fin.append(e)
index = 0
lower = False
for i in range(n):
	e = fin[i]
	if e < 0:
		if e % 2 == 0:
			to_add = e // 2
			fin[i] = to_add
			s += to_add
		else:
			index = i
			if lower:
				to_add = floor(e / 2)
				fin[i] = to_add
				s += to_add
			else:
				to_add = ceil(e / 2)
				fin[i] = to_add
				s += to_add
			lower = not lower
fin[index] -= s
for i in fin:
	print(i)


n = int(input())
l = [0] * n
for i in range(n):
	l[i] = int(input())
one = True
for i in range(n):
	x = l[i]
	if x % 2:
		if one:
			x += 1
		else:
			x -= 1
		one = not one
	l[i] = x // 2
for x in l:
	print(x)


n = int(input())
st = 1
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
		continue
	if a == 0:
		print(0)
	if a < 0:
		if st == 1:
			print(a // 2)
			st = 0
		else:
			print(a // 2 + 1)
			st = 1
	if a > 0:
		if st == 1:
			print(a // 2)
			st = 0
		else:
			print(a // 2 + 1)
			st = 1


import math
s = 0
y = int(input())
a = []
for i in range(y):
	x = int(input())
	if x % 2 == 1:
		s += 1
	a.append(x)
c = 0
for i in a:
	if i % 2 == 0:
		print(i // 2)
	elif c < s // 2:
		print(i // 2)
		c += 1
	else:
		print(math.ceil(i / 2))


n = int(input())
A = []
for i in range(n):
	A.append(int(input()))
flg = 1
for a in A:
	if a % 2 == 0:
		print(a // 2)
	else:
		print((a + flg) // 2)
		flg = -flg


n = int(input())
l = [int(input()) for i in range(n)]
c = 0
for j in l:
	if j % 2:
		c = c + 1
c = c // 2
for i in range(n):
	if l[i] % 2 == 0:
		l[i] = l[i] // 2
	elif l[i] % 2 and c > 0:
		l[i] = l[i] // 2
		c = c - 1
	elif l[i] % 2 and c == 0:
		l[i] = l[i] // 2 + 1
for i in l:
	print(i)


arr = []
ans = []
flag = 0
from math import floor
for _ in range(int(input())):
	arr.append(int(input()))
for i in arr:
	if i % 2 == 0:
		ans.append(floor(i / 2))
	elif flag == 0:
		ans.append(floor(i / 2) + 1)
		flag = 1
	else:
		ans.append(floor(i / 2))
		flag = 0
for i in ans:
	print(i)


n = int(input())
t = 1
for _ in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif t:
		print(a // 2 + 1)
		t = 0
	else:
		print(a // 2)
		t = 1


n = int(input())
a = [0 for i in range(n)]
count = 0
for i in range(n):
	x = int(input())
	a[i] = x
	if a[i] % 2 == 1:
		count += 1
b = [0 for i in range(n)]
temp = 0
for i in range(n):
	if a[i] % 2 == 0:
		b[i] = a[i] // 2
	elif temp < count // 2:
		b[i] = (a[i] + 1) // 2
		temp += 1
	else:
		b[i] = a[i] // 2
for i in range(n):
	print(b[i])


def solve(a, n):
	b = [i // 2 for i in a]
	diff = -sum(b)
	for i in range(len(a)):
		if diff <= 0:
			break
		if a[i] % 2 == 1:
			b[i] += 1
			diff -= 1
	for i in b:
		print(i)

def main():
	n = int(input())
	a = []
	for _ in range(n):
		a.append(int(input()))
	solve(a, n)
main()


from math import ceil

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

def ii():
	return int(input())
n = ii()
a = [0] * n
na = [0] * n
for i in range(n):
	a[i] = int(input())
	na[i] = ceil(a[i] // 2)
ex = sum(na)
c = abs(ex)
for i in range(n):
	if ex < 0 and c > 0 and (abs(a[i]) % 2 == 1):
		na[i] += 1
		c -= 1
	elif ex > 0 and c > 0 and (abs(a[i]) % 2 == 1):
		na[i] -= 1
		c -= 1
for i in range(n):
	print(na[i])


def solver():
	n = int(input())
	s = []
	ans = []
	for i in range(n):
		k = int(input())
		s.append(k)
		ans.append(k // 2)
	ret = sum(ans)
	for i in range(n):
		if ret < 0 and s[i] % 2 == 1:
			ans[i] += 1
			ret += 1
	print(' '.join(map(str, ans)))

def main():
	while 1:
		try:
			solver()
		except EOFError:
			break
main()


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
odd = 0
for _ in range(Int()):
	n = Int()
	if not n % 2:
		print(n // 2)
	else:
		odd += 1
		if odd % 2:
			print(ceil(n / 2))
		else:
			print(n // 2)


import math
array = []
amount = int(input())
for i in range(amount):
	array.append(int(input()))
balance = 0
for num in array:
	if num % 2:
		if balance == 0:
			if num > 0:
				print(math.floor(num / 2))
			else:
				print(math.floor(num / 2))
			balance += 1
		else:
			if num > 0:
				print(math.ceil(num / 2))
			else:
				print(math.ceil(num / 2))
			balance -= 1
	else:
		print(num // 2)


import sys
import math
Input = sys.stdin.readline
tmp = 1
for i in range(int(input())):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	else:
		if tmp == -1:
			print(x // 2)
		else:
			print(math.ceil(x / 2))
		tmp *= -1


n = int(input())
b = []
c = []
d = 0
odd = 0
for i in range(n):
	b.append(int(input()))
	if b[i] % 2 == 0:
		b[i] = b[i] // 2
		d += b[i]
	else:
		b[i] = b[i] // 2
		c.append(i)
		odd += b[i]
for i in c:
	if odd + d != 0:
		b[i] += 1
		odd += 1
for i in range(n):
	print(b[i])


n = int(input())
a = []
ji = 0
for i in range(n):
	temp = int(input())
	if temp % 2 == 1:
		ji += 1
	a.append(temp)
ji = ji // 2
for num in a:
	if num % 2 == 0:
		print(num // 2)
	elif ji > 0:
		ji -= 1
		print(int(num / 2 + 0.5))
	else:
		print(int(num / 2 - 0.5))


import sys
input = lambda : sys.stdin.readline().rstrip()
N = int(input())
d = 0
for _ in range(N):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		print((a + d) // 2)
		d ^= 1


n = int(input())
flag = False
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif flag is False:
		print(x // 2)
		flag = True
	else:
		print(x // 2 + 1)
		flag = False


from math import floor, ceil
input_list = []
number_of_inputs = int(input())
for i in range(number_of_inputs):
	input_list.append(int(input()))
output_list = []
upper_flag = False
lower_flag = False
for each_number in input_list:
	if each_number % 2 == 0:
		output_list.append(int(each_number / 2))
	elif upper_flag == False:
		output_list.append(int(ceil(each_number / 2)))
		upper_flag = True
		lower_flag = False
	elif lower_flag == False:
		output_list.append(int(floor(each_number / 2)))
		lower_flag = True
		upper_flag = False
for each_number in output_list:
	print(each_number)


import math
n = int(input())
a = []
(co, ce) = (0, 0)
odd = [0] * n
even = [0] * n
for i in range(n):
	ai = int(input())
	a.append(ai)
	if ai % 2 == 0:
		ce += 1
	else:
		co += 1
coo = 1
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] // 2
	elif a[i] % 2 == 1 and coo % 2 == 0:
		a[i] = math.ceil(a[i] / float(2))
		coo += 1
	elif a[i] % 2 == 1 and coo % 2 == 1:
		a[i] = math.floor(a[i] / float(2))
		coo += 1
for i in range(n):
	print(int(a[i]))


from math import *
from sys import *
from heapq import *
from collections import defaultdict
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def graph_as_tree_1_root():
	n = int(input())
	dict = defaultdict(list)
	for _ in range(n - 1):
		(x, y) = list(map(int, input().split()))
		dict[x].append(y)
		dict[y].append(x)
	tree = [[1]]
	temp = [1]
	vall = 0
	seen = set([i for i in range(2, n + 1)])
	lol = []
	while len(seen) > 0:
		lol = list(seen)
		tt = []
		for x in temp:
			aa = []
			for val in dict[x]:
				if val in seen:
					aa += [val]
					seen.remove(val)
			dict[x] = aa
			tt += aa
		tree.append(tt)
		temp = tt
		vall += 1
	for x in lol:
		dict[x] = []
	print(tree, dict)

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a *= a
		b >>= 1
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def alldivisors(n):
	list = []
	arr = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				arr += [i]
			else:
				arr += [i]
				list.append(n // i)
	arr += list[::-1]
	return arr

def primefactorisation(n):
	potentional_p = 3
	itog_list = defaultdict(int)
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			itog_list[n] += 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			itog_list[potentional_p] += 1
		potentional_p += 2
	return itog_list

def main():
	n = int(input())
	a = []
	b = []
	pos = 0
	c = []
	for _ in range(n):
		a.append(int(input()))
	for x in a:
		if x % 2 == 0:
			b.append([x // 2, 0])
		else:
			pos += 1
			b.append([x // 2, 1])
		c.append(x // 2)
	sm = sum(c)
	sm = -1 * sm
	i = 0
	while sm > 0:
		if b[i][1] == 1:
			sm -= 1
			b[i][0] += 1
		i += 1
	for x in b:
		print(x[0])
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
f = 0
for _ in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif f == 0:
		print(int(x // 2) + 1)
		f = 1
	else:
		print(int(x // 2))
		f = 0


from math import *

def arr_inp(n):
	return [int(input()) for i in range(n)]

def print_arr(arr):
	print(*arr, sep='\n')
(n, sign) = (int(input()), 1)
a = arr_inp(n)
for i in range(n):
	if a[i] % 2 != 0:
		if sign:
			a[i] = floor(a[i] / 2)
		else:
			a[i] = ceil(a[i] / 2)
		sign = not sign
	else:
		a[i] = a[i] // 2
print_arr(a)


import math
n = int(input())
a = list(range(n))
s = 0
for i in range(n):
	a[i] = int(input())
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = int(a[i] / 2)
	else:
		if s % 2 == 0:
			a[i] = math.ceil(a[i] / 2)
		else:
			a[i] = math.floor(a[i] / 2)
		s = s + 1
for i in range(n):
	print(a[i])


n = int(input())
inputs = []
for i in range(n):
	inputs.append(int(input()))
c = 0
for i in range(len(inputs)):
	if inputs[i] % 2 == 0:
		inputs[i] = int(inputs[i] / 2)
	else:
		if inputs[i] <= 0:
			inputs[i] = int(inputs[i] / 2) - c % 2
		else:
			inputs[i] = int(inputs[i] / 2) + (c + 1) % 2
		c += 1
for i in range(len(inputs)):
	print(inputs[i])


flag = 0
for i in range(int(input())):
	num = int(input())
	if num % 2:
		flag = 0 if flag else 1
	print(num // 2 if not num % 2 or flag else num // 2 + 1)


import math
n = int(input())
state = 0
for _ in range(n):
	x = int(input())
	if x % 2 == 0:
		r = x // 2
	elif state == 0:
		r = math.ceil(x / 2)
		state = 1
	else:
		r = math.floor(x / 2)
		state = 0
	print(int(r))


import math
n = int(input())
c = 0
for i in range(n):
	b = int(input())
	if b % 2 == 0:
		print(b // 2)
		continue
	elif b % 2 != 0:
		c = c + 1
		if c % 2 == 0:
			print(math.ceil(b / 2))
			continue
		else:
			print(b // 2)


a = 1
for i in range(int(input())):
	n = int(input())
	print((n + a * (n % 2)) // 2)
	a += -1 * a * (n % 2) * 2


import math
n = int(input())
a = []
b = []
for i in range(n):
	k = int(input())
	a.append(k)
flag = 0
for i in a:
	if i % 2 == 0:
		temp = int(i / 2)
		b.append(temp)
	elif flag == 0:
		tem = i / 2
		temp = math.ceil(tem)
		flag = 1
		b.append(temp)
	else:
		tem = i / 2
		temp = math.floor(tem)
		b.append(temp)
		flag = 0
for i in b:
	print(i)


n = int(input())
ceil = False
import math
for _ in range(n):
	nr = int(input())
	if nr % 2 == 0:
		print(nr // 2)
	else:
		ans = math.floor(nr / 2)
		if ceil:
			ans += 1
		ceil = not ceil
		print(ans)


import math
k = 0
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif k % 2 == 0:
		print(math.ceil(n / 2))
		k += 1
	else:
		print(math.floor(n / 2))
		k += 1


f = 0
import math as m
for tc in [0] * int(input()):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif f:
		print(m.floor(n / 2))
		f = 0
	else:
		print(m.ceil(n / 2))
		f = 1


rr = lambda : int(input())
t = rr()
res = [0] * t
bal = 0
for i in range(t):
	a = rr()
	if a % 2 == 0:
		res[i] = a // 2
	elif a < 0:
		if bal == -1:
			res[i] = a // 2 + 1
			bal = 0
		else:
			res[i] = a // 2
			bal -= 1
	elif bal == 1:
		res[i] = a // 2
		bal = 0
	else:
		res[i] = a // 2 + 1
		bal += 1
for i in res:
	print(i)


n = int(input())
c = 0
for i in range(n):
	k = int(input())
	if k % 2 == 0:
		k /= 2
	else:
		if c % 2 == 0:
			k = (k + 1) / 2
		else:
			k = (k - 1) / 2
		c += 1
	print(int(k))


n = int(input())
a = [0] * n
s = 0
b = []
for i in range(n):
	a[i] = int(input())
	if a[i] % 2 == 0:
		a[i] //= 2
		s += a[i]
	else:
		a[i] //= 2
		s += a[i]
		b.append(i)
boo = True if s > 0 else False
s = abs(s)
i = 0
while s > 0:
	if b:
		a[b[i]] += 1
	else:
		a[b[i]] -= 1
	s -= 1
	i += 1
for i in a:
	print(i)


import math

def balanced_rating(n, bi):
	cop = bi.copy()
	sum_neg = 0
	sum_pos = 0
	for i in range(n):
		bi[i] = math.trunc(bi[i] / 2)
		if bi[i] < 0:
			sum_neg += bi[i]
		else:
			sum_pos += bi[i]
	val_range = sum_neg * -1 - sum_pos
	flag = 0
	if val_range < 0:
		for i in range(n):
			if cop[i] < 0 and cop[i] % 2 != 0:
				bi[i] = bi[i] - 1
				flag -= 1
			if flag == val_range:
				break
	elif val_range > 0:
		for i in range(n):
			if cop[i] > 0 and cop[i] % 2 != 0:
				bi[i] = bi[i] + 1
				flag += 1
			if flag == val_range:
				break
	for i in range(n):
		print(bi[i])
n = int(input())
qi = [None] * n
for i in range(n):
	qi[i] = int(input())
bi = list(qi)
balanced_rating(n, bi)


n = int(input())
a = list()
b = list()
for i in range(n):
	a.append(int(input()))
	b.append(a[-1] // 2)
sm = sum(b)
if sm > 0:
	for i in range(n):
		if a[i] < 0:
			b[i] -= 1
			sm -= 1
			if sm == 0:
				break
elif sm < 0:
	for i in range(n):
		if a[i] > 0 and a[i] % 2 != 0:
			b[i] += 1
			sm += 1
			if sm == 0:
				break
		elif a[i] < 0 and a[i] % 2 != 0:
			b[i] += 1
			sm += 1
			if sm == 0:
				break
for i in range(n):
	print(b[i])


from sys import *
input = stdin.readline
n = int(input())
c = 0
for _ in range(n):
	i = int(input())
	if i % 2 == 0:
		print(i // 2)
	elif c == 0:
		print(i // 2)
		c = 1
	else:
		print(i // 2 + 1)
		c = 0


def f(n, m):
	ans = (n + m - 1) // m
	return ans
n = int(input())
A = [0] * n
B = [0] * n
ost = 0
for i in range(n):
	A[i] = int(input())
	if A[i] % 2 == 0:
		B[i] = A[i] // 2
	elif ost == 0:
		B[i] = f(A[i], 2)
		ost += 1
	else:
		B[i] = A[i] // 2
		ost -= 1
for i in range(n):
	print(B[i])


n = int(input())
a = [int(input()) for _ in range(n)]
q1 = 0
for q in a:
	if q % 2 == 0:
		print(q // 2)
	else:
		print((q - 1) // 2 + q1)
		q1 = 1 - q1


n = int(input())
k = 1
for i in range(n):
	a = int(input())
	b = a // 2
	if a % 2 == 1:
		if k == 1:
			b += 1
		k *= -1
	print(b)


import math
arr = []
status = False
n = int(input())
for _ in range(n):
	arr.append(int(input()))
for i in range(n):
	if arr[i] % 2 == 0:
		arr[i] //= 2
	elif status:
		arr[i] = math.ceil(arr[i] / 2)
		status = False
	else:
		arr[i] = math.floor(arr[i] / 2)
		status = True
	print(arr[i])


p = 0
a = []
n = int(input())
flag = 0
for i in range(n):
	q = int(input())
	if q % 2 == 0:
		print(q // 2)
	else:
		if flag % 2 == 0:
			print(q // 2)
		else:
			print(q // 2 + 1)
		flag = flag + 1


import math
f = 1
for _ in range(int(input())):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif x & 1 and f:
		print(math.ceil(x / 2))
		f = 0
	else:
		print(math.floor(x / 2))
		f = 1


flag = 1
n = int(input())
for _ in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	else:
		print((x + flag) // 2)
		flag = -flag


from math import *
n = int(input())
a = []
o = []
even = 0
odd = 0
for i in range(n):
	t = int(input())
	if t % 2 == 0:
		a.append(t // 2)
	elif odd == 0:
		odd = 1
		a.append((t + 1) // 2)
	else:
		odd = 0
		a.append(t // 2)
for e in a:
	print(e)


from math import sqrt

def main():
	n = int(input())
	nodd = 0
	podd = 0
	a = []
	ans = []
	sm = 0
	for i in range(n):
		ai = int(input())
		if ai < 0:
			x = ai // 2
		elif ai % 2 == 1:
			x = (ai + 1) // 2
		else:
			x = ai // 2
		sm += x
		a.append(ai)
		ans.append(x)
	if sm < 0:
		for i in range(n):
			if abs(a[i]) % 2 == 1 and ans[i] < 0:
				ans[i] += 1
				sm += 1
			if sm == 0:
				break
	elif sm > 0:
		for i in range(n):
			if a[i] % 2 == 1 and ans[i] > 0:
				ans[i] -= 1
				sm -= 1
			if sm == 0:
				break
	for i in ans:
		print(i)
main()


t = input()
sum = 0
taken = 0
given = 0
for i in range(int(t)):
	w = input()
	q = int(w)
	if q % 2 == 0:
		print(q // 2)
	elif given > taken:
		t = (q - 1) // 2
		print(t)
		taken += 1
		sum += t
	else:
		t = (q + 1) // 2
		print(t)
		given += 1
		sum += t


n = int(input())
q = []
c = 0
for i in range(n):
	q.append(int(input()))
	if q[i] % 2 == 1:
		c += 1
c //= 2
for i in range(n):
	if q[i] % 2 == 0:
		print(q[i] // 2)
	elif c > 0:
		print(q[i] // 2)
		c -= 1
	else:
		print(q[i] // 2 + 1)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
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 list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

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 pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		a = [I() for _ in range(n)]
		b = [c // 2 for c in a]
		s = sum(b)
		for i in range(n):
			if s == 0:
				break
			if a[i] % 2 == 0:
				continue
			b[i] += 1
			s += 1
		rr.append(JA(b, '\n'))
	return JA(rr, '\n')
print(main())


n = int(input())
flag = 0
for j1 in range(n):
	j = int(input())
	if j / 2 > j // 2:
		if flag == 0:
			flag = 1
			j = j // 2 + 1
		else:
			flag = 0
			j = j // 2
	else:
		j = j // 2
	print(j)


n = int(input())
arr = []
ind = []
for i in range(n):
	val = int(input())
	if val % 2 != 0:
		ind.append(i)
	arr.append(val // 2)
extra = abs(sum(arr))
i = 0
if extra != 0:
	while extra > 0:
		arr[ind[i]] += 1
		extra -= 1
		i += 1
		if i == len(ind):
			break
for i in arr:
	print(i)


a = int(input())
cnt = 0
while a > 0:
	b = int(input())
	if b % 2 != 0 and cnt % 2 == 0:
		print(int((b - 1) / 2))
		cnt += 1
	elif b % 2 == 0:
		print(int(b / 2))
	else:
		print(int((b + 1) / 2))
		cnt += 1
	a -= 1


from math import *
n = int(input())
vn = 0
vver = 0
for i in range(n):
	s = int(input())
	if s % 2 == 0:
		print(s // 2)
	elif vn <= vver:
		print(s // 2)
		vn += 1
	else:
		print(s // 2 + 1)
		vver += 1


import math
elem = int(input())
count = 0
for x in range(elem):
	temp = int(input())
	if temp % 2 == 0:
		print(int(temp / 2))
	elif count == 0:
		print(int(math.floor(temp / 2)))
		count = 1
	else:
		print(int(math.ceil(temp / 2)))
		count = 0


import math

def main():
	testcase = int(input())
	flagP = True
	flagN = False
	for i in range(testcase):
		n = int(input())
		if n % 2 == 0:
			print(n // 2)
		elif n < 0:
			if flagN:
				print(n // 2 + 1)
			else:
				print(n // 2)
			flagN = not flagN
		else:
			if flagP:
				print(n // 2 + 1)
			else:
				print(n // 2)
			flagP = not flagP
main()


mod = 10 ** 9 + 7
from sys import stdin, stdout
import bisect
import sys
sys.setrecursionlimit(10 ** 6)
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
from random import randint as rn

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	t = inin()
	su = 0
	a = []
	b = []
	for _ in range(t):
		n = inin()
		b.append(n)
		a.append(n // 2)
	x = sum(a)
	if x < 0:
		for i in range(t):
			if b[i] % 2 == 1:
				a[i] += 1
				x += 1
				if x == 0:
					break
	print(*a, sep='\n')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


n = int(input())
odd = 0
while n:
	n -= 1
	x = int(input())
	if x % 2:
		odd += 1
		x //= 2
		if odd % 2:
			x += 1
	else:
		x //= 2
	print(x)


cnt = 0
sum = 0
x = 0
n = int(input())
numbers = []
numbers2 = []
for i in range(0, n):
	numbers.append(int(input()))
for j in numbers:
	x = int(j / 2)
	sum += x
	x = 0
if sum == 0:
	for k in numbers:
		print(int(k / 2))
if sum > 0:
	for k in numbers:
		if k >= 0:
			print(int(k / 2))
		elif k < 0 and sum != 0 and (k % 2 != 0):
			print(int(k / 2) - 1)
			sum = sum - 1
		elif k < 0 and sum == 0:
			print(int(k / 2))
		elif k < 0 and k % 2 == 0:
			print(int(k / 2))
if sum < 0:
	for k in numbers:
		if k <= 0:
			x = x + int(k / 2)
			print(int(k / 2))
		elif k > 0 and sum != 0 and (k % 2 != 0):
			x = x + int(k / 2 + 1)
			print(int(k / 2) + 1)
			sum = sum + 1
		elif k > 0 and sum == 0:
			x = x + int(k / 2)
			print(int(k / 2))
		elif k > 0 and k % 2 == 0:
			x = x + int(k / 2)
			print(int(k / 2))


from math import floor, ceil
n = int(input())
x = [int(input()) for i in range(n)]
g = 0
for i in range(n):
	if x[i] % 2 == 0:
		x[i] = x[i] // 2
	elif g == 0:
		x[i] = ceil(x[i] / 2)
		g += 1
	else:
		x[i] = floor(x[i] / 2)
		g -= 1
for i in x:
	print(int(i))


a = int(input())
l = 0
for i in range(a):
	u = int(input())
	if u % 2 == 0:
		print(u // 2)
	else:
		if l == 0:
			print(u // 2)
		else:
			print((u + 1) // 2)
		l = 1 - l


from sys import stdin
import math
n = int(stdin.readline().rstrip())
f = 0
while n > 0:
	p = int(stdin.readline().rstrip())
	if p % 2 == 0:
		print(p // 2)
	else:
		if f == 0:
			print(math.ceil(p / 2))
		else:
			print(math.floor(p / 2))
		f = 1 - f
	n -= 1


import math
a = []
j = int(input())
c = 1
s = []
for i in range(j):
	a.append(int(input()))
	if c == 1 and a[i] % 2 != 0:
		s.append(math.ceil(a[i] / 2))
		c = 0
	elif c == 0 and a[i] % 2 != 0:
		s.append(math.floor(a[i] / 2))
		c = 1
	else:
		s.append(int(a[i] / 2))
for i in range(j):
	print(s[i])


n = int(input())
(f, s, j, k) = ([], 0, 0, 0)
for i in range(n):
	a = int(input())
	a = a / 2
	f.append(a)
for j in range(n):
	s += f[j]
for k in range(n):
	if f[k] * 2 % 2 != 0 and s > 0:
		f[k] -= 0.5
		s -= 0.5
	elif f[k] * 2 % 2 != 0 and s <= 0:
		f[k] += 0.5
		s += 0.5
	print(int(f[k]))


n = int(input())
m = 0
a = []
for _ in [0] * n:
	x = int(input())
	a += (x,)
	m += x % 2
i = j = 0
while i < n:
	x = a[i]
	a[i] = x // 2 + x % 2 * (2 * j < m)
	j += x % 2
	i += 1
print(*a)


n = int(input())
l = []
low = 0
even = 0
for i in range(0, n):
	t = int(input())
	if t % 2 == 0:
		even = even + t // 2
		l.append((t // 2, 0))
	else:
		low = low + t // 2
		l.append(t // 2)
if low != -1 * even:
	count = -1 * even - low
	for i in range(0, len(l)):
		if count == 0:
			break
		if type(l[i]) != tuple:
			l[i] = l[i] + 1
			count = count - 1
for i in range(0, len(l)):
	if type(l[i]) == tuple:
		print(l[i][0])
	else:
		print(l[i])


from math import floor, ceil
n = int(input())
cnt = 1
for i in range(n):
	k = int(input())
	if k % 2:
		cnt += 1
		if cnt % 2 == 0:
			print(floor(k / 2))
		else:
			print(ceil(k / 2))
	else:
		print(k // 2)


n = int(input())
d = 0
for i in range(n):
	i = int(input())
	if i % 2 == 0:
		i = i // 2
	elif d == 0:
		i = i // 2 + 1
		d = 1
	else:
		i = i // 2
		d = 0
	print(i)


n = int(input())
l = []
for i in range(n):
	l.append(int(input()))
flag = True
for i in l:
	if i % 2 == 0:
		print(i // 2)
	elif flag:
		print(i // 2)
		flag = False
	else:
		print(i // 2 + 1)
		flag = True


b = []
for _ in range(int(input())):
	x = int(input())
	b.append(x)
a = []
count = 0
for i in b:
	if i % 2 == 0:
		a.append(i // 2)
	elif count % 2 != 0:
		a.append(i // 2)
		count += 1
	else:
		a.append(i // 2 + 1)
		count += 1
for i in a:
	print(i)


import math
n = int(input())
p = 0
a = []
for _ in range(n):
	x = int(input())
	if x % 2 == 0:
		a.append(str(x // 2))
	else:
		if p % 2 == 0:
			a.append(str(math.ceil(x / 2)))
		else:
			a.append(str(math.floor(x / 2)))
		p += 1
print('\n'.join(a))


import bisect
import functools
import math
import sys
from collections import defaultdict
rt = lambda : map(int, input().split())
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))

def main():
	n = ri()
	n_odd = 0
	for _ in range(n):
		x = ri()
		if x % 2 == 0:
			print(x // 2)
		else:
			if n_odd % 2 == 0:
				print((x + 1) // 2)
			else:
				print((x - 1) // 2)
			n_odd += 1
main()


n = int(input())
arr = []
flag = 0
for i in range(n):
	ele = int(input())
	if ele % 2 == 0:
		arr.append(ele // 2)
	elif flag == 0:
		flag = 1
		new = ele / 2.0
		new = int(new - 0.5)
		arr.append(new)
	else:
		flag = 0
		new = ele / 2.0
		new = int(new + 0.5)
		arr.append(new)
for i in arr:
	print(i)


b = 0
z = int(input())
for x in range(z):
	c = int(input())
	if c % 2 == 0:
		print(c // 2)
	else:
		print(c // 2 + b)
		b = 1 - b


n = int(input())
c = 0
a = []
import math
for i in range(n):
	k = int(input())
	if k % 2 != 0 and c == 1:
		print(int(math.ceil(k / 2)))
		a.append(int(math.ceil(k / 2)))
		c = 0
	elif k % 2 != 0 and c == 0:
		print(int(math.floor(k / 2)))
		a.append(int(math.floor(k / 2)))
		c = 1
	else:
		print(int(k / 2))
		a.append(int(k / 2))


n = int(input())
odd = 0
for _ in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x >> 1)
	else:
		if odd % 2 == 0:
			print(x >> 1)
		else:
			k = x >> 1
			print(k + 1)
		odd += 1


n = int(input())
l = list()
for i in range(n):
	l.append(int(input()))
a = list()
c = 0
for i in l:
	if i % 2 == 0:
		a.append(i // 2)
	else:
		f = i // 2
		a.append(f)
		c += (i - 2 * f) / 2
for i in range(n):
	if c > 0 and l[i] % 2 == 1:
		a[i] += 1
		c -= 1
for i in a:
	print(i)


n = int(input())
a = []
for i in range(n):
	t = int(input())
	a.append(t)
rm = 0
for i in a:
	if i % 2 == 0:
		print(i // 2)
	else:
		print((i + rm) // 2)
		rm = (rm + 1) % 2


n = int(input())
cnt = 0
flag = 1
for _ in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		print((a + flag) // 2)
		flag *= -1


def main():
	n = int(input())
	ratings = []
	rounding = True
	for _ in range(n):
		rating = int(input())
		if rating % 2 == 1:
			if rounding:
				rating += 1
			else:
				rating -= 1
			rounding = not rounding
		ratings.append(rating // 2)
	for rating in ratings:
		print(rating)
main()


n = int(input())
o = list()
e = list()
t = list()
p = list()
for i in range(n):
	k = int(input())
	t.append(k)
	if k % 2 == 0:
		e.append(k)
	else:
		p.append(i)
		o.append(k)
for i in range(len(e)):
	e[i] = int(e[i] / 2)
for i in range(len(o)):
	o[i] = int(o[i] / 2)
s1 = sum(e)
s2 = sum(o)
q = 0
while s1 + s2 != 0:
	if t[p[q]] < 0:
		t[p[q]] -= 1
		s2 -= 1
	else:
		t[p[q]] += 1
		s2 += 1
	q += 1
for i in t:
	i = int(i / 2)
	print(i)


import math
n = int(input())
xs = []
flag = True
for _ in range(n):
	ai = int(input())
	if ai % 2 == 0:
		xs.append(ai // 2)
	elif flag:
		xs.append(math.floor(ai / 2))
		flag = 1 - flag
	else:
		xs.append(math.ceil(ai / 2))
		flag = 1 - flag
for x in xs:
	print(x)


import math
N = int(input())
A = []
B = []
for i in range(0, N):
	a = int(input())
	A.append(math.floor(a / 2))
	b = a % 2
	B.append(b)
c = sum(A)
for i in range(0, N):
	if c > 0:
		if B[i] == 1:
			A[i] -= 1
			c = c - 1
	elif c < 0:
		if B[i] == 1:
			A[i] += 1
			c = c + 1
for i in A:
	print(i)


import math
t = int(input())
a = [int(input()) for _ in range(t)]
odd = sum(map(lambda x: x % 2, a))
h = 0
res = []
for i in a:
	if i % 2 == 0:
		res.append(str(i // 2))
	elif h >= odd // 2:
		res.append(str(int(math.ceil(i / 2))))
	else:
		res.append(str(int(math.floor(i / 2))))
		h += 1
print('\n'.join(res))


n = int(input())
A = []
for i in range(n):
	A.append(int(input()))
cnt = 0
for i in range(n):
	if A[i] % 2:
		if cnt == 1:
			A[i] //= 2
			cnt -= 1
		else:
			A[i] = (A[i] + 1) // 2
			cnt += 1
	else:
		A[i] //= 2
for i in range(n):
	print(A[i], end=' ')


from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 7)

def iin():
	return int(stdin.readline())

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

def main():
	n = iin()
	a = [iin() for i in range(n)]
	na = [[a[i] // 2, i] for i in range(n)]
	sm = 0
	for (i, j) in na:
		sm += i
	pv = []
	for i in range(n):
		if a[i] > 0 and a[i] % 2:
			pv.append(na[i])
	nv = []
	for i in range(n):
		if a[i] < 0 and a[i] % 2:
			nv.append(na[i])
	sm = abs(sm)
	l = min(len(nv), sm)
	for i in range(l):
		na[nv[i][1]][0] += 1
	if l < sm:
		l2 = len(pv)
		for i in range(min(l2, sm - l)):
			na[pv[i][1]][0] += 1
	for (i, j) in na:
		print(i)
main()


import math
s = 0
l = []
l1 = []
l2 = []
for _ in range(int(input())):
	a = int(input())
	l.append(a)
	if a % 2 == 0:
		a = a // 2
		s += a
		l1.append(a)
	else:
		a1 = math.floor(a / 2)
		s += a1
		l1.append(a1)
if s < 0:
	for i in range(len(l)):
		if l[i] % 2 != 0:
			l1[i] += 1
			s = s + 1
			if s == 0:
				break
for i in l1:
	print(i)


n = int(input())
string = ''
odd = 0
for i in range(n):
	t = int(input())
	if t % 2 == 1:
		string = string + str(int((t - 1) / 2) + odd) + '\n'
		odd = 1 - odd
	else:
		string = string + str(int(t / 2)) + '\n'
print(string)


import math
T = int(input())
add = False
for _ in range(T):
	a = int(input())
	ans = a / 2
	if add:
		ans = math.floor(ans)
	else:
		ans = math.ceil(ans)
	if abs(a) % 2 != 0:
		add = not add
	print(int(ans))


import math as mth
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
c = 1
b = []
for i in range(n):
	if a[i] % 2 == 0:
		b.append(a[i] // 2)
	elif c == 0:
		b.append(a[i] // 2)
		c = 1
	else:
		b.append(mth.ceil(a[i] / 2))
		c = 0
	print(b[i])


z = 0
from math import ceil as c
for _ in ' ' * int(input()):
	a = int(input())
	if a & 1:
		if z ^ 1:
			print(c(a / 2))
			z ^= 1
		else:
			print(a // 2)
			z ^= 1
	else:
		print(a // 2)


from math import *
n = int(input())
a = []
b = []
k = True
for i in range(n):
	temp = int(input())
	a.append(temp)
for i in range(n):
	if not a[i] % 2:
		b.append(int(a[i] / 2))
	elif k:
		b.append(int(floor(a[i] / 2)))
		k = False
	else:
		b.append(int(ceil(a[i] / 2)))
		k = True
for i in range(n):
	print(b[i])


import math
n = int(input())
A = []
even = 0
odd = 0
for i in range(n):
	data = int(input())
	A.append(data)
	if data % 2 == 0:
		even += 1
	else:
		odd += 1
count = 0
for i in range(n):
	if A[i] % 2 == 0:
		print(int(A[i] / 2))
	elif count < odd / 2:
		count += 1
		print(math.ceil(A[i] / 2))
	else:
		print(math.floor(A[i] / 2))
		count += 1


from bisect import bisect
from collections import defaultdict
from math import gcd, sqrt, ceil, inf
from collections import Counter
import sys
sys.setrecursionlimit(10 ** 9)
n = int(input())
l = []
hash = defaultdict(int)
count1 = 0
count2 = 0
la = []
for i in range(n):
	l.append(int(input()))
	la.append(l[i] // 2)
z = sum(la)
if z == 0:
	for i in la:
		print(i)
else:
	for i in range(n):
		if z < 0 and l[i] % 2 != 0:
			la[i] = ceil(l[i] / 2)
			z += 1
		elif z == 0:
			break
	for i in la:
		print(i)


a = [int(input()) for i in range(int(input()))]
d = []
flag = 1
for i in a:
	if i % 2 != 0:
		if flag == 1:
			d.append((i + 1) // 2)
			flag = 0
		else:
			d.append((i - 1) // 2)
			flag = 1
	else:
		d.append(i // 2)
print(*d, sep='\n')


k = 0
for _ in [0] * int(input()):
	x = int(input())
	if x % 2:
		x += k
		k ^= 1
	print(x // 2)


from collections import Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys
import math
n = int(input())
f = 0
for i in range(n):
	u = int(input())
	if u % 2 == 0:
		print(u // 2)
	elif f == 0:
		print(math.floor(u / 2))
		f = 1
	else:
		print(math.ceil(u / 2))
		f = 0


t = int(input())
l1 = []
for x in range(t):
	l1.append(int(input()))
balancer = sum([int(x / 2) for x in l1])
for x in range(len(l1)):
	temp = int(l1[x] / 2)
	if balancer > 0 and l1[x] % 2:
		if l1[x] < 0:
			temp -= 1
			balancer -= 1
	elif balancer < 0 and l1[x] % 2:
		if l1[x] > 0:
			temp += 1
			balancer += 1
	else:
		pass
	l1[x] = temp
for x in l1:
	print(x)


from math import *
n = int(input())
a = []
for _ in range(n):
	a.append(int(input()) / 2)
b = list(map(floor, a))
c = sum(b)
for i in range(n):
	if a[i] != b[i]:
		if c < 0:
			b[i] += 1
			c += 1
for bb in b:
	print(bb)


n = int(input())
X = []
B = [0 for i in range(n)]
a = 0
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		B[i] = x // 2
	if x % 2 != 0 and a % 2 != 0:
		B[i] = x // 2 + 1
		a += 1
	elif x % 2 != 0 and a % 2 == 0:
		B[i] = x // 2
		a += 1
for i in B:
	print(i)


n = int(input())
a = [int(input()) for _ in range(n)]
f = 0
for i in a:
	if i & 1:
		if f:
			print((i + 1) // 2)
			f = 0
		else:
			print(i // 2)
			f = 1
	else:
		print(i // 2)


x = 0
for _ in range(int(input())):
	(b, m) = divmod(int(input()), 2)
	if m:
		print(b + x)
		x = 1 - x
	else:
		print(b)


n = int(input())
up_flag = False
for _ in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		if up_flag:
			print((a + 1) // 2)
		else:
			print((a - 1) // 2)
		up_flag = not up_flag


from math import ceil, floor
RoundUp = True
for i in range(int(input())):
	X = int(input())
	if X % 2 == 0:
		print(X // 2)
	else:
		print(ceil(X / 2) if RoundUp else floor(X / 2))
		RoundUp = not RoundUp


def f(p):
	od = len(list(filter(lambda x: x % 2 != 0, p)))
	c = 0
	for i in p:
		if i % 2 == 0:
			print(int(i / 2))
			continue
		if i % 2 == 1 and c != od / 2:
			c += 1
			print(int((i + 1) / 2))
			continue
		if i % 2 == 1 and c == od / 2:
			print(int((i - 1) / 2))
			continue
nt = int(input())
l = []
for i in range(nt):
	a = int(input())
	l.append(a)
f(l)


import math
n = int(input())
store = []
r = 0
for x in range(n):
	d = int(input())
	store.append(d)
	r += math.ceil(d / 2)
for (i, v) in enumerate(store):
	if r != 0 and v % 2:
		if v > 0 and r > 0:
			print(v // 2)
			r -= 1
		elif v > 0 and r < 0:
			print(v // 2)
			r += 1
		elif v < 0 and r > 0:
			print(v // 2)
			r -= 1
	else:
		print(math.ceil(v / 2))


import math
n = int(input())
flag = 0
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif flag == 0:
		print(math.ceil(a / 2))
		flag = 1
	else:
		print(math.floor(a / 2))
		flag = 0


n = int(input())
nc = 0
a = [0] * n
for i in range(n):
	a[i] = int(input())
	if a[i] % 2 == 0:
		print(a[i] // 2)
	else:
		nc = (nc + 1) % 2
		if nc == 1:
			print(a[i] // 2)
		else:
			print((a[i] + 1) // 2)


n = int(input())
a = []
for i in range(n):
	x = int(input())
	a.append(x)
count = 0
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] // 2
	else:
		if count % 2 == 0:
			a[i] = a[i] // 2
		else:
			a[i] = a[i] // 2 + 1
		count += 1
	print(a[i])


n = int(input())
l = []
a = 0
for i in range(n):
	kek = int(input())
	l.append(kek)
	if kek % 2:
		a += 1
a //= 2
for i in l:
	if i % 2:
		if a:
			print((i + 1) // 2)
			a -= 1
		else:
			print((i - 1) // 2)
	else:
		print(i // 2)


import sys

class ABalancedRatingChanges:

	def solve(self):
		import math
		n = int(input())
		a = []
		for _ in range(n):
			a.append(int(input()))
		sg = 1
		for i in range(n):
			if a[i] % 2 == 0:
				a[i] //= 2
			else:
				if sg == 1:
					a[i] = math.ceil(a[i] / 2)
				else:
					a[i] = math.floor(a[i] / 2)
				sg *= -1
		for x in a:
			print(x)
solver = ABalancedRatingChanges()
input = sys.stdin.readline
solver.solve()


import math
bol = 0
tests = int(input())
for t in range(tests):
	n = int(input())
	if n % 2:
		if bol:
			print(math.floor(n / 2))
		else:
			print(math.ceil(n / 2))
		bol ^= 1
	else:
		print(n // 2)


a = [int(input()) for _ in range(int(input()))]
c = sum(map(lambda x: x % 2, a))
n = 0
for i in a:
	if i % 2:
		if n * 2 < c:
			print(i // 2 + 1)
			n += 1
		else:
			print(i // 2)
	else:
		print(i // 2)


flag = False
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif flag == False:
		print(n // 2)
		flag = True
	else:
		print(n // 2 + 1)
		flag = False


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

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

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

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

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def solve():
	n = int(input())
	(plus, minus) = ([], [])
	num = []
	positive = negative = 0
	ans = []
	for _ in range(n):
		r = int(input())
		x = abs(r) // 2
		num.append(r)
		if r >= 0:
			ans.append(x)
			positive += x
			plus.append(_)
		else:
			x = -x
			ans.append(x)
			negative += x
			minus.append(_)
	if positive == abs(negative):
		for i in ans:
			print(i)
	elif positive > abs(negative):
		diff = positive - abs(negative)
		for i in range(n):
			if diff > 0:
				if i in minus:
					if num[i] % 2 != 0:
						diff -= 1
						print(-(abs(num[i]) // 2) - 1)
					else:
						print(ans[i])
				else:
					print(ans[i])
			else:
				print(ans[i])
	else:
		diff = abs(negative) - positive
		for i in range(n):
			if diff > 0:
				if i in plus:
					if num[i] % 2 != 0:
						diff -= 1
						print(num[i] // 2 + 1)
					else:
						print(ans[i])
				else:
					print(ans[i])
			else:
				print(ans[i])
t = 1
for _ in range(t):
	solve()


from sys import stdin
n = int(stdin.readline())
i = 0
for _ in range(n):
	ai = int(stdin.readline())
	if ai % 2 == 0:
		print(ai // 2)
	else:
		print(ai // 2 if i % 2 == 0 else ai // 2 + 1)
		i += 1


n = int(input().strip())
from math import floor, ceil
d = 0
for i in range(n):
	a = int(input().strip())
	if a % 2 == 0:
		print(a // 2)
	else:
		if d % 2 == 0:
			print(floor(a / 2))
		else:
			print(ceil(a / 2))
		d += 1


import math
n = int(input())
arr = []
arrx = []
sum = 0
for i in range(n):
	inp = int(input())
	arr.append(inp)
for i in range(n):
	if arr[i] >= 0:
		sum = sum + math.floor(arr[i] / 2)
	else:
		sum += math.ceil(arr[i] / 2)
realsum = 0
count = 0
if sum < 0:
	for i in range(n):
		if arr[i] > 0 and arr[i] % 2 != 0 and (sum != 0) and (arr[i] != 0):
			arrx.append(math.ceil(arr[i] / 2))
			sum += 1
		elif arr[i] >= 0:
			arrx.append(math.floor(arr[i] / 2))
		else:
			arrx.append(math.ceil(arr[i] / 2))
	for i in range(n):
		print(arrx[i])
elif sum > 0:
	for i in range(n):
		if arr[i] < 0 and arr[i] % 2 != 0 and (sum != 0) and (arr[i] != 0):
			arrx.append(math.floor(arr[i] / 2))
			sum -= 1
		elif arr[i] >= 0:
			arrx.append(math.floor(arr[i] / 2))
		else:
			arrx.append(math.ceil(arr[i] / 2))
	for i in range(n):
		print(arrx[i])
else:
	for i in range(n):
		if arr[i] < 0:
			print(math.ceil(arr[i] / 2))
		else:
			print(math.floor(arr[i] / 2))


n = int(input())
flag = True
for _ in range(n):
	b = int(input())
	if b % 2 == 0:
		print(b // 2)
	else:
		if flag:
			print(b // 2)
			flag = False
		else:
			print(b // 2 + 1)
			flag = True
		prev = b


N = int(input())
A = []
for _ in range(N):
	A.append(int(input()))
odd_count = 0
for a in A:
	if a % 2 == 0:
		print(a // 2)
	else:
		if odd_count % 2 == 0:
			print((a + 1) // 2)
		else:
			print((a - 1) // 2)
		odd_count += 1


import sys
import math

def main():
	n = int(sys.stdin.readline())
	flag = 0
	for i in range(n):
		x = int(sys.stdin.readline())
		if x % 2 == 0:
			print(x // 2)
		elif flag == 0:
			print(x // 2)
			flag = 1
		else:
			q = x // 2
			q += 1
			print(q)
			flag = 0
main()


n = int(input())
s = 0
x = [int(input()) for i in range(n)]
t = -1
for i in x:
	if i % 2 != 0:
		if t == -1:
			print(i // 2)
		else:
			print(i // 2 + 1)
		t = t * -1
	else:
		print(i // 2)


t = int(input())
p = 1
while t > 0:
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		print((a + p) // 2)
		p = p * -1
	t -= 1


n = int(input())
a = [0] * n
for i in range(n):
	a[i] = int(input())
s = sum(a)
c = 0
for x in a:
	if x % 2 == 0:
		x //= 2
	elif c == 0:
		c += 1
		x //= 2
	else:
		c -= 1
		x //= 2
		x += 1
	print(x)


import math
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
b = []
c = []
for i in range(n):
	if a[i] % 2 != 0:
		if a[i] > 0:
			b.append(i)
		elif a[i] < 0:
			c.append(i)
	else:
		a[i] = a[i] // 2
n1 = len(b)
for i in range(n1 // 2):
	a[b[i]] = int(math.floor(a[b[i]] / 2))
	a[b[n1 - 1 - i]] = int(math.ceil(a[b[n1 - 1 - i]] / 2))
if n1 % 2 != 0:
	a[b[n1 // 2]] = int(math.floor(a[b[n1 // 2]] / 2))
n2 = len(c)
for i in range(n2 // 2):
	a[c[i]] = int(math.floor(a[c[i]] / 2))
	a[c[n2 - 1 - i]] = int(math.ceil(a[c[n2 - 1 - i]] / 2))
if n2 % 2 != 0:
	a[c[n2 // 2]] = int(math.ceil(a[c[n2 // 2]] / 2))
for i in range(n):
	print(a[i])


t = int(input())
l = []
for v in range(t):
	l.append(int(input()))
(a, b) = (1, 0)
for i in range(len(l)):
	if l[i] % 2 == 0:
		print(l[i] // 2)
	else:
		print(l[i] // 2 + a)
		(a, b) = (b, a)


import math
a = []
for _ in range(int(input())):
	a.append(int(input()))
odd = sum((1 for i in a if i % 2 == 1)) // 2
c = 0
for i in a:
	if i % 2 == 1 and c < odd:
		print(i // 2 + 1)
		c += 1
	else:
		print(i // 2)


n = int(input())
o = 0
arr = []
for i in range(n):
	x = int(input())
	arr.append(x)
	if x % 2:
		o += 1
for a in arr:
	if a % 2 == 0:
		print(a // 2)
	elif o > 0:
		print(a // 2 + 1)
		o -= 2
	else:
		print(a // 2)


n = int(input())
li = []
for _ in range(n):
	li.append(int(input()))
x = []
clock = 0
for a in li:
	if a % 2 == 0:
		x.append(a // 2)
	else:
		x.append(a // 2 + 1 - clock)
		clock = 1 - clock
x = [str(a) for a in x]
for a in x:
	print(a)


import sys

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

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())
n = oint()
b = [0] * n
r = [0] * n
t = 0
for i in range(n):
	a = oint()
	b = a // 2
	r = a % 2
	if r:
		if t:
			print(b)
		else:
			print(b + 1)
		t += 1
		t = t % 2
	else:
		print(b)


import math
n = int(input())
nums = []
for i in range(n):
	nums.append(int(input()))
ups = 0
downs = 0
for i in range(n):
	if nums[i] % 2 == 0:
		print(nums[i] // 2)
	else:
		if ups < downs:
			out = int(math.ceil(nums[i] / 2))
			ups += 1
		else:
			out = int(math.floor(nums[i] / 2))
			downs += 1
		print(out)


from math import floor, ceil
n = int(input())
a = []
c = 0
for _ in range(n):
	x = int(input())
	if x % 2 == 1:
		c += 1
	a.append(x)
flag = 0
for i in a:
	if i % 2 == 0:
		print(i // 2)
	elif flag == 1:
		print(ceil(i / 2))
		flag = 0
	elif flag == 0:
		print(floor(i / 2))
		flag = 1


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
n = get_int()
lst = []
for i in range(n):
	lst.append(get_int())
res = 1
for i in range(n):
	if lst[i] % 2 != 0:
		lst[i] = (lst[i] + res) // 2
		res *= -1
	else:
		lst[i] = lst[i] // 2
print(*lst)


n = int(input())
a = []
for i in range(n):
	no = int(input())
	a.append(no)
new = 1
for i in range(n):
	if a[i] % 2 != 0:
		a[i] = (a[i] + new) // 2
		new = new * -1
	else:
		a[i] = a[i] // 2
print(*a, sep='\n')


from collections import namedtuple
import math
n = int(input())
count = 0
arr = []
for i in range(0, n):
	num = int(input())
	if num % 2 == 0:
		arr.append(int(num / 2))
	elif count % 2 == 0:
		arr.append(math.ceil(num / 2))
		count += 1
	else:
		arr.append(math.floor(num / 2))
		count += 1
for i in arr:
	print(i)


import math
n = int(input())
num = []
pairs = 0
impairs = 0
interruptor = []
for i in range(n):
	current = int(input())
	if current % 2 != 0:
		if current < 0:
			current = int(math.floor(current / 2))
		else:
			current = int(math.ceil(current / 2))
		impairs += current
		num.append(current)
		interruptor.append(False)
	else:
		current = current / 2
		pairs += current
		interruptor.append(True)
		num.append(current)
for i in range(len(num)):
	if not interruptor[i]:
		if num[i] < 0:
			num[i] += 1
			impairs += 1
		else:
			num[i] -= 1
			impairs -= 1
	if impairs + pairs == 0:
		break
for i in num:
	print(int(i))


t = int(input())
count = 0
import math
for i in range(t):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
		continue
	elif count % 2 == 0:
		print(math.ceil(a / 2))
	else:
		print(math.floor(a / 2))
	count += 1


import sys
n = int(input())
d = [int(i) for i in sys.stdin.readlines()]
dd = [0] * n
pos = 0
neg = 0
for i in range(n):
	ddd = d[i]
	if ddd & 1:
		if ddd > 0:
			pos += 1
		elif ddd < 0:
			neg += 1
odd = pos + neg
odd //= 2
for i in range(n):
	ddd = d[i]
	if ddd & 1:
		if odd:
			odd -= 1
			d[i] = ddd // 2 + 1
		else:
			d[i] = ddd // 2
	else:
		d[i] = ddd // 2
[sys.stdout.write(str(i) + '\n') for i in d]


n = int(input())
c = 0
for i in range(n):
	s = int(input())
	if s % 2 == 0:
		print(int(s / 2))
	elif c % 2 == 0:
		print(int((s + 1) / 2))
		c += 1
	else:
		print(int((s - 1) / 2))
		c += 1


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
t = ii()
f = 0
for i in range(t):
	n = ii()
	if n % 2:
		f += 1
		n >>= 1
		if f % 2:
			n += 1
	else:
		n >>= 1
	print(n)


flag = 1
for i in range(int(input())):
	k = int(input())
	if k % 2 == 0:
		print(k // 2)
	else:
		print((k + flag) // 2)
		flag = -flag


def new_a():
	res = []
	sum = 0
	qustion_valuez = []
	for i in range(n):
		new__ = a[i] // 2
		if a[i] % 2 != 0:
			qustion_valuez.append(i)
		sum += new__
		res.append(new__)
	for i in range(len(qustion_valuez)):
		if sum > 0:
			if res[qustion_valuez[i]] > 0:
				res[qustion_valuez[i]] -= 1
				sum -= 1
		if sum < 0:
			res[qustion_valuez[i]] += 1
			sum += 1
		if sum == 0:
			break
	return res
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
k = new_a()
for i in range(len(k)):
	print(k[i])


import math
t = int(input())
(pc, ng) = (0, 0)
l = []
for i in range(t):
	n = int(input())
	l.append(n)
	if n > 0 and n % 2 == 1:
		pc += 1
	elif n < 0 and n % 2 == 1:
		ng += 1
if pc == ng:
	for i in l:
		if i >= 0:
			print(i // 2)
		else:
			print(-(abs(i) // 2))
elif pc > ng:
	k = (pc - ng) // 2
	for i in l:
		if i % 2 == 0:
			print(i // 2)
		elif i > 0 and i % 2 == 1 and (k > 0):
			print(math.ceil(i / 2))
			k -= 1
		elif i < 0:
			print(-(abs(i) // 2))
		else:
			print(i // 2)
elif ng > pc:
	k = (ng - pc) // 2
	for i in l:
		if i % 2 == 0:
			print(i // 2)
		elif i < 0 and i % 2 == 1 and (k > 0):
			print(-(abs(i) // 2 + 1))
			k -= 1
		elif i > 0:
			print(i // 2)
		else:
			print(-(abs(i) // 2))


from math import floor, ceil
n = int(input())
flag = False
answer = []
for _ in range(n):
	i = int(input())
	if i % 2 == 0:
		answer.append(i // 2)
		continue
	if flag:
		answer.append(floor(i / 2))
	else:
		answer.append(ceil(i / 2))
	flag = not flag
print(' '.join(map(str, answer)))


import math
n = int(input())
A = []
for _ in range(n):
	A.append(int(input()))
flag = 1
for i in range(len(A)):
	if A[i] % 2 == 0:
		A[i] = A[i] // 2
	elif flag == 1:
		A[i] = math.ceil(A[i] / 2)
		flag = 0
	else:
		A[i] = math.floor(A[i] / 2)
		flag = 1
for i in A:
	print(i)


from collections import Counter
from collections import defaultdict
import math
t = int(input())
a = list()
s = 0
for i in range(0, t):
	n = int(input())
	a.append(n)
	s = s + n
s1 = 0
g = 0
for i in range(0, t):
	if i == t - 1:
		print(s - s1)
	elif a[i] % 2 == 1:
		if g % 2 == 0:
			print(math.ceil(a[i] / 2))
			s1 = s1 + math.ceil(a[i] / 2)
			g = g + 1
		else:
			print(a[i] // 2)
			s1 = s1 + a[i] // 2
			g = g + 1
	else:
		print(a[i] // 2)
		s1 = s1 + a[i] // 2


import math
odd = 0
for _ in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif odd:
		print(math.ceil(a / 2))
		odd = 0
	else:
		print(math.floor(a / 2))
		odd = 1


c = 0
for t in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	else:
		if c % 2 == 0:
			print(n // 2)
		else:
			print(n // 2 + 1)
		c += 1


(s, f) = (0, 0)
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif f == 0 or f == 1:
		print(n // 2)
		f = -1 if f == 0 else 0
	else:
		print(n // 2 + 1)
		f = 0 if f == -1 else 1


def solution(arr):
	last = 0
	for v in arr:
		if v % 2 != 0:
			yield (v // 2 + -1 * last)
			last = -1 - last
		else:
			yield (v // 2)

def main():
	t = int(input())
	m = (int(input()) for _ in range(t))
	p = solution(m)
	print('\n'.join(map(str, p)))
main()


import math
c = 0
for _ in range(int(input())):
	n = int(input())
	if not n & 1:
		print(n // 2)
	elif c & 1:
		print(n // 2)
		c += 1
	else:
		print(math.ceil(n / 2))
		c += 1


import sys
from math import ceil
cin = sys.stdin.buffer.readline
(a, b) = ([], [])
for _ in range(int(cin())):
	a.append(int(cin()))
	b.append(a[-1] // 2)
sm = sum(b)
for i in range(len(a)):
	if sm != 0 and a[i] % 2 != 0:
		b[i] += 1
		sm += 1
	print(b[i])


n = int(input())
l = [int(input()) for _ in range(n)]
is_odd = [e & 1 for e in l]
res = [e // 2 for e in l]
cur = sum(res)
for i in range(n):
	if cur == 0:
		break
	if is_odd[i]:
		cur += 1
		res[i] += 1
print(*res, sep='\n')


import math

def main():
	n = int(input())
	a = []
	for i in range(n):
		a.append(int(input()))
	b = []
	less = False
	for i in range(n):
		if a[i] % 2 == 0:
			b.append(a[i] // 2)
		elif less:
			b.append(a[i] // 2)
			less = False
		else:
			b.append(a[i] // 2 + 1)
			less = True
	print('\n'.join((str(x) for x in b)))
main()


n = int(input())
l = []
for i in range(n):
	k = int(input())
	l += [k]
s1 = 0
s2 = 0
for i in range(0, n):
	if l[i] % 2 == 0:
		s1 = s1 + l[i] // 2
	else:
		s2 = s2 + l[i] // 2
if s1 + s2 == 0:
	for i in l:
		print(i // 2)
else:
	d = s1 + s2
	i = 0
	while d != 0:
		if d > 0:
			if l[i] % 2 != 0:
				if l[i] > 0:
					l[i] += 1
					d -= 1
				else:
					l[i] += 1
					d -= 1
		elif l[i] % 2 != 0:
			if l[i] > 0:
				l[i] += 1
				d += 1
			else:
				l[i] += 1
				d += 1
		i += 1
	for j in l:
		print(j // 2)


import sys, math
input = sys.stdin.readline
n = int(input())
a = []
for i in range(n):
	k = int(input())
	a.append(k)
q = []
w = 0
for i in range(len(a)):
	if a[i] % 2 == 0:
		q.append(a[i] // 2)
	elif w % 2 == 0:
		q.append(a[i] // 2)
		w = w + 1
	else:
		q.append(math.ceil(a[i] / 2))
		w = w + 1
for i in range(len(q)):
	print(q[i])


odd = 0
ans = []
for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		ans.append(n // 2)
	elif odd == 0:
		ans.append(n // 2)
		odd = 1
	else:
		ans.append(n // 2 + 1)
		odd = 0
for i in ans:
	print(i)


a = int(input())
b = []
d = []
for i in range(0, a):
	d.append(int(input()))
	b.append(d[i] // 2)
c = sum(b)
for i in range(0, a):
	if c != 0 and d[i] % 2 != 0:
		print(b[i] + 1)
		c = c + 1
	else:
		print(b[i])


import math
n = int(input())
x = 0
a = []
b = []
for i in range(n):
	k = int(input())
	b.append(k)
	if k % 2 == 0:
		a.append(k // 2)
	else:
		k = k / 2
		if abs(k - math.floor(k)) > abs(k - math.ceil(k)):
			a.append(math.ceil(k))
		else:
			a.append(math.floor(k))
val = sum(a)
if val != 0:
	for i in range(n):
		if val == 0:
			break
		if b[i] % 2 != 0:
			if val > 0:
				if math.ceil(b[i] / 2) == a[i]:
					a[i] = a[i] - 1
					val = val - 1
			elif val < 0:
				if math.floor(b[i] / 2) == a[i]:
					a[i] = a[i] + 1
					val = val + 1
for i in range(n):
	print(a[i])


n = int(input())
m = 1
for _ in range(n):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	else:
		print(n // 2 + m)
		m = 1 - m


import math
n = int(input())
l = 0
g = 0
for i in range(n):
	m = int(input())
	if m % 2 == 0:
		print(m // 2)
	elif l == g:
		print(math.floor(m / 2))
		l = l + 1
	else:
		print(math.ceil(m / 2))
		g = g + 1


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

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

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

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007
fact_powers = [0] * 19
tset = set()

def go(ind, x):
	if ind == 19:
		tset.add(x)
		return
	if x in tset:
		return
	go(ind + 1, x)
	i = 0
	for xx in fact_powers[ind]:
		p = x * xx
		if p > 1e+18:
			break
		go(ind + 1, p)

def solve():
	t = 1
	for tt in range(t):
		n = nu()
		zp = 1
		for i in range(n):
			p = nu()
			if p % 2 == 0:
				print(p // 2)
			elif zp == 1:
				op = int(ma.floor(p / 2))
				print(op)
				zp *= -1
			else:
				op = int(ma.ceil(p / 2))
				print(op)
				zp *= -1
solve()


n = int(input())
l = [int(input()) for i in range(n)]
number_odd = sum([l[i] % 2 == 1 for i in range(n)])
for i in range(n):
	if l[i] % 2 == 1:
		if number_odd % 2 == 1:
			l[i] = (l[i] + 1) // 2
		else:
			l[i] = (l[i] - 1) // 2
		number_odd -= 1
	else:
		l[i] = l[i] // 2
print('\n'.join(list(map(str, l))))


import sys
import collections
input = sys.stdin.readline

def rints():
	return map(int, input().strip().split())

def rint():
	return int(input().strip())

def rintas():
	return [int(i) for i in input().strip().split()]

def gcd(a, b):
	if a == 0:
		return b
	return gcd(a % b, a)
n = rint()
(a, b) = (list(), [])
for _ in range(n):
	a.append(rint())
	b.append(a[-1] // 2)
total = sum(b)
for i in range(n):
	if total != 0 and a[i] % 2:
		total += 1
		if b[i] < 0 and total < 0:
			print(b[i] + 1)
		elif b[i] < 0 and total > 0:
			print(b[i] - 1)
		else:
			print(b[i] + 1)
	else:
		print(b[i])


import math
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
l = [a[i] for i in range(n)]
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] // 2
	elif i % 2 == 0:
		a[i] = int(math.floor(a[i] / 2))
	else:
		a[i] = int(math.ceil(a[i] / 2))
if sum(a) != 0:
	c = abs(sum(a))
	if sum(a) < 0:
		x = 0
		for i in range(n):
			if l[i] % 2 != 0:
				if i % 2 == 0:
					a[i] = a[i] + 1
					x = x + 1
				if x == c:
					break
	elif sum(a) > 0:
		x = 0
		for i in range(n):
			if l[i] % 2 != 0:
				if i % 2 != 0:
					a[i] = a[i] - 1
					x = x + 1
				if x == c:
					break
if sum(a) == 0:
	for i in range(n):
		print(a[i])


import sys
import math
import bisect
import math
from itertools import accumulate
input = sys.stdin.readline

def inpit():
	return int(input())

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

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

def inpspit():
	return map(int, input().split())
pow = math.pow
fl = math.floor
ceil = math.ceil
dis = math.hypot

def lcm(a):
	return abs(math.prod(a)) // math.gcd(*a)

def cumulativeSum(input):
	return list(accumulate(input))
t = inpit()
lt = []
for i in range(t):
	lt.append(inpit())
b = 0
for i in range(t):
	if lt[i] % 2 == 0:
		lt[i] = lt[i] / 2
	elif b < 0:
		lt[i] = math.ceil(float(lt[i]) / 2.0)
		b = b + 1
	elif b > 0:
		lt[i] = math.floor(float(lt[i]) / 2.0)
		b = b - 1
	elif b == 0:
		lt[i] = math.ceil(float(lt[i]) / 2.0)
		b = b + 1
for i in lt:
	print(int(i))


n = int(input())
a = [int(input()) for i in range(n)]
z = 0
for x in a:
	if x % 2 == 0:
		print(x // 2)
	else:
		print(x // 2 + z % 2)
		z += 1


import array
import math
import os
import sys

def main():
	N = read_int()
	A = [read_int() for _ in range(N)]
	print(*solve(N, A), sep='\n')

def solve(N, A):
	bias = 0
	for (i, a) in enumerate(A):
		if a % 2 == 0:
			A[i] = a // 2
			continue
		A[i] = a // 2 + bias
		bias = 1 - bias
	return A
DEBUG = 'DEBUG' in os.environ

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

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
main()


n = int(input())
q = 0
for i in range(n):
	p = int(input())
	if p % 2 == 0:
		print(int(p // 2))
	elif q == 0:
		print(int(p // 2) + 1)
		q = 1
	else:
		print(int(p // 2))
		q = 0


n = int(input())
a = []
b = []
for i in range(n):
	x = int(input())
	a.append(x)
	if x >= 0:
		b.append(x // 2)
	else:
		b.append(0 - abs(x) // 2)
s = sum(b)
i = 0
while s < 0:
	while i < n:
		if a[i] > 0 and a[i] % 2 == 1:
			b[i] += 1
			i += 1
			break
		i += 1
	s += 1
while s > 0:
	while i < n:
		if a[i] < 0 and a[i] % 2 == 1:
			b[i] -= 1
			i += 1
			break
		i += 1
	s -= 1
for i in b:
	print(i)


sum = 0
for i in range(int(input())):
	x = int(input())
	y = x // 2
	if y == x / 2:
		print(y)
	elif sum == 0:
		sum = x - y * 2
		print(y)
	else:
		y = y + sum
		sum = 0
		print(y)


n = int(input())
sm = 0
isEven = []
ls = []
for i in range(n):
	tmp = int(input())
	ls.append(tmp // 2)
	isEven.append(tmp % 2 == 0)
sm = sum(ls)
newsm = 0
for i in range(len(ls)):
	l = ls[i]
	if not isEven[i]:
		if sm < 0:
			print(l + 1)
			newsm += l + 1
			sm += 1
		elif sm > 0:
			print(l - 1)
			newsm += l - 1
			sm -= 1
		else:
			print(l)
			newsm += l
	else:
		print(l)
		newsm += l


import math
n = int(input())
count = 0
arr = []
for i in range(n):
	arr.append(int(input()))
ans = []
for i in range(n):
	val = arr[i]
	if val % 2 == 0:
		ans.append(int(val / 2))
	elif count == 0:
		if val > 0:
			ans.append(int(val / 2))
		else:
			ans.append(int(val / 2) - 1)
		count += 1
	else:
		if val > 0:
			ans.append(int(val / 2) + 1)
		else:
			ans.append(int(val / 2))
		count -= 1
for i in ans:
	print(i)


import math
t = int(input())
output = []
flag = 0
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		b = n / 2
	elif flag == 0:
		b = math.ceil(n / 2)
		flag = 1
	else:
		b = math.floor(n / 2)
		flag = 0
	output.append(int(b))
for x in output:
	print(x)


n = int(input())
flag = 5
for x in range(n):
	a = int(input())
	if a % 2 != 0:
		if flag == 5:
			print(int(a // 2) + 1)
			flag = 6
		else:
			flag = 5
			print(int(a // 2))
	else:
		print(int(a // 2))


import math
t = int(input())
arr = []
half_arr = []
e = 0
o = 0
for i in range(t):
	n = int(input())
	arr.append(n)
	half_arr.append(n // 2)
diff = sum(half_arr)
if diff < 0:
	for i in range(len(arr)):
		if arr[i] % 2 == 1:
			half_arr[i] += 1
			diff += 1
		if diff == 0:
			break
for i in range(t):
	print(half_arr[i])


from sys import stdin
import math
n = int(stdin.readline())
a = []
for i in range(n):
	r = int(stdin.readline())
	a.append([r, i])
a.sort()
k = [0] * n
flag = 0
for e in a:
	if e[0] & 1:
		if flag == 0:
			k[e[1]] = math.ceil(e[0] / 2)
			flag = 1
		else:
			k[e[1]] = e[0] // 2
			flag = 0
	else:
		k[e[1]] = e[0] // 2
for e in k:
	print(e)


import math
toFloor = False
for i in range(int(input())):
	k = int(input())
	if k % 2 == 0:
		print(k // 2)
	elif toFloor:
		print(math.floor(k / 2))
		toFloor = False
	else:
		print(math.ceil(k / 2))
		toFloor = True


N = int(input())
B = [int(input()) for _ in range(N)]
c = 0
res = [b // 2 for b in B]
k = sum(res)
for (i, b) in enumerate(B):
	if k == 0:
		break
	if b % 2 == 1:
		res[i] += 1
		k += 1
print(*res, sep='\n')


n = int(input())
odds = 0
array = []
count = 0
for i in range(n):
	a = int(input())
	array.append(a)
	if a % 2 != 0:
		count += 1
this = 1
ans = []
limit = count // 2
for i in array:
	if i % 2 != 0 and this <= limit:
		this += 1
		ans.append(int(i / 2 - 0.5))
	elif i % 2 != 0 and this > limit:
		this += 1
		ans.append(int(i / 2 + 0.5))
	else:
		ans.append(i // 2)
for i in ans:
	print(i)


from math import *
t = int(input())
a = list()
for _ in range(t):
	a.append(int(input()))
pos = 1
neg = 1
b = list()
for i in range(t):
	if a[i] % 2 == 0:
		b.append(a[i] // 2)
	elif a[i] < 0:
		if neg == 1:
			b.append(floor(a[i] / 2))
			neg = 0
		else:
			b.append(ceil(a[i] / 2))
			neg = 1
	elif pos == 1:
		b.append(ceil(a[i] / 2))
		pos = 0
	else:
		b.append(floor(a[i] / 2))
		pos = 1
for i in range(len(b)):
	print(b[i])


import math as mt
import sys, string
from collections import Counter, defaultdict
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda : list(map(int, input().split()))

def printARR(arr):
	for e in arr:
		print(e, end=' ')
	print()
flag = -1

def main():
	global flag
	n = I()
	if n % 2 == 0:
		print(n // 2)
		return
	elif flag == -1:
		flag = 1
		print(n // 2)
		return
	elif flag == 1:
		print(n // 2 + 1)
		flag = 0
	elif flag == 0:
		print(n // 2)
		flag = 1
tc = 1
tc = I()
for _ in range(tc):
	main()


p = n = False
for i in range(int(input())):
	x = int(input())
	if x % 2 and x < 0:
		x = abs(x)
		if n:
			print(-(x // 2 + 1))
		else:
			print(-(x // 2))
		n = not n
	elif x % 2 and x > 0:
		if p:
			print(x // 2 + 1)
		else:
			print(x // 2)
		p = not p
	else:
		print(x // 2)


n = int(input())
cnt = 0
res = []
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		res.append(a // 2)
	elif cnt % 2 == 0:
		res.append((a + 1) // 2)
		cnt += 1
	else:
		res.append(a // 2)
		cnt += 1
for el in res:
	print(el)


import math
n = int(input())
a = []
flag = 0
na = []
y = 0
for i in range(n):
	x = int(input())
	a.append(x)
for i in range(n):
	if a[i] % 2 == 0:
		na.append(a[i] // 2)
	elif flag == 0:
		y = math.ceil(a[i] / 2)
		na.append(y)
		flag = 1
	else:
		y = math.floor(a[i] / 2)
		na.append(y)
		flag = 0
for i in range(n):
	print(na[i])


n = int(input())
l = []
curr = 0
for i in range(n):
	n = int(input())
	if n % 2 == 1 and curr % 2 == 0:
		l.append(n // 2)
		curr += 1
	elif n % 2 == 1 and curr % 2 == 1:
		l.append(n // 2 + 1)
		curr += 1
	else:
		l.append(n // 2)
for i in l:
	print(i)


import sys
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(1):
	n = int(input())
	c = 0
	for i in range(n):
		t = int(input())
		if t % 2 == 1:
			if c == 1:
				print(t // 2 + 1)
				c = 0
			else:
				print(t // 2)
				c = 1
		else:
			print(t // 2)


import sys
import math
input = sys.stdin.readline
n = int(input())
flag = True
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif flag:
		print(x // 2)
		flag = False
	else:
		print(math.ceil(x / 2))
		flag = True


def half(arr, n):
	add = True
	for i in range(n):
		if arr[i] & 1:
			if add:
				arr[i] = arr[i] // 2 + 1
				add = False
			else:
				arr[i] = arr[i] // 2
				add = True
		else:
			arr[i] //= 2
n = int(input())
arr = []
for _ in range(n):
	arr.append(int(input()))
half(arr, n)
for i in range(n):
	print(arr[i])


flag = 0
for i in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif flag == 1:
		print(a // 2)
		flag = 0
	else:
		print(a // 2 + 1)
		flag = 1


import math
n = int(input())
oc = 0
s = 0
for i in range(n):
	x = int(input())
	if x % 2:
		if oc % 2:
			print(math.ceil(x / 2))
		else:
			print(math.floor(x / 2))
		oc += 1
	else:
		print(x // 2)


t = int(input())
ans = []
temp = 0
for i in range(t):
	a = int(input())
	if a % 2 == 0:
		ans.append(a // 2)
	elif a % 2 != 0:
		if temp == 0:
			ans.append(a // 2)
			temp = -1
		elif temp == -1:
			ans.append(a // 2 + 1)
			temp = 0
print(*ans, sep='\n')


import math
n = int(input())
i = 0
sw = 0
while i < n:
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif sw == 0:
		sw = 1
		print(math.ceil(x / 2))
	else:
		sw = 0
		print(math.floor(x / 2))
	i += 1


from math import floor, ceil
N = int(input())
a = []
for _ in range(N):
	x = int(input())
	a.append(x)
fl = False
for i in a:
	if i % 2 == 0:
		print(int(i / 2))
	elif fl:
		print(int(floor(i / 2)))
		fl = False
	else:
		print(int(ceil(i / 2)))
		fl = True


n = int(input())
s = []
x = 0
for i in range(n):
	val = int(input())
	if val % 2 == 0:
		print(val // 2)
		s.append(val // 2)
	else:
		if x != 0:
			ans = int(val / 2 + x)
			x = 0
		elif val < 0:
			x = (val / 2 - val // 2) * -1
			ans = val // 2 + 1
		else:
			x = val / 2 - val // 2
			ans = val // 2
		print(ans)
		s.append(ans)


n = int(input())
m = 0
p = 0
for k in range(n):
	i = int(input())
	if i % 2 == 0:
		print(i // 2)
	elif i < 0:
		if m:
			print(i // 2 + 1)
			m = 0
		elif p:
			print(i // 2)
			p = 0
		else:
			print(i // 2)
			m = 1
	elif i > 0:
		if m:
			print(i // 2 + 1)
			m = 0
		elif p:
			print(i // 2)
			p = 0
		else:
			print(i // 2 + 1)
			p = 1


import math
tc = int(input())
flag = True
while tc > 0:
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif flag:
		print(math.floor(n / 2))
		flag = False
	else:
		print(math.ceil(n / 2))
		flag = True
	tc -= 1


n = int(input())
isDownPositive = False
isDownNegative = False
for _ in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif isDownPositive:
		if x > 0:
			print((x + 1) // 2)
		else:
			print((x + 1) // 2)
		isDownPositive = False
	elif isDownNegative:
		if x > 0:
			print((x - 1) // 2)
		else:
			print((x - 1) // 2)
		isDownNegative = False
	elif x > 0:
		print(x // 2)
		isDownPositive = True
	else:
		print((x + 1) // 2)
		isDownNegative = True


t = int(input())
a = []
for i in range(t):
	a.append(int(input()))
c = 0
for j in a:
	if j % 2 == 0:
		print(j // 2)
	elif j % 2 != 0:
		if c == 0:
			print(j // 2)
			c = 1
		else:
			print(j // 2 + 1)
			c = 0


import sys
input = sys.stdin.readline
t = int(input())
arr = [0 for i in range(t)]
ans = [0 for i in range(t)]
sum = 0
for i in range(t):
	arr[i] = int(input())
	ans[i] = arr[i] // 2
	sum += ans[i]
begin = 0
while sum != 0:
	for i in range(begin, t):
		if arr[i] % 2:
			ans[i] += 1
			sum += 1
			begin = i + 1
			break
for i in ans:
	print(i)


n = int(input())
index = 1
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		b = a / 2
	else:
		if index % 2 == 0:
			b = (a + 1) / 2
		else:
			b = (a - 1) / 2
		index = index + 1
	print(int(b))


import math as m
n = int(input())
arr = []
c = 1
for i in range(n):
	t = int(input())
	if t / 2 == m.ceil(t / 2):
		arr.append(t // 2)
	elif c % 2 != 0:
		arr.append(m.ceil(t / 2))
		c += 1
	else:
		arr.append(m.floor(t / 2))
		c += 1
for i in arr:
	print(i)


n = int(input())
a = [0] * n
for i in range(n):
	a[i] = int(input())
count = 0
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] // 2
	elif a[i] > 0:
		if count % 2 == 0:
			a[i] = a[i] - 1 * (a[i] // abs(a[i]))
			a[i] = a[i] // 2
		else:
			a[i] = a[i] + 1 * (a[i] // abs(a[i]))
			a[i] = a[i] // 2
		count += 1
	else:
		if count % 2 == 0:
			a[i] = a[i] + 1 * (a[i] // abs(a[i]))
			a[i] = a[i] // 2
		else:
			a[i] = a[i] - 1 * (a[i] // abs(a[i]))
			a[i] = a[i] // 2
		count += 1
print(*a)


plus = True
for _ in range(int(input())):
	n = int(input())
	if n & 1 == 0:
		print(n // 2)
	else:
		if plus:
			print(n // 2 + 1)
		else:
			print(n // 2)
		plus = not plus


n = int(input())
l = []
octr = 0
ectr = 0
for i in range(n):
	k = int(input())
	if k % 2 == 0:
		ectr += 1
	else:
		octr += 1
	l.append(k)
c = 1
ans = []
if n == n:
	if octr == octr:
		for lk in l:
			if lk % 2 == 0:
				ans.append(lk // 2)
			elif c == 1:
				ans.append(lk // 2 + 1)
				c = 0
			else:
				ans.append(lk // 2)
				c = 1
for j in ans:
	print(j)


n = int(input())
sum = 0
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif sum == 0:
		sum += a - a // 2 * 2
		print(a // 2)
	else:
		sum += a - (a + 1) // 2 * 2
		print((a + 1) // 2)


import math as ma

def nu():
	return int(input())
n = nu()
zp = 1
for i in range(n):
	p = nu()
	if p % 2 == 0:
		print(p // 2)
	elif zp == 1:
		op = int(ma.floor(p / 2))
		print(op)
		zp *= -1
	else:
		op = int(ma.ceil(p / 2))
		print(op)
		zp *= -1


from math import floor, ceil
n = int(input())
la = []
for i in range(n):
	la.append(int(input()))
up = False
for (i, j) in enumerate(la):
	if not j % 2:
		print(j // 2)
	elif up:
		print(ceil(j / 2))
		up = not up
	else:
		print(floor(j / 2))
		up = not up


import math
n = int(input())
a = []
count = 0
b = []
for i in range(n):
	val = int(input())
	a.append(val)
for i in a:
	if i % 2 == 0:
		b.append(i // 2)
	else:
		if count % 2 == 0:
			b.append(math.floor(i / 2))
		else:
			b.append(math.ceil(i / 2))
		count = count + 1
for i in b:
	print(i)


from math import ceil, floor
A = []
B = {}
for i in range(int(input())):
	a = int(input())
	if a / 2 % 1 != 0:
		B[len(A)] = a / 2
	A += [a / 2]
s = 0
for i in B:
	if s == 0:
		A[i] = ceil(B[i])
		s = 1
	else:
		A[i] = floor(B[i])
		s = 0
for i in A:
	print(int(i))


n = int(input())
Bs = []
Is = []
s = 0
for i in range(n):
	a = int(input())
	if a % 2 != 0:
		Is.append(i)
	b = a // 2
	Bs.append(b)
	s += b
i = 0
while s < 0:
	index = Is[i]
	Bs[index] += 1
	s += 1
	i += 1
for b in Bs:
	print(b)


n = int(input())
arr = []
for i in range(n):
	arr.append(int(input()))
c = 0
for i in range(n):
	if arr[i] % 2 == 1:
		c += 1
for i in range(n):
	if c > 0 and arr[i] % 2 == 1:
		print(arr[i] // 2 + 1)
		c -= 2
	else:
		print(arr[i] // 2)


import sys
import math
import itertools
import functools
import collections
import operator

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
n = ii()
arr = []
for i in range(n):
	arr.append(ii())
odd = 0
f = True
for i in range(n):
	if arr[i] % 2:
		if f:
			arr[i] //= 2
			f = False
		else:
			arr[i] = math.ceil(arr[i] / 2)
			f = True
	else:
		arr[i] //= 2
print('\n'.join(map(str, arr)))


import math
n = int(input())
flag = 0
a = []
for i in range(n):
	a.append(int(input()))
for elem in a:
	if elem % 2 == 0:
		print(elem // 2)
	elif flag >= 0:
		print(math.floor(elem / 2))
		flag -= 0.5
	else:
		print(math.ceil(elem / 2))
		flag += 0.5


import math
n = int(input())
(a, b) = ([int(input()) for _ in range(n)], 0)
for each in a:
	if each % 2 == 0:
		print(each // 2)
	elif b == 0:
		print(math.ceil(each / 2.0))
		b = 1
	else:
		print(math.floor(each / 2.0))
		b = 0


n = int(input())
rating_array = [0] * n
for i in range(n):
	rating_array[i] = int(input())
b_array = [0] * n
switch = 0
for i in range(len(rating_array)):
	if rating_array[i] % 2 == 0:
		b_array[i] = int(rating_array[i] / 2)
	elif switch == 0:
		b_array[i] = rating_array[i] // 2 + 1
		switch = 1
	else:
		b_array[i] = rating_array[i] // 2
		switch = 0
for i in b_array:
	print(i)


from math import ceil
from math import floor
n = int(input())
a = [0] * n
b = [0] * n
odds = []
for i in range(n):
	a[i] = int(input())
	if a[i] % 2:
		odds.append(i)
	else:
		b[i] = a[i] // 2
for i in range(0, len(odds), 2):
	j = i + 1
	ai = a[odds[i]]
	aj = a[odds[j]]
	s = (ai + aj) // 2
	if ceil(ai / 2) + ceil(aj / 2) == s:
		b[odds[i]] = ceil(ai / 2)
		b[odds[j]] = ceil(aj / 2)
	elif floor(ai / 2) + floor(aj / 2) == s:
		b[odds[i]] = floor(ai / 2)
		b[odds[j]] = floor(aj / 2)
	elif ceil(ai / 2) + floor(aj / 2) == s:
		b[odds[i]] = ceil(ai / 2)
		b[odds[j]] = floor(aj / 2)
	elif floor(ai / 2) + ceil(aj / 2) == s:
		b[odds[i]] = floor(ai / 2)
		b[odds[j]] = ceil(aj / 2)
for x in b:
	print(x)


n = int(input())
s = 0
a = []
r = []
for i in range(n):
	b = int(input())
	a.append(b // 2)
	r.append(b % 2)
	s += a[i]
if s != 0:
	k = 0 - s
	for i in range(n):
		if r[i] == 1:
			a[i] += 1
			k -= 1
		if k == 0:
			break
for i in range(n):
	print(a[i])


from math import *
n = int(input())
sum = 0
found = 1
for i in range(n):
	x = int(input())
	if x & 1:
		if found == 1:
			print(x // 2)
			found = 0
		else:
			print(x // 2 + 1)
			found = 1
	else:
		print(x // 2)


n = int(input())
l = []
b = []
c = 0
for i in range(n):
	a = int(input())
	c += a // 2
	b.append(a)
for i in b:
	l.append(i // 2)
i = 0
while c != 0:
	if b[i] % 2 != 0:
		l[i] += 1
		c += 1
	i += 1
for i in l:
	print(i)


n = int(input())
counter = 0
import math
a = []
for _ in range(n):
	k = int(input())
	if k % 2 == 1:
		counter += 1
	a.append(k)
counter = counter / 2
for el in a:
	if el % 2 == 0:
		print(el // 2)
	elif el % 2 == 1 and counter > 0:
		counter -= 1
		print(math.ceil(el / 2))
	else:
		print(math.floor(el / 2))


import math
n = int(input())
a = [0] * n
b = [0] * n
c = 0
for i in range(n):
	a[i] = int(input())
	if a[i] / 2 != a[i] // 2:
		c += 1
		if c % 2 == 0:
			b[i] = math.floor(a[i] / 2)
		else:
			b[i] = math.ceil(a[i] / 2)
	else:
		b[i] = a[i] // 2
for i in range(n):
	print(b[i])


k = int(input())
count = 0
for _ in range(k):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	else:
		count += 1
		if count % 2 == 0:
			print(n // 2)
		else:
			print(n // 2 + 1)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import *
(n,) = I()
ans = []
f = 1
for i in range(n):
	(k,) = I()
	if k % 2:
		if f:
			f = 0
			ans.append(ceil(k / 2))
		else:
			f = 1
			ans.append(floor(k / 2))
	else:
		ans.append(k // 2)
print(*ans)


n = int(input())
b = []
while n > 0:
	n -= 1
	a = int(input())
	b.append(a / 2)
bal = 0
for x in b:
	if x * 2 % 2 == 0:
		print(int(x))
	elif bal > 0:
		print(int(x - 0.5))
		bal -= 1
	else:
		print(int(x + 0.5))
		bal += 1


f = int(input())
c = 0
for i in range(f):
	k = int(input())
	if k % 2 == 0:
		print(k // 2)
	elif c % 2 == 0:
		print(k // 2)
		c += 1
	else:
		print(k // 2 + 1)
		c += 1


import sys, math

def input():
	return sys.stdin.readline()[:-1]

def main():
	n = int(input())
	a = []
	f = 0
	for _ in range(n):
		t = int(input())
		if t % 2 == 0:
			a.append(t // 2)
		elif f == 0:
			a.append(t // 2)
			f = 1
		else:
			a.append((1 + t) // 2)
			f = 0
	print(*a, sep='\n')
main()


n = int(input())
A = []
even = odd = 0
for _ in range(n):
	a = int(input())
	if a % 2 == 0:
		even += 1
	else:
		odd += 1
	A.append(a)
B = []
o = 0
for a in A:
	if a % 2 == 0:
		B.append(a // 2)
	else:
		o += 1
		if o > odd // 2:
			B.append(a // 2 + 1)
		else:
			B.append(a // 2)
for b in B:
	print(b)


n = int(input())
l = [int(input()) for i in range(n)]
pos = []
neg = []
for i in l:
	if i >= 0:
		pos.append(i)
	else:
		neg.append(abs(i))
op = sum((i % 2 for i in pos))
on = sum((abs(i) % 2 for i in neg))
if op == on:
	for i in l:
		if i >= 0:
			print(i // 2)
		else:
			n = abs(i)
			print(-(n // 2))
if op > on:
	r = op - on
	c = 0
	a = r // 2
	for i in l:
		if i >= 0:
			if i & 1:
				if c < a:
					print(i // 2 + 1)
					c += 1
				else:
					print(i // 2)
			else:
				print(i // 2)
		else:
			n = abs(i)
			print(-(n // 2))
if op < on:
	r = on - op
	a = r // 2
	c = 0
	for i in l:
		if i >= 0:
			print(i // 2)
		else:
			n = abs(i)
			if n & 1:
				if c < a:
					print(-(n // 2 + 1))
					c += 1
				else:
					print(-(n // 2))
			else:
				print(-(n // 2))


numbers = int(input())
evenarr = []
oddarr = []
sumEven = 0
sumOdd = 0
ans = []
for i in range(numbers):
	temp = int(input())
	if abs(temp) % 2 == 0:
		evenarr.append(i)
		sumEven += temp // 2
	else:
		oddarr.append(i)
		sumOdd += temp // 2
	ans.append(temp // 2)
diff = sumEven + sumOdd
k = 0
for i in oddarr:
	if k >= abs(diff):
		break
	ans[i] += 1
	k += 1
for i in ans:
	print(i)


n = int(input())
ls = []
x = 0
for i in range(n):
	k = int(input())
	if k % 2:
		x ^= 1
		ls.append(k // 2 + x)
	else:
		ls.append(k // 2)
for i in ls:
	print(i)


n = int(input())
a = [int(input()) for i in range(n)]
cnt = len([i for i in a if i & 1])
j = 0
for i in a:
	if i & 1:
		if j < cnt // 2:
			print(i // 2)
		else:
			print(i // 2 + 1)
		j += 1
	else:
		print(i // 2)


num = int(input())
arr = []
while num:
	v = int(input())
	arr.append(v)
	num -= 1
even = []
odd = []
i = 0
length = len(arr)
while length:
	if arr[i] % 2 == 0:
		even.append(arr[i] // 2)
	else:
		odd.append(arr[i] // 2)
	i += 1
	length -= 1
diff = sum(odd) + sum(even)
b = abs(diff)
i = 0
length = len(arr)
while length > 0:
	if arr[i] % 2 == 0:
		arr[i] = arr[i] // 2
	else:
		arr[i] = arr[i] // 2
		if b != 0:
			if diff > 0:
				arr[i] = arr[i] - 1
				b -= 1
			elif diff < 0:
				arr[i] = arr[i] + 1
				b -= 1
	i += 1
	length -= 1
length = len(arr)
i = 0
while i < length:
	print(arr[i])
	i = i + 1


c = 0
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif n > 0 and c < 0:
		c += 1
		print((n + 1) // 2)
	elif n > 0 and c > 0:
		c -= 1
		print(n // 2)
	elif n < 0 and c < 0:
		c += 1
		print((n + 1) // 2)
	else:
		c -= 1
		print(n // 2)


import math
n = int(input())
l = []
b = []
c = 1
for i in range(n):
	c = int(input())
	l.append(c)
for i in range(n):
	if l[i] % 2 == 0:
		b.append(l[i] // 2)
	elif l[i] % 2 != 0 and c % 2 != 0:
		b.append(math.ceil(l[i] / float(2)))
		c += 1
	else:
		b.append(math.floor(l[i] / float(2)))
		c += 1
for i in range(n):
	print(b[i])


n = int(input())
s = 1
z = []
for i in range(n):
	l = int(input())
	if l % 2 == 0:
		z.append(l // 2)
	else:
		z.append((l + s) // 2)
		s *= -1
for i in range(len(z)):
	print(z[i])


no_part = int(input())
ratings = []
for i in range(no_part):
	rating = int(input('\n'))
	ratings.append(rating)
odd_no_count = 0
for nos in range(len(ratings)):
	if ratings[nos] % 2 == 0:
		print(int(ratings[nos] / 2))
	elif ratings[nos] % 2 != 0 and odd_no_count % 2 == 0:
		print(int((ratings[nos] + 1) / 2))
		odd_no_count += 1
	elif ratings[nos] % 2 != 0 and odd_no_count % 2 == 1:
		print(int((ratings[nos] - 1) / 2))
		odd_no_count += 1


n = int(input())
rate = []
odd = [False] * n
for i in range(n):
	a = int(input())
	rate.append(a // 2)
	if a % 2 == 1:
		odd[i] = True
s = -sum(rate)
i = 0
while s > 0:
	if odd[i]:
		rate[i] += 1
		s -= 1
	i += 1
for i in range(n):
	print(rate[i])


l = int(input())
a = [int(input()) for _ in range(l)]
(n, d) = (True, True)
for i in a:
	if i % 2:
		if i > 0:
			if n:
				print(i // 2 + 1)
			else:
				print(i // 2)
			n = not n
		else:
			if d:
				print(i // 2)
			else:
				print(i // 2 + 1)
			d = not d
	else:
		print(i // 2)


n = int(input())
l = []
t = []
r = 1
for i in range(n):
	x = int(input())
	if x == 0:
		l.append(x)
	elif x % 2 == 0:
		l.append(x // 2)
	elif r == 1:
		l.append((x + 1) // 2)
		r = 2
	else:
		l.append((x - 1) // 2)
		r = 1
for k in l:
	print(k)


t = int(input())
l = []
(op, on) = (0, 0)
for i in range(t):
	n = int(input())
	if abs(n) % 2 == 1:
		if n > 0:
			op += 1
		else:
			on += 1
	l.append(n)
if op == on == 0:
	for i in l:
		print(i // 2)
elif op == 0:
	on = on // 2
	for i in l:
		if abs(i) % 2 == 1 and on != 0:
			print(i // 2 + 1)
			on -= 1
		else:
			print(i // 2)
elif on == 0:
	op = op // 2
	for i in l:
		if abs(i) % 2 == 1 and op != 0:
			print(i // 2 + 1)
			op -= 1
		else:
			print(i // 2)
elif op % 2 == 0 and on % 2 == 0:
	op = op // 2
	on = on // 2
	for i in l:
		if abs(i) % 2 == 1 and i < 0 and (on != 0):
			print(i // 2 + 1)
			on -= 1
		elif abs(i) % 2 == 1 and i > 0 and (op != 0):
			print(i // 2 + 1)
			op = op - 1
		else:
			print(i // 2)
else:
	o = (op + on) // 2
	for i in l:
		if abs(i) % 2 == 1 and o != 0:
			print(i // 2 + 1)
			o -= 1
		else:
			print(i // 2)


n = int(input())
l1 = []
l2 = []
for i in range(n):
	l1.append(int(input()))
for i in range(n):
	l2.append(l1[i] // 2)
z = sum(l2)
if z > 0:
	for i in range(n):
		if l1[i] % 2 != 0:
			l2[i] -= 1
			z -= 1
			if z == 0:
				break
elif z < 0:
	for i in range(n):
		if l1[i] % 2 != 0:
			l2[i] += 1
			z += 1
			if z == 0:
				break
for i in l2:
	print(i)


n = int(input())
cnt = 0
for _ in range(n):
	v = int(input())
	if v % 2 == 0:
		print(v // 2)
	else:
		if cnt % 2 == 0:
			print(v // 2 + 1)
		else:
			print(v // 2)
		cnt += 1


def main():
	t = int(input())
	flip = False
	for _ in range(t):
		n = int(input())
		if n % 2 == 0:
			print(n // 2)
		else:
			if flip:
				print(n // 2)
			else:
				print(n // 2 + 1)
			flip = not flip
main()


c = 0
for n in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif a >= 0:
		c += 1
		if c % 2 == 0:
			print(a // 2)
		else:
			print(a // 2 + 1)
	else:
		c += 1
		if c % 2 == 0:
			print(a // 2)
		else:
			print(a // 2 + 1)


l = []
for i in range(int(input())):
	l.append(int(input()))
ans = []
f = 1
for i in l:
	if i % 2 == 0:
		ans.append(i // 2)
	else:
		ans.append((i + f) // 2)
		f *= -1
for i in ans:
	print(i)


import math
i = 0
l = []
for j in range(int(input())):
	a = int(input())
	if a % 2 != 0:
		if i == 0:
			l.append(math.floor(a / 2))
			i = 1
		else:
			l.append(math.ceil(a / 2))
			i = 0
	else:
		l.append(a // 2)
for k in l:
	print(k)


import math
n = int(input())
check = 0
sum = 0
for i in range(n):
	x = int(input())
	if x % 2 != 0 and check == 0:
		x = x // 2
		check = 1
		print(x)
		sum += x
	elif x % 2 != 0 and check == 1:
		x = x // 2
		x = math.ceil(x)
		x += 1
		sum += x
		check = 0
		print(x)
	else:
		x = x // 2
		sum += x
		print(x)


n = int(input())
k = 0
a = []
fl = True
for i in range(n):
	x = int(input())
	if abs(x) % 2 == 0:
		print(x // 2)
	elif fl:
		print(x // 2)
		fl = False
	else:
		fl = True
		print(x // 2 + 1)


n = int(input())
l = []
l1 = []
for i in range(n):
	a = int(input())
	l.append(a)
	l1.append(a // 2)
d = 0 - sum(l1)
i = 0
while d:
	while i < n:
		if l[i] % 2 != 0:
			l1[i] += 1
			i += 1
			break
		i += 1
	d -= 1
for i in l1:
	print(i)


import math
n = int(input())
a = []
for _ in range(n):
	x = int(input())
	a.append(x)
cnt = 0
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] // 2
	else:
		if cnt % 2 == 0:
			a[i] = math.ceil(a[i] / 2)
		else:
			a[i] = math.floor(a[i] / 2)
		cnt = cnt + 1
for i in range(n):
	print(a[i])


from math import *
n = int(input())
l = [int(input()) for i in range(n)]
m = l.copy()
odd = 0
x = 0
flag = True
for i in range(n):
	if int(abs(l[i])) % 2 == 1:
		if l[i] < 0:
			if flag:
				l[i] = floor(l[i] / 2)
				flag = not flag
			else:
				l[i] = ceil(l[i] / 2)
				flag = not flag
		elif flag:
			l[i] = floor(l[i] / 2)
			flag = not flag
		else:
			flag = not flag
			l[i] = ceil(l[i] / 2)
		odd += l[i]
	else:
		x += l[i] // 2
		l[i] //= 2
for i in range(n):
	print(l[i])


import math
l = []
for i in range(int(input())):
	l.append(int(input()))

def fun(a, c):
	if a % 2 == 0:
		return a / 2
	elif c % 2 == 0:
		return int(a - 1 / 2)
	elif c % 2 != 0:
		return int(a + 1 / 2)
count = 0
for i in l:
	if i % 2 == 0:
		i = int(i / 2)
		print(i)
	elif count % 2 == 0:
		i = int((i - 1) / 2)
		count += 1
		print(i)
	elif count % 2 != 0:
		i = int((i + 1) / 2)
		count += 1
		print(i)


from math import ceil, floor
arg = int(input())
res = []
r2 = 0
for i in range(0, arg):
	n = int(input())
	if r2 == 0:
		if n % 2 == 0:
			res.append(n // 2)
		else:
			res.append(int(floor(n / 2)))
			r2 -= 1
	elif r2 == 1:
		if n % 2 == 0:
			res.append(n // 2)
		else:
			res.append(int(floor(n / 2)))
			r2 -= 1
	elif n % 2 == 0:
		res.append(n // 2)
	else:
		res.append(int(ceil(n / 2)))
		r2 += 1
for k in res:
	print(k)


import math

def solve(n, a):
	r = []
	delta = 0
	for i in range(n):
		if a[i] % 2 == 0:
			r.append(a[i] // 2)
		else:
			r.append(math.ceil(a[i] / 2) + delta)
			delta += a[i] - r[i] * 2
	return r
a = []
n = int(input())
for _ in range(n):
	a.append(int(input()))
for v in solve(n, a):
	print(v)


def main():
	n = int(input())
	cnt = 0
	for i in range(n):
		a = int(input())
		if a % 2 == 0:
			print(a // 2)
		elif cnt % 2 == 0:
			print(a // 2)
			cnt += 1
		else:
			print(a // 2 + 1)
			cnt += 1
main()


import math
i = 0
for _ in range(int(input())):
	x = int(input())
	if x & 1:
		if i & 1:
			print(x // 2)
		else:
			print(math.ceil(x / 2))
		i += 1
	else:
		print(x // 2)


from math import floor, ceil
n = int(input())
e = []
c = 0
for i in range(n):
	x = int(input())
	if x & 1:
		if c == 0:
			e.append(ceil(x / 2))
		else:
			e.append(floor(x // 2))
		c ^= 1
	else:
		e.append(x // 2)
for i in e:
	print(i)


n = int(input())
a = 0
s = ''
for i in range(n):
	b = int(input())
	if b % 2 == 0:
		s += str(b // 2) + '\n'
	elif a == 0:
		a = 1
		s += str(b // 2 + 1) + '\n'
	else:
		a = 0
		s += str(b // 2) + '\n'
print(s)


from math import ceil, floor
n = int(input())
rts = [0] * n
for i in range(n):
	rts[i] = int(input())
floorTurn = True
for i in rts:
	if i % 2 == 0:
		print(i // 2)
	elif floorTurn:
		print(floor(i / 2))
		floorTurn = False
	else:
		print(ceil(i / 2))
		floorTurn = True


from sys import stdin
from math import ceil
n = int(input())
x = [int(input()) for a in range(n)]
f = -1
for i in x:
	if i % 2 == 0:
		print(i // 2)
	else:
		print((i - f) // 2)
		f *= -1


t = int(input())
p = [0] * t
s = 0
for i in range(0, t):
	p[i] = int(input())
	if p[i] % 2 != 0:
		s += 1
k = 0
s = int(s / 2)
for i in range(0, t):
	if p[i] % 2 == 0:
		print(int(p[i] / 2))
	else:
		k += 1
		if k <= s:
			if p[i] > 0:
				print(int(p[i] / 2))
			else:
				print(int(p[i] / 2) - 1)
		elif p[i] > 0:
			print(int(p[i] / 2) + 1)
		else:
			print(int(p[i] / 2))


from sys import stdin

def input():
	return stdin.readline()[:-1]

def intput():
	return int(input())

def sinput():
	return input().split()

def intsput():
	return map(int, sinput())

def floor(x):
	if x >= 0:
		return x // 2
	else:
		return -(abs(x) // 2)
n = intput()
a = []
b = []
s = 0
for _ in range(n):
	a.append(intput())
for x in a:
	if x % 2 == 0:
		b.append(x // 2)
		s += b[-1]
s = -s
o = 0
for x in a:
	if x % 2:
		o += floor(x)
off = s - o
diff = None
if off:
	diff = off // abs(off)
off = abs(off)
for x in a:
	if x % 2 == 0:
		print(x // 2)
	elif off:
		if x > 0 and diff > 0:
			print(floor(x) + diff)
			off -= 1
		elif x < 0 and diff < 0:
			print(floor(x) + diff)
			off -= 1
		else:
			print(floor(x))
	else:
		print(floor(x))


n = int(input())
arr = []
for i in range(n):
	x = int(input())
	arr.append(x)
i = 0
arr1 = []
turn = 0
while i < n:
	if arr[i] % 2 == 0:
		print(arr[i] // 2)
		i += 1
	else:
		print(arr[i] // 2)
		val = arr[i]
		i += 1
		while i < n and arr[i] % 2 == 0:
			print(arr[i] // 2)
			i += 1
		val1 = val + arr[i]
		print(val1 // 2 - val // 2)
		i += 1


n = int(input())
s = []
for i in range(n):
	x = int(input())
	s.append(x)
(f, g) = (0, 0)
for i in range(n):
	if s[i] % 2 == 0:
		print(s[i] // 2)
	elif s[i] > 0:
		print(s[i] // 2 + f)
		f ^= 1
	else:
		print(s[i] // 2 + 1 - g)
		g ^= 1


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
N = INT()
A = LIST(N)
B = [0] * N
oddcnt = 0
for i in range(N):
	if A[i] % 2 == 0:
		B[i] = A[i] // 2
	else:
		if oddcnt % 2 == 0:
			B[i] = A[i] // 2
		else:
			B[i] = ceil(A[i], 2)
		oddcnt += 1
print(*B, sep='\n')


t = int(input())
l1 = []
c = 0
c3 = 0
l2 = []
for i in range(t):
	l1.append(int(input()))
	if l1[i] % 2 != 0:
		c += 1
for k in range(t):
	if l1[k] % 2 == 0:
		l2.append(int(l1[k] / 2))
	else:
		c3 += 1
		if c3 <= int(c / 2):
			if l1[k] > 0:
				l2.append(int(l1[k] / 2) + 1)
			else:
				l2.append(int(l1[k] / 2))
		elif l1[k] > 0:
			l2.append(int(l1[k] / 2))
		else:
			l2.append(int(l1[k] / 2) - 1)
for k in range(t):
	print(l2[k])


def f(l):
	dl = [-1, 1]
	ii = 0
	for i in range(len(l)):
		if l[i] % 2 > 0:
			l[i] += dl[ii]
			ii = (ii + 1) % 2
		l[i] = l[i] // 2
	return l
n = int(input())
l = [int(input()) for _ in range(n)]
[print(r) for r in f(l)]


n = int(input())
count = 0
for _ in range(n):
	x = int(input())
	if abs(x) % 2 == 0:
		print(x // 2)
	elif count % 2 != 0:
		print((x - 1) // 2)
		count += 1
	else:
		print((x + 1) // 2)
		count += 1


import math
n = int(input())
n2 = n
rating = []
while n2:
	rating.append(int(input()))
	n2 -= 1
rating_b = []
flag = 0
for i in rating:
	if i % 2 == 0:
		val = i // 2
	elif flag == 0:
		val = math.ceil(i / 2)
		flag = 1
	else:
		val = math.floor(i / 2)
		flag = 0
	print(val)


def half(arr, n):
	flag = 0
	for i in range(n):
		if arr[i] % 2 == 0:
			print(arr[i] // 2)
		elif flag == 0:
			print(arr[i] // 2)
			flag = 1
		else:
			q = arr[i] // 2
			q += 1
			print(q)
			flag = 0
arr = list()
num = int(input())
while num > 0:
	n = input()
	arr.append(int(n))
	num = num - 1
half(arr, len(arr))


def main():
	from math import ceil
	n = int(input())
	b = []
	s = 0
	for i in range(n):
		a = int(input())
		b.append([a // 2, a % 2 == 0])
		s += a // 2
	i = 0
	while s != 0:
		if not b[i][-1]:
			s += 1
			b[i][0] += 1
		i += 1
	for i in range(len(b)):
		print(b[i][0])
main()


n = int(input())
ai = []
for i in range(n):
	ai.append(int(input()))
flag = 1
for i in ai:
	if i % 2 == 0:
		print(i // 2)
	else:
		print((i + flag) // 2)
		flag = flag * -1


n = int(input())
a = []
b = []
for i in range(n):
	x = int(input())
	a.append(x)
	b.append(x // 2)
counter = sum(b)
for i in range(n):
	if counter == 0:
		break
	if a[i] % 2 == 1:
		b[i] += 1
		counter += 1
for i in range(n):
	print(b[i])


a = []
b = []
for _ in range(int(input())):
	x = int(input())
	if x % 2 == 1:
		b.append(len(a))
		a.append(x // 2)
	else:
		a.append(x // 2)
z = sum(a)
while z != 0:
	if z > 0:
		a[b.pop()] -= 1
		z -= 1
	elif z < 0:
		a[b.pop()] += 1
		z += 1
[print(x) for x in a]


import math
n = int(input())
should_ceil = True
for _ in range(n):
	ai = int(input())
	if ai % 2 == 0:
		print(ai // 2)
	else:
		if should_ceil:
			print(math.floor(ai / 2))
		else:
			print(math.ceil(ai / 2))
		should_ceil = not should_ceil


n = int(input())
points = []
k = 0.01
for i in range(n):
	points.append(int(input()))
	if points[-1] % 2 == 0:
		points[-1] //= 2
	else:
		k *= -1
		points[-1] = round((points[-1] + k) / 2)
print(*points, sep='\n')


total = int(input())
lst = []
for i in range(total):
	lst.append(int(input()))
new = []
count = 0
for i in lst:
	if i % 2 == 0:
		new.append(i // 2)
	elif count == 0:
		new.append(i // 2)
		count = 1
	elif i < 0:
		new.append(i // 2 + 1)
		count = 0
	else:
		new.append(i // 2 + 1)
		count = 0
for i in new:
	print(i)


class mod:

	def __init__(self, x):
		self.org = x
		self.mod = x // 2
l = []
sm = 0
for _ in range(int(input())):
	x = int(input())
	obj = mod(x)
	sm += x // 2
	l.append(obj)
newl = []
if sm > 0:
	while sm > 0:
		x = l.pop()
		if x.org % 2:
			sm -= 1
			x.mod -= 1
		newl.append(x)
elif sm < 0:
	while sm < 0:
		x = l.pop()
		if x.org % 2:
			sm += 1
			x.mod += 1
		newl.append(x)
newl = newl[::-1]
l += newl
for i in l:
	sm += i.mod
	print(i.mod)


a = int(input())
z = []
OP = 0
ON = 0
for i in range(a):
	n = int(input())
	z.append(n)
flag = 0
for i in range(len(z)):
	if z[i] % 2 == 0:
		z[i] = z[i] // 2
	elif z[i] % 2 == 1 and flag == 0:
		z[i] = z[i] // 2
		flag = 1
	elif z[i] % 2 == 1 and flag == 1:
		z[i] = z[i] // 2 + 1
		flag = 0
for i in range(len(z)):
	print(z[i])


from math import floor, ceil
arr = []
for _ in range(int(input())):
	n = int(input())
	arr.append(n)
count = 0
for i in range(len(arr)):
	if arr[i] % 2 == 0:
		arr[i] = arr[i] // 2
	elif arr[i] % 2 == 1:
		if count:
			arr[i] = floor(arr[i] / 2)
			count -= 1
		else:
			arr[i] = ceil(arr[i] / 2)
			count += 1
	print(arr[i])


from math import *
n = int(input())
a_i_arr = []
for i in range(n):
	a_i = int(input())
	a_i_arr.append(a_i)
a_i_odd_arr = []
odd_count = 0
for i in range(n):
	if a_i_arr[i] % 2 == 1:
		if odd_count % 2 == 0:
			a_i_arr[i] = floor(a_i_arr[i] / 2)
		else:
			a_i_arr[i] = ceil(a_i_arr[i] / 2)
		odd_count += 1
	else:
		a_i_arr[i] = a_i_arr[i] // 2
for i in range(n):
	print(a_i_arr[i])


import sys
readline = sys.stdin.readline
N = int(readline())
A = [int(readline()) for _ in range(N)]
Ans = [0] * N
p = True
for i in range(N):
	a = A[i]
	if a % 2 == 0:
		Ans[i] = a // 2
	else:
		if p:
			Ans[i] = a // 2
		else:
			Ans[i] = a // 2 + 1
		p = not p
print('\n'.join(map(str, Ans)))


n = int(input())
sm = 0
a = []
b = []
for i in range(n):
	v = int(input())
	sm += v // 2
	a.append(v)
	b.append(v // 2)
i = 0
while sm != 0:
	if a[i] % 2 == 1:
		b[i] += 1
		sm += 1
	i += 1
for i in range(n):
	print(b[i])


n = int(input())
round_down = True
for i in range(n):
	num = int(input())
	if num % 2 == 0:
		print(num // 2)
	else:
		if round_down:
			print(num // 2)
		else:
			print((num + 1) // 2)
		round_down = not round_down


n = int(input())
a = []
for _ in range(n):
	a.append(int(input()))
r = 0
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] = a[i] / 2
	elif r == 0:
		a[i] = a[i] / 2 - 0.5
		r = 1
	else:
		a[i] = a[i] / 2 + 0.5
		r = 0
	print(int(a[i]))


from math import *

def balanced_rating_changes(n, a):
	flag = False
	for i in range(n):
		if a[i] % 2 == 0:
			a[i] //= 2
		elif flag:
			a[i] = floor(a[i] / 2)
			flag = False
		else:
			a[i] = ceil(a[i] / 2)
			flag = True
	for i in a:
		print(i)
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
balanced_rating_changes(n, a)


from math import ceil, floor
n = int(input())
foo = 0
for i in range(n):
	a = int(input())
	if abs(a) % 2 == 0:
		print(a // 2)
	else:
		if foo % 2 == 0:
			print(ceil(a / 2))
		else:
			print(floor(a / 2))
		foo += 1


ans = list()
flag = False
a = list()
l = 0
for t in range(int(input())):
	l += 1
	n = int(input())
	added = n // 2
	a.append(n)
	ans.append(added)
s = 0
for v in ans:
	s += v
diff = s - 0
for i in range(l):
	if a[i] % 2 != 0:
		ans[i] += 1
		diff += 1
	if not diff:
		break
for v in ans:
	print(v)


n = int(input())
arr = []
pos = 0
neg = 0
for i in range(n):
	x = int(input())
	arr.append(x)
	if x >= 0:
		pos += x // 2
	else:
		neg += x // 2
n1 = abs(neg) - pos
i = 0
while n1 > 0 and i < n:
	if arr[i] % 2 == 0:
		print(arr[i] // 2)
	else:
		print(arr[i] // 2 + 1)
		n1 -= 1
	i += 1
while i < n:
	print(arr[i] // 2)
	i += 1


def printf(l):
	for i in l:
		print(i)
n = int(input())
arr = []
arr1 = []
sum = 0
for i in range(0, n):
	t = int(input())
	arr1.append(t)
	t //= 2
	sum += t
	arr.append(t)
a = 0
if sum == 0:
	printf(arr)
	exit()
else:
	for i in range(n):
		if sum == 0:
			break
		if arr1[i] % 2 != 0:
			arr[i] += 1
			sum += 1
	printf(arr)


import math
l = []
n = int(input())
for i in range(n):
	l.append(int(input()))
a = []
q = []
for i in range(len(l)):
	if l[i] % 2 == 0:
		q.append(int(l[i] / 2))
	else:
		a.append(int(math.floor(l[i] / 2.0)))
		q.append(1165)
s = 0
for i in q:
	if i == 1165:
		pass
	else:
		s += i
r = s
r += sum(a)
for i in range(abs(r)):
	a[i] += 1
a = a[::-1]
for i in range(len(q)):
	if q[i] == 1165:
		print(a.pop())
	else:
		print(q[i])


import math
rating = []
n = int(input())
for i in range(n):
	num = int(input())
	rating.append(num)
count_odd = 0
for i in range(n):
	if rating[i] % 2 == 0:
		rating[i] //= 2
	else:
		count_odd += 1
		if count_odd % 2 == 0:
			rating[i] = math.floor(rating[i] / 2)
		else:
			rating[i] = math.ceil(rating[i] / 2)
for i in rating:
	print(i)


array = []
for _ in range(int(input())):
	array.append(int(input()))
co = 0
for i in array:
	if i % 2 == 0:
		print(int(i / 2))
	elif co == 0:
		print(int(i // 2))
		co = 1
	elif co == 1:
		print(int(i // 2) + 1)
		co = 0


n = int(input())
l = []
s = 0
for i in range(n):
	m = int(input())
	l.append([m // 2, m % 2])
	s += m // 2
for i in range(n):
	if s == 0:
		break
	if l[i][1] == 1:
		l[i][0] += 1
		s += 1
for i in l:
	print(i[0])


t = int(input())
c = 0
while t:
	t -= 1
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	else:
		if c % 2 == 0:
			print(n // 2 + 1)
		else:
			print(n // 2)
		c += 1


n = int(input())
a = []
b = []
for i in range(n):
	a.append(int(input()))
	b.append(a[i] // 2)
s = sum(b)
if s != 0:
	s = abs(s)
	i = 0
	while s != 0:
		if a[i] % 2 != 0:
			b[i] += 1
			s -= 1
		i += 1
for i in b:
	print(i)


from math import ceil, floor
inp = int(input())
ls = [int(input()) for a in range(inp)]
flag = 0
for i in range(len(ls)):
	if ls[i] % 2 != 0:
		if flag == 0:
			ls[i] = ceil(ls[i] / 2)
			flag += 1
		else:
			ls[i] = floor(ls[i] / 2)
			flag -= 1
	else:
		ls[i] = int(ls[i] / 2)
print(*ls, sep='\n')


import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

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

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

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def main():
	n = inp()
	fl = False
	for _ in range(n):
		x = inp()
		if x % 2 == 0:
			print(x // 2)
		else:
			if fl:
				print(x // 2)
			else:
				print(x // 2 + 1)
			fl = not fl
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


from math import floor, ceil
n = int(input())
a = []
flag = 0
for i in range(n):
	t = int(input())
	if t % 2 != 0:
		if flag == 0:
			a.append(int(floor(t / 2)))
			flag = 1
		else:
			a.append(int(ceil(t / 2)))
			flag = 0
	else:
		a.append(t // 2)
print(*a, sep='\n')


n = int(input())
sgn = 0
for ni in range(n):
	it = int(input())
	if it & 1:
		if sgn:
			sgn = 0
			print((it >> 1) + 1)
		else:
			sgn = 1
			print(it >> 1)
	else:
		print(it >> 1)


n = int(input())
nv = 0
pv = 0
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	else:
		if nv % 2 == 0:
			print(int(x + 1) // 2)
		else:
			print(int(x - 1) // 2)
		nv += 1


n = int(input())
l1 = []
odd = 0
for i in range(n):
	l1.append(int(input()))
l = []
sum1 = 0
for i in range(n):
	if l1[i] % 2 == 0:
		sum1 += int(l1[i] / 2)
		l.append(int(l1[i] / 2))
	elif l1[i] % 2 != 0 and odd == 0:
		l.append(int(l1[i] / 2))
		sum1 += int(l1[i] / 2)
if sum1 == 0:
	for i in range(n):
		print(l[i])
elif sum1 < 0:
	for i in range(n):
		if l1[i] % 2 != 0 and l1[i] > 0:
			sum1 += 1
			l[i] += 1
		if sum1 == 0:
			break
	for i in range(n):
		print(l[i])
elif sum1 > 0:
	for i in range(n):
		if l1[i] % 2 != 0 and l1[i] < 0:
			sum1 -= 1
			l[i] -= 1
		if sum1 == 0:
			break
	for i in range(n):
		print(l[i])


t = int(input())
f = 0
while t > 0:
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif f == 0:
		print(n // 2 + 1)
		f = 1
	else:
		print(n // 2)
		f = 0
	t -= 1


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
mod = 1000000007

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

def In():
	return map(int, stdin.readline().split())

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

def printIn(ob):
	return stdout.write(str(ob) + '\n')

def powerLL(n, p):
	result = 1
	while p:
		if p & 1:
			result = result * n % mod
		p = int(p / 2)
		n = n * n % mod
	return result

def myCode():
	a = I()
	flagn = True
	flagp = True
	for i in range(a):
		n = I()
		if n % 2 == 0:
			print(n // 2)
		elif flagn:
			print(int(n / 2 + 0.5))
			flagn = False
		else:
			print(int(n / 2 - 0.5))
			flagn = True

def main():
	myCode()
main()


def isEven(num):
	return abs(num) % 2 != 1
import math
n = int(input())
b = []
b_new = []
vverh = True
negativ_vverh = True
for i in range(n):
	num = int(input())
	if isEven(num):
		b.append(num // 2)
	elif vverh:
		b.append(math.ceil(num / 2))
		vverh = False
	else:
		b.append(math.floor(num / 2))
		vverh = True
for num in b:
	print(num)


import math
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
div = []
mask = []
for i in range(n):
	temp = a[i] / 2
	if a[i] % 2 == 0:
		div.append(temp)
	else:
		div.append(temp)
		mask.append(temp)
sol = []
j = 0
for i in range(n):
	if not div[i].is_integer():
		if j % 2 == 0:
			calc = math.ceil(mask[j])
			sol.append(calc)
			print(calc)
			j += 1
		else:
			calc = math.floor(mask[j])
			sol.append(calc)
			print(calc)
			j += 1
	else:
		sol.append(int(div[i]))
		print(int(div[i]))


from math import ceil, floor
n = int(input())
vals = [int(input()) for n in range(n)]
Sum = 0
puffer = 0
puffer = True
for v in vals:
	if v % 2 == 0:
		print(int(v / 2))
	elif puffer:
		print(int(ceil(v / 2)))
		puffer = False
	else:
		print(int(v // 2))
		puffer = True


from sys import stdin

def scal(typ=int):
	return typ(stdin.readline())

def vec(typ=int):
	if isinstance(typ, list):
		inp = stdin.readline().split()
		return [typ[i](inp[i]) for i in range(len(inp))]
	else:
		return list(map(typ, stdin.readline().split()))
n = scal()
(a, b) = ([], [])
for _ in range(n):
	a.append(scal())
	b.append(a[-1] // 2)
(s, c) = (sum(b), 0)
for i in range(n):
	if c == -s:
		break
	if a[i] & 1:
		b[i] += 1
		c += 1
for e in b:
	print(e)


import sys
import itertools
import math
import collections
from collections import Counter

def pow(x, y, mod):
	r = 1
	x = x % mod
	while y > 0:
		if y & 1:
			r = r * x % mod
		y = y >> 1
		x = x * x % mod
	return r

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
n = ii()
r = []
o = 0
f = 1
for _ in range(n):
	t = ii()
	if t % 2 == 1 and f == 1:
		t = t // 2
		f = 1 - f
	elif t % 2 == 1 and f == 0:
		t = cdiv(t, 2)
		f = 1 - f
	else:
		t = t // 2
	r.append(t)
prr(r, '\n')


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


s = 0
l = []
n1 = int(input())
s1 = 0
for _ in range(n1):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	else:
		if s1 % 2 == 0:
			print(n // 2)
		else:
			print(n // 2 + 1)
		s1 = s1 + 1


import sys
from heapq import heappop
from heapq import heappush
from heapq import heapify
from bisect import insort
from bisect import bisect_right
from bisect import bisect_left
from sys import stdin, stdout
from collections import defaultdict
inp = lambda : int(stdin.readline())
sip = lambda : input()
mulip = lambda : map(int, input().split())
lst = lambda : list(map(int, stdin.readline().split()))
slst = lambda : list(sip())
arr2d = lambda x: [[int(j) for j in input().split()] for i in range(x)]
odds = lambda l: len(list(filter(lambda x: x % 2 != 0, l)))
evens = lambda l: len(list(filter(lambda x: x % 2 == 0, l)))
mod = pow(10, 9) + 7
n = inp()
l = []
for i in range(n):
	x = inp()
	l.append(x)
f = 0
for i in range(n):
	if l[i] % 2 == 0:
		print(l[i] // 2)
	elif f == 0:
		print(l[i] // 2)
		f = 1
	else:
		f = 0
		print(l[i] // 2 + 1)


import math
f = f1 = 0
l = []
for n in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		l.append(a // 2)
	elif a < 0:
		if f == 0:
			l.append(a // 2)
			f = 1
		else:
			l.append(math.ceil(a / 2))
			f = 0
	elif f1 == 0:
		l.append(math.ceil(a / 2))
		f1 = 1
	else:
		l.append(a // 2)
		f1 = 0
print(*l)


from math import *
t = int(input())
flag = True
for _ in range(t):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif flag == True:
		print(ceil(a / 2))
		flag = False
	else:
		print(floor(a / 2))
		flag = True


from collections import defaultdict as dc
from collections import deque as dq
from bisect import bisect_left, bisect_right, insort_left
import sys
import math
mod = 10 ** 9 + 7

def bs(a, x):
	i = bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def inp():
	p = sys.stdin.readline()
	return p

def line():
	p = list(map(int, inp().split()))
	return p
n = int(inp())
a = []
k = 0
for i in range(n):
	z = int(inp())
	if z % 2 == 0:
		z = z // 2
	elif k == 0:
		z = math.ceil(z / 2)
		k = 1
	else:
		z = math.floor(z / 2)
		k = 0
	a.append(z)
for i in range(n):
	print(a[i])


n = int(input())
l = []
for i in range(n):
	x = int(input())
	l.append(x)
sum_odd = 0
helper = 0
for t in l:
	if t % 2 == 0:
		print(t // 2)
	elif helper == 0:
		print(t // 2)
		helper = 1
		continue
	elif helper == 1:
		print(t // 2 + 1)
		helper = 0
		continue


from math import ceil, floor
n = int(input())
cou = 0
p = 0
while n:
	a = int(input())
	if a % 2 == 1:
		cou += 1
		if cou % 2 == 1:
			if a > 0:
				p = 1
			else:
				p = -1
			print(ceil(a / 2))
		else:
			print(floor(a / 2))
	else:
		print(a // 2)
	n -= 1


I = input
pr = print
t = 1
for _ in range(int(I())):
	n = int(I())
	print(int((n + (n & 1) * t) / 2))
	t *= -1 if n & 1 else 1


n = int(input())
array = []
c = 1
for i in range(n):
	array += [int(input())]
for (j, i) in enumerate(array):
	if i % 2 == 0:
		array[j] = i // 2
	elif c == 1:
		array[j] = int(i / 2 - 0.5)
		c = 0
	else:
		array[j] = int(i / 2 + 0.5)
		c = 1
for i in array:
	print(i)


l = []
co = 0
n = int(input())
for i in range(n):
	d = int(input())
	l.append(d)
for i in range(n):
	if l[i] % 2 == 0:
		l[i] = l[i] / 2
	elif l[i] % 2 != 0:
		co += 1
		if co % 2 == 0:
			l[i] = (l[i] + 1) / 2
		else:
			l[i] = (l[i] - 1) / 2
if sum(l) == 0:
	for i in range(n):
		print(int(l[i]))
else:
	l[-1] = l[-1] - sum(l)
	for i in range(n):
		print(l)


n = int(input())
j = 0
res = []
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		res.append(a // 2)
	else:
		res.append(a // 2 + j)
		j = (j + 1) % 2
for i in res:
	print(i)


import math
n = int(input())
a = []
b = []
f = 0
for i in range(n):
	a.append(int(input()))
	if a[i] / 2 - a[i] // 2 == 0.5 and f == 0:
		b.append(math.ceil(a[i] / 2))
		f = 1
	elif a[i] / 2 - a[i] // 2 == 0.5 and f == 1:
		b.append(math.floor(a[i] / 2))
		f = 0
	else:
		b.append(round(a[i] / 2))
for i in b:
	print(i)


n = int(input())
k = n
a = []
while k > 0:
	k -= 1
	x = int(input())
	a.append(x)
b = []
for i in range(n):
	b.append(a[i] // 2)
z = sum(b)
if z >= 0:
	i = 0
	while z > 0:
		if a[i] % 2 != 0:
			b[i] -= 1
			z -= 1
		i += 1
elif z < 0:
	i = 0
	while z < 0:
		if a[i] % 2 != 0:
			b[i] += 1
			z += 1
		i += 1
for i in b:
	print(i)


n = int(input())
res = []
sm = 0
odds = set()
for i in range(n):
	r = int(input())
	v = r // 2
	if r & 1:
		odds.add(i)
	res.append(v)
	sm += v
i = 0
while i < n and sm:
	if sm == 0:
		break
	if i in odds:
		res[i] += 1
		sm += 1
	i += 1
print(*res, sep='\n')


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 1000010
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
a = [int(input()) for _ in range(int(input()))]
o = 0
for i in a:
	if i % 2:
		o += 1
assert o % 2 == 0
x = o // 2
f = 1
b = []
for i in a:
	if i % 2:
		if f:
			b += [i // 2]
			x -= 1
			if x == 0:
				f ^= 1
		else:
			b += [(i + 1) // 2]
	else:
		b += [i // 2]
for i in b:
	print(i)


n = int(input())
l = []
for i in range(n):
	a = int(input())
	l.append(a)
dup = 0
for i in l:
	if i % 2 == 1:
		dup += 1
m = 0
for i in l:
	if i % 2 == 0:
		print(i // 2)
	elif m < dup // 2:
		print(i // 2)
		m += 1
	else:
		print(i // 2 + 1)
		m += 1


import math
n = int(input())
adder = 0
for p in range(n):
	num = int(input())
	if num % 2 == 0:
		ans = num / 2
	else:
		ans = round((num + adder) / 2)
		adder = adder + num - 2 * ans
	print(int(ans))


l = []
i = 1
t = 0
import math
for p in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		l.append(n // 2)
	elif i == 1:
		l.append(math.ceil(n / 2))
		i = -1
	else:
		l.append(math.floor(n / 2))
		i = 1
for i in l:
	print(i)


from math import *
n = int(input())
c = 0
for i in range(n):
	a = int(input())
	if a % 2 == 1 and c == 0:
		c += 1
		print(a // 2)
	elif a % 2 == 1 and c == 1:
		c = 0
		print(int(ceil(a / 2)))
	else:
		print(a // 2)


import sys
input = sys.stdin.buffer.readline
con = 10 ** 9 + 7
INF = float('inf')

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

def main():
	N = int(input())
	a = [0] * N
	b = [0] * N
	for i in range(N):
		a[i] = int(input())
	p = 0
	q = 0
	for i in range(N):
		if a[i] >= 0:
			if a[i] % 2 != 0:
				if p % 2 == 0:
					b[i] = a[i] // 2
				else:
					b[i] = a[i] // 2 + 1
				p += 1
			else:
				b[i] = a[i] // 2
		elif a[i] % 2 != 0:
			if q % 2 == 0:
				b[i] = a[i] // 2 + 1
			else:
				b[i] = a[i] // 2
			q += 1
		else:
			b[i] = a[i] // 2
	for i in range(N):
		print(b[i])
main()


def modify(inp, arr, diff):
	n = len(arr)
	i = 0
	while i < n:
		if diff == 0:
			return arr
		if diff > 0:
			if inp[i] & 1:
				arr[i] = arr[i] - 1
				diff = -1
		elif diff < 0:
			if inp[i] & 1:
				arr[i] = arr[i] + 1
				diff += 1
		i += 1
from math import floor, ceil
a = []
n = int(input())
for i in range(n):
	x = int(input())
	a.append(x)
out = []
sum = 0
for i in range(n):
	if a[i] & 1:
		num = a[i] // 2
		out.append(num)
	else:
		num = int(a[i] / 2)
		out.append(num)
	sum += num
if sum != 0:
	x = modify(a, out, sum)
	for i in x:
		print(i)
else:
	for i in out:
		print(i)


q = int(input())
f = 1
for i in range(q):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		print((a + f) // 2)
		f *= -1


tests = int(input())
g = 1
for _ in range(tests):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	else:
		print(n // 2 + g)
		g = 1 - g


n = int(input())
new_list = []
odd = True
for i in range(n):
	new_list.append(int(input()))
for j in new_list:
	if j % 2 == 0:
		print(j // 2)
	elif odd:
		print(j // 2)
		odd = False
	else:
		print(j // 2 + 1)
		odd = True


n = int(input())
z = []
a = []
s = 0
for i in range(n):
	z.append(int(input()))
	s += z[i] // 2
i = 0
for i in range(n):
	k = 0
	if z[i] % 2 != 0 and s != 0:
		if s < 0 and 0 < z[i]:
			k = 1
			s += 1
		elif s < 0 and 0 > z[i]:
			k = 1
			s += 1
	print(z[i] // 2 + k)


n = int(input())
a = [int(input()) for _ in range(n)]
c = 0
for ai in a:
	if ai % 2 == 1:
		c += 1
c //= 2
for ai in a:
	if ai % 2 == 1:
		if c > 0:
			print(ai // 2 + 1)
			c -= 1
		else:
			print(ai // 2)
	else:
		print(ai // 2)


from sys import stdin
input = stdin.readline
a = []
p = 1
ans = []
c = 0
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		a.append(n // 2)
	else:
		c += 1
	ans.append(n)
for i in ans:
	if i % 2 == 0:
		print(i // 2)
	else:
		if p <= c // 2:
			print(i // 2)
		else:
			print(i // 2 + 1)
		p += 1


import math

def main():
	n = int(input())
	b = []
	for i in range(n):
		b.append(int(input()))
	cnt = 0
	for i in range(len(b)):
		if b[i] % 2 == 0:
			b[i] //= 2
		else:
			if cnt % 2 == 0:
				b[i] = math.floor(b[i] / 2)
			else:
				b[i] = math.ceil(b[i] / 2)
			cnt += 1
	for i in b:
		print(i)
main()


import math
n = int(input())
arr = []
for ii in range(n):
	x = int(input())
	arr.append(x)
neg = []
pos = []
for i in range(len(arr)):
	if arr[i] % 2 == 1:
		if arr[i] < 0:
			neg.append(i)
		else:
			pos.append(i)
ans = []
for i in range(len(arr)):
	ans.append(arr[i] // 2)
ss = sum(ans)
if ss == 0:
	for i in ans:
		print(i)
	exit()
elif ss > 0:
	for i in range(len(neg)):
		if ss == 0:
			break
		ans[neg[i]] = math.ceil(arr[neg[i]] / 2)
		ss -= 1
		if ss == 0:
			break
	for i in range(len(pos)):
		if ss == 0:
			break
		ans[pos[i]] = math.floor(arr[pos[i]] / 2)
		ss -= 1
		if ss == 0:
			break
	for i in ans:
		print(i)
	exit()
else:
	for i in range(len(pos)):
		if ss == 0:
			break
		ans[pos[i]] = math.ceil(arr[pos[i]] / 2)
		ss += 1
		if ss == 0:
			break
	for i in range(len(neg)):
		if ss == 0:
			break
		ans[neg[i]] = math.ceil(arr[neg[i]] / 2)
		ss += 1
		if ss == 0:
			break
	for i in ans:
		print(i)
	exit()


n = int(input())
amaris = []
plus_count = 0
minus_count = 0
min_sum = 0
half_vals = []
for i in range(n):
	val = int(input())
	if val % 2 == 0:
		amaris.append(0)
	elif val >= 0:
		amaris.append(1)
		plus_count += 1
	else:
		amaris.append(-1)
		minus_count += 1
	half_val = val // 2
	min_sum += half_val
	half_vals.append(half_val)
for (half_val, flag) in zip(half_vals, amaris):
	if min_sum < 0 and (flag == -1 or flag == 1):
		cur_val = half_val + 1
		min_sum += 1
	else:
		cur_val = half_val
	print(cur_val)


n = int(input())
balance = 0
A = []
for i in range(n):
	a = int(input())
	if a % 2 == 1:
		if a > 0:
			A.append((a // 2, 1))
			balance += a // 2
		else:
			A.append((a // 2 + 1, -1))
			balance += a // 2 + 1
	else:
		A.append((a // 2, 0))
		balance += a // 2
for at in A:
	(a, t) = at
	if t == -1 and balance > 0:
		print(a - 1)
		balance -= 1
	elif t == 1 and balance < 0:
		print(a + 1)
		balance += 1
	else:
		print(a)


import math as m
n = int(input())
a = [0] * n
flag = False
for i in range(n):
	a[i] = int(input())
	if a[i] % 2:
		if flag == False:
			a[i] = a[i] // 2
			flag = True
		else:
			a[i] = a[i] // 2 + 1
			flag = False
	else:
		a[i] = a[i] // 2
for i in range(n):
	print(a[i])


from math import floor, ceil
n = int(input())
sum1 = 0
(a, b) = (list(), list())
for i in range(n):
	a.append(int(input()))
	b.append(ceil(a[i] / 2) if a[i] >= 0 else floor(a[i] / 2))
	sum1 += b[i]
while sum1 != 0:
	if sum1 > 0:
		for j in range(len(b)):
			if b[j] >= 0 and a[j] % 2 == 1:
				b[j] -= 1
				sum1 -= 1
				if sum1 == 0:
					break
	elif sum1 < 0:
		for j in range(len(b)):
			if b[j] < 0 and abs(a[j]) % 2 == 1:
				b[j] += 1
				sum1 += 1
				if sum1 == 0:
					break
print(*b, sep='\n')


n = int(input())

def ceil(a):
	return -(-a // 2)

def floor(a):
	return a // 2
(a, b) = ([], [])
s = 0
for i in range(n):
	tmp = int(input())
	a.append(tmp)
	b.append(tmp // 2)
	s += tmp // 2
if s == 0:
	for i in range(n):
		print(b[i])
else:
	for i in range(n):
		if s == 0:
			print(b[i])
		elif a[i] % 2:
			print(b[i] + 1)
			s += 1
		else:
			print(b[i])


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
k = 0.5
for i in a:
	if i % 2 == 0:
		print(i // 2)
	else:
		print(int(i // 2 + 0.5 + k))
		k *= -1


import math
n = int(input())
oddp = []
oddn = []
sumarr = []
ceil = []
floor = []
for _ in range(n):
	a = int(input())
	sumarr.append(a)
	ceil.append(math.ceil(a / 2))
	floor.append(math.floor(a / 2))
	if a & 1:
		if a <= 0:
			oddn.append(a)
		else:
			oddp.append(a)
count1 = abs(sum(floor))
count2 = abs(sum(ceil))
if count1 == 0:
	for u in floor:
		print(u)
elif count2 == 0:
	for u in ceil:
		print(u)
else:
	if count1 > count2:
		for i in range(0, n):
			if count2 > 0:
				if math.ceil(sumarr[i] / 2) != math.floor(sumarr[i] / 2):
					sumarr[i] = math.floor(sumarr[i] / 2)
					count2 = count2 - 1
				else:
					sumarr[i] = sumarr[i] // 2
			elif math.ceil(sumarr[i] / 2) != math.floor(sumarr[i] / 2):
				sumarr[i] = math.ceil(sumarr[i] / 2)
			else:
				sumarr[i] = sumarr[i] // 2
	else:
		for i in range(0, n):
			if count1 > 0:
				if math.ceil(sumarr[i] / 2) != math.floor(sumarr[i] / 2):
					sumarr[i] = math.ceil(sumarr[i] / 2)
					count1 = count1 - 1
				else:
					sumarr[i] = sumarr[i] // 2
			elif math.ceil(sumarr[i] / 2) != math.floor(sumarr[i] / 2):
				sumarr[i] = math.floor(sumarr[i] / 2)
			else:
				sumarr[i] = sumarr[i] // 2
	for s in sumarr:
		print(s)


n = int(input())
l = []
c = 0
for i in range(n):
	x = int(input())
	if x % 2:
		if c == 0:
			l.append(x // 2)
			c = 1
		else:
			l.append(x // 2 + 1)
			c = 0
	else:
		l.append(x // 2)
print(*l, sep='\n')


b = 0.5
for ch in [int(input()) / 2 for k in range(0, int(input()))]:
	print(int(ch) if int(ch) == ch else int(ch + b))
	b = b if int(ch) == ch else -b


x = int(input())
test = 0.5
te = False
li = []
for i in range(x):
	h = int(input())
	if h % 2 == 0:
		li.append(h // 2)
		continue
	li.append(h / 2)
	if li[i] < 0 and te is False:
		li[i] = li[i] - 0.5
	if li[i] < 0 and te is True:
		li[i] = li[i] + 0.5
	if li[i] > 0 and te is False:
		li[i] = li[i] - 0.5
	if li[i] > 0 and te is True:
		li[i] = li[i] + 0.5
	if te is False:
		te = True
	else:
		te = False
for i in li:
	print(int(i))


from math import ceil, floor
n = int(input())
rate = []
for i in range(n):
	rate.append(int(input()))
out_rate = []
error = 0
num = 0
for r in rate:
	if r % 2 == 0:
		out_rate.append(int(r / 2))
	elif error > 0:
		out_rate.append(floor(r / 2))
		reduced = num
		error -= 1
	else:
		out_rate.append(ceil(r / 2))
		increased = num
		error += 1
	num += 1
Sum = sum(out_rate)
if Sum > 0:
	out_rate[increased] -= 1
elif Sum < 0:
	out_rate[reduced] += 1
print(*out_rate, sep='\n')


n = int(input())
a = [0] * n
counter = 0
for i in range(n):
	a[i] = int(input())
	if a[i] % 2 == 0:
		a[i] //= 2
	elif a[i] < 0:
		if counter <= 0:
			a[i] = (a[i] + 1) // 2
			counter += 1
		elif counter == 1:
			a[i] = a[i] // 2
			counter -= 1
	elif counter <= 0:
		a[i] = (a[i] + 1) // 2
		counter += 1
	else:
		a[i] = a[i] // 2
		counter -= 1
for i in range(len(a)):
	print(a[i])


from math import ceil
flag = True
n = int(input())
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		if flag:
			print(a // 2)
		else:
			print(ceil(a / 2))
		flag = not flag


n = int(input())
f = 1
for i in range(n):
	m = int(input())
	if m % 2 == 0:
		print(m // 2)
	else:
		print(m // 2 + f)
		f = (f + 1) % 2


import math
n = int(input())
e = []
r = 0
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		e.append(x // 2)
	elif r == 0:
		r = 1
		f = math.floor(x / 2)
		e.append(f)
	else:
		r = 0
		c = math.ceil(x / 2)
		e.append(c)
for i in range(n):
	print(e[i])


n = int(input(''))
a = [] * n
c = 0
e = 0
f = 0
q = [] * n
for i in range(0, n):
	o = int(input(''))
	a.append(o)
	if a[i] == 0:
		q.append(0)
	elif a[i] % 2 == 0:
		q.append(a[i] // 2)
	elif a[i] > 0:
		if c > 0:
			q.append(a[i] // 2 + 1)
			c = 0
		else:
			q.append(a[i] // 2)
			c += 1
	else:
		a[i] = a[i] * -1
		if e > 0:
			q.append((a[i] // 2 + 1) * -1)
			e = 0
		else:
			q.append(a[i] // 2 * -1)
			e += 1
for i in range(0, n):
	print(q[i])


n = int(input())
l = []
odd = 0
flag = 1
for i in range(n):
	a = int(input())
	if a % 2 != 0:
		print((a + flag) // 2)
		flag *= -1
	else:
		print(a // 2)


n = int(input())
a = []
for _ in range(n):
	a.append(int(input()))
m = 0
for b in a:
	if b % 2 == 0:
		print(b // 2)
	else:
		print(b // 2 + m)
		m = b % 2 if not m else 0


from math import ceil
n = int(input())
seq = [int(input()) for _ in range(n)]
ans = []
do_ceil = False
for e in seq:
	if e % 2 == 0:
		ans.append(e // 2)
	else:
		ans.append(ceil(e / 2) if do_ceil else e // 2)
		do_ceil = not do_ceil
print('\n'.join(map(str, ans)))


import math
n = int(input())
cnt = 0
while n:
	x = int(input())
	if x & 1:
		if cnt & 1:
			print(math.floor(x / 2))
		else:
			print(math.ceil(x / 2))
		cnt = cnt + 1
	else:
		print(x // 2)
	n = n - 1


import math
t = int(input())
arr = []
parity = 0
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		arr.append(n // 2)
	elif parity == 0:
		arr.append(math.ceil(n / 2))
		parity = 1
	else:
		arr.append(math.floor(n / 2))
		parity = 0
for i in arr:
	print(i)


import sys
from collections import defaultdict
from math import floor, ceil
input = sys.stdin.readline
n = int(input())
lis = []
for _ in range(n):
	x = int(input())
	lis.append(x)
	if x % 2 == 0:
		lis[-1] = [x // 2, 0]
	elif x < 0:
		lis[-1] = [ceil(x / 2), -1]
	else:
		lis[-1] = [floor(x / 2), 1]
s = 0
for i in lis:
	s += i[0]
for i in range(n):
	if s > 0:
		if lis[i][1] == -1:
			lis[i][0] -= 1
			s -= 1
	elif s < 0:
		if lis[i][1] == 1:
			lis[i][0] += 1
			s += 1
for i in lis:
	print(i[0])


import sys
import math

def main(arr):
	odd_nums = len(list(filter(lambda x: x % 2 != 0, arr)))
	to_round_up = odd_nums / 2
	for (e, n) in enumerate(arr):
		if n % 2 == 0:
			arr[e] = int(n / 2)
		elif to_round_up > 0:
			to_round_up -= 1
			arr[e] = int(math.ceil(n / 2))
		else:
			arr[e] = n // 2
	for n in arr:
		print(n)
arr = []
for (e, line) in enumerate(sys.stdin.readlines()):
	if e == 0:
		continue
	else:
		arr.append(int(line.strip()))
main(arr)


n = int(input())
sum_b = 0
answer = []
for i in range(n):
	a = int(input())
	b = a // 2
	if a % 2 == 0:
		None
	elif sum_b == 1:
		b -= 1
		sum_b -= 1
	elif sum_b == -1:
		b += 1
		sum_b += 1
	else:
		sum_b -= 1
	answer.append(b)
for i in answer:
	print(i)


n = int(input())
a = []
b = []
a.append(0)
b.append(0)
delt = 0
for i in range(1, n + 1):
	a.append(int(input()))
	b.append(a[i] // 2)
	delt += b[i]
for i in range(1, n + 1):
	if a[i] & 1:
		if delt < 0:
			delt += 1
			b[i] += 1
	print(b[i])


import math
s = 0
check = 0
n = int(input())
for i in range(n):
	a = int(input())
	d = a / 2
	if a % 2 == 0:
		print(int(d))
		s += int(d)
		continue
	if check == 0:
		print(math.floor(d))
		check = 1
		s += math.floor(d)
		continue
	if check == 1:
		print(math.ceil(d))
		s += math.ceil(d)
		check = 0
		continue


n = int(input().strip())
arr = []
b = []
flag = False
for i in range(n):
	arr.append(int(input().strip()))
	if arr[i] % 2 == 0:
		arr[i] //= 2
	elif flag:
		arr[i] //= 2
		arr[i] += 1
		flag = False
	else:
		arr[i] //= 2
		flag = True
	print(arr[i])


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(int(input()))
	cnt = 0
	for i in range(n):
		if arr[i] % 2 == 0:
			print(arr[i] // 2)
		elif arr[i] % 2 != 0 and cnt == 0:
			print(arr[i] // 2)
			cnt += 1
		elif arr[i] % 2 != 0 and cnt == 1:
			print(math.ceil(arr[i] / 2))
			cnt -= 1
t = 1
for _ in range(t):
	main()


n = int(input())
a = [int(input()) for k in range(0, n)]
b = 0.5
for ch in a:
	if ch % 2 == 0:
		print(int(ch / 2))
	else:
		print(int(ch / 2 + b))
		b *= -1


import sys
first = True
n = -1
done = 0
last = 0
for line in sys.stdin:
	if first:
		first = False
		n = int(line)
		continue
	a = int(line)
	if a % 2 == 0:
		print(a // 2)
	else:
		if last % 2 == 0:
			print(a // 2 + 1)
		else:
			print(a // 2)
		last = last + 1
	done = done + 1
	if done == n:
		break


def rndup(n):
	res = n + 1
	res = res // 2
	return res

def rnddown(n):
	res = n - 1
	res = res // 2
	return res
n = int(input())
a = []
b = []
flag = 0
for i in range(n):
	t = int(input())
	b.append(t)
	if abs(t) % 2 == 1:
		a.append(t)
i = 0
while i < len(a):
	t1 = a[i]
	t2 = a[i + 1]
	a[i] = rndup(t1)
	a[i + 1] = rnddown(t2)
	i += 2
i = 0
cnt = 0
while i < n:
	if abs(b[i]) % 2 == 1:
		print(a[cnt])
		cnt += 1
	else:
		print(b[i] // 2)
	i += 1


from math import *
n = int(input())
k = []
p = 0
for x in range(n):
	a = int(input())
	if a % 2 == 0:
		a = int(a / 2)
		k.append(a)
	else:
		if p % 2 == 0:
			a = floor(a / 2)
			k.append(a)
		else:
			a = ceil(a / 2)
			k.append(a)
		p += 1
for i in range(len(k)):
	print(k[i])


n = int(input())
a = [int(input()) for _ in range(n)]
o = 0
for x in a:
	if x % 2:
		o += 1
o = o // 2
for i in range(n):
	if a[i] % 2:
		a[i] = a[i] // 2
		if o:
			a[i] += 1
			o -= 1
	else:
		a[i] = a[i] // 2
for x in a:
	print(x)


import math
n = int(input())
ratings = []
for i in range(n):
	ratings.append(int(input()))
up_flag = True
down_flag = False
for r in ratings:
	if r % 2 == 0:
		print(r // 2)
	elif up_flag:
		print(math.ceil(r / 2))
		up_flag = not up_flag
		down_flag = not down_flag
	else:
		print(math.floor(r / 2))
		up_flag = not up_flag
		down_flag = not down_flag


q = int(input())
flag = 1
ans = 0
for _ in range(q):
	x = int(input())
	if x & 1:
		if flag:
			print(x // 2)
			ans += x // 2
		else:
			print((x + 1) // 2)
			ans += (x + 1) // 2
		flag ^= 1
	else:
		print(x // 2)
		ans += x // 2


from math import floor, ceil
f = 1
for i in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		print(floor(a / 2) if f == -1 else ceil(a / 2))
		f *= -1


def inp_n():
	return int(input())

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

def inp_mul_num():
	return map(int, input().split())

def is_odd(n):
	if n & 1:
		return True
	return False
from collections import defaultdict
import math
n = inp_n()
l = [0] * n
s1 = s2 = 0
for i in range(n):
	l[i] = inp_n()
f = 1
for el in l:
	if el % 2 != 0:
		print((el + f) // 2)
		f *= -1
	else:
		print(el // 2)


n = int(input())
test = True
for i in range(n):
	k = int(input())
	yes = False
	if k % 2 != 0:
		yes = True
	if yes:
		if test:
			print(k // 2 + 1)
			test = False
		else:
			print(k // 2)
			test = True
	else:
		print(k // 2)


l = []
for q in range(int(input())):
	n = int(input())
	l.append(n)
nl = []
k = 0
for i in l:
	if i % 2 == 0:
		print(i // 2)
	elif k == 0:
		print((i - 1) // 2)
		k = 1
	elif k == 1:
		print((i + 1) // 2)
		k = 0


n = int(input())
odn = True
odp = True
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(f'{int(x / 2)}')
	elif x < 0:
		print(f'{int(x / 2 - 1)}') if odn else print(f'{int(x / 2)}')
		odn = not odn
	else:
		print(f'{int(x / 2 + 1)}') if odp else print(f'{int(x / 2)}')
		odp = not odp


from sys import stdin

def main():
	input()
	(l, balance) = (stdin.read().splitlines(), True)
	for (i, s) in enumerate(l):
		b = int(s)
		if b & 1:
			b += balance
			balance ^= True
		l[i] = str(b // 2)
	print('\n'.join(l))
main()


import math
li = []
lodd = []
n = int(input())
for i in range(n):
	li.append(int(input()))
for i in range(n):
	if li[i] % 2 == 0:
		li[i] = li[i] // 2
	else:
		lodd.append((li[i], i))
lodd = sorted(lodd, key=lambda x: x[0])
k = len(lodd)
for i in range(k // 2):
	li[lodd[i][1]] = math.floor(lodd[i][0] / 2)
	li[lodd[k - 1 - i][1]] = math.ceil(lodd[k - 1 - i][0] / 2)
for i in li:
	print(i)


n = int(input())
mod = 1
for _ in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		print(a // 2 + mod)
		mod = 1 - mod


n = int(input())
d = list()
odd_count = 0
for i in range(n):
	d.append(int(input()))
	if d[-1] % 2 == 1:
		odd_count += 1
second_count = 0
for i in range(n):
	if d[i] % 2 == 1:
		second_count += 1
		d[i] //= 2
		if second_count <= odd_count // 2:
			d[i] += 1
	else:
		d[i] //= 2
for elem in d:
	print(elem)


import math
t = int(input())
c = 0
while t:
	n = int(input())
	if n % 2 != 0 and c % 2 == 0:
		c += 1
		print(math.ceil(n / 2))
	elif n % 2 != 0 and c % 2 != 0:
		c += 1
		print(math.floor(n / 2))
	else:
		print(n // 2)
	t -= 1


n = int(input())
upper = True
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif upper:
		print((a + 1) // 2)
		upper = False
	else:
		print((a - 1) // 2)
		upper = True


n = int(input())
a = [int(input()) for i in range(n)]
b = [0] * n
c = 1
for i in range(n):
	b[i] = a[i] // 2
	if a[i] % 2:
		b[i] += c
		c ^= 1
print('\n'.join(map(str, b)))


n = int(input())
out = []
check = 0
for i in range(n):
	b = int(input())
	if b % 2 == 0:
		out.append(int(b / 2))
	elif b % 2 == 1 and b > 0:
		if check >= 0:
			check = check - 1
			out.append(int(b / 2))
		elif check < 0:
			check = check + 1
			out.append(int(b / 2) + 1)
	elif b % 2 == 1 and b < 0:
		if check >= 0:
			check = check - 1
			out.append(int(b / 2) - 1)
		elif check < 0:
			check = check + 1
			out.append(int(b / 2))
for i in range(n):
	print(out[i])


from math import floor, ceil
n = int(input())
temp = 0
brr = []
for i in range(n):
	val = int(input())
	if val % 2 == 0:
		brr.append(val // 2)
	else:
		if temp == 0:
			ans = int(floor(val / 2))
			temp = 1
		else:
			ans = int(ceil(val / 2))
			temp = 0
		brr.append(ans)
for i in range(n):
	print(brr[i])


import sys
input = sys.stdin.readline
n = int(input())
A = [int(input()) for i in range(n)]
ANS = [a // 2 for a in A]
SUM = sum(ANS)
for i in range(n):
	if A[i] % 2 == 1:
		ANS[i] += 1
		SUM += 1
	if SUM == 0:
		break
for ans in ANS:
	print(ans)


n = int(input())
l = []
s = []
for i in range(n):
	a = int(input())
	s.append(a)
	a = a // 2
	l.append(a)
S = sum(l)
for i in range(n):
	if S > 0:
		if s[i] % 2 == 1:
			l[i] += 1
			S -= 1
	if S < 0:
		if s[i] % 2 == 1:
			l[i] += 1
			S += 1
	print(l[i])


n = int(input())
a = [int(input()) for _ in range(n)]
(even, odd) = ([], [])
(s1, s2) = (0, 0)
for i in range(n):
	if a[i] % 2 == 0:
		even.append([i, a[i] // 2])
		s1 += a[i] // 2
	else:
		odd.append([i, a[i] // 2])
		s2 += a[i] // 2
lack = -s1 - s2
counter = 0
if lack > 0:
	for i in range(lack):
		odd[counter][1] += 1
		counter += 1
else:
	for i in range(abs(lack)):
		odd[counter][1] -= 1
		counter += 1
l = even + odd
l.sort(key=lambda k: k[0])
for (_, v) in l:
	print(v)


n = int(input())
flag = 1
for _ in range(n):
	t = int(input())
	if not t % 2:
		print(t // 2)
	else:
		print((t + flag) // 2)
		flag *= -1


def main():
	testcase = int(input())
	result = []
	positive_total = 0
	negative_total = 0
	positivOdd = []
	negativeOdd = []
	for i in range(testcase):
		cin = int(input())
		div = int(cin / 2)
		result.append(div)
		if cin % 2 == 0:
			if cin >= 0:
				positive_total += div
			else:
				negative_total += div
		elif cin >= 0:
			positive_total += div
			positivOdd.append(i)
		else:
			negative_total += div
			negativeOdd.append(i)
	negative_total *= -1
	while negative_total != positive_total:
		if positive_total < negative_total:
			result[positivOdd.pop()] += 1
			positive_total += 1
		else:
			result[negativeOdd.pop()] -= 1
			negative_total += 1
	for i in result:
		print(i)
main()


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
ini = sum(a)
mapp = []
for i in range(n):
	if a[i] & 1:
		mapp.append(i)
	else:
		a[i] = a[i] // 2
for i in range(len(mapp) // 2):
	a[mapp[i]] = a[mapp[i]] // 2
for i in range(len(mapp) // 2, len(mapp)):
	a[mapp[i]] = a[mapp[i]] // 2 + 1
curr = sum(a)
if ini == curr:
	for x in a:
		print(x)
elif ini > curr:
	diff = ini - curr
	for i in range(len(mapp) // 2, len(mapp) // 2 + diff + 1):
		a[mapp[i]] -= 1
	for x in a:
		print(x)
else:
	diff = curr - ini
	for i in range(diff + 1):
		a[mapp[i]] += 1
	for x in a:
		print(x)


from math import floor, ceil
n = int(input())
a = []
for i in range(0, n):
	a.append(int(input()))
flooring = True
for i in range(0, n):
	if a[i] % 2 == 0:
		a[i] = a[i] // 2
		continue
	elif a[i] == 0:
		a[i] = a[i]
		continue
	elif flooring:
		a[i] = floor(a[i] / 2)
	else:
		a[i] = ceil(a[i] / 2)
	if flooring:
		flooring = False
	else:
		flooring = True
for i in a:
	print(i)


from math import ceil
from math import floor
n = int(input())
salida = [0] * n
j = 0
for i in range(0, n):
	a = int(input())
	if a % 2 == 0:
		salida[i] = int(a / 2)
	elif j % 2 == 0:
		salida[i] = ceil(a / 2)
		j = j + 1
	else:
		salida[i] = floor(a / 2)
		j = j + 1
for i in range(0, n):
	print(salida[i])


a = int(input())
inp = []
c = 0
for i in range(a):
	p = int(input())
	inp.append(p)
out = []
for i in inp:
	if i % 2 == 0:
		out.append(int(i / 2))
	else:
		c += 1
		if c % 2 == 1:
			out.append(int((i - 1) / 2))
		else:
			out.append(int((i + 1) / 2))
for i in out:
	print(i)


import math
import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	input = sys.stdin.readline

def takeInput():
	return [int(x) for x in input().strip().split()]
can_be_changed = {}
n = int(input())
a = []
for i in range(n):
	number = int(input())
	a.append(number)
for i in range(n):
	ele = a[i]
	if ele % 2 != 0:
		can_be_changed[i] = ele
	a[i] = math.ceil(a[i] / 2)
current_sum = sum(a)
for i in range(n):
	if current_sum <= 0:
		break
	if i in can_be_changed:
		a[i] = math.floor(can_be_changed[i] / 2)
		current_sum -= 1
for ele in a:
	print(ele)


from sys import stdin, stdout
import sys
INF = 100000000000.0
import bisect

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
from collections import defaultdict
import math
n = get_int()
ans = 0
f = 0
for i in range(n):
	a = get_int()
	if a % 2 != 0:
		if f == 0:
			print(a // 2)
			f = 1
		else:
			print(a // 2 + 1)
			f = 0
	else:
		print(a // 2)


n = int(input())
a = []
b = True
for _ in range(n):
	a.append(int(input()))
for i in range(n):
	if a[i] % 2 == 0:
		a[i] //= 2
	elif b:
		a[i] = a[i] // 2
		b = False
	else:
		a[i] = (a[i] + 1) // 2
		b = True
for i in a:
	print(i)


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
inc = True
for elem in a:
	if elem % 2 == 0:
		print(elem // 2)
		continue
	if inc:
		print(elem // 2)
	else:
		print((elem + 1) // 2)
	inc = not inc


from math import *
t = int(input())
yeh = 1
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif yeh:
		print(ceil(n / 2))
		yeh ^= 1
	else:
		print(floor(n / 2))
		yeh ^= 1


import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
	return int(input())

def getList():
	return list(map(int, input().split()))
n = getN()
floor = True
for i in range(n):
	ai = getN()
	if ai % 2 == 0:
		print(ai // 2)
	else:
		if floor:
			print((ai - 1) // 2)
		else:
			print((ai + 1) // 2)
		floor = not floor


import math
lower_bol = True
ans = []
for n in range(int(input())):
	e = int(input())
	if e % 2 == 0:
		ans.append(int(e / 2))
	elif e % 2 != 0:
		if lower_bol:
			e = int(math.floor(e / 2))
			ans.append(e)
			lower_bol = False
		else:
			e = int(math.ceil(e / 2))
			ans.append(e)
			lower_bol = True
for e in ans:
	print(e)


from math import ceil

def down(x):
	if x >= 0:
		return x // 2
	else:
		return -ceil(-x / 2)
n = int(input())
a = []
bal = 0
can = [False] * n
for i in range(n):
	m = int(input())
	a.append(down(m))
	can[i] = abs(m) % 2 == 1
	bal += a[i]
for i in range(n):
	if can[i]:
		a[i] += 1
		bal += 1
	if bal == 0:
		break
for b in a:
	print(b, end=' ')


n = int(input())
l = []
count = 0
for i in range(n):
	a = int(input())
	if a % 2 == 1:
		count += 1
	l.append(a)
li = []
for i in range(n):
	li.append(int(l[i] // 2))
su = sum(li)
if su < 0:
	i = 0
	while su != 0:
		if abs(l[i]) % 2 and l[i] < 0:
			li[i] += 1
			su += 1
		elif abs(l[i]) % 2 and l[i] > 0:
			li[i] += 1
			su += 1
		i += 1
for i in range(n):
	print(li[i])


from math import ceil
lock = 1
for _ in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		print(n // 2)
	elif lock:
		print(int(ceil(n / 2)))
		lock = 0
	else:
		print(n // 2)
		lock = 1


from collections import defaultdict, deque
from itertools import permutations
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
from random import randint
from math import ceil, floor
int_input = lambda : int(stdin.readline())
string_input = lambda : stdin.readline()
multi_int_input = lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input = lambda : list(map(int, stdin.readline().split()))
string_list_input = lambda : list(string_input())
MOD = pow(10, 9) + 7
n = int_input()
final_ratings = []
last_index = 0
counter = 0
index_of_odd = []
initial_ratings = []
for i in range(n):
	score = int_input()
	if score % 2 == 0:
		score = score // 2
	else:
		score = score / 2
		if score < 0:
			score = int(floor(score))
		else:
			score = int(floor(score))
		index_of_odd.append(i)
	final_ratings.append(score)
sum = 0
for i in final_ratings:
	sum += i
k = 0
while sum != 0:
	if sum < 0:
		final_ratings[index_of_odd[k]] += 1
		sum += 1
		k += 1
for i in final_ratings:
	print(i)


n = int(input())
l = [int(input()) for _ in range(n)]
(p, n) = (0, 0)
for i in l:
	if i < 0:
		n += -i // 2
	else:
		p += i // 2
m = min(p, n)
p -= m
n -= m
(p, n) = (n, p)
for i in l:
	if i % 2 == 0:
		print(i // 2)
	elif i < 0:
		i = -i // 2
		if n > 0:
			i += 1
		print(-i)
		n -= 1
	else:
		i = i // 2
		if p > 0:
			i += 1
		print(i)
		p -= 1


n = int(input())
(l, ls, sumi, x) = ([], [], 0, 0)
for i in range(0, n):
	x = int(input())
	l.append(int(x / 2))
	ls.append(x)
	sumi += int(x / 2)
if sumi < 0:
	for i in range(0, n):
		if ls[i] > 0 and ls[i] % 2 != 0 and (sumi < 0):
			l[i] += 1
			sumi += 1
elif sumi > 0:
	for i in range(0, len(l)):
		if ls[i] < 0 and ls[i] % 2 != 0 and (sumi > 0):
			l[i] -= 1
			sumi -= 1
print(*l, sep='\n')


n = int(input())
l = []
for i in range(n):
	l.append(int(input()))
	c = 0
for i in range(n):
	if l[i] % 2 == 0:
		print(l[i] // 2)
	elif c == 0:
		print(l[i] // 2)
		c = 1
	elif l[i] < 0:
		print(l[i] // 2 + 1)
		c = 0
	elif l[i] > 0:
		print(l[i] // 2 + 1)
		c = 0


import math
count = int(input())
rangs = []
while count > 0:
	rangs.append(int(input()))
	count -= 1
flag = True
for rang in rangs:
	if rang % 2 == 0:
		print(int(rang / 2))
	elif flag:
		print(math.floor(rang / 2))
		flag = not flag
	else:
		print(math.ceil(rang / 2))
		flag = not flag


o = 0
ans = []
n = int(input())
for i in range(n):
	temp = int(input())
	if temp & 1:
		if o == 1:
			ans.append(temp // 2)
			o = 0
		else:
			ans.append(temp // 2 + 1)
			o = 1
	else:
		ans.append(temp // 2)
for i in ans:
	print(i)


import math
n = int(input())
check1 = 0
while n:
	n -= 1
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif a % 2 and check1 % 2 == 0:
		print(int(math.floor(a / 2)))
		check1 += 1
	elif a % 2 and check1 % 2:
		print(int(math.ceil(a / 2)))
		check1 += 1
	else:
		print(a)


n = int(input())
arr = [int(input()) for _ in range(n)]
nm = 0
for x in arr:
	if x % 2 == 1:
		nm += 1
nm //= 2
for i in range(n):
	if arr[i] % 2 == 0:
		arr[i] //= 2
		continue
	if nm > 0:
		arr[i] = arr[i] // 2
		nm -= 1
	else:
		arr[i] = arr[i] // 2 + 1
print('\n'.join(map(str, arr)))


size = int(input())
even = list()
odd = list()
original = list()
for i in range(size):
	ine = int(input())
	original.append(ine)
	if ine % 2 == 0:
		even.append(ine)
	else:
		odd.append(ine)
for i in range(len(odd)):
	odd[i] = odd[i] / 2
for i in range(len(even)):
	even[i] = int(even[i] / 2)
for i in range(int(len(odd) / 2)):
	odd[i] = int(odd[i] - 1 / 2)
for i in range(int(len(odd) / 2), int(len(odd))):
	odd[i] = int(odd[i] + 1 / 2)
for i in range(len(original)):
	if original[i] % 2 == 0:
		a = even.pop(0)
		original[i] = a
	else:
		a = odd.pop(0)
		original[i] = a
for i in range(len(original)):
	print(original[i])


coun = int(input())
tf = False
for i in range(coun):
	num = int(input())
	if num % 2 == 1:
		if tf:
			print(num // 2)
		else:
			print(num // 2 + 1)
		tf ^= True
	else:
		print(num // 2)


odd = 0
a = []
for i in range(int(input())):
	x = int(input())
	if x % 2 == 0:
		a.append(x // 2)
	elif odd == 0:
		a.append(x // 2)
		odd = 1
	else:
		a.append(x // 2 + 1)
		odd = 0
for i in a:
	print(i)


import sys
import math
input = sys.stdin.readline
n = int(input().strip())
odd_indices = []
A = []
for _ in range(n):
	x = int(input().strip())
	A.append(x // 2)
	if x % 2:
		odd_indices.append(_)
x = abs(sum(A))
while x:
	A[odd_indices[-1]] += 1
	odd_indices.pop()
	x -= 1
[print(el) for el in A]


import os
import sys
from io import BytesIO, IOBase
from math import floor, ceil

def solution(arr):
	half = [x / 2 for x in arr]
	switch = True
	for x in half:
		if x - int(x) == 0:
			write(int(x))
			continue
		if switch:
			write(ceil(x))
			switch = False
		else:
			write(floor(x))
			switch = True

def main():
	arr = []
	for _ in range(r_int()):
		arr.append(r_int())
	solution(arr)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())

def w_array(arr):
	for x in arr:
		write(x, end=' ')
	write()
main()


n = int(input())
arr = [int(input()) for _ in range(n)]
ar2 = [arr[i] // 2 for i in range(n)]
s = -sum(ar2)
for i in range(n):
	if s == 0:
		break
	if abs(arr[i]) % 2 == 1:
		ar2[i] += 1
		s -= 1
for e in ar2:
	print(e)


n = int(input())
l = []
s = []
count = 0
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif count == 0:
		print(a // 2)
		count = a - a // 2 * 2
	else:
		print((count + a) // 2)
		count = 0


from fractions import gcd
from datetime import date, timedelta
from heapq import *
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7

def main():
	n = int(input())
	a = [int(input()) for i in range(n)]
	cnt = 0
	for i in range(n):
		if abs(a[i]) % 2 == 1:
			cnt += 1
	cnt /= 2
	for i in range(n):
		if a[i] % 2 == 0:
			print(int(a[i] / 2))
		elif cnt > 0:
			print(math.ceil(a[i] / 2))
			cnt -= 1
		else:
			print(math.floor(a[i] / 2))
main()


n = int(input())
p = 0
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif p == 0:
		print(a // 2)
		p += 1
	elif p:
		print(a // 2 + 1)
		p -= 1


import sys
input = lambda : sys.stdin.readline().strip()
n = int(input())
r = [int(input()) for _ in range(n)]
d = [k // 2 if k % 2 == 0 else (k - 1) // 2 for k in r]
s = sum(r) - sum(d)
for i in range(n):
	if s > 0 and r[i] % 2 != 0:
		s -= 1
		d[i] += 1
print(*d, sep='\n')


from sys import stdin
n = int(stdin.readline().strip())
eve = []
odd = []
s = []
for i in range(n):
	a = int(stdin.readline().strip())
	s.append(a)
	if a % 2 == 0:
		eve.append(a)
	else:
		odd.append(a)
c = 0
aa = []
for i in range(n):
	if s[i] % 2 == 0:
		print(s[i] // 2)
		aa.append(s[i] // 2)
	else:
		if c == 1:
			print(s[i] // 2 + 1)
			aa.append(1 + s[i] // 2)
		else:
			print(s[i] // 2)
			aa.append(s[i] // 2)
		c += 1
		c = c % 2


n = int(input())
a = [0] * n
d = [0] * n
for i in range(n):
	a[i] = int(input())
for i in range(n):
	d[i] = a[i] // 2
summ = sum(d)
if summ < 0:
	for i in range(len(d)):
		if a[i] % 2 != 0 and summ != 0:
			d[i] += 1
			summ += 1
if summ > 0:
	for i in range(len(d)):
		if a[i] % 2 != 0 and summ != 0:
			d[i] -= 1
			summ -= 1
for i in range(len(d)):
	print(d[i])


a = int(input())
p = []
nemin = 0
nemax = 0
pomin = 0
pomax = 0
for _ in range(a):
	b = int(input())
	p.append(b)
	if b >= 0:
		pomin += b // 2
		pomax += b // 2
		if b % 2:
			pomax += 1
	else:
		nemin += -(-b // 2)
		nemax += -(-b // 2)
		if b % 2:
			nemax -= 1
dif = 0
if pomin > abs(nemin):
	dif = pomin - abs(nemin)
	d = 'neg'
elif pomin < abs(nemin):
	dif = abs(nemin) - pomin
	d = 'pos'
else:
	d = ''
for i in p:
	if i < 0:
		if dif and d == 'neg' and i % 2:
			print(-(-i // 2) - 1)
			dif -= 1
		else:
			print(-(-i // 2))
	elif i > 0:
		if dif and d == 'pos' and i % 2:
			print(i // 2 + 1)
			dif -= 1
		else:
			print(i // 2)
	else:
		print(i)


n = int(input())
round_down = True
for i in range(n):
	temp = int(input())
	if temp % 2 == 0:
		print(temp // 2)
	elif round_down:
		print(temp // 2)
		round_down = False
	else:
		print(temp // 2 + 1)
		round_down = True


odds = {}
evens = {}
total_sum = 0
n = int(input())
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		evens[i] = x // 2
		total_sum += x // 2
		continue
	odds[i] = x // 2
	total_sum += x // 2
if total_sum == 0:
	for i in range(n):
		if i in evens:
			print(evens[i])
			continue
		print(odds[i])
else:
	if total_sum > 0:
		change = total_sum
		for i in odds.keys():
			if change != 0:
				odds[i] -= 1
				change -= 1
			else:
				break
		for i in range(n):
			if i in evens:
				print(evens[i])
				continue
			print(odds[i])
	if total_sum < 0:
		change = total_sum
		for i in odds.keys():
			if change != 0:
				odds[i] += 1
				change += 1
			else:
				break
		for i in range(n):
			if i in evens:
				print(evens[i])
				continue
			print(odds[i])


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
from math import ceil, floor, log, sqrt, factorial
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

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

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

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 read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = ii()
	l = []
	(a, b) = (0, 0)
	for i in range(n):
		x = ii()
		l.append(x)
		if x % 2 == 0:
			a += 1
		else:
			b += 1
	cnt = 1
	for i in range(n):
		if l[i] % 2 == 0:
			l[i] //= 2
		else:
			if cnt <= b // 2:
				if l[i] < 0:
					l[i] = ceil(l[i] / 2)
				else:
					l[i] = ceil(l[i] / 2)
			elif l[i] > 0:
				l[i] = floor(l[i] / 2)
			else:
				l[i] = floor(l[i] / 2)
			cnt += 1
	for i in l:
		print(i)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
up_down = 0
for _ in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif up_down % 2 == 0:
		b = a / 2
		print(math.ceil(b))
		up_down += 1
	else:
		print(a // 2)
		up_down += 1


import math
n = int(input())
e = []
s = 0
while n:
	t = int(input())
	if t % 2 == 0:
		t /= 2
		e.append([int(t), False])
	else:
		t = math.ceil(t / 2)
		e.append([int(math.ceil(t)), True])
	s += t
	n -= 1
i = 0
if s > 0:
	while s:
		if e[i][1]:
			e[i][0] -= 1
			s -= 1
		print(e[i][0])
		i += 1
while i < len(e):
	print(e[i][0])
	i += 1


n = int(input())
arr = []
decide = 1
for i in range(n):
	temp = int(input())
	if temp % 2 == 0:
		arr.append(temp // 2)
	else:
		if decide % 2 == 0:
			arr.append((temp + 1) // 2)
		else:
			arr.append((temp - 1) // 2)
		decide += 1
for i in arr:
	print(i)


n = int(input())
a = [float(input()) / 2 for i in range(n)]
k = 0.5
for i in range(n):
	if int(a[i]) != a[i]:
		a[i] += k
		k = -k
for i in a:
	print(int(i))


def main():
	n = int(input())
	arr = []
	neg = []
	pos = []
	for i in range(n):
		a = int(input())
		if a % 2 != 0:
			if a < 0:
				neg.append(i)
			else:
				pos.append(i)
		arr.append(a // 2)
	total = sum(arr)
	while total != 0:
		if total > 0:
			if neg:
				arr[neg.pop()] += 1
				total -= 1
		elif pos:
			arr[pos.pop()] += 1
			total += 1
		elif neg:
			arr[neg.pop()] += 1
			total += 1
	for i in arr:
		print(i)
main()


n = int(input())
ratings = [int(input()) for i in range(n)]
output = [0] * n
offset = 0
for (i, rating) in enumerate(ratings):
	if rating % 2 == 0:
		output[i] = rating // 2
	elif offset == 1:
		output[i] = rating // 2
		offset = 0
	else:
		output[i] = rating // 2 + 1
		offset = 1
print('\n'.join(map(str, output)))


from math import ceil, floor
a = int(input())
flag = False
for i in range(a):
	k = int(input())
	if k % 2 == 0:
		print(int(k / 2))
	elif flag == True:
		print(int(ceil(k / 2)))
		flag = False
	else:
		print(int(floor(k / 2)))
		flag = True


a = 0
data = []
n = int(input())
for i in range(n):
	b = int(input())
	a += b
	data += [b]
for i in range(n):
	if data[i] % 2 == 0:
		print(data[i] // 2)
	elif a >= 0:
		print(data[i] // 2)
		a -= 1
	else:
		a += 1
		print((data[i] + 1) // 2)


n = int(input())
increase = True
for _ in range(n):
	a = int(input())
	if a % 2:
		if increase:
			print((a + 1) // 2)
		else:
			print((a - 1) // 2)
		increase = not increase
	else:
		print(a // 2)


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	a = []
	for _ in range(n):
		a.append(int(input()))
	c_mi_odd = 0
	c_pl_odd = 0
	for i in a:
		if i > 0 and i % 2 == 1:
			c_pl_odd += 1
		elif i < 0 and i % 2 == 1:
			c_mi_odd += 1
	c_pl_odd %= 2
	c_mi_odd %= 2
	pl_next_up = True
	mi_next_up = False
	if c_pl_odd == c_mi_odd:
		pl_next_up = False
	for (i, v) in enumerate(a):
		if v % 2 == 0:
			print(v // 2)
		elif v > 0:
			if pl_next_up:
				print(v // 2)
				pl_next_up = False
			else:
				print(-(-v // 2))
				pl_next_up = True
		elif mi_next_up:
			print(-(-v // 2))
			mi_next_up = False
		else:
			print(v // 2)
			mi_next_up = True
main()


t = int(input())
ratings = []
for i in range(t):
	value = int(input())
	ratings.append(value)
flag = 0
for i in range(t):
	if ratings[i] % 2 == 0:
		print(ratings[i] // 2)
	elif flag == 1:
		print((ratings[i] - 1) // 2)
		flag = 0
	else:
		print((ratings[i] + 1) // 2)
		flag = 1


import math
t = int(input())
li = []
for i in range(t):
	li.append(int(input()))
toggle = 1
for i in range(len(li)):
	if math.fabs(li[i]) % 2 == 0 or toggle == 0:
		if li[i] % 2 != 0:
			toggle = 1
		li[i] = li[i] // 2
	else:
		li[i] = li[i] // 2 + 1
		toggle = 0
for i in range(len(li)):
	print(li[i])


n = int(input())
z = 0
for t in range(n):
	a = int(input())
	if a % 2 == 1:
		z += 1
		if z % 2:
			print((a >> 1) + 1)
		else:
			print(a >> 1)
	else:
		print(a >> 1)


n = int(input())
newscores = list()
j = 0
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		newscores.append(a / 2)
	elif j == 0:
		j = 1
		newscores.append(a // 2)
	else:
		j = 0
		newscores.append(a // 2 + 1)
for i in range(n):
	print(str(int(newscores[i])) + '\n')


n = int(input())
c = 0
while n > 0:
	n -= 1
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
		c -= 1
	elif c % 2 == 1:
		print(a // 2)
	else:
		print(a // 2 + 1)
	c += 1


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
changep = []
changen = []
net = 0
for j in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	elif net <= 0:
		print(a // 2 + 1)
		net += 1
	else:
		print(a // 2)
		net -= 1


n = int(input())
lis = [0] * n
ans = [0] * n
for i in range(n):
	lis[i] = int(input())
	ans[i] = lis[i] // 2
a = sum(ans)
if a == 0:
	for i in ans:
		print(i)
elif a < 0:
	i = 0
	while a != 0:
		if lis[i] % 2 != 0:
			ans[i] += 1
			a += 1
		i += 1
	for i in ans:
		print(i)


n = int(input())
v = []
e = 0
o = 0
for i in range(n):
	m = int(input())
	if m % 2 == 0:
		e += 1
	else:
		o += 1
	v.append(m)
k = o // 2
for i in range(len(v)):
	if v[i] % 2 == 0:
		print(v[i] // 2)
	elif k > 0:
		print((v[i] + 1) // 2)
		k -= 1
	else:
		print(v[i] // 2)


import math
n = int(input())
array = []
k = 0
for i in range(n):
	z = int(input())
	if z % 2 == 0:
		array.append(z / 2)
	else:
		if k % 2 == 0:
			array.append(math.ceil(z / 2))
		else:
			array.append(math.floor(z / 2))
		k = k + 1
for i in array:
	print(int(i))


t = int(input())
list = []
for i in range(t):
	list.append(int(input()))
add = 1
for i in list:
	if i % 2 == 0:
		print(int(i / 2))
	elif add == 1:
		print(int((i + 1) / 2))
		add = -1
	else:
		print(int((i - 1) / 2))
		add = 1


import math
n = int(input())
A = [int(input()) for _ in range(n)]
B = [x for x in A if x > 0]
c = 0
for i in range(n):
	if A[i] % 2 != 0:
		if c:
			print(math.ceil(A[i] / 2))
		else:
			print(math.floor(A[i] / 2))
		c = not c
	else:
		print(int(A[i] / 2))


a = int(input())
k = 1
for j in range(a):
	i = int(input())
	if not i % 2:
		print(i // 2)
	elif k:
		print((i - 1) // 2)
		k = 0
	else:
		print((i + 1) // 2)
		k = 1


n = int(input())
import math
a = []
b_frac = []
b_int = []
b = []
count = 0
for i in range(0, n):
	ai = int(input())
	bi = ai / 2
	a.append(ai)
	if bi == ai // 2:
		b.append(bi)
	else:
		if count % 2 == 0:
			b.append(math.floor(bi))
		else:
			b.append(math.ceil(bi))
		count += 1
for i in range(0, len(b)):
	print(int(b[i]))


import math
q = int(input())
a = [[0] * q for i in range(2)]
su = 0
for i in range(q):
	n = int(input())
	a[0][i] = math.ceil(n / 2)
	if n % 2 == 0:
		a[1][i] = 1
	su += a[0][i]
for i in range(q):
	if su != 0 and a[1][i] == 0:
		a[0][i] -= 1
		su -= 1
	print(a[0][i])


import sys
import math
n = int(sys.stdin.readline())
a = []
for p in range(n):
	a.append(int(sys.stdin.readline()))
ans = [0] * n
arr = []
for i in range(n):
	if a[i] % 2 == 1:
		arr.append([a[i], i])
	else:
		ans[i] = a[i] // 2
w = len(arr) // 2
for g in range(len(arr)):
	if g < w:
		arr[g][0] = math.floor(arr[g][0] / 2)
	else:
		arr[g][0] = math.ceil(arr[g][0] / 2)
for h in range(len(arr)):
	ans[arr[h][1]] = arr[h][0]
for k in range(n):
	print(ans[k])


import math
n = int(input())
a = []
co = []
for i in range(n):
	x = int(input())
	if x % 2 != 0:
		co.append([x, i])
	a.append(math.floor(x / 2))
if sum(a) < 0:
	for i in range(-sum(a)):
		a[co[i][1]] += 1
for i in a:
	print(i)


n = int(input())
l = []
for i in range(n):
	a = int(input())
	l.append(a)
i = 0
f1 = +1
f2 = +1
while i < n:
	if l[i] % 2 == 0:
		print(int(l[i] / 2))
	elif l[i] > 0:
		if f1 == -1:
			print(int(l[i] / 2) + 1)
		else:
			print(int(l[i] / 2))
		f1 = f1 * -1
	else:
		if f2 == -1:
			print(int(l[i] / 2) - 1)
		else:
			print(int(l[i] / 2))
		f2 = f2 * -1
	i += 1


n = int(input())
mark = 0
for i in range(n):
	a = int(input())
	if a % 2 == 1 and mark == 1:
		print(a // 2 + 1)
		mark = 1 - mark
	elif a % 2 == 1 and mark == 0:
		print(a // 2)
		mark = 1 - mark
	else:
		print(a // 2)


import sys
N = int(input())
(p, n) = (0, 0)
xs = []
for i in range(N):
	x = int(input())
	if x % 2:
		if x > 0:
			p += 1
		else:
			n += 1
	xs.append((i, x))
mn = min(p, n)
(np, nn) = (p, n)
t = True
for (i, x) in xs:
	if x % 2:
		if x > 0:
			if np > p - mn:
				print(x // 2)
			else:
				if t:
					print(x // 2)
				else:
					print(x // 2 + 1)
				t = not t
			np -= 1
		else:
			if nn > n - mn:
				print(-(abs(x) // 2))
			else:
				if t:
					print(-(abs(x) // 2))
				else:
					print(-(abs(x) // 2) - 1)
				t = not t
			nn -= 1
	else:
		print(x // 2)


import math
queries = int(input())
ratings = []
count = 0
for x in range(queries):
	y = int(input())
	ratings.append(y)
for z in range(len(ratings)):
	if ratings[z] % 2 == 0:
		ratings[z] = ratings[z] // 2
	else:
		count += 1
		if count % 2 == 0:
			ratings[z] = math.ceil(ratings[z] / 2)
		else:
			ratings[z] = math.floor(ratings[z] / 2)
for a in ratings:
	print(a)


t = int(input())
arr = []
odds = []
for i in range(t):
	num = int(input())
	arr.append(num)
	if num != 0 and num % 2 != 0:
		odds.append(i)
for i in range(t):
	arr[i] = arr[i] // 2
s = sum(arr)
if s == 0:
	for i in arr:
		print(i)
else:
	for i in odds:
		arr[i] = arr[i] + 1
		s += 1
		if s == 0:
			break
	for i in arr:
		print(i)


import math

def io():
	n = int(input())
	ls = []
	for i in range(n):
		ls.append(int(input()))
	return ls

def solve():
	ls = io()
	ans = []
	odd = 0
	for i in ls:
		if i % 2 == 0:
			ans.append(i // 2)
		else:
			if odd % 2 == 0:
				ans.append(math.ceil(i / 2))
			else:
				ans.append(math.floor(i / 2))
			odd += 1
	for i in ans:
		print(i)
solve()


n = int(input())
a = [int(input()) for i in range(n)]
cnt = 0
ans = []
for i in range(n):
	if a[i] % 2 == 0:
		ans.append(a[i] // 2)
	elif a[i] % 2 == 1:
		if a[i] < 0:
			if cnt % 2 == 0:
				ans.append(a[i] // 2 + 1)
			elif cnt % 2 == 1:
				ans.append(a[i] // 2)
		if a[i] > 0:
			if cnt % 2 == 0:
				ans.append(a[i] // 2 + 1)
			elif cnt % 2 == 1:
				ans.append(a[i] // 2)
		cnt += 1
for i in range(n):
	print(ans[i])


n = int(input())
od = 1
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	else:
		print((x - od) // 2)
		od *= -1


import math
n = int(input())
A = [0] * n
B = [0] * n
i = 0
k = 0
for i in range(0, n):
	A[i] = int(input())
	if A[i] % 2 != 0:
		if k % 2 != 0:
			B[i] = int(math.floor(A[i] / 2))
			k += 1
		else:
			B[i] = int(math.ceil(A[i] / 2))
			k += 1
	else:
		B[i] = int(A[i] // 2)
for i in range(len(B)):
	print(B[i])


n = int(input())
flag = 1
while n:
	i = int(input())
	if i % 2 == 0:
		print(i // 2)
	else:
		d = i // 2 + flag
		if flag == 1:
			flag = 0
		elif flag == 0:
			flag = 1
		print(d)
	n = n - 1


from sys import stdout, stdin
lista = []
cont = True
for i in range(int(stdin.readline())):
	a = int(stdin.readline())
	if a % 2 == 0:
		lista.append(a // 2)
	elif cont:
		lista.append(a // 2)
		cont = False
	else:
		lista.append(a // 2 + 1)
		cont = True
for i in lista:
	stdout.write(str(i) + '\n')


n = int(input())
li = []
l = []
count = 0
for i in range(n):
	a = int(input())
	li.append(a)
for i in range(len(li)):
	b = li[i] / 2 - int(li[i] / 2)
	if b == 0:
		l.append(li[i] / 2)
	if b != 0:
		count += 1
		if count % 2 == 0:
			l.append(li[i] // 2)
		else:
			l.append(li[i] // 2 + 1)
for i in l:
	print(int(i))


import math
cel = []
flor = []
ans = 0
flag = False
for _ in range(int(input())):
	i = int(input())
	if i % 2 == 0:
		ans += i // 2
		print(i // 2)
	elif flag:
		ans += math.ceil(i / 2)
		print(math.ceil(i / 2))
		flag = False
	else:
		ans += math.floor(i / 2)
		print(math.floor(i / 2))
		flag = True


def ii():
	a = int(input())
	return a

def ai():
	a = list(map(int, input().split()))
	return a

def mi():
	a = map(int, input().split())
	return a
n = ii()
chek = True
for i in range(n):
	rating = ii()
	net_rating = 0
	if rating % 2:
		if chek:
			chek = False
			if rating >= 0:
				print(rating // 2)
			else:
				print(rating // 2)
		else:
			chek = True
			if rating >= 0:
				print(rating // 2 + 1)
			else:
				print(rating // 2 + 1)
	else:
		print(rating // 2)


b = []
k = 0
for i in range(int(input())):
	a = int(input())
	if a % 2 == 0:
		b.append(a // 2)
	elif a % 2 == 1 and k == 1:
		b.append(a // 2 + 1)
		k = 0
	else:
		b.append(a // 2)
		k = 1
for i in b:
	print(i)


n = int(input())
odd = []
ans = []
for _ in range(n):
	i = int(input())
	if not i & 1:
		ans.append(i // 2)
	elif not odd:
		ans.append(i // 2)
		odd.append(i)
	else:
		odd.pop()
		ans.append(i // 2 + 1)
for i in range(n):
	print(ans[i])


from math import ceil
n = int(input())
p = 0
for i in range(n):
	m = int(input())
	if m % 2 == 0:
		print(m // 2)
	elif m % 2 != 0:
		p += 1
		if p > 1:
			print(ceil(m / 2))
			p = 0
		else:
			print(m // 2)


import math
n = int(input())
L = []
temp = 0
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif temp == 0:
		print(x // 2 + 1)
		temp = 1
	else:
		print(x // 2)
		temp = 0


n = int(input())
j = 0
for i in range(n):
	r = int(input())
	if r % 2 == 0:
		print(r // 2)
	else:
		print((r + j) // 2)
		if j == 0:
			j = 1
		else:
			j = 0


n = int(input())
arr = []
for _ in range(n):
	arr.append(int(input()))
flag = 0
for i in range(len(arr)):
	if arr[i] % 2 == 0:
		arr[i] //= 2
	elif flag == 0:
		arr[i] //= 2
		flag = 1
	else:
		arr[i] //= 2
		arr[i] += 1
		flag = 0
for i in arr:
	print(i)


n = int(input())
a = (int(input()) for _ in range(n))
d = 1
for x in a:
	if x % 2 == 0:
		print(x // 2)
	else:
		print((x + d) // 2)
		d *= -1


import math
n = int(input())
lis_ = list()
check = 0
i = 0
while n > 0:
	lis_.append(int(input()))
	n = n - 1
for num in lis_:
	if num % 2 == 0:
		print(int(num / 2))
	elif check == 0:
		print(math.floor(num / 2))
		check = 1
	elif check == 1:
		print(math.ceil(num / 2))
		check = 0


flag = 0
for _ in range(int(input())):
	m = int(input())
	if m % 2 == 0:
		print(m // 2)
	elif m % 2 != 0 and flag == 0:
		print(m // 2)
		flag = 1
	else:
		print(m // 2 + 1)
		flag = 0


from math import ceil, floor
n = int(input())
toggle = True
bList = []
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		bList.append(a // 2)
	else:
		if toggle:
			bList.append(ceil(a / 2))
		else:
			bList.append(floor(a / 2))
		toggle = not toggle
for b in bList:
	print(b)


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
b = [0] * n
c1 = 0
for i in range(n):
	if a[i] % 2 == 0:
		b[i] = a[i] // 2
	elif c1 == 1:
		b[i] = a[i] // 2
		c1 = 0
	elif c1 == 0:
		b[i] = a[i] // 2 + 1
		c1 = 1
for i in range(n):
	print(b[i])


n = int(input())
a = [int(input()) for i in range(n)]
b = [a[i] // 2 for i in range(n)]
cnt = 0
for i in range(n):
	if a[i] % 2 != 0:
		cnt = 1 - cnt
		if cnt == 0:
			b[i] += 1
for i in range(n):
	print(b[i])


n = int(input())
lst = 0
ans = []
for i in range(n):
	x = int(input())
	f = True
	if x < 0:
		f = False
	if x % 2 == 0:
		ans.append(x // 2)
	elif lst == 0:
		x //= 2
		lst = 1
		ans.append(x)
	else:
		x //= 2
		x += 1
		lst = 0
		ans.append(x)
for i in ans:
	print(i)


n = int(input())
a = []
for i in range(n):
	x = int(input())
	a.append(x)
npos = 1
l = len(a)
for i in range(l):
	if a[i] % 2 == 0:
		a[i] /= 2
	elif npos % 2 == 0:
		a[i] = (a[i] - 1) / 2
		npos += 1
	else:
		a[i] = (a[i] + 1) / 2
		npos += 1
for i in a:
	print(int(i))


n = int(input())
a = [0] * n
sa = []
for i in range(n):
	a[i] = int(input())
	if a[i] % 2 != 0:
		sa.append(i)
	a[i] //= 2
for i in range(abs(sum(a))):
	a[sa[i]] += 1
for i in range(n):
	print(a[i])


n = int(input())
k = 0
sum = 0
T = []
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
		sum += x // 2
	elif k == 0:
		print(x // 2)
		sum += x // 2
		k = 1
	elif k == 1:
		print(x // 2 + 1)
		sum += x // 2 + 1
		k = 0
exit()


n = int(input())
L = []
L1 = []
dic = {}
cnt = 0
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		L1.append(a // 2)
	else:
		cnt += 1
		if cnt % 2 != 0:
			L1.append(a // 2)
		else:
			L1.append(a // 2 + 1)
for i in L1:
	print(i)


import math
n = int(input())
flag = 0
while n > 0:
	n -= 1
	a = float(input())
	if not a % 2:
		print(int(a // 2))
		continue
	if flag:
		ans = math.floor(a / 2)
		print(int(ans))
		flag = (flag + 1) % 2
	else:
		ans = math.ceil(a / 2)
		print(int(ans))
		flag = (flag + 1) % 2


def solution(t):
	last = 0
	for i in range(t):
		v = int(input())
		if v % 2 != 0:
			yield (v // 2 + -1 * last)
			last = -1 - last
		else:
			yield (v // 2)

def main():
	t = int(input())
	print('\n'.join(map(str, solution(t))))
main()


b = []
x = []
s = 0
for i in range(int(input())):
	a = int(input())
	if a & 1:
		x.append(i)
	s += a // 2
	b.append(a // 2)
for i in x[:-1 * s]:
	b[i] += 1
print(*b, sep='\n')


import sys
import math
input = sys.stdin.readline
t = int(input())
arr = list()
cno = 0
cpo = 0
for i in range(t):
	arr.append(int(input()))
	if arr[i] % 2 == 1 and arr[i] < 0:
		cno += 1
	elif arr[i] % 2 == 1 and arr[i] > 0:
		cpo += 1
cno = (cno + 1) // 2
cpo = (cpo + 1) // 2
for i in range(t):
	if arr[i] % 2 == 1 and arr[i] < 0:
		if cno > 0:
			print(-1 * (abs(arr[i]) // 2) - 1)
			cno -= 1
		else:
			print(-1 * (abs(arr[i]) // 2))
	elif arr[i] % 2 == 1 and arr[i] > 0:
		if cpo > 0:
			print(abs(arr[i]) // 2 + 1)
			cpo -= 1
		else:
			print(abs(arr[i]) // 2)
	else:
		print(arr[i] // 2)


n = int(input())
f = True
for i in range(n):
	k = int(input())
	if k % 2 == 0:
		print(k // 2)
	elif f:
		if k > 0:
			print(k // 2)
			f = not f
		else:
			print(-(abs(k) // 2) - 1)
			f = not f
	elif k > 0:
		print(k // 2 + 1)
		f = not f
	else:
		print(-(abs(k) // 2))
		f = not f


for _ in range(1):
	n = int(input())
	ok = False
	for i in range(n):
		x = int(input())
		if x % 2 != 0:
			if not ok:
				print((x + 1) // 2)
				ok = True
			else:
				print((x - 1) // 2)
				ok = False
		else:
			print(x // 2)


n = int(input())
list0 = []
sum0 = 0
t = 0
for i in range(n):
	list0.append(int(input()))
for k in range(n):
	sum0 += list0[k]
	if list0[k] % 2 != 0:
		t += 1
c = (t - sum0) / 2
d = 0
for i in range(n):
	if list0[i] % 2 == 0:
		list0[i] /= 2
	elif d < c:
		list0[i] = list0[i] / 2 + 0.5
		d += 1
	else:
		list0[i] = list0[i] / 2 - 0.5
for i in list0:
	print(int(i))


input = __import__('sys').stdin.readline
print = __import__('sys').stdout.write
r = True
bef = None
same = False
for _ in range(int(input())):
	k = int(input())
	if k % 2 == 0:
		print('%s\n' % (k // 2))
	elif bef is None:
		print('%s\n' % int(k / 2))
		bef = k > 0
	else:
		tmp = k > 0
		if tmp is bef:
			if k > 0:
				print('%s\n' % (int(k / 2) + 1))
			else:
				print('%s\n' % (int(k / 2) - 1))
		else:
			print('%s\n' % int(k / 2))
		bef = None


n = int(input())
a = []
for _ in range(n):
	a.append(int(input()))
b = [i // 2 for i in a]
c = sum(b)
if c < 0:
	for i in range(n):
		if abs(a[i]) % 2 == 0:
			continue
		if a[i] != 0:
			b[i] += 1
			c += 1
		if c == 0:
			break
assert sum(b) >= 0
for i in b:
	print(i)


import math
part = int(input())
l = []
for i in range(part):
	n = int(input())
	l.append(n)
m = []
count = 4
for i in l:
	if i % 2 == 0:
		m.append(i // 2)
	elif i % 2 != 0 and count % 2 == 0:
		count += 1
		m.append(i // 2)
	elif i % 2 != 0 and count % 2 != 0:
		count += 1
		d = math.ceil(i / 2)
		m.append(d)
for i in m:
	print(i)


import math
n = int(input())
vs = []
sum = 0
for i in range(0, n):
	v = int(input())
	vs.append(v)
flag = 0
for v in vs:
	if v % 2 == 0:
		print(v // 2)
	elif flag == 0:
		print(math.ceil(v / 2))
		flag = 1
	else:
		print(math.floor(v / 2))
		flag = 0


import sys
import os
from io import IOBase, BytesIO

def main():
	from math import ceil, floor
	n = int(input())
	arr = [0] * n
	for i in range(n):
		arr[i] = int(input())
	(f1, f2) = (0, 0)
	ans = [0] * n
	for i in range(n):
		if arr[i] % 2 == 0:
			ans[i] = arr[i] // 2
		elif arr[i] <= 0:
			if f1 == 0:
				ans[i] = ceil(arr[i] / 2)
			else:
				ans[i] = floor(arr[i] / 2)
			f1 = 1 - f1
		else:
			if f2 == 0:
				ans[i] = floor(arr[i] / 2)
			else:
				ans[i] = ceil(arr[i] / 2)
			f2 = 1 - f2
	for i in ans:
		print(i)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

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

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

def input():
	return sys.stdin.readline().strip()
main()


n = int(input())
l1 = []
k = 0
for i in range(n):
	x = int(input())
	if x % 2 == 0:
		l1.append(x // 2)
	elif k == 0:
		l1.append(x // 2)
		k = 1
	else:
		l1.append(x // 2 + 1)
		k = 0
for i in l1:
	print(i)


from math import ceil, floor
n = int(input())
a = []
count = 0
for i in range(n):
	j = int(input())
	if j % 2 != 0:
		count += 1
	a.append(j)
count = count // 2
for i in range(len(a)):
	if a[i] % 2 != 0:
		if count > 0:
			a[i] = int(ceil(a[i] / 2))
			count -= 1
		else:
			a[i] = int(floor(a[i] / 2))
	else:
		a[i] = a[i] // 2
for i in a:
	print(i)


n = int(input())
l = []
tt = 0
for i in range(0, n):
	temp = int(input())
	if temp % 2 == 0:
		l += [int(temp / 2)]
	else:
		if tt % 2 == 0:
			l += [int((temp + 1) / 2)]
		else:
			l += [int((temp - 1) / 2)]
		tt += 1
for e in l:
	print(e)


n = int(input())
arr = []
res = []
ch = [False] * n
balance = 0
for i in range(n):
	arr.append(int(input()))
for i in range(n):
	if arr[i] % 2 == 0:
		ch[i] = True
	res.append(arr[i] // 2)
	balance += arr[i] // 2
if balance != 0:
	for i in range(n):
		if ch[i] == False:
			res[i] += 1
			balance += 1
			if balance == 0:
				break
for i in range(n):
	print(res[i])


n = int(input())
a = []
for i in range(n):
	x = int(input())
	a.append(x)
flag = 0
for i in range(n):
	if a[i] % 2 == 0:
		a[i] //= 2
	elif flag == 1:
		a[i] //= 2
		flag = 0
	else:
		if True:
			a[i] = a[i] // 2 + 1
		flag = 1
for i in a:
	print(i)


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
pos = True
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] = int(a[i] / 2)
	else:
		if pos:
			a[i] = int((a[i] + 1) / 2)
		else:
			a[i] = int((a[i] - 1) / 2)
		pos = not pos
for i in range(len(a)):
	print(a[i])


import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def val():
	return int(input().rstrip('\n'))

def st():
	return input().rstrip('\n')

def sttoli():
	return [int(i) for i in input().rstrip('\n')]
l = []
n = val()
for _ in range(n):
	l.append(val())
neg = pos = 0
for i in range(n):
	if l[i] // 2 == l[i] / 2:
		l[i] = l[i] // 2
	elif l[i] < 0:
		if pos > 0:
			l[i] = l[i] // 2
			pos -= 1
		elif pos < 0:
			l[i] = l[i] // 2 + 1
			pos += 1
		elif neg < 0:
			neg += 1
			l[i] = l[i] // 2
		else:
			neg -= 1
			l[i] = l[i] // 2 + 1
	elif pos > 0:
		l[i] = l[i] // 2
		pos -= 1
	elif pos < 0:
		l[i] = l[i] // 2 + 1
		pos += 1
	elif neg < 0:
		neg += 1
		l[i] = l[i] // 2
	else:
		neg -= 1
		l[i] = l[i] // 2 + 1
print(*l)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def solution():
	o = int(input())
	count = 0
	for i in range(o):
		n = int(input())
		if n % 2 != 0:
			count += 1
			if count % 2 == 0:
				print(ceil(n / 2))
			else:
				print(floor(n / 2))
		else:
			print(n // 2)
solution()


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
bo = 0
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] // 2
	elif a[i] % 2 != 0 and bo == 1 and (a[i] < 0):
		a[i] = a[i] // 2
		bo = 0
	elif a[i] % 2 != 0 and bo == 1 and (a[i] > 0):
		a[i] = a[i] // 2
		bo = 0
	elif a[i] % 2 != 0 and bo == 0 and (a[i] < 0):
		a[i] = a[i] // 2 + 1
		bo = 1
	elif a[i] % 2 != 0 and bo == 0 and (a[i] > 0):
		a[i] = a[i] // 2 + 1
		bo = 1
for i in range(n):
	print(a[i])


from math import ceil
g = False
for _ in range(int(input())):
	a = int(input())
	if not a % 2:
		b = a // 2
		print(b)
	else:
		if not g:
			print(ceil(a / 2))
		else:
			print(a // 2)
		g = not g


n = int(input())
lower = True
for _ in range(n):
	a = int(input())
	if a % 2 == 0:
		print(a // 2)
	else:
		if lower:
			print(a // 2)
		else:
			print(a // 2 + 1)
		lower = not lower


N = int(input())
L = []
for i in range(N):
	L.append(int(input()))
FLAG = 0
for i in range(N):
	if L[i] % 2 == 0:
		print(L[i] // 2)
	elif FLAG == 0:
		print(L[i] // 2)
		FLAG = 1
	elif L[i] < 0:
		print(L[i] // 2 + 1)
		FLAG = 0
	elif L[i] > 0:
		print(L[i] // 2 + 1)
		FLAG = 0


n = int(input())
ratingChange = [int(input()) for i in range(n)]
floor = lambda x: int(x) + (0 if x > 0 else -1) if x % 1 else int(x)
ceil = lambda x: int(x) + (1 if x > 0 else 0) if x % 1 else int(x)
halfSums = [i / 2 for i in ratingChange]
curSum = sum(halfSums)
for i in halfSums:
	if curSum > 0:
		if i % 1 != 0:
			curSum -= 0.5
		print(floor(i))
	else:
		if i % 1 != 0:
			curSum += 0.5
		print(ceil(i))


n = int(input())
evenar = []
oddar = []
ar = []
ar1 = []
sum1 = 0
sum2 = 0
sumi = 0
for i in range(n):
	s = int(input())
	ar.append(s)
	if s % 2 == 0:
		evenar.append(s // 2)
	else:
		oddar.append(s // 2)
for j in range(len(evenar)):
	sum1 = sum1 + evenar[j]
for j in range(len(oddar)):
	sum2 = sum2 + oddar[j]
sum = sum1 + sum2
a = abs(sum)
for i in range(len(ar)):
	ar1.append(ar[i] // 2)
if sum == 0:
	for i in range(len(ar1)):
		print(ar1[i])
elif sum < 0:
	i = 0
	while a != 0 and i < len(ar):
		if ar[i] % 2 != 0:
			ar1[i] = ar1[i] + 1
			a = a - 1
		i = i + 1
	for k in range(len(ar1)):
		print(ar1[k])
else:
	i = 0
	while a != 0 and i < len(ar):
		if ar[i] % 2 != 0:
			ar1[i] = ar1[i] - 1
			a = a - 1
		i = i + 1
	for k in range(len(ar1)):
		print(ar1[k])


import sys, math
tc = int(sys.stdin.readline())
arr = []
temp = []
for _ in range(tc):
	arr.append(int(sys.stdin.readline()))
for i in range(tc):
	temp.append(arr[i] // 2)
now = sum(temp)
if now > 0:
	idx = 0
	while now > 0:
		if arr[idx] % 2 != 0:
			temp[idx] -= 1
			now -= 1
		idx = (idx + 1) % tc
elif now < 0:
	idx = 0
	while now < 0:
		if arr[idx] % 2 != 0:
			temp[idx] += 1
			now += 1
		idx = (idx + 1) % tc
for i in temp:
	print(i)


n = int(input())
l = []
count = 0
for i in range(n):
	x = int(input())
	l.append(x)
p = 0
for i in range(n):
	if l[i] % 2 == 0:
		l[i] = l[i] // 2
	elif p == 0:
		l[i] = l[i] // 2
		p = 1
	elif p == 1:
		l[i] = l[i] // 2 + 1
		p = 0
for i in l:
	print(i)


def solution(arr):
	last = 0
	for i in range(len(arr)):
		v = arr[i]
		if v % 2 != 0:
			if v > 0:
				if last == -1:
					arr[i] = v // 2 + 1
					last = 0
				elif last == 0:
					arr[i] = v // 2
					last = -1
				elif last == 1:
					arr[i] = v // 2 - 1
					last = 0
			elif last == -1:
				arr[i] = v // 2 + 1
				last = 0
			elif last == 0:
				arr[i] = v // 2
				last = -1
			elif last == 1:
				arr[i] = v // 2 + 1
				last = 0
		else:
			arr[i] = v // 2
	print('\n'.join(map(str, arr)))

def main():
	t = int(input())
	m = [int(input()) for _ in range(t)]
	solution(m)
main()


from math import ceil
n = int(input())
t = []
odd = []
for i in range(n):
	q = int(input())
	t.append(q // 2)
	if abs(q) % 2 == 1:
		odd.append((i, q))
p = sum(t)
if p != 0:
	for i in odd:
		if p == 0:
			break
		if abs(i[1]) % 2 == 1 and p < 0:
			t[i[0]] = t[i[0]] + 1
			p = p + 1
		elif abs(i[1]) % 2 == 1 and p > 0:
			t[i[0]] = t[i[0]] - 1
			p = p - 1
print(*t, sep='\n')


n = int(input())
extra = False
for i in range(n):
	inp = int(input())
	if inp % 2 == 0:
		print(inp // 2)
	elif extra:
		print(inp // 2)
		extra = False
	else:
		print((inp + 1) // 2)
		extra = True


q = int(input())
w = [0] * q
e = 0
r = 0
t = [0] * q
for i in range(q):
	w[i] = int(input())
	if w[i] < 0:
		r -= (w[i] + 1) // 2
		t[i] = (w[i] + 1) // 2
	else:
		e += w[i] // 2
		t[i] = w[i] // 2
i = 0
while e < r:
	if w[i] % 2 == 1 and w[i] > 0:
		t[i] += 1
		e += 1
	i += 1
while r < e:
	if w[i] % 2 == 1 and w[i] < 0:
		t[i] -= 1
		r += 1
	i += 1
for i in t:
	print(i)


from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string

def I():
	return int(input())

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def StoI():
	return [ord(i) - 97 for i in input()]

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
YN = ['Yes', 'No']
mo = 10 ** 9 + 7
inf = float('inf')
input = lambda : sys.stdin.readline().rstrip()
import sys
sys.setrecursionlimit(10 ** 7)
show_flg = False
n = I()
a = [0] * n
b = [0] * n
f = [0] * n
for i in range(n):
	y = I()
	if y % 2 != 0:
		f[i] = 1
	b[i] = y // 2
d = -sum(b)
show(d, b)
for i in range(n):
	ans = b[i]
	if f[i] == 1 and d > 0:
		ans += 1
		d -= 1
	print(ans)
	a[i] = ans
show(sum(a), a)


n = int(input())
ratings = []
for i in range(n):
	ratings.append(int(input()))
flag = 1
new_ratings = []
flags = []
for (index, rating) in enumerate(ratings):
	(factor, flag) = (0, flag) if rating % 2 == 0 else (flag, -flag)
	flags.append(factor)
	new_ratings.append(int((rating + factor) // 2))
for rating in new_ratings:
	print(rating)


c = 1
a = []
(j1, j2) = (0, 0)
for i in range(int(input())):
	n = int(input())
	if n // 2 == n / 2:
		a.append(n // 2)
	elif c == 1:
		c -= 1
		a.append(n // 2 + 1)
		if j1 == 0:
			j1 = i
	else:
		c += 1
		a.append(n // 2)
if c == 0:
	a[j1] -= 1
for i in a:
	print(i)


import math
t = int(input())
k = 0
while t > 0:
	n = int(input())
	if n % 2 != 0:
		if k == 0:
			print(math.floor(n / 2))
			k = 1
		else:
			print(math.ceil(n / 2))
			k = 0
	else:
		print(n // 2)
	t -= 1


n = int(input())
ar = [int(input()) / 2 for _ in range(n)]
k = 0.5
for (i, v) in enumerate(ar):
	if v != int(v):
		ar[i] += k
		k *= -1
for c in ar:
	print(int(c))


n = int(input())
count = 0
flag = False
for i in range(n):
	m = int(input())
	if m % 2 == 0:
		count += m // 2
		print(m // 2)
	elif flag == False:
		print(m // 2 + 1)
		count += m // 2 + 1
		flag = True
	else:
		print(m // 2)
		count += m // 2
		flag = False


n = int(input())
ans = [0 for i in range(n)]
a = []
for i in range(n):
	el = int(input())
	ans[i] = el // 2
	if el % 2 != 0:
		a.append(i)
i = 0
while sum(ans) != 0:
	ans[a[i]] += 1
	i += 1
print('\n'.join(list(map(str, ans))))


t = int(input())
flag = 0
for i in range(t):
	num = int(input())
	if num % 2 == 0:
		print(int(num // 2))
	else:
		flag = 1 - flag
		print(num // 2 + flag)


from math import floor, ceil
n = int(input())
conv = {0: 1, 1: 0}
flag = 0
s = 0
for i in range(n):
	a = int(input())
	if a % 2 == 0:
		b = a // 2
	else:
		flag = conv[flag]
		if flag == 0:
			if i == n - 1:
				b = -1 * s
			else:
				b = floor(a / 2)
		else:
			b = ceil(a / 2)
	s += b
	print(b)


n = int(input())
B = []
A = []
c = 0
for i in range(n):
	a = input()
	A.append(a)
for i in range(n):
	f = int(A[i])
	if f % 2 == 0:
		B.append(int(f / 2))
	elif c % 2 == 0:
		c = c + 1
		g = (f + 1) / 2
		B.append(int(g))
	else:
		c = c + 1
		g = (f - 1) / 2
		B.append(int(g))
for i in range(n):
	print(B[i])


n = int(input())
l = []
l1 = []
for i in range(n):
	l.append(int(input()))
f = 1
for i in range(n):
	if l[i] % 2 == 0:
		l1.append(l[i] // 2)
	elif f == 1:
		l1.append((l[i] + f) // 2)
		f = -1
	elif f == -1:
		l1.append((l[i] + f) // 2)
		f = 1
for j in range(n):
	print(l1[j])


n = int(input())
l = []
no = 0
po = 0
for i in range(n):
	x = int(input())
	if x < 0 and x % 2 == 1:
		no += 1
	elif x > 0 and x % 2 == 1:
		po += 1
	l.append(x)
ans = []
no //= 2
po //= 2
for i in l:
	x = i
	if x % 2 == 1:
		if x < 0 and no > 0:
			x -= 1
			no -= 1
		elif x > 0 and po > 0:
			x += 1
			po -= 1
	if x < 0:
		ans.append(-(abs(x) // 2))
	else:
		ans.append(x // 2)
for i in ans:
	print(i)


c = 1
for i in range(int(input())):
	x = int(input())
	if x % 2 == 0:
		print(x // 2)
	elif c % 2 == 0:
		print(x // 2 + c)
		c = 1
	elif c == 1:
		print(x // 2 + c)
		c = 0
	else:
		print(x // 2 + c)
		c = 1


import math
a = []
b = []
c = []
n = int(input())
for i in range(n):
	a.append(int(input()))
	b.append(math.ceil(a[-1] / 2))
	c.append(math.floor(a[-1] / 2))
s = sum(b)
S = sum(c)
for i in range(len(b)):
	if s > 0 and b[i] != c[i]:
		print(c[i])
		s -= 1
	else:
		print(b[i])


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
d = 0
b = []
for ea in a:
	if ea % 2 == 0:
		eb = ea // 2
	elif d == 0:
		eb = ea // 2
		d += 1
	else:
		eb = ea // 2 + d
		d = 0
	b.append(eb)
for eb in b:
	print(eb)


import math
n = int(input())
numbers = []
s_numbers = []
t_nums = []
for i in range(n):
	a = int(input())
	numbers.append(a)
flag = True
for i in range(len(numbers)):
	if numbers[i] % 2 == 0:
		b = numbers[i] / 2
		s_numbers.append(int(b))
	elif flag:
		b = math.ceil(numbers[i] / 2)
		s_numbers.append(b)
		flag = False
	else:
		b = math.floor(numbers[i] / 2)
		s_numbers.append(b)
		flag = True
for j in range(len(s_numbers)):
	print(s_numbers[j])


import math
x = int(input())
a = 0
for __ in range(x):
	n = int(input())
	if n % 2 == 1:
		if a % 2 == 0:
			print(math.floor(n / 2))
		else:
			print(math.ceil(n / 2))
		a += 1
	else:
		print(n // 2)


n = int(input())
even = []
odd = []
sumEven = 0
sumOdd = 0
ans = []
for i in range(n):
	t = int(input())
	if abs(t) % 2 == 0:
		even.append(i)
		sumEven += t // 2
	else:
		odd.append(i)
		sumOdd += t // 2
	ans.append(t // 2)
d = sumEven + sumOdd
k = 0
for i in odd:
	if k >= abs(d):
		break
	ans[i] += 1
	k += 1
for i in ans:
	print(i)


import math
n = int(input())
l = []
count = 0
for i in range(n):
	l.append(int(input()))
	if l[i] % 2 == 0:
		l[i] = int(l[i] / 2)
	else:
		if count % 2:
			l[i] = math.ceil(l[i] / 2)
		else:
			l[i] = math.floor(l[i] / 2)
		count += 1
for i in range(n):
	print(l[i])


n = int(input())
B = []
C = []
for i in range(n):
	a = int(input())
	B.append(a)
	s = 0
for i in range(n):
	if B[i] % 2 == 1:
		s += 1
x = 0
l = 0
i = 0
while x < s // 2:
	l += 1
	if B[i] % 2 == 1:
		C.append(B[i] // 2)
		x += 1
	else:
		C.append(B[i] // 2)
	i += 1
for i in range(l, n):
	if B[i] % 2 == 1:
		C.append(B[i] // 2 + 1)
	else:
		C.append(B[i] // 2)
for i in range(n):
	print(C[i])


n = int(input())
b = [0] * n
a = [0] * n
s = 0
for i in range(n):
	x = int(input())
	if x % 2 != 0:
		b[i] = 1
	a[i] = x // 2
	s += a[i]
i = 0
while s != 0:
	if b[i]:
		a[i] += 1
		s += 1
	i += 1
for i in range(n):
	print(a[i])


t = int(input())
a = []
op = []
x = 0
for i in range(t):
	a.append(int(input()))
	if a[i] % 2 == 0:
		op.append(a[i] // 2)
	elif x > 0 and a[i] >= 0:
		op.append(a[i] // 2 + 1)
		y = a[i] / 2 - (a[i] // 2 + 1)
		x += y
	elif x <= 0 and a[i] >= 0:
		op.append(a[i] // 2)
		y = a[i] / 2 - a[i] // 2
		x += y
	elif x <= 0 and a[i] < 0:
		op.append(a[i] // 2)
		y = a[i] / 2 - a[i] // 2
		x += y
	else:
		op.append(a[i] // 2 + 1)
		y = a[i] / 2 - (a[i] // 2 + 1)
		x += y
	print(op[i])


n = int(input())
list_of_results = list()
for i in range(n):
	list_of_results.append(int(input()))
num_of_odds = 0
for j in range(n):
	if list_of_results[j] % 2 == 0:
		print(list_of_results[j] // 2)
	else:
		num_of_odds += 1
		if num_of_odds % 2 == 0:
			print(list_of_results[j] // 2)
		else:
			print(list_of_results[j] // 2 + 1)


n = int(input())
a = [0] * n
b = [0] * n
sum = 0
for i in range(n):
	a[i] = int(input())
	b[i] = a[i]
print()
for i in range(n):
	a[i] //= 2
	sum += a[i]
if sum == 0:
	for i in range(n):
		print(a[i])
else:
	for i in range(n):
		if sum == 0:
			break
		if b[i] % 2 == 1:
			a[i] += 1
			sum += 1
	for i in range(n):
		print(a[i])


from math import ceil, floor
n = int(input())
arr = []
cnt = 0
for i in range(n):
	arr.append(int(input()))
	if arr[-1] % 2:
		cnt += 1
cnt //= 2
for i in range(n):
	if arr[i] % 2 == 0:
		print(arr[i] // 2)
	elif cnt:
		cnt -= 1
		print(ceil(arr[i] / 2))
	else:
		print(floor(arr[i] / 2))


n = int(input())
a = []
m = 0
b = [0 for i in range(n)]
for i in range(n):
	a.append(int(input()))
for i in range(n):
	if a[i] % 2 == 0:
		b[i] = a[i] // 2
	else:
		if m % 2 == 0:
			b[i] = a[i] // 2 + 1
		else:
			b[i] = a[i] // 2
		m += 1
if sum(b) != 0:
	m = 0
	for i in range(n):
		if a[i] % 2 == 0:
			b[i] = a[i] // 2
		else:
			if m % 2 == 0:
				b[i] = a[i] // 2
			else:
				b[i] = a[i] // 2 + 1
			m += 1
	for i in range(n):
		print(b[i])
else:
	for i in range(n):
		print(b[i])


import math as ma
x = int(input())
a = []
o = []
e = []
t = []
for i in range(x):
	p = int(input())
	a.append(p)
	if p % 2 == 0:
		e.append(p)
	else:
		o.append(p)
		t.append(p // 2)
r = int(abs(sum(e) / 2 + sum(t)))
for i in a:
	if i % 2 == 0:
		print(int(i / 2))
	elif r != 0:
		print(ma.ceil(i / 2))
		r -= 1
	else:
		print(i // 2)


n = int(input())
turn = 0
for i in range(n):
	val = int(input())
	if abs(val) % 2 == 0:
		print(val // 2)
	elif not turn:
		print((val - 1) // 2)
		turn = 1
	else:
		print((val + 1) // 2)
		turn = 0


def out(m):
	for i in m:
		print(i)
n = int(input())
a = []
a1 = []
total = 0
for i in range(0, n):
	t = int(input())
	a1.append(t)
	t //= 2
	total += t
	a.append(t)
for i in range(n):
	if total == 0:
		break
	if a1[i] % 2 != 0:
		a[i] += 1
		total += 1
out(a)


c = True
for _ in '0' * int(input()):
	n = int(input())
	if n % 2 != 0:
		if c:
			print(n // 2)
		else:
			print(n // 2 + 1)
		c = not c
	else:
		print(n // 2)


import math
n = int(input())
i = 0
valid = 2
answer = []
while i < n:
	a = int(input())
	if a % 2 == 0:
		b = str(int(a / 2))
		answer.append(b)
	elif valid % 2 == 0:
		b = str(int(math.ceil(a / 2)))
		valid += 1
		answer.append(b)
	else:
		b = str(int(math.floor(a / 2)))
		valid += 1
		answer.append(b)
	i += 1
for i in answer:
	print(int(i))


def divide(x):
	if x > 0:
		return x // 2
	else:
		return (x + 1) // 2
a = []
b = []
n = input()
cnt = 0
for i in range(int(n)):
	x = int(input())
	cnt += divide(x)
	a.append(x)
for x in a:
	if x % 2 == 0:
		print(divide(x))
	elif cnt < 0 and x > 0:
		print(divide(x) + 1)
		cnt += 1
	elif cnt > 0 and x < 0:
		print(divide(x) - 1)
		cnt -= 1
	else:
		print(divide(x))


def read():
	return input()
n = int(read())
sign = 1
for i in range(n):
	x = int(read())
	if x % 2 == 0:
		print(int(x / 2))
	else:
		sign = sign * -1
		k = (x + sign) / 2
		print(int(k))


n = int(input())
ans_array = []
odd = []
for i in range(n):
	d = int(input())
	if d % 2 == 1:
		odd.append(i)
	ans_array.append(d // 2)
s = sum(ans_array)
if s != 0:
	for odd_i in odd:
		if s > 0:
			s -= 1
			ans_array[odd_i] -= 1
		elif s < 0:
			s += 1
			ans_array[odd_i] += 1
		elif s == 0:
			break
for num in ans_array:
	print(num)


n = int(input())
ans = [0] * n
arr = []
for i in range(n):
	arr.append(int(input()))
c = 0
for i in range(n):
	if abs(arr[i]) % 2 == 0:
		ans[i] = arr[i] // 2
		continue
	if c == 0:
		ans[i] = (arr[i] - 1) // 2
		c += 1
		continue
	if c == 1:
		ans[i] = (arr[i] + 1) // 2
		c = 0
for i in range(n):
	print(ans[i])


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	n = int(input())
	s = [0] * n
	o = [0] * n
	c = 0
	for i in range(n):
		t = int(input())
		s[i] = t // 2
		o[i] = t % 2
		if o[i]:
			c += 1
	j = 0
	for i in range(n):
		if o[i] and j < c // 2:
			s[i] += 1
		j += o[i]
	print(*s)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()