peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()

    if S <= '2019/04/30':
        print('Heisei')
    else:
        print('TBD')

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

B = [A[i]-i for i in range(N)]
B.sort()

if N % 2 == 1:
  b = B[(N-1)//2]
else:
  b = (B[N//2] + B[N//2-1]) // 2
  
ans = 0
for a in B:
  ans += abs(a - b)
  
print(ans)
# Judge status: Wrong Answer
s = input()

chkStr = ["k","e","y","e","n","c","e"]

inpStr = list(s)
idx = 0

chkCount = 0


# print(chkStr)
# print(inpStr)
bParam = 0
stopParam = 0

for i in range(len(inpStr)):
    if chkStr[idx] == inpStr[i]:
        idx += 1
        chkCount += 1
    elif (bParam == 0 and stopParam == 0) or bParam != idx:
        bParam = idx
        stopParam += 1


    
    if idx == len(chkStr):
        break


if chkCount == len(chkStr) and stopParam <= 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
S=input()
ans=0
for n in range(1,len(S)//2+1):
    if S[n-1]!=S[-(n)]:
        ans+=1
print(ans)
# Judge status: Accepted
import collections
N,K = map(int,(input().split()))
a = list(map(int,(input().split())))
f = collections.Counter(a)
c = f.most_common()[::-1]
ans = 0
for key in c[:max(0,len(c)-K)]:
    ans += key[1]
print(ans)
# Judge status: Accepted
n=int(input())
k=int(input())
x=int(input())
y=int(input())

tot=0

for i in range(n):
    i+=1
    if i<=k:
        tot+=x
        
    else:
        tot+=y
print(tot)
# Judge status: Accepted
n = int(input())
if n % 2 == 1:
    print('{:.10f}'.format(((n // 2) + 1) / n))
else:
    print('{:.10f}'.format(1 / 2))
# Judge status: Accepted
N=input()

if (N[0]==N[1] and N[1]==N[2]) or (N[1]==N[2] and N[2]==N[3]):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
S = input()
ans = []

for i in range(len(S)):
    ans.append("x")

print("".join(ans))
# Judge status: Accepted
def binary_search(A, target):
  left = 0 
  right = len(A)
  while(3 <= right - left):
    index = (left + right) // 2
    if(A[index] < target):
      left = index
    else:
      right = index + 1
  return left
  
N = int(input())
A = list(map(int, input().split()))
A.sort()
target = A[N - 1] / 2
if(target <= A[0]): ai = A[0]
elif(A[N - 2] <= target): ai = A[N - 2]
else:
  index = binary_search(A[:N - 1], target)
  ai = A[index] if(abs(A[index] - target) < abs(A[index + 1] - target)) else A[index + 1]
print(A[N - 1], ai)
# Judge status: Accepted
n, k, q = map(int, input().split())
P = [k for i in range(n)]
for i in range(q):
    a = int(input())-1
    P[a] += 1
for i in range(n):
    if P[i] - q > 0: print("Yes")
    else: print("No")
# Judge status: Accepted
N=int(input())

print(int(N**0.5)**2)
# Judge status: Wrong Answer
s = input()
i = 1; a = 0; n = 1
while i < len(s):
    if a == 0 and s[i-1] == s[i]:
        a = 1; i += 2; n += 1
    else:
        a = 0; i += 1; n += 1
        if i == len(s)-2 and s[i] == s[i+1]: n -= 1
print(n)
# Judge status: Accepted
N = int(input())
l = []
for i in range(N):
  s, p = input().split()
  l.append([s, int(p), i+1]) 

# まず点数で降順に並べる
l = sorted(l, key=lambda x:(x[1]), reverse=True)
# 次に地名で辞書順に並べる
l = sorted(l, key=lambda x:(x[0]))
for i in range(N):
  print(l[i][2])
# Judge status: Wrong Answer
h,w = map(int,input().split())

if h%2 == 0:
    print(w*(h//2))
else:
    print((w*(h//2)) + ((w//2)+1))
# Judge status: Wrong Answer
N=int(input())
D=list(map(int,input().split()))
mod=99824453

if D[0]!=0:
    print(0)
    exit()


B=[0]*N
for d in D:
    B[d]+=1
if B[0]!=1:
    print(0)
    exit()

ans=1
total=1
for i in range(1,N):
    if B[i]==0:
        if total!=N:
            print(0)
            exit()
        else:break
    total+=B[i]
    ans*=(B[i-1]**B[i])%mod

print(ans)
# Judge status: Accepted
w = ['Sunny','Cloudy','Rainy','Sunny']
print(w[w.index(input()) + 1])
# Judge status: Accepted
n = int(input())
ans = ":("
for i in range(1, 50001):
    if (i*1.08)//1 == n:
        ans = i
        break
print(ans)
# Judge status: Wrong Answer
def main():
    a, b, c = map(int, input().split())
    if a == b or a == c or b == c:
        print(2)
    elif a == b == c:
        print(1)
    else:
        print(3)
main()
# Judge status: Accepted
from collections import defaultdict
N = int(input())

def primeFactorization(n):
    res = defaultdict(int)
    m = int(n**0.5)
    for i in range(2,m+1):
        while n % i == 0:
            n = n//i
            res[i] += 1
    if n > 1:
        res[n] = 1
    return res

dic = primeFactorization(N)

ans = 0
for k,v in dic.items():
    n = 1
    while v >= n*(n+1)//2:
        ans += 1
        n += 1

print(ans)
# Judge status: Accepted
N = int(input())

ans = 0
for a in range(1, N+1):
    ans += (N-1)//a
print(ans)
# Judge status: Accepted
temp = int(input())
print("Yes" if temp >= 30 else "No")
# Judge status: Wrong Answer
a=int(input())
k=[]
while a%2==0:
  a//=2
  k+=[2]
t=3
while t**2<=a:
  if a%t==0:
    a//=t
    k+=[t]
  else:t+=2
k+=[a]
z=[1,1]
for i in range(len(k)):
  z[i%2]*=k[i]
print(sum(z)-2)
# Judge status: Accepted
n = int(input())

res = 0
for i in range(9, n+1, 2):
    yakusu = 0
    for j in range(1, i+1):
        if i % j == 0:
            yakusu += 1
    if yakusu == 8:
        res += 1

print(res)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
x = 0
y = sum(A)
ans = 10**9

for n in range(N-1):
  x+=A[n]
  y-=A[n]
  ans = min(ans,abs(x-y))

print(ans)
# Judge status: Accepted
def main():
 name =input()
 if name=='a' or name =='i' or name =='u' or name =='e' or name=='o' :
  print('vowel')
 else :
  print('consonant')
 
main()
# Judge status: Wrong Answer
n,m = map(int,input().split())
A = list(map(int,input().split()))

A.sort(reverse=True)
b = sum(A) // (4*m)
if A[m-1] < b:
  print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
n=int(input())
s=input()
from collections import Counter
d=Counter(list(s))
ans=1
for i in d:ans*=d[i]+1
print(ans%(10**9+7))
# Judge status: Accepted
import math 
n, k = map(int, input().split())
yes = 'Yes'
no = 'No'
h = list( map(int, input().split()))
h = sorted(h, reverse=True)
if len(h) <= k:
  print(0)
else:
  print(sum(h[k:]))
# Judge status: Accepted
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=list(input())

commands = ['']*n
score = 0

for i,c in enumerate(t):
    if c=='r':
        command = 'p'
        point = p
    elif c=='p':
        command = 's'
        point = s
    elif c=='s':
        command = 'r'
        point = r
        
    if (i-k>=0) and (commands[i-k]==command):
        command = ''
        point = 0
    
    score += point
    commands[i] = command

print(score)
# Judge status: Accepted
print(sum(x for x in range(1,int(input())+1)))
# Judge status: Wrong Answer
l,r,d= list(map(int, input().strip().split()))

print(r//d-l//d+1)
# Judge status: Accepted
S = input()
ans = []
for s in S:
    if s == "B":
        if ans:
            ans.pop(-1)
    else:
        ans.append(s)
print(*ans, sep='')
# Judge status: Accepted
# input
A, B = input().split()
A = int(A)
B, C = map(int, B.split('.'))
B = B*100

# output
print((A*(B+C))//100)
# Judge status: Accepted
A, B, C = map(int, input().split())

if A < C < B:
  print('Yes')
  
elif B < C < A:
  print('Yes')
  
else:
  print('No')
# Judge status: Wrong Answer
N, L = map(int, input().split())
hates = list(map(str, input().split()))
for i in range(N, 9999):
    nums = list(str(i))
    com = set(nums) & set(hates)
    print(com)
    if len(com) == 0:
        print(i)
        break
# Judge status: Accepted
def main():
    N = int(input())
    A = [int(v) for v in input().split()]
    C = [0] * (N + 1)

    for i in A:
        C[i] += 1

    b = 0
    
    for cnt in C:
        b += ((cnt * (cnt - 1)) // 2)

    for i in range(N):
        p = ((C[A[i]] - 1) * (C[A[i]] - 2)) >> 1
        m = (C[A[i]] * (C[A[i]] - 1)) >> 1
        print(b - m + p)


if __name__ == '__main__':
    main()
# Judge status: Accepted
x = int(input())
ans = x//11*2
x %= 11
if x==0:
  print(ans)
elif x<=6:
  print(ans+1)
else:
  print(ans+2)
# Judge status: Accepted
abc = list(map(int,input().split()))

a = abc[0]
b = abc[1]
c = abc[2]

if abc.count(a) == 2 or abc.count(b) == 2 or abc.count(c) == 2:
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer

s = str(input().split())
i = 0
while True:
    if s[i] == s[i + 1]:
        print_ans = 'Bad'
        break
    else:
        print_ans = 'Good'
    i += 1
    if i == 3:
        break
    
print(print_ans)
# Judge status: Wrong Answer
a = int(input())
b  =int(input())
h = int(input())
 
print(((a+b)*h)/2)
# Judge status: Accepted
a,b,c=map(int,input().split());print(['NO','YES'][max(a,b,c)==7 and (a+b+c)-max(a,b,c)==10])
# Judge status: Accepted
N, M = map(int, input().split())
A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]
def check(dx, dy):
    cut_A = [[] for _ in range(M)]
    for i in range(dx, dx + M):
        for j in range(dy, dy + M):
            cut_A[i-dx].append(A[i][j])
    return cut_A == B

for dx in range(N-M+1):
    for dy in range(N-M+1):
        if check(dx, dy):
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
import math
n,d = map(int,input().split())
print(math.ceil(n /(d * 2 +1)))
# Judge status: Wrong Answer
import math
a,b,c,d = map(int,input().split())
#a c hp
#b d atk
t_n = math.ceil(c / b)
a_n = math.ceil(a / d)

if t_n <= a_n:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
a,b,c,d,e,k=int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
l=[a,b,c,d,e]
f=0
for i in range(4):
    for j in range(i+1,5):
        d=abs(l[j]-l[i])
        if(d>k):
            f=1
            break
if(f==0):
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
# https://atcoder.jp/contests/abc042/tasks/arc058_a
# 最悪でも10**6探索する程度なのでNを一つづつ足して全探索でもよくね？


N, K = list(map(int, input().split()))
D = set(input().split())


def is_inD(n: int):
    tmp = set(str(n))
    return tmp.isdisjoint(D)


for i in range(N, N + 10 ** 6):
    if is_inD(i):
        print(i)
        exit()
# Judge status: Accepted
import numpy as np

H, N = map(int, input().split())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

A = np.array(A)
B = np.array(B)

dp = np.full(H + 1, np.inf)
dp[0] = 0

for i in range(1, H + 1):
    dp[i] = np.amin(dp[np.maximum(i - A, 0)] + B)

print(int(dp[H]))
# Judge status: Wrong Answer
N = int(input())
i = 0
while (2 ** i) < N:
    i += 1
print(2 ** (i - 1))
# Judge status: Wrong Answer
N, K = map(int, input().split())
mod = 10 ** 9 + 7
ans = 0
tmp = 0
for i in range(K-1):
  tmp += i
for i in range(K, N + 1):
  tmp += K - 1
  ans += K * N - tmp * 2 + 1
  ans = ans % mod
print(ans)
# Judge status: Wrong Answer
input()
a = sorted(map(int, input().split()))[::-1]
print(sum(a[::2])-sum(a[1::2]))
# Judge status: Wrong Answer
h,w = map(int, input().split())
total = h * w

if w % 2: #wide size = odd
    if h % 2: #both wide, high = odd
        ans = (total + 1)/2
        print(ans)
        exit()
ans = total/2
print(ans)
# Judge status: Accepted
n = list(input())
if n[-1]=="3":
  print("bon")
elif n[-1]=="0" or n[-1]=="1" or n[-1]=="6" or n[-1]=="8":
  print("pon")
else:
  print("hon")
# Judge status: Wrong Answer
n=int(input())
print(800*n-200*n%15)
# Judge status: Accepted
s=input()
ans = ""
for x in s:
  if x == 'B':
    ans = ans[:-1]
  else:
    ans += x
print(ans)
# Judge status: Accepted
A,B=map(int,input().split())
if 1<=A<=9 and 1<=B<=9:
  print(A*B)
else:
  print(-1)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(1,N):
  if A[i-1] < A[i]:
    ans += A[i] - A[i-1]
print(ans)
# Judge status: Accepted
c=[list(map(int,input().split())) for i in range(3)]
xd=[[c[i][1]-c[i][0],c[i][2]-c[i][1]] for i in range(3)]
yd=[[c[1][i]-c[0][i],c[2][i]-c[1][i]] for i in range(3)]
if(xd[0]==xd[1]==xd[2] and yd[0]==yd[1]==yd[2]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m,X,Y=map(int,input().split())
x=sorted(list(map(int,input().split())))
y=sorted(list(map(int,input().split())))
ans='War'
for i in range(X+1,Y+1):
    if x[-1]<i and y[0]>=i:
        ans='No War'
        break
print(ans)
# Judge status: Accepted
N = input()
L = list(map(int, input().split()))

if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s = list(input())
for i in range(len(s)):
    if s[i] == "A":
        a = i
    elif s[i] == "Z":
        z = i

print(len(s[a:z]))
# Judge status: Accepted
S = list(input())
if len(S) == 1:
  print("No")
  exit()
flg = True
for i, s in enumerate(S):
  if i%2 == 0:
    if s != "h":
      flg = False
  else:
    if s != "i":
      flg = False
if flg and len(S)%2 == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a,b = map(int, input().split())
if a >= 13:
    print(b)
elif a >= 6 and a <= 12:
    print(b//2)
else:
    print(0)
# Judge status: Accepted
import sys
A = int(input())
B = int(input())
array = [1,2,3]

array.pop(array.index(A))
array.pop(array.index(B))
print(*array)
# Judge status: Accepted
import bisect

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a.sort()
b.sort()
c.sort()

ans = 0

for i in range(n):
    bi = b[i]
    x = bisect.bisect_left(a, bi)
    y = bisect.bisect_right(c, bi)
    ans += x * (n - y)

print(ans)
# Judge status: Accepted
N = int(input())
L = [2, 1]
for i in range(2, N+1):
    L.append(L[i-1] + L[i-2])
print(L[N])
# Judge status: Accepted
N = int(input())
ls = list(map(int,input().split()))
ls.sort(reverse=True)
a = 0
b = 0
for i in range(N):
    if i % 2 == 0:
        a += ls[i]
    else:
        b += ls[i]
print(a-b)
# Judge status: Wrong Answer
def solve(H, W, N):
    c = 0
    b = 0
    L = max(H, W)
    while b < N:
        b += L
        c += 1
    return c
H = int(input())
W = int(input())
N = int(input())
# Judge status: Accepted
x, a, b = map(int, input().split())

if a-b >= 0:
    print('delicious')
elif a+x >= b:
    print('safe')
else:
    print('dangerous')
# Judge status: Accepted
A, B, C, K = map(int, input().split(" "))

if K <= A:
    print(1*K)
elif K <= B:
    print(1*A + 0*(K-A))
else:
    print(1*A + 0*B + (-1)*(K-A-B))
# Judge status: Accepted
s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()
if s==u:
    a-=1
if t==u:
    b-=1
print(a,b)
# Judge status: Accepted
from fractions import gcd
from functools import reduce
import numpy as np

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

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

A = list(map(int, input().split()))
A = list(map(lambda x: x // 2 , A))
A = np.array(A)

l = lcm(A)

if ((l//A % 2 == 1).sum() != N):
    print(0)
else:
    ans = (M//l + 1) // 2
    print(ans)
# Judge status: Accepted
N, M = map(int, input().split())

odd_head, odd_tail = 1, 0
even_head, even_tail = 0, 0

if M & 1:
    odd_tail = M + 1
    even_head = M + 2
    even_tail = M + 2 + M - 1
else:
    odd_tail = 1 + (M - 1)
    even_head = M + 1
    even_tail = M + 1 + M

while odd_tail - odd_head > 0:
    print(odd_head, odd_tail)
    odd_head += 1
    odd_tail -= 1

while even_tail - even_head > 0:
    print(even_head, even_tail)
    even_head += 1
    even_tail -= 1
# Judge status: Accepted
str1 = input()
li = list(str1)
flag = False
for i in range(len(li)):
    a = i+1
    x = li[i]
    while a < len(li):
        if x == li[a]:
            flag = True
            break
        a += 1
    if flag:
        break
if flag:
    print('no')
else:
    print('yes')
# Judge status: Accepted
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int, input().split()))

    dic = {}
    for a in A:
        if a in dic:
            dic[a] += 1
        else:
            dic[a] = 1
    
    ans = 0
    for key, value in dic.items():
        ans += (value * (value-1)) // 2
    
    for a in A:
        print(ans - dic[a] + 1)


if __name__ == "__main__":
    main()
# Judge status: Accepted
x, y, z = map(int, input().split())
ans = (x - z) // (y + z)
print(ans)
# Judge status: Wrong Answer
from scipy import misc
N,P = (int(x) for x in input().split())
A = list(map(int, input().split()))
o = sum(x % 2 == 1 for x in A)
e = sum(x % 2 == 0 for x in A)
if P == 0:
    sum0 = int(sum(misc.comb(o, i) for i in range(0, o+1, 2)))
    print(sum0*(2**e))
else:
    sum1 = int(sum(misc.comb(o, i) for i in range(1, o+1, 2)))
    print(sum1*(2**e))
# Judge status: Accepted
n = int(input())
s = map(int,input().split())
cnt = 0
t = sorted(s)
 
for i in range(n):
    a = t[i]
    for j in range(i+1, n):
        b = t[j]
        for k in range(j+1, n):
            c = a + b
            if t[k] < (a+b) and a < (b+t[k]) and b < (a+t[k]) and a != b and b != t[k] and a != t[k]:
                cnt += 1
print(cnt)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
print("Yes" if (abs(b - a) <= d and abs(c - b) <= d) or abs(c - a) <= d else "No")
# Judge status: Wrong Answer
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))

N = int(input())

d = [0]*(10**6 + 1)

for x in range(101):
    for y in range(101):
        for z in range(101):
            res = x**2 + y**2 + z**2 + x*y + y*z + z*x
            d[res] += 1

for i in range(1,N+1):
    print(d[i])
# Judge status: Wrong Answer
h1, m1, h2, m2, k = map(int, input().split())
if h1 <= 12 and h2 >= 12:
    h1 = 12 - h1
    h2 = h2 -12
    x = (h2 + h1) * 60 + m1 + m2 - k
    
elif h1 < 12 and h2 < 12 or h1 >= 12 and h2 >= 12:
    x = abs(h2 - h1) * 60 + m1 + m2 - k
    
else:
    h1 = h1 -12
    h2 = 12 - h2
    x = h2 + h1 * 60 + m1 + m2 - k
  
print(x)
# Judge status: Accepted


def main():
    n = int(input())
    z = [[], []]
    for i in range(n):
        x, y = map(int, input().split())
        z[0].append(x + y)
        z[1].append(x - y)
    z[0] = sorted(z[0])
    z[1] = sorted(z[1])
    print(max(z[0][-1] - z[0][0], z[1][-1] - z[1][0]))



if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
import math as mt
#input=sys.stdin.buffer.readline  
t=1
#t=int(input())
for _ in range(t):
    #n=int(input())
    #a,b,c=map(int,input().split())
    #l=list(map(int,input().split()))
    ans=0
    s1=input()
    s2=input()
    for i in range(len(s1)):
        if s1[i]!=s2[i]:
            ans+=1
    print(ans)
# Judge status: Accepted
N = str(input())
if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
    result = 'Yes'
else:
    result = 'No'

print(result)
# Judge status: Wrong Answer
n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in reversed(range(1,len(h))):
  if i == 1 :
    ans = max(ans,cnt)
  elif h[i-1] >= h[i] :
    cnt +=1
  else:
    ans = max(ans,cnt)
    cnt = 0

print(ans)
# Judge status: Wrong Answer
N,M= list(map(int , input().split()))
k = N//2
s = N %2
if s == 1:
    for i in range (M):
        n = i+1
        print (n,N-n)
if s == 0:
    w = 0
    for i in range (M):
        if ((2*i + 1)==k):
            w += 1
        
        print (k-i-w,k+1+i+w)
# Judge status: Accepted
a, b = input().split()
a = int(a)
b = int(b)

if (a+b)%2 == 0:
    print(int((a+b)/2))
else:
    print(int((a+b)//2)+1)
# Judge status: Accepted
N,K = map(int, input().split())
A = list(map(int, input().split()))

lst = [0] * N
k = 1
cnt = 0
for j in range(10*N):
  lst[k-1] += 1
  k = A[k-1]
num = len(list(filter(lambda x:x>=1,lst)))
k = 1
first = []
loop = []
for j in range(num):
  if lst[k-1] == 1:
    first.append(k)
  elif lst[k-1] > 1:
    loop.append(k)
  k = A[k-1]
if K < len(first):
  print(first[K])
else:
  K -= len(first)
  print(loop[K%len(loop)])
# Judge status: Accepted
def DP_A() :
    N = int(input())
    h = [int(x) for x in input().split()]
    dp = [10**10]*(N+1)

    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2,N) :
        dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
        dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

    return dp[N-1]


print(DP_A())
# Judge status: Wrong Answer
x,y,z = map(int,input().split())
width = y + z
print(x // width)
# Judge status: Wrong Answer
N = int(input())
List=list(map(int,input().split()))

cnt4 = 0
for i in range(N):
  a = List[i]
  if a%4 == 0:
    cnt4 += 1

cnt2 = 0
for i in range(N):
  a = List[i]
  if a%2 == 0:
    cnt2 += 1
cnt2 = cnt2 - cnt4

if N - cnt4*3 - cnt2//2 > 0:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: -int(x), input().split()))

heapq.heapify(A)

for _ in range(M):
    p = -heapq.heappop(A)
    tmp = p // 2
    heapq.heappush(A, -tmp)

print(-sum(A))
# Judge status: Wrong Answer
s = input()
a = 0
b = 0
for i in s:
  if int(s) == 0:
    a += 1
  else:
    b += 1
print(min(a,b))
# Judge status: Wrong Answer
N = int(input())

def SumDigits(num):
    sum = 0
    while True:
        sum += num % 10
        num //= 10
        if num == 0:
            break
    return sum

infinity = float('inf')
min = infinity

for x in range(1, -(-N//2)):
    if SumDigits(x) + SumDigits(N - x) < min:
        min = SumDigits(x) + SumDigits(N - x)
print(min)
# Judge status: Accepted
N = int(input())
L = [0]*N
for X in range(1,101):
    for Y in range(1,101):
        for Z in range(1,101):
            Num = X*X+Y*Y+Z*Z+X*Y+X*Z+Y*Z
            if Num>N: break
            else: L[Num-1] += 1
print('\n'.join(str(X) for X in L))
# Judge status: Accepted
n,m=map(int,input().split())
ll,rr=0,n
for i in range(m):
    l,r=map(int,input().split())
    ll=max(l,ll)
    rr=min(r,rr)
print(max(rr-ll+1,0))
# Judge status: Wrong Answer
K = int(input())

v = 0
for i in range(1, K):
    v = (v * 10 + 7) % K
    if v == 0:
        print(i)
        exit(0)
print(-1)
# Judge status: Wrong Answer
from itertools import product
n = int(input())

ans = n-1
for a in range(1, int(n**0.5)):
    if n%a==0:
        b = n//a
        ans = min(ans, b+a-2)
print(ans)
# Judge status: Accepted
n = int(input())
a = list (map (int, input().strip().split()))
x = 0
for i in range(n):
    x^=a[i]
for i in range(n):
    print(a[i]^x,end=" ")
# Judge status: Accepted
import math
def ip():return int(input())
def inp():return map(int,input().split())
def linp():return list(map(int,input().split()))

n,l=inp()
ans=l*n+(1+n)*n//2-n
if l>=0:k=1+l-1
elif l<-(n-1):
    k=l+n-1
else:k=0
print(ans-k)
# Judge status: Accepted
n, k = map(int, input().split())
mod = 10**9+7
ans = 0
for i in range(k, n+1):
  ans += ((i*(2*n-i+1))//2 - (i*(i-1))//2 + 1) % mod
ans += 1
print(ans % mod)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

num2 = 0
num4 = 0
for i in range(N):
  if a[i] % 4 == 0:
    num4 += 1
  elif a[i] % 2 == 0:
    num2 += 1

if num4 >= N // 2 or num4*2 + num2 >= N:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n,a,b = [int(i) for i in input().split()]
k = n // (a + b)
q = n % (a + b)
if n > (a + b):
    print(a * k + q)
else:
    print(min(n,a))
# Judge status: Wrong Answer
N = int(input())
c = input()
a = c[0:len(c)//2]
if ("W" not in c) or ("R" not in c):
  print(0)
  exit()

print(c.count("R")-a.count("R"))
# Judge status: Wrong Answer
n=int(input())
s=input().strip()
R=s.count('R')
t=0
for i in range(R):
    if s[i]=='W':
        t=t+1
u=R-(n-R-t)
f=max(t,u)
if R==0 or R==n:
    f=0
print(f)
# Judge status: Accepted
N = int(input())

ans = {}
for _ in range(N):
    a = input()
    if a in ans:
        del ans[a]
    else:
        ans[a] = 1

print(len(ans))
# Judge status: Accepted
x=int(input())
if x<600:
    a=8
elif x<800:
    a=7
elif x<1000:
    a=6
elif x<1200:
    a=5
elif x<1400:
    a=4
elif x<1600:
    a=3
elif x<1800:
    a=2
else:
    a=1
print(a)
# Judge status: Wrong Answer
s = input()
if "N" in s:
  if "S" not in s :
    print("No")
    exit()
if "E" in s:
  if "W" not in s:
    print("No")
    exit()
print("Yes")