peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
W = list(map(int, input().split()))

ans = 10**5

for i in range(1,N):
    temp = abs(sum(W[:i+1]) - sum(W[i+1:]))
    ans = min(ans, temp)
print(ans)
# Judge status: Accepted
import math

a, b, x = map(int, input().split())
if x >= a**2*b/2:
    print(math.degrees(math.atan((2*b-2*x/a**2)/a)))
else:
    print(math.degrees(math.atan(b**2*a/2/x)))
# Judge status: Accepted
N,R =map(int,input().split())

print(R if N>=10 else R+100*(10-N))
# Judge status: Accepted
N=int(input())
H=list(map(int, input().split()))
H=list(reversed(H))
ans='Yes'
for i in range(N-1):
    if H[i]<H[i+1]:
        if H[i]<H[i+1]-1:
            ans='No'
        else:
            H[i+1]=H[i+1]-1
print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a - b == c - b:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
import itertools
A,B,C,D = list(input())

for ops in itertools.product(['+', '-'], repeat=3):
	eq = A+ops[0]+B+ops[1]+C+ops[2]+D
	x = eval(eq)

	if x == 7:
		break

print(eq+'=7')
# Judge status: Wrong Answer
s = input()
asw='keyence'
l=7
m=len(s)
n=m-7
z=0
if n==0 and s==asw:
	print('YES')
elif n<0:
	print('NO')
elif n>0:
	for i in range(0, n):
		st = s[0:i]
		ed = s[i+n:m+1]
		con = st+ed
		if con==asw:
			print('YES')
			z=1
	if z==0:
		print('NO')
# Judge status: Accepted
import sys
from collections import deque

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

Q, H, S, D = lr()
N = ir()

H = min(Q * 2, H)
S = min(H * 2, S)
if S * 2 <= D:
    print(S * N)
else:
    print((N // 2) * D + (N % 2) * S)
# Judge status: Wrong Answer
n =int(input())
a =list(map(int ,input().split()))
b =list(map(int ,input().split()))
b.append(0)
c =0
d =0
enemy =0
for i in range(len(a)):
    if a[i] >b[i] +c:
        d += a[i] -(b[i]+c)
    elif a[i] <b[i] +c:
        c =b[i]+c -a[i]
for i in range(len(a)):
    enemy +=a[i]       
print(enemy -d)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
ans = set()
for i in range(n,0,-1):
    count = 0
    for j in range(1,n//i+1):
        if j in ans:
            count += 1
    if count % 2 != a[i-1] :
        ans.add(i)
print(len(ans))
if ans:
    print("".join(map(str,ans)))
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

M1 = max(A, C)
M2 = min(B, D)

if B >= C:
    print(M2 - M1)

else:
    print(0)
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
d = list(map(int, input().split()))
dist = Counter(d)
mod = 998244353
if d[0] != 0 and dist[0] != 1:
    print(0)
    exit()
ans = 1
for i in range(n-1):
    ans = (ans * pow(dist[i], dist[i + 1], mod)) % mod
print(ans)
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
print(int(((a+b)*c)/2))
# Judge status: Accepted
import fractions
from functools import reduce

d = 10**9+7
n = int(input())
A = list(map(int, input().split()))

def lcm(l):
    return reduce(lambda x, y: (x * y) // fractions.gcd(x, y), l, 1)

base = lcm(A)
print(sum(map(lambda n: base // n, A))%d)
# Judge status: Accepted
print(['NO', 'YES'][int(int(input()) in [3, 5, 7])])
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))
A = [i-1 for i in A]

doubling = [[0] * N for _ in range(61)]
for i in range(N):
  doubling[0][i] = A[i]
  
for i in range(1,61):
  for j in range(N):
    doubling[i][j] = doubling[i-1][doubling[i-1][j]]
    
now = 0
i = 0
while K!=0:
  if K&1==1:
    now = doubling[i][now]
    K = K>>1
    i += 1
    
  else:
    K = K>>1
    i += 1
    
print(now+1)
# Judge status: Wrong Answer

c = input()
d = input()

print("YES" if c==c[::-1] and d==d[::-1] else "NO")
# Judge status: Accepted
A,B = map(int,input().split())

for i in range(B*10,(B+1)*10):
    if i*8//100 == A:
        print(i)
        exit()

print(-1)
# Judge status: Accepted
a = list(map(int, input().split()))
num = int(input())
k = 0
for i in range(num):    #num回２倍を繰り返す。でなければNoをprint
  if a[0] == max(a) or a[1] == max(a):   #リストaの中のmaxよりも青が小さいならば青を二倍する
    a[2] = a[2] * 2
    k += 1
  elif a[1] == min(a) and k < num:
    a[1] = a[1] * 2
    k += 1 
  else:
    pass

if a[0] < a[1] and a[1] < a[2]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
i = list(map(int, input().split()))
k=int(i[0]/2)
if i[0]%2==1:
    for j in range(i[1]):
        print(k-j, k+1+j)
else:
    for j in range(i[1]):
        print(k-j-1, k+1+j)
# Judge status: Accepted
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N,T = map(int,input().split())
CT = [tuple(map(int,input().split())) for _ in range(N)]

INF = float("inf")
ans = INF
for c,t in CT:
    if t <= T and c < ans:
        ans = c

print(ans if ans != INF else "TLE")
# Judge status: Wrong Answer
n = int(input())
a = -(-n//111)
if a == 9:
    print(1111)
else:
    print(a*111)
# Judge status: Accepted
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

a, b, c = na()

print(max(a * 10 + b + c, b * 10 + a + c, c * 10 + a + b))
# Judge status: Accepted
x = input()

if x in "753":
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
a = int(input())
print('Yes' if ((n%500)-a)<=0 else 'No')
# Judge status: Accepted
s=input()
cnt=0
while(1):
    if cnt>=1 and len(s)%2==0 and s[:(len(s)//2)]==s[(len(s)//2):]:
        print(len(s))
        break
    s=s[:-1]
    cnt+=1
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
alice=sum(a[::2])
Bob=sum(a[1::2])
print(alice-Bob)
# Judge status: Accepted
a, b = map(int, input().split())

if a == 1:
    a = 14
if b == 1:
    b = 14

if a > b:
    print('Alice')
elif a < b:
    print('Bob')
else:
    print('Draw')
# Judge status: Accepted
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

import math

H=one_int()

beki = int(math.log2(H))+1

print(2**beki -1 )
# Judge status: Wrong Answer
str = input()
part = input()

flg = False

for i in range(len(part)):
  for j in range(i + 1):
    target = str[j: len(str) - (i - j)]
    search = part[j: len(part) - (i - j)]
    # print(f'target {target}, search {search}')
    if search in target:
      print(i)
      flg = True
      break
  
  if flg:
    break

if not flg:
	print(len(part))
# Judge status: Accepted
n = int(input())
x = 0
ans = []

for i in range(1,10000000):
    x += i
    ans.append(i)
    if x >= n:
        break

if x != n:
    ans.remove(x-n)
  
for i in ans:
    print(i)
# Judge status: Wrong Answer
print("Yws"if int(input())%9==0 else"No")
# Judge status: Wrong Answer
import collections
s = input()
c1 = s.count("1")
c0 = s.count("0")

print(min(c1,c0))
# Judge status: Accepted
N, K = map(int, input().split())

import math

ans = 0
for n in range(1, N+1):
    continue_num = max(math.ceil(math.log(K, 2) - math.log(n, 2)), 0)
    ans += (1/N) * (1/2)**continue_num
    
print(ans)
# Judge status: Wrong Answer
s=input() ; n=len(s)
for i in range(100):
    s=s.replace("ST","")
print(len(s))
# Judge status: Wrong Answer
a,b=map(int,input().split())
print((a+b)/2 if (a+b)%2==0 else "IMPOSSIBLE")
# Judge status: Accepted
N = int(input())
 
if N == 0:
    print(0)
    exit()
ans = []
while N:
    ans.append(N % 2)
    N = N // 2
    N *= -1
print("".join(map(str, ans[::-1])))
# Judge status: Accepted
k, x = map(int, input().split())
if 500 * k >= x:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,b = map(int,input().split())
if a>0:
    print('Positive')
elif b<0:
    if (a-b+1)%2==0:
        print('Positive')
    else:
        print('Negative')
else:
    print('Zero')
# Judge status: Wrong Answer
n = int(input())
a = [0] * n
b = [0] * n
sa = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())
    sa[i] = b[i] - a[i]
# so = sa.copy()
# sa.sort()
c = b.copy()
c.sort()
# print(sa)
# print(so)
# print(su)
wa = 0
for i in c:
    wa += a[b.index(i)]
    # print(wa, b[c.index(i)])
    if wa > b[b.index(i)]:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
a,b = map(int, input().split())
print(a) if a<=b else a-1
# Judge status: Wrong Answer
import math

x,y = map(int,input().split(" "))

n = int(math.log2(y)-math.log2(x))

print(n+1)
# Judge status: Accepted
S=input()
T=input()
ans=0

for i in range(len(S)-len(T)+1):
  temp=S[i:i+len(T)]
  cnt=0
  for j in range(len(T)):
    if T[j]==temp[j]:
      cnt+=1
  else:
    ans=max(ans,cnt)
print(len(T)-ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline

def ppp(n,m,h,ab):
    g = [1] * n
    for l,r in ab:
        if h[l-1] >= h[r-1]:
            g[r-1] = 0
        if h[l-1] <= h[r-1]:
            g[l-1] = 0
    print(sum(g))
if __name__ == "__main__":
    n,m = map(int,input().split())
    h = list(map(int,input().split()))
    ab = [list(map(int,input().split())) for _ in range(m)]
    ppp(n,m,h,ab)
# Judge status: Accepted
"""
int(input())
map(int,input().split())
list(map(int,input().split()))

"""

n=int(input())
s=list(map(int,input().split()))
if(len(s)==len(list(set(s)))):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, m = map(int, input().split())

if n>=2 and m>=2:
    print(n*m - (n-2)*2 - (m-2)*2 - 4)
elif n==1 and m==1:
    print(1)
elif n==1 and m>=2:
    print(m-2)
else:
    print(n-2)
# Judge status: Wrong Answer
s =input()
t = list(input())
t.remove(t[-1])

t= ''.join(t)
if s == t:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
x,y,z = map(int,input().split())
print((x-1)//(y+z))
# Judge status: Wrong Answer
S = input()

ACGT = ['A', 'C', 'G', 'T']

count_list = [0]
count = 0
max_count = 0
for s in S:
    if s in ACGT:
        count += 1
    else:
        count_list.append(count)
        # max_count = max(max_count, count)
        count = 0
print(max(count_list))
# Judge status: Accepted
n =int(input())
b = list(map(int, input().split()))
a = [b[0]]
for i in range(1,n-1):
    a.append(min(b[i-1],b[i]))
a.append(b[-1])
print(sum(a))
# Judge status: Accepted
S = int(input())
S_lst = [S]

for i in range(10**5):
    if S_lst[i] % 2 == 0:
        S_lst.append(S_lst[i] / 2)
    else:
        S_lst.append(3 * S_lst[i] + 1)
    if S_lst[i+1] in S_lst[:-1]:
        print(i+2)
        break
# Judge status: Wrong Answer
# coding: utf-8
N = int(input())
a = list(map(int, input().split()))
num = 1
while len(a) >= 1:
    if num in a:
        a = a[a.index(num) +1 :]
        num += 1
    else:
        print(-1)
        exit()
else:
    print(N - num + 1)
# Judge status: Accepted
n, m, *lr = list(map(int, open(0).read().split()))
print(max(0, min(lr[1::2]) - max(lr[::2]) + 1))
# Judge status: Accepted
n, m = map(int, input().split())
x = [int(i) for i in input().split()]
x.sort()

dif = []
for i in range(1,len(x)):
  dif.append(x[i] - x[i-1])
dif.sort()
dif.reverse()

print(sum(dif[n-1:]))
# Judge status: Accepted
from heapq import heapify, heappop, heappush
N,M = map(int, input().split())
AB = []
for i in range(N):
    a,b = map(int, input().split())
    if a<=M:
        AB.append((a,-b))
    else:
        N-=1
AB.sort()

Q = []
heapify(Q)
ans = 0
i = 0

for day in range(M):
    while i<N and AB[i][0] == day+1:
        heappush(Q, AB[i][1])
        i+=1
    if Q:
        ans -= heappop(Q)
print(ans)
# Judge status: Wrong Answer
data = {'AC':0,'WA':0,'TLE':0,'RE':0}
N = int(input())
for i in range(N):
  inputSTR = input()
  data[inputSTR] = data[inputSTR] + 1
  
for key,value in data.items():
  print(key + ' × ' + str(value))
# Judge status: Wrong Answer
from fractions import gcd
N, X = map(int, input().split())
Xs = [int(i) for i in input().split()]

Xs.append(X)
dist = sorted(Xs)

i = dist[0]
# gcdは２数の最大公約数しか求めることができない。gcd(手前の２数の最大公約数,距離の値)とすれば全ての距離の最大公倍数が求められる。
for j in range(1, len(dist)):
    i = gcd(i, j)

print(i)
# Judge status: Accepted
N = int(input())
ans = 0
if N % 2 == 1:
    pass
else:
    two = 0
    five = 0
    tmp = 2
    while tmp <= N:
        two += N // tmp
        tmp *= 2
    tmp = 10
    while tmp <= N:
        five += N // tmp
        tmp *= 5
    ans = min(two, five)
print(ans)
# Judge status: Accepted
S = input()
dp = [0] * (len(S) + 1)
dp[0] = 1

words = ["dream", "dreamer", "erase", "eraser"]
done = 'NO'

for i in range(len(S)):
    if dp[i] == 0:
        continue
    for w in words:
        if S[i:i+len(w)] == w:
            dp[i+len(w)] = 1
    
    if dp[len(S)] == 1:
        done = 'YES'
        break

print(done)
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    q, h, s, d = map(int, readline().split())
    n = int(readline())
    ans = min(8 * q, 4 * h, 2 * s, d) * (n // 2) + min(4 * q, 2 * h, s) * (n % 2)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
k = int(input())
n = k // 2
if k % 2 == 0:
    print(n**2)

if k % 2 == 1:
    o = n + 1
    print(o*n)
# Judge status: Wrong Answer
import itertools
import numpy as np
n, m, x = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(n)]
l = np.array(l)
ans = np.sum(l, 0)[0]
ans_s = np.sum(l, 0)
if np.any(ans_s[1:] < x):
    print(-1)
    exit()
for i in range(1, m + 1):
    for j in itertools.combinations(l, i):
        tot = np.sum(j, 0)
        if np.all(tot[1:] >= x) and tot[0] < ans:
            ans = tot[0]
print(int(ans))
# Judge status: Accepted
s = input()
if s[0] == '9' or s[1] == '9':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a, b = map(int,input().split())
if a < 6:
    b = 0
elif a < 13:
    b //= 2
print(b)
# Judge status: Accepted
rs = [(x - l, x + l) for x, l in (map(int, input().split()) for _ in range(int(input())))]
rs.sort(key=lambda x: x[1])
last = - 10 ** 9
ans = 0
for l, r in rs:
    if last <= l:
        ans += 1
        last = r
print(ans)
# Judge status: Wrong Answer
N, X, T = list(map(int, input().split()))
ans = ((N // X) + int(N % X) ) * T
print(ans)
# Judge status: Accepted
l, r = map(int, input().split())
a = []
if r - l > 2019:
  for i in range(l, l + 2019):
    for j in range(i + 1, min(r + 1, l + 2020)):
      a.append((i * j) % 2019)
else:
  for i in range(l, r):
    for j in range(i + 1, r + 1):
      a.append((i * j) % 2019)
ans = min(a)
print(ans)
# Judge status: Accepted
n = int(input())

dp = [1]*(n)
dp[0] = 0

for i in range(2, n):
  for j in range(i, n, i):
    dp[j] += 1
    
print(sum(dp))
# Judge status: Wrong Answer
a,b = map(int,input().split())
print(b//a)
# Judge status: Accepted
# C - Energy Drink cntlector
import heapq

N, M = map(int, input().split())
AB = []
for i in range(N):
    heapq.heappush(AB, list(map(int, input().split())))

cnt = 0
ans = 0
for i in range(N):
    price, bottles = heapq.heappop(AB)
    cnt = min(M, bottles)
    M -= cnt
    ans += price * cnt
    if M==0:
        break

print(ans)
# Judge status: Accepted
a,b=map(int,input().replace(".","").split())
print(a*b//100)
# Judge status: Accepted
n = int(input())
lst = list(map(int, input().split()))
cst = [float('inf')] * n

cst[0] = 0
for _ in range(0, n-2):
    cst[_+1] = min(cst[_] + abs(lst[_+1] - lst[_]),cst[_+1])
    cst[_+2] = min(cst[_] + abs(lst[_+2] - lst[_]),cst[_+2])
cst[n-1] = min(cst[n-2] + abs(lst[n-1] - lst[n-2]),cst[n-1])
print(cst[n-1])
# Judge status: Accepted
a,b,c,k=map(int,input().split())
if k%2==0:
    print(a-b)
else:
    print(b-a)
# Judge status: Wrong Answer
from bisect import bisect_left
N = int(input())
A = list(map(int,input().split()))
A.sort()
n = A.pop()
index = bisect_left(A, n//2+1)
if index == 0:
    r = A[0]
elif index == N-1:
    r = A[N-2]
else:
    if abs(n//2+1-A[index]) <= abs(n//2+1-A[index-1]):
        r = A[index]
    else:
        r = A[index - 1]
print(*[n,r])
# Judge status: Accepted
# １食８００円をN食食べた
N = int( input() )
x = int( 800 * N )

#  １５食食べるごとに２００円もらえる

y = N // 15 * 200

print( x - y )
# Judge status: Accepted
import sys

N = int(input())

for i in range(1,10):
    for j in range(1,10):
        if i*j == N:
            print("Yes")
            sys.exit()

print("No")
# Judge status: Accepted
from collections import Counter

n=int(input())
a=Counter(list(map(int,input().split())))
x=[0,0]
for i in a.keys():
    if a[i]>1:
        x.append(i)
    if a[i]>3:
        x.append(i)
x.sort()
print(x[-1]*x[-2])
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
S = input()[:-1]
acc = [0]

for Si in S:
    if Si=='#':
        acc.append(acc[-1]+1)
    else:
        acc.append(acc[-1])

ans = 10**18

for i in range(N+1):
    ans = min(ans, acc[i]+N-i-(acc[N]-acc[i]))

print(ans)
# Judge status: Accepted
import sys
def input():
    return sys.stdin.readline()[:-1]
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

import bisect
from collections import deque

lis = deque()
for i in range(n):
    ind = bisect.bisect_left(lis,a[i])
    if ind==0:
        lis.appendleft(a[i])
    else:
        lis[ind-1] = a[i]

print(len(lis))
# Judge status: Accepted
# coding: utf-8
# Your code here!

temp = int(input())

if temp >= 30 : 
    print("Yes")
else : 
    print("No")
# Judge status: Accepted
n = str(input())
list = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
x = 7
for item in list:
    if(n == item):
        print(x)
    x -= 1
# Judge status: Accepted
n = int(input())

aru = 0
for i in range(25):
    for j in range(14):
        if i*4 + j*7 == n:
            aru = 1
if aru == 1:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
num = int(input())
base = ["a","b","c","d","e","f","g","h","j","k"]

if num == 1:
  print("a")
elif num == 2:
  print("aa")
  print("ab")
elif num == 3:
  print("aaa")
  print("aab")
  print("aba")
  print("abb")
  print("abc")
# Judge status: Wrong Answer
n = int(input())
cnt = 0
for i in range(1, n+1):
    if n % i == 0:
        cnt += 1
if cnt == 8:
    print(1)
else:
    print(0)
# Judge status: Accepted
import sys
n = int(input())
t_ls = []
for i in range(n):
    t_ls.append(int(sys.stdin.readline().strip()))

def gcd(a, b):
    while a and b:
        if a < b:
            b %= a
        else:
            a %= b
    return max(a, b)

def scm(a, b):
    _gcd = gcd(a, b)
    return a * b // _gcd

res = 1
for t in t_ls:
    res = scm(res, t)
print(res)
# Judge status: Accepted
import math

text = input()

if text == "hi" or text == "hihi" or text == "hihihi" or text == "hihihihi" or text == "hihihihihi":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
x = list(map(int, input().split()))

ans = 10 ** 9

x_min = min(x)
x_max = max(x)

for i in range(x_min, x_max+1):
    tmp = sum([(i-j)*(i-j) for j in x])
    if ans > tmp:
        ans = tmp

print(ans)
# Judge status: Accepted
N, X, T = map(int,input().split())
if N % X == 0:
  print((N//X)*T)
else:
  print((N//X+1)*T)
# Judge status: Wrong Answer
n=int(input())
s=input()
l=[]
for i in s:
  if i==')':
    if len(l)>0:
      if l[-1]=='(':
        l.pop()
      else:
        l.append(i)
    else:
      l.append(i)
print(len(l)*'(' + s)
# Judge status: Accepted
s = input()
if len(list(set(s))) == 2:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a, b = map(int, input().split())
s = input()

def is_int(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

if is_int(s[0:a]) and is_int(s[a+1:a+b+2]) and s[a] == "-":
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if c<=b and a<=c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s = list(input())
count = 0
for i in s:
    if (i == 'A'):
        break
    count += 1
for i in s[::-1]:
    if (i == 'Z'):
        break
    count += 1
print(len(s) - count)
# Judge status: Wrong Answer
N, *A = map(int, open(0).read().split())
ans = sum(c//2 for c in A)
A = [c%2 for c in A]
for i in range(N-2):
  if A[i]==A[i+1]==1:
    A[i+1] = 0
    ans += 1
print(ans)
# Judge status: Accepted
N = input()
a = 0
for s in N:
    a+=(int(s)%9)
if a%9==0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
sousuu = int(input())
listnum = list(map(int, input().split()))
posinum = sousuu // 2 if sousuu % 2 == 0 else sousuu // 2 + 1
posival = sum(listnum) // len(listnum)
dst = 99999
for p in range(posinum - 3, posinum + 3):
    _dst = 0
    for i, s in enumerate(range(p - sousuu//2, p - sousuu//2 + sousuu)):
        _dst += abs(listnum[i] - s)
    if dst > _dst:
        dst = _dst
print(dst)
# Judge status: Accepted
S = input()
ans = [0 for i in range(len(S) + 1)]

for i in range(len(S)):
    if "<" == S[i]:
        ans[i + 1] = ans[i] + 1

for i in range(len(S) - 1, -1, -1):
    if ">" == S[i]:
        ans[i] = max(ans[i], ans[i + 1] + 1)

print(sum(ans))
# Judge status: Accepted
n = int(input())
cnt=0
factor=[]
for i in range(2, int(n**.5)+1):
    j=1
    while n%i==0:
        n//=i
        factor.append(i)
if n>1:
    cnt+=1

# 1->1, 3->2, 6->3, 10->4 ...を返す
def f(x):
    i=1
    cnt=0
    while x>=i:
       x-=i
       i+=1
       cnt+=1
    return cnt

from itertools import groupby
for k,v in groupby(factor):
    cnt+=f(len(list(v)))
print(cnt)
# Judge status: Wrong Answer
N,M=map(int,input().split())

if N>=2*M:
  print(M//2)
else:
  answer=0
  k=(M-2*N)//4
  N+=k
  M-=2*k
  #print(k,N,M)  
  print(N)
# Judge status: Accepted
A,B,C = map(int,input().split())
flag = False
for i in range(B):
    tmp = i*A%B
    if tmp == C:
        flag = True

if flag:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n=int(input())
if n<7: 
  print(1);exit()
print(n//11*2+(n%11>0)+(n%11>6))
# Judge status: Wrong Answer
a,b = map(int, input().split())

for i in (b-(a-1),b+(a-1)+1):
  print(i,' ',end='')
# Judge status: Accepted
import sys

N = int(sys.stdin.readline())
ans = 1
MOD = 10 ** 9 + 7
for i in range(1, N + 1):
    ans = ans * i % MOD
print(ans)
# Judge status: Wrong Answer
n=int(input())
a = list(map(int,input().split()))
b = list(set(a))
b.sort(reverse=True)
b_dict={}
for i in b:
  b_dict[i]=a.count(i)

h_max=0

for i in b:
  if b_dict[i]>=4:
    print(i**2)
    exit()
  elif b_dict[i]>=2:
    if h_max==0:
      h_max=i
    else:
      print(h_max*i)
      exit()
print(0)
# Judge status: Accepted
N = int(input())
if(N%9 == 0):
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())
ans = ""
gx, gy = (tx - sx, ty - sy)
# go
ans += "R" * gx + "U" * gy
ans += "R" + "D" * (gy + 1) + "L" * (gx + 1) + "U"

# return
ans += "U" * gx + "R" * gy
ans += "U" + "L" * (gx + 1) + "D" * (gy + 1) + "R"

print(ans)
# Judge status: Wrong Answer
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline
    from heapq import heappush, heappop

    N, M = map(int, input().split())
    AB = [ [] for _ in range(100000) ]

    for _ in range(N):
        a, b = map(int, input().split())
        AB[a-1].append(-b)

    ans = 0
    heap = []
    for a in range(M):
        for b in AB[a]:
            heappush(heap, b)
        if heap:
            ans -= heappop(heap)

main()
# Judge status: Wrong Answer
N, M = map(int, input().split())
L = list(list(map(int,input().split())) for i in range(M))
l = 0
r = N
for i in range(M):
    l = max(l,L[i][0])
    r = min(r,L[i][1])
print(l-r+1)
# Judge status: Wrong Answer
a,s,c=input().split()

print('A{}X'.format(s[0]))
# Judge status: Wrong Answer
n = int(input())
s = input()
s = list(s.replace(')(', ') (').split())
ans = ''
for c in s:
    x = c.count('(')
    y = c.count(')')
    ans += '('*max(x,y) + ')'*max(x,y)
print(ans)