Harryxun/stf_run huggingface dataset:
n = int(input())
v = list(map(int, input().split(" ")))

v1 = {}
v2 = {}
for i in range(len(v)):
    if(i % 2 == 0):
        if((v[i] in v1) == True):
            v1[v[i]] += 1
        else:
            v1[v[i]] = 1
    else: 
        if((v[i] in v2) == True):
            v2[v[i]] += 1
        else:
            v2[v[i]] = 1


if(max_k1 == max_k2):
    if(v1[max_k1] > v2[max_k2]):
        v2[max_k2] = 0
        max_k2 = max(v2, key=v2.get)
    else:
        v1[max_k1] = 0
        max_k1 = max(v1, key=v1.get)


ans = n // 2 - v1[max_k1]
ans += n // 2 - v2[max_k2]

print(ans)

### FIXED CODE ###

n = int(input())
v = list(map(int, input().split(" ")))

v1 = {}
v2 = {}
for i in range(n):
    if(i % 2 == 0):
        if((v[i] in v1) == True):
            v1[v[i]] += 1
        else:
            v1[v[i]] = 1
    else: 
        if((v[i] in v2) == True):
            v2[v[i]] += 1
        else:
            v2[v[i]] = 1

max_k1 = max(v1, key=v1.get)
max_k2 = max(v2, key=v2.get)

ans1 = 1e9
ans2 = 1e9
if(max_k1 == max_k2):
    tmp = v1[max_k1]
    v1[max_k1] = 0
    max_k1 = max(v1, key=v1.get)
    ans1 = n - v1[max_k1] - v2[max_k2]
    v1[max_k1] = tmp
    max_k1 = max(v1, key=v1.get)

    v2[max_k2] = 0
    max_k2 = max(v2, key=v2.get)
    ans2 = n - v1[max_k1] - v2[max_k2]
else: ans1 = n - v1[max_k1] - v2[max_k2]

print(min(ans1, ans2))
n = int(input())

if n == 1:
    print('Hello World')
if n == 2:
    a, b = map(int,input().split())
    print(a + b)

### FIXED CODE ###

n = int(input())

if n == 1:
    print('Hello World')
if n == 2:
    a = int(input())
    b = int(input())
    print(a + b)
A=input("A:")
B=input("B:")
C=input("C:")

A=int(A)
B=int(B)
C=int(C)

while B<A:
    B=B+1
    C=C-1
    if C==0:
        break

print(C)

### FIXED CODE ###

Water=input()
Water2=Water.split(" ")

A=int(Water2[0])
B=int(Water2[1])
C=int(Water2[2])

while B<A:
    B=B+1
    C=C-1
    if C==0:
        break

print(C)
a = int(input())
h = int(a / 3600)
m = int((a - h * 3600) / 60)
s = int(a - (h * 3600) - (m * 60))
print("%s:%s:%s % (h, m, s)

### FIXED CODE ###

a = int(input())
h = int(a / 3600)
m = int((a - h * 3600) / 60)
s = int(a - (h * 3600) - (m * 60))
print("%s:%s:%s" % (h, m, s))
N = input()
Li = map(int, input().split(" "))
Li.sort()
total = 0
for i in Li[0::2]
    total += i
print(total)


### FIXED CODE ###

N = input()
Li = list(map(int, input().split(" ")))
Li.sort()
total = 0
for i in Li[0::2]:
    total += i
print(total)
n = int(input())

ans = 0
i = 0
while True:
    if n//2 = 1:
        break
    i += 1
    ans += n//2//(5**i)
    if n//2//(5**i) == 0:
        break

print(ans)

### FIXED CODE ###

n = int(input())

ans = 0
i = 0
while True:
    if n%2 == 1:
        break
    i += 1
    ans += n//2//(5**i)
    if n//2//(5**i) == 0:
        break

print(ans)
a, b, c, d = sorted(map(int, input().split())
print("YES" if a == b and c == d else "NO")

### FIXED CODE ###

a, b, c, d = sorted(map(int, input().split()))
print("yes" if a == b and c == d else "no")
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left

def main():
	N, X = map(int, input().split(" "))
	L = input().split(" ")
	L = [int(s) for s in L]
	
	if N == 1:
		print(abs(L[0]-X))
		sys.exit()
	
	L.sort()
	tmp = bisect_left(L, X)
	
	max = 2000000001
	if tmp < len(L)
		max1 = L[tmp]
	
	min1 = 2000000001
	if tmp != 0:
		min1 = L[tmp-1]
	
	ans = min(abs(max1-X), abs(X-min1))
	
	print(ans)
		
	
if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left

def gcd(a, b):
	if a > b:
		a, b = b, a
		
	while a > 0:
		a, b = b % a, a
	return b
	
def main():
	N, X = map(int, input().split(" "))
	L = input().split(" ")
	L = [int(s) for s in L]
	
	if N == 1:
		print(abs(L[0]-X))
		sys.exit()
	
	L.sort()
	tmp = bisect_left(L, X)
	
	max1 = 2000000001
	if tmp < len(L):
		max1 = L[tmp]
	
	min1 = 2000000001
	if tmp != 0:
		min1 = L[tmp-1]
	
	seed = 0
	mark = -1
	if abs(max1-X) < abs(X-min1):
		seed = abs(max1-X)
		mark = tmp
	else:
		seed = abs(X-min1)
		mark = tmp-1
	
	ans = 2000000001
	for i, val in enumerate(L):
		if i == mark:
			continue
		tmp = abs(L[i] - L[mark])
		ans_tmp = gcd(tmp, seed)
		if ans > ans_tmp:
			ans = ans_tmp
	
	print(ans)
		
	
if __name__ == "__main__":
	main()
def main():
x=int(input())
for a in range(-250,251):
  for b in range(-250,251):
      if pow(a,5)-pow(b,5)==x:
          print(a,b)
          exit()
main()

### FIXED CODE ###

def main():
  x=int(input())
  for a in range(-250,251):
    for b in range(-250,251):
        if pow(a,5)-pow(b,5)==x:
            print(a,b)
            exit()
main()
from sympy import nextprime

X = int(input())
p = sympy.nextprime(X, 1)

print(p)

### FIXED CODE ###

N = int(input())

def prime_check(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

for x in range(N, 1000000):
    if prime_check(x):
        print(x)
        exit()
N, K = map(int, input().split())

C = N-K+1
D = 1
for i in range(1, K+1):
    if N-K+1 < i:
        print(0)
    else:
        ans = (int(C*D))%(10**9+7)
        print(ans)
    #print(C,D)
    C = C*(N-K-i+1)/(i+1)
    D = D*(K-i)/i


### FIXED CODE ###

N, K = map(int, input().split())

C = N-K+1
D = 1
for i in range(1, K+1):
    if N-K+1 < i:
        print(0)
    else:
        ans = (C*D)%(10**9+7)
        print(ans)
    #print(C,D)
    C = C*(N-K-i+1)//(i+1)
    D = D*(K-i)//i
'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n,q = map(int,ipt().split())
#    n = 5*10**5
#    q = 5*10**5
#    c = [int(i)+1 for i in range(n)]
    c = [int(i) for i in ipt().split()]
    qi = []
    for i in range(q):
        l,r = map(int,ipt().split())
        qi.append((r,l,i))

    qi.sort()

    ans = [-1]*q
    ln = [-1]*(n+1)
    bq_al = [0]*(n+1)

    #Bit_Indexed_Tree
    #A1 ... AnのBIT(1-indexed)
    BIT = [0]*(n+1)

    #A1 ~ Aiまでの和 O(logN)
    def BIT_query(idx):
        res_sum = 0
        while idx > 0:
            res_sum += BIT[idx]
            idx -= idx&(-idx)
        return res_sum

    #Ai += x O(logN)
    def BIT_update(idx,x):
        while idx <= n:
            BIT[idx] += x
            idx += idx&(-idx)
        return
'''
    pr = 0
    for r,l,i in qi:
        for j in range(pr,r):
            cj = c[j]
            ij = ln[cj]
            if ij != -1:
                BIT_update(ij,-1)
            ln[cj] = j+1
            BIT_update(j+1,1)
        pr = r

        ans[i] = BIT_query(r)-BIT_query(l-1)
'''
    for i in ans:
        print(i)

    return None

if __name__ == '__main__':
    main()


### FIXED CODE ###

'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    n,q = map(int,ipt().split())
#    n = 5*10**5
#    q = 5*10**5
#    c = [int(i)+1 for i in range(n)]
    c = [int(i) for i in ipt().split()]
    qi = []
    for i in range(q):
        l,r = map(int,ipt().split())
        qi.append(r*((10**6+1)**2)+l*(10**6+1)+i)

    qi.sort()

    ans = [0]*q
    ln = [-1]*(n+1)
    bq_al = [0]*(n+1)

    #Bit_Indexed_Tree
    #A1 ... AnのBIT(1-indexed)
    BIT = [0]*(n+1)

    #A1 ~ Aiまでの和 O(logN)
    def BIT_query(idx):
        res_sum = 0
        while idx > 0:
            res_sum += BIT[idx]
            idx -= idx&(-idx)
        return res_sum

    #Ai += x O(logN)
    def BIT_update(idx,x):
        while idx <= n:
            BIT[idx] += x
            idx += idx&(-idx)
        return

    pr = 0
    for ist in qi:
        i = ist%(10**6+1)
        l = (ist//(10**6+1))%(10**6+1)
        r = ist//(10**6+1)**2
        for j in range(pr,r):
            cj = c[j]
            ij = ln[cj]
            if ij != -1:
                BIT_update(ij,-1)
            ln[cj] = j+1
            BIT_update(j+1,1)
        pr = r

        ans[i] = BIT_query(r)-BIT_query(l-1)


    for i in ans:
        print(i)

    return None

if __name__ == '__main__':

    main()
s1 = int(raw_input())
s2 = int(raw_input())
if s1>s2:
    print "GREATER"
if s1 == s2:
    print "EQUAL"
if s1 < s2:
    print "LESS

### FIXED CODE ###

s1 = int(raw_input())
s2 = int(raw_input())
if s1>s2:
    print "GREATER"
elif s1 == s2:
    print "EQUAL"
else:
    print "LESS"
O = input()
E = input()

password = ""
for i in range(len(E)):
    password = password + O[i] + E[i]

if len(E)%2 == 1:
    print(password)
else:
    password = password + O[len(O)]
    print(password)

### FIXED CODE ###

O = input()
E = input()

olen = len(O)
elen = len(E)

word = ""

if olen==elen:
    for i in range(olen):
        word = word + O[i] + E[i]
else:
    for i in range(elen):
        word = word + O[i] + E[i]
    word = word + O[olen-1]

print(word)
N = int(input())
L = [-1 for i in range(N)]
flg = [0 for i in range(N)]
D = {}
S = []
A = []
u, v, w = map(int, input().split())
if w % 2 == 0:
  D[u], D[v] = 0, 0
else:
  D[u], D[v] = 0, 1
for i in range(N - 2):
  u, v, w = map(int, input().split())
  if u in D:
    D[v] = (D[u] + w) % 2
  elif v in D:
    D[u] = (D[v] + w) % 2
  else:
    if w % 2 == 0:
      S.append([u, v])
    else:
      A.append([u, v])
for i in range(len(S)):
  if S[i][0] in D and S[i][1] not in D:
    D[S[i][1]] = D[S[i][0]]
  elif S[i][1] in D and S[i][0] not in D:
    D[S[i][0]] = D[S[i][1]]
for i in range(len(A)):
  if A[i][0] in D and A[i][1] not in D:
    D[A[i][1]] = (D[A[i][0]] + 1) % 2
  elif A[i][1] in D and A[i][0] not in D:
    D[A[i][0]] = (D[A[i][1]] + 1) % 2
for i in range(1, N+1):
  print(D[i])
print(S, A)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
N = int(input())
L = [-1 for i in range(N)]
flg = [0 for i in range(N)]
M = [[] for i in range(N)]
for i in range(N-1):
  u, v, w = map(int, input().split())
  M[u-1].append([v-1, w%2])
  M[v-1].append([u-1, w%2])
L[0] = 0
def dist(m, d):
  L[m] = d % 2
  for i in M[m]:
    if L[i[0]] == -1:
      dist(i[0], i[1] + d)
dist(0, 0)
for i in range(N):
  print(L[i])
#問題 D
import numpy as np
N, W = map(int,input().split())
#普通に書くとTLEだったのでNumpy化
dp = np.zeros(W+1)
for i in range(N):
    w,v = map(int,input().split())
    dp[w:] = np.maximum(dp[w:],dp[:-w]+v)
print(int(dp[-1]))


#dpをN*(W+1)配列とかにしてもnumpyなら間に合う。コピーに時間がかかるのかな？

# numpy化してもやっぱりTLEなので、どうもコピーが悪かったらしい
# N, W = map(int,input().split())
# VAL = np.zeros(W+1)
# val = np.zeros(W+1)
# for n in range(N):
#     w,v = map(int,input().split())
#     for weight in range(w,W+1):
#         val[weight] = max(VAL[weight],VAL[weight-w]+v)
#     VAL = np.copy(val)
# print(int(VAL[W]))

# VAL = [0]*(W+1)
# val = [0]*(W+1)
# for n in range(N):
#     w,v = map(int,input().split())
#     for weight in range(w,W+1):
#         val[weight] = max(VAL[weight],VAL[weight-w]+v)
#     VAL = val[:]
#print(VAL[W])
    # listをコピーするときは注意　https://qiita.com/utgwkk/items/5ad2527f19150ae33322
    # listへのアクセスは重いらしい。 https://qiita.com/pegasusBS15/items/620985fdc21c75ad8026


### FIXED CODE ###

N = int(input())
h = list(map(int,input().split()))
# N=4
# h=[10, 30, 40, 20]
l = [0]*N
l[1]=abs(h[0]-h[1])
#print(l[0],l[1])
for i in range(2,N):
    l[i] = min(l[i-1]+abs(h[i]-h[i-1]),l[i-2]+abs(h[i]-h[i-2]))
print(l[N-1])
import math
n,k=map(int,input().split())
a_lis=list(map(int,input().split()))
direct={ i+1:a_lis[i] for i in range(len(a_lis))}
 
d_lis=[1]
j=direct[1]
while True:
  d_lis.append(j)
  j=direct[j]
  if j==1:
    break
dp=d_lis*(math.floor(k/len(d_lis))+1)
 
print(dp[k-1])

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(lambda x:int(x)-1,input().split()))
town=[0]
set={0}
i=0
while True:
  idx=town[-1]
  if a[idx] in set:
    s=a[idx]
    i+=1
    break
  else:
    i+=1
    town.append(a[idx])
    set.add(a[idx])
if i!=n:
  idp=town.index(s)
  chain=len(town[:idp])
  cycle=len(town[idp:])
  if k<=chain:
    print(town[k]+1)
  else:
    p=(k-chain)%cycle + chain
    print(town[p]+1)
else:
  print(town[k%n]+1)
while 1:
        H,W = map(int, raw_input().split())
        if H + W == 0:
                break
        for i in range(H):
                if i % 2 == 0:
                        if W % 2 == 0:
                                print "#." * (W / 2)
                        else:
                                print "#." * (W / 2) + "#"                       
                else:
                        if W % 2 == 0:
                                print ".#" * (W / 2)
                        else:
                                print ".#" * (W / 2) +"."
         print ""

### FIXED CODE ###

while 1:
        H,W = map(int, raw_input().split())
        if H + W == 0:
                break
        for i in range(H):
                if i % 2 == 0:
                        if W % 2 == 0:
                                print "#." * (W / 2)
                        else:
                                print "#." * (W / 2) + "#"                       
                else:
                        if W % 2 == 0:
                                print ".#" * (W / 2)
                        else:
                                print ".#" * (W / 2) +"."
        print ""
S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60 
print(h, m, s, sep=':'

### FIXED CODE ###

S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60 
print(h, m, s, sep=':')
import sys
import functools
import operator

L = []
for l in sys.stdin:
  L.append(l) 
  A = list(map(int, L[1].split()))

answer = functools.reduce(operator.mul, A)
if answer <= 1000000000000000000:
  print(answer)
else:
  print(-1) 


### FIXED CODE ###

A, B = map(int, input().split())
print(A * B)
import numpy as np

W = int(input())
n, k = map(int, input().split())
width = []
importance = []

for _ in range(n):
    w, imp = map(int, input().split())
    width.append(w)
    importance.append(imp)

DP = [[[[0]*(W+1)] for _ in range(n+1)] for _ in range(k+1)]

for i in range(1, n+1):
    for w in range(1, W+1):
        for k in range(0, k):
            wid = width[i-1]
            imp = importance[i-1]

            if w + wid <= W:
                DP[i][w+wid][k+1] = DP[i-1][w][k] + imp
            DP[i][w] = max(DP[i][w], DP[i-1][w])

ans = np.argmax(DP[n])
print(ans)


### FIXED CODE ###

n, W = map(int, input().split())
obj = [list(map(int, input().split())) for _ in range(n)]
DP = [[0]*2*W for _ in range(n+1)]

for i in range(1, n+1):
    for w in range(W+1):
        weight, value = obj[i-1]
        DP[i][w] = max(DP[i-1][w], DP[i][w])
        if w + weight <= W:
            DP[i][w + weight] = max(DP[i - 1][w] + value, DP[i][w + weight])

ans = max(DP[n])
print(ans)
#! /usr/local/bin/python3
# coding: utf-8

from sys import setrecursionlimit

setrecursionlimit(21)


class Node():
    def __init__(self, parent=-1, child=[]):
        self.parent = parent
        self.child = child


def node_depth(u, id):
    if u[id].parent == -1:
        return 0
    else:
        return node_depth(u, u[id].parent) + 1


def node_type(u, id):
    if u[id].parent == -1:
        return "root"
    elif u[id].child == []:
        return "leaf"
    else:
        return "internal node"


def main():
    n = int(input())
    u = [Node() for _ in range(n)]

    for i in range(n):
        _, _, *child = (int(x) for x in input().split())
        u[i].child = child
        for c in child:
            u[c].parent = i

    for i in range(n):
        print("node {}: parent = {}, depth = {}, {}, {}".
              format(i, u[i].parent,
                     node_depth(u, i), node_type(u, i),
                     u[i].child))


if __name__ == '__main__':
    main()



### FIXED CODE ###

class Node():
    def __init__(self, parent=-1, child=[]):
        self.parent = parent
        self.child = child


def node_depth(u, id):
    if u[id].parent == -1:
        return 0
    else:
        return node_depth(u, u[id].parent) + 1


def node_type(u, id):
    if u[id].parent == -1:
        return "root"
    elif u[id].child == []:
        return "leaf"
    else:
        return "internal node"


def main():
    n = int(input())
    u = [Node() for _ in range(n)]

    for _ in range(n):
        id, _, *child = (int(x) for x in input().split())
        u[id].child = child
        for c in child:
            u[c].parent = id

    for id in range(n):
        print("node {}: parent = {}, depth = {}, {}, {}".
              format(id, u[id].parent,
                     node_depth(u, id), node_type(u, id),
                     u[id].child))


main()
import sys
input = sys.stdin.readline

n = int(input())
w = list(input().split())
ans = ['TAKAHASHIKUN', 'Takahashikun', 'takahashikun']
cnt = 0
w[n - 1] = w[n - 1].rstrip('.')
for i in range(n):
    if len(w[i]) == 12 and w[i] in ans:
        cnt += 1

print(cnt)


### FIXED CODE ###

s = input()
memo = ''
len_s = len(s)
cnt = 0
ans = 0

for i in range(2 * 10 ** 5):
    ans += 1
    if memo == s[cnt]:
        if cnt == len_s - 1:
            ans -= 1
        memo = s[cnt:cnt + 2]
        cnt += 2
    else:
        memo = s[cnt]
        cnt += 1
    if cnt > len_s - 1:
        break

print(ans)
n=int(input())
a=sorted(list(map(int,input().split())))
flag=0
ans=1
a_cumulative=[0]
for i in range(n):
  flag+=a[i]
  a_cumulative.append(flag)
a.reverse()
a_cumulative.reverse()
for j in range(n-1):
  if a[j]＜= a_cumulative[j+1]*2:
    ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
a=sorted(list(map(int,input().split())))
flag=0
ans=1
a_cumulative=[0]
for i in range(n):
  flag+=a[i]
  a_cumulative.append(flag)
a.reverse()
a_cumulative.reverse()
for j in range(n-1):
  if a[j] <= a_cumulative[j+1]*2:
    ans+=1
  else:
    break
print(ans)
N,X = map(int,input().split(" "))
x = list(map(int,input().split(" ")))
x = list(map(lambda y: abs(y - X),x))


# gcd
def gcd (a,b):
    if a < b:
        a,b = b,a
    return a if b == 0 else gcd(b,a%b)

ans = gcd(x[0],x[1])
for i in range(2,N):
    ans = gcd(ans,x[i])

print(ans)


### FIXED CODE ###

N,X = map(int,input().split(" "))
x = list(map(int,input().split(" ")))
x = list(map(lambda y: abs(y - X),x))


# gcd
def gcd (a,b):
    if a < b:
        a,b = b,a
    return a if b == 0 else gcd(b,a%b)

if N == 1:
    print(x[0])
    exit(0)
ans = gcd(x[0],x[1])
if N == 2:
    print(ans)
    exit(0)
for i in range(2,N):
    ans = gcd(ans,x[i])

print(ans)
import sys
import time
#from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
#import heapq
import math
start=time.time()
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n = rl()
a=rl()
a.sort()
b=[]
ans=[0]*2*10**5
for i in a:
    if len(b)==0:
        b.append(i)
        ans[i]=1
        continue
    flag=True
    for j in b:
        if i==j:
            ans[i]=0
        if i%j==0:
            flag=False
    if flag:
        b.append(i)
        ans[i]=1

print(sum(ans))

### FIXED CODE ###

import sys
import time
#from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
#import heapq
import math
start=time.time()
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n = rl()
a=rl()
a.sort()
b=[0]*2*10**6
for i in a:
    if b[i]==0:
        b[i]=-1
        for j in range(2,10**6):
            if i*j>10**6:
                break
            b[i*j]+=1
        continue
    
    if b[i]==-1:
        b[i]=1
cnt = 0
for i in a:
    if b[i]==-1:
        cnt+=1
print(cnt)
import sys

if __name__ == '__main__':
    N, A = sys.argv[1:]
    assert 2<=int(N)<=200
    assert -100<=int(A)<=100

    L = int(A)
    R = int(A)+int(N)-1

    if R <= 0:
        eat = R
    elif L >= 0:
        eat = L
    else:
        eat = 0

    ans = (R+L)*(R-L+1)//2-eat
    print(ans)


### FIXED CODE ###

if __name__ == '__main__':
    N, A = input().split()[0:]
    assert 2<=int(N)<=200
    assert -100<=int(A)<=100

    L = int(A)
    R = int(A)+int(N)-1

    if R <= 0:
        eat = R
    elif L >= 0:
        eat = L
    else:
        eat = 0

    ans = (R+L)*(R-L+1)//2-eat
    print(ans)
import sys
import numpy as np

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


n, k = map(int, input().split())
a_li = list(map(int, input().split()))

for _ in range(k):
    b_li = [0 for _ in range(n)]
    for i in range(n):
        l = max(0, i-a_li[i])
        r = min(n-1, i+a_li[i])
        for j in range(l, r+1):
            b_li[j] += 1
    a_li = b_li
    
print(' '.join(map(str, a_li)))

### FIXED CODE ###

import sys

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


n, k = map(int, input().split())
a_li = list(map(int, input().split()))

if k>=42:
    print(*[n]*n)
    exit()

for i in range(k):
    b = [0] * n
    for j in range(n):
        l = max(0, j-a_li[j])
        r = min(n-1, j+a_li[j])
        b[l] += 1
        if (r+1<n):
            b[r+1] -= 1
    for j in range(n-1):
        b[j+1] += b[j]
    a_li = b
print(*a_li)
p=lambda x:print(f'{x//3600:02}:{x//60%60:02}:{x%60:02}')
for e in iter(input,'-1'):
 h,m,s=map(int,e.split())
 d=7200-h*3600-m*60-s
 p(d);p(d*3)


### FIXED CODE ###

p=lambda x:print(f'{x//3600:02}:{x//60%60:02}:{x%60:02}')
for e in iter(input,'-1 -1 -1'):
 h,m,s=map(int,e.split())
 d=7200-h*3600-m*60-s
 p(d);p(d*3)
S = input()
T = input()

con = 0

ans = "Yes"

for i in range(0,len(S)):
  cutS = S[i+1:]
  cutT = T[i+1:]
  if S[i] in cutS:
    print(S[i],cutS)
    j = cutS.index(S[i]) + (i + 1)
    print(T[i],T[j])
    if T[i] != T[j]:
      ans = "No"
      break
  if T[i] in cutT:
    k = cutT.index(T[i]) + (i + 1)
    if S[i] != S[k]:
      ans = "No"
      break

print(ans)

### FIXED CODE ###

S = input()
T = input()

ans = "Yes"
 
for i in range(0,len(S)):
  for j in range(0,i):
    if S[j] == S[i]:
      if T[i] != T[j]:
        ans = "No"
        break
      break
    if T[j] == T[i]:
      if S[j] != S[i]:
        ans = "No"
        break
      break
print(ans)
O=input()
E=input()

for i in range(len(O)):
    print(O[i], E[i], sep="",end="")

### FIXED CODE ###

O=list(input())
E=list(input()) + [""]

for i in range(len(O)):
    print(O[i], E[i], sep="",end="")
h,w = map(int, input().split())

if w == 1:
    print(1)
    exit()

if w == 2 and h == 2:
    print(2)
    exit()

if w % 2 == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    second = can - 1
    num = can + second
elif w % 2 == 1 and h == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    print(can)
    exit()
elif w % 2 == 0 and h == 1:
    idle = int(w / 2)
    print(idle)
    exit()
else:
    idle = int(w / 2)
    num = idle * 2
    
if h % 2 == 1:
    row = int(h // 2)
    print(num * row + can)
else:
    row = int(h / 2)
    print(num * row)

### FIXED CODE ###

h,w = map(int, input().split())

if w == 1 or h == 1:
    print(1)
    exit()
    
if w == 2 and h == 2:
    print(2)
    exit()

if w % 2 == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    second = can - 1
    num = can + second
elif w % 2 == 1 and h == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    print(can)
    exit()
elif w % 2 == 0 and h == 1:
    print(1)
    exit()
else:
    idle = int(w / 2)
    num = idle * 2

if h % 2 == 1 and w % 2 == 0:
    print(int((w / 2) * h))
    exit()

if h % 2 == 1:
    row = int(h // 2)
    print(num * row + can)
else:
    row = int(h / 2)
    print(num * row)