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

dp = [0] * N
dp[1] = abs(H[1] - H[0])

for i in range(2, N):
	dp[i] = min(dp[i - 1] + abs(H[i] - H[i - 1]), dp[i - 2] + abs(H[i] - H[i - 2]))
print(dp[-1])
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())
print(max([a*c,b*c,a*d,c*d]));
# Judge status: Accepted
l=list(map(int,input().split()))
print('Yes' if l[0]+l[1]>=l[2] else 'No')
# Judge status: Accepted
from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
l = list(map(int, input().split()))

key = lcm_list(l)
ans = 0

for i in l:
  ans += key // i
print(ans % (10** 9 + 7))
# Judge status: Accepted
# -*- coding:utf-8 -*-
N = int(input())
d = list(map(int,input().split()))

half = N//2
d.sort()

print(d[half] - d[half-1] )
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(str(i))%2 == 1:
        ans += 1
print(ans)
# Judge status: Wrong Answer
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M): 
    b.append(b[i] + B[i])
print(a)
print(b)
ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
# Judge status: Wrong Answer
S = input()
if(S == "Sunny"):
    print("Cloudy")
elif(S == "Cloudy"):
    print("Rainy")
else:
    print("Suuny")
# Judge status: Accepted
n,k=map(int,input().split())
x=list(map(int,input().split()))

mt=5*10**8

for i in range(n-k+1):
  mt=min(mt,2*abs(x[i])+abs(x[i+k-1]),abs(x[i])+2*abs(x[i+k-1]))

if x[0]>0:mt=min(mt,x[k-1])
elif x[-1]<0:mt=min(mt,abs(x[-1-k+1]))
print(mt)
# Judge status: Wrong Answer
N, Y = map(int, input().split())
for x in range(N+1):
  for y in range(N-x):
    if x*10000+y*5000+(N-x-y)*1000 == Y:
      print(x,y,N-x-y)
      exit(0)
print(-1,-1,-1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
step = [0] * N
for i, a in enumerate(A[1:], 1):
    step[i] = max(0, A[i - 1] + step[i - 1] - a)
print(sum(step))
# Judge status: Accepted
import math
print(math.ceil((int(input())/2)))
# Judge status: Accepted
a,b,c=map(int,input().split())
if a%2==0 or b%2==0 or c%2==0:
    print(0)
else:
    if a==1 or b==1 or c==1:
        print(a*b*c)
    else:
        l=[a*b,b*c,c*a]
        print(min(l))
# Judge status: Accepted
N = int(input())

sum = 0
for i in range(N-1):
    sum += int((N-1)/(i+1))
print(sum)
# Judge status: Accepted
n=int(input())
cnt=0
ans="No"
for i in range(n):
  d,k=map(int,input().split())
  if d==k:
    cnt+=1
  else:
    cnt=0
  if cnt==3:
    ans="Yes"
    break
print(ans)
# Judge status: Accepted
n = int(input())
num = 0
count = 0
a_list = []

for i in range(n):
    a = int(input())
    a -= 1
    a_list.append(a)

OK = False

for i in range(n):
    num = a_list[num]
    count += 1
    if num == 1:
        OK = True
        break
if OK:    
    print(count)
else:
    print(-1)
# Judge status: Wrong Answer
import sys
import itertools

print(set(itertools.islice(sys.stdin.buffer, 1, None)))
# Judge status: Accepted
A,B,K = map(int,input().split())

for i in range(A,min(A+K,B+1)):
    print(i)
    
for i in range(max(A+K,B-K+1),B+1):
    print(i)
# Judge status: Wrong Answer
a,b,c=map(int, input().split())
if a%2 and b%2 and c%2:
    print(0)
else:
    print(min(a*b,b*c,c*a))
# Judge status: Wrong Answer
N,M,X = map(int, input().split())

def python_list_add(in1, in2):
    return [a + b for a, b in zip(in1, in2)]

A = []
for i in range(N):
	A.append(list(map(int, input().split())))

m = 1e9
for i in range(2 ** N):
	bag = []
	total = [0] * M
	for j in range(N):
		if((i >> j) & 1):
			bag.append(A[j][0])
			total = python_list_add(total, A[j])
	if(all(elem >= X for elem in total[1:])):
		m = min(total[0],m)
if m == 1e9:
	m = -1
print(m)
# Judge status: Accepted
N=int(input())

li=[input() for i in range(N)]

temp=li[0][-1]
for j in range(N-1):
    if temp==li[j+1][0]:
        temp=li[j+1][-1]
    else:
        print("No")
        exit()
li.sort()

for k in range(N-1):
    if li[k]==li[k+1]:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
N = int(input())
ans = 0
for i in range(1, N+1):
    j = N // i
    ans += i * j * (j+1) / 2

print(ans)
# Judge status: Accepted
h, n = list(map(int, input().split()))
a = list(map(int, input().split()))
if h > sum(a):
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
k=input()

list_a=k.split()

n=list_a[0]

int(n)

m=list_a[1]

int(m)

t=input()

list_b=t.split()

h=len(list_b)

int(h)

list_s=[int(s) for s in list_b]

if m==h and sum(list_s) <= n:
  print(n-sum(list_s))
elif m==h and sum(list_s) > n:
  print("-1")
# Judge status: Accepted
X = int(input())

running = True
for a in range(-1000, 1001):
    if not running:
        break
    for b in range(-1000, 1001):
        if a**5 - b**5 == X:
            print(a, b)
            running = False
            break
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

# D - Derangement
def swap(index, swap_with_right):
  global p

  if swap_with_right:
    l = index
    r = index + 1
  else:
    l = index - 1
    r = index

  pl = p[l]
  pr = p[r]
  p[l] = pr
  p[r] = pl


N = int(input())
p = list(map(int, input().split()))

p.insert(0, 0)
ans = 0

if p[1] == 1:
  swap(1, True)
  ans += 1

for i in range(2, N):
  if i == p[i]:
    if p[i-1] == i:
      swap(i, True)

    ans += 1

print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
H = list(map(int, input().split()))
H = [H[0]] * K + H

# dp[i] := 足場iに来るのにかかる最小のコスト
INF = 10**18
dp = [INF] * (K + N)
dp[0] = 0
for i in range(K, N + K):
    h = H[i]
    # TLEするので内包表記にする
    costs = [x + abs(y - h) for x, y in zip(dp[i - K:i], H[i - K:i])]
    dp[i] = min(costs)
ans = dp[-1]
print(ans)
# Judge status: Accepted
n = int(input())
t = sorted(list(map(int, input().split())))
print(t[n//2] - t[n//2 - 1])
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()

H = ini()


def solve(h):
    if h == 1:
        return 1
    return 1 + 2 * solve(h >> 1)


print(solve(H))
# Judge status: Wrong Answer
x = int(input())

ans = 0

def prime(x):
    y = x//2+1
    cnt = 0
    for i in range(2,y+1):
        if x%i==0:
            cnt += 1
            
    if cnt == 0:
        return x
    else:
        return 0
        
while ans == 0:
    ans = prime(x)
    x += 1
    
print(ans)
# Judge status: Accepted
N = int(input())
arr = list(map(int, input().split()))
cnt = {}
sum_num = 0
for idx in arr:
    if idx in cnt:
        cnt[idx] += 1
    else:
        cnt[idx] = 1

for i in cnt.values():
    sum_num += i * (i - 1) // 2

for idx in arr:
    c = cnt[idx]
    ans = sum_num - c * (c - 1) // 2
    ans = ans + (c - 1) * (c - 2) // 2
    print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a2 = [i - a[i] for i in range(n)]
a3 = [a[i] + i for i in range(n)]
b2 = {}
for i in a2:
    b2.setdefault(i, 0)
    b2[i] += 1
b3 = {}
for i in a3:
    b3.setdefault(i, 0)
    b3[i] += 1
ans = 0
for i, j in b2.items():
    b3.setdefault(i, 0)
    ans += j * b3[i]
print(ans)
# Judge status: Accepted
a = input()
k, s = a.split(' ')
K = int(k)
S = int(s)
ans = 0
for x in range(K + 1):
    for y in range(K + 1):
        z = S - x - y
        if (z >= 0) and (z <= K):
            ans += 1

print(ans)
# Judge status: Accepted
H1,M1,H2,M2,K = list(map(int,input().split()))

min1 = H1*60 + M1
min2 = H2*60 + M2
min = min2 - min1


if min > 0:
  print(min-K)
else:
  print(0)
# Judge status: Wrong Answer
import math

r = int(input())

a = (math.pi * (r)**2)
ans = a / math.pi

print(int(ans))
# Judge status: Accepted
x,y = map(int, input().split())
print(x+y//2)
# Judge status: Accepted
def main():
    N, A, B = map(int, input().split())
    if N == 1 and A != B:
        print(0)
        return
    if A > B:
        print(0)
        return
    min_sum = A * (N - 1) + B
    max_sum = A + (N - 1) * B
    ans = max_sum - min_sum + 1
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
count=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[i]<l[j]+l[k] and l[i]!=l[j]!=l[k]:
        count+=1
print(count)
# Judge status: Accepted
n,m = map(int,input().split())
h = list(map(int,input().split()))
ans = [1]*n
for i in range(m):
    a,b = map(int,input().split())
    if h[a-1]>h[b-1]:
        ans[b-1] = 0
    elif h[b-1]>h[a-1]:
        ans[a-1] = 0
    else:
        #print("a")
        ans[a-1] = 0
        ans[b-1] = 0
print(ans.count(1))
# Judge status: Accepted
S=input()

if(S=="ABC"):
    print("ARC")
else:
    print("ABC")
# Judge status: Accepted
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
print('YES' if abs(a - b) <= (v - w) * t else 'NO')
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
x=float(a/d)
y=float(c/b)
 
if x>=y:
  print("yes")
elif 0<x-y<1:
  print("yes")
else:
  print("no")
# Judge status: Accepted
import collections
cc = collections.Counter()
for _ in range(int(raw_input())):
	v = int(raw_input())
	cc[v] += 1
	if cc[v] == 2:
		cc[v] = 0
s = 0
for k in cc:
	if cc[k] == 1:
		s +=1
print s
# Judge status: Wrong Answer
import sys; readline = sys.stdin.readline
from collections import deque

k, x = map(int, readline().split())

if k * 500 >= x:
    print('yes')
else:
    print('no')
# Judge status: Accepted
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = min(a) + min(b)

for i in range(M):
    x, y, c = map(int, input().split())
    ans = min(ans, a[x-1] + b[y-1] - c)
print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())

print(int((a + b) // 2+1))
# Judge status: Wrong Answer
n = int(input())

s = ''
while(n != 0):
    s = str(n % 2)+s
    n = -(n//2)
    print(s)
# Judge status: Accepted
#077_A
C1=input()
C2=input()
print('YES' if all([C1[i]==C2[2-i] for i in range(3)]) else 'NO')
# Judge status: Wrong Answer
n = int(input())
list = []
for i in range(n):
  x, l = input().split()
  list.append((int(x), int(l)))

new = sorted(list)
i = 0
d = 0
while i < n-1:
  if new[i][0] + new[i][1] > new[i+1][0] - new[i+1][1]:
    if i + 2 > n-1:
      d = d + 1
    else:
      if new[i][0] + new[i][1] > new[i+2][0] - new[i+2][1]:
        d = d +1
      else:
        new[i+1] = new[i]
        d = d + 1
    i = i + 1
  else:
    i = i + 1  

print(n - d)
# Judge status: Accepted
n, a, b = map(int, input().split())
if n == 1:
	if a != b:
		print (0)
	else:
		print (1)
else:
	print (max((n-2)*(b-a)+1,0))
# Judge status: Wrong Answer
n,m=map(int,input().split())
r=[0]*n
w=[1]*n
r[0]=1
w[0]=0
for i in range(m):
    x,y=map(int,input().split())
    x-=1
    y-=1
    if w[x]==0:
        r[x]=0
        r[y]=1
    elif r[x]:
        w[x]-=1
        r[y]=1
    else:
      w[x]-=1
      w[y]+=1
print(sum(r))
# Judge status: Accepted
a,b,t = map(int,input().split())
c = ((t+0.5)//a) * b 
print(int(c))
# Judge status: Wrong Answer
s = input()
s_cnt, t_cnt = 0, 0
n = len(s)
for i in range(n):
    if s[i] == "S":
        for j in range(i, n):
            if s[j] == "T":
                t_cnt += 1
        
        break

for i in range(n - 1, -1, -1):
    if s[i] == "T":
        for j in range(i, -1, -1):
            if s[j] == "S":
                s_cnt += 1
        break
print(n - min(t_cnt, s_cnt) * 2)
# Judge status: Accepted
judge=0
N,M = map(int,input().split())
import fractions
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
for j in a:
    if (ans//j)%2==0:
        judge=1
        sss=0
        break
if judge==0 and M-ans//2 <0:
    sss=0
elif judge==0 and M-ans//2 >=0:
    sss=((M-ans//2)//ans)+1
print(sss)
# Judge status: Wrong Answer
import math

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

a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())
m = max(a)
b.sort()

ans = 0
for i in range(n):
    if m <= b[i]:
        h -= b[i]
        ans += 1
        if h < 0 :
            print(ans)
            exit()

ans += math.ceil(h / m)
print(ans)
# Judge status: Wrong Answer
N,K=map(int,input().split())
A=list(map(int,input().split()))
m=1
L=[1]
for i in range(N+2):
  m=A[m-1]
  if m not in L:
    L.append(m)
  else:
    L.append(m)
    break
c=L.index(m)
le=len(L)
#le-cでループ　c,le,2*le-c....
rupe=le-c-1
a=K%rupe
if a<c:
  a+=rupe
print(L[a])
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ruiseki = [0]*(N+1)
total = 0
now = 10**20
sa = 0
now_2 = 0
for i in range(N):
  total += A[i]
  ruiseki[i+1] = total
for i in range(1,len(ruiseki)-1):
  snuke = ruiseki[i]-ruiseki[0]
  arai = ruiseki[N]-ruiseki[i]
  now_2 = abs(snuke-arai)
  now = min(now,now_2)
print(now)
# Judge status: Wrong Answer
from collections import Counter

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

AC = list(Counter(A).items())
AC.sort()
MOD = 998244353
ans = 1
last = 1
for k, v in AC:
  if k == 0:
    continue
  ans = ans*pow(last, v, MOD)%MOD
  last = v
print(ans)
# Judge status: Accepted
N,X,Y=map(int,input().split())
l=[0]*~-N
for i in range(1,N):
    for j in range(i):
        l[min(abs(i-j-1),abs(X-j-1)+abs(Y-i-1))]+=1
print(*l,sep="\n")
# Judge status: Accepted
x = input()
y = int(x)
if y < 100:
    print(0)
else:
    ans = 0
    i = int(x[:len(x)-2])
    if 100*i <= y and y <= 105*i:
        ans = 1
    print(ans)
# Judge status: Accepted
s = input()
print(s.rfind('Z') - s.find('A') + 1)
# Judge status: Accepted
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-1]-a[i]
        a[i] = a[i-1]

print(ans)
# Judge status: Accepted
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=INT()
    b=INT()
    c=INT()
    d=INT()
    e=INT()
    f=INT()
    if e-a<=f:
        print('Yay!')
    else:
        print(':(')
if __name__ == '__main__':
    do()
# Judge status: Accepted
n,k = map(int,input().split())
li = list(map(int,input().split()))
mux = 0
s = 0

def div(n):
    return (n + 1)/2

for i in range(k):
    s += div(li[i])
mux = s 	

for i in range(k,len(li)):
    s -= div(li[i-k])
    s += div(li[i])
    if s > mux:
        mux = s
print(mux)
# Judge status: Wrong Answer
n = int(input())
ns = list(map(int, input().split()))
li = 1
ans = 0
max_leafs = [1]
for i in ns:
    li = (li - i) * 2
    max_leafs.append(li)
max_leafs.pop()
points = ns.pop()
ans += points
for i in range(len(ns)-1, -1, -1):
    a = ns[i]
    points = min(points + a, max_leafs[i])
    ans += points
if max_leafs[-1] <= 0:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
a, b, c, d = input()

if (a == b and c == d) or (a == c and b == d) or (a == d and b == c):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
l=list(map(str,input().split()))
c=list("".join(l))
w=c.count('W')
cc=c[-w:]
r=cc.count('R')
print(r)
# Judge status: Accepted
x=int(input())
for i in range(1,10):
    if(x%i==0 and x/i<10):
        print("Yes")
        exit()
print("No")
# Judge status: Wrong Answer
ST = input().split()
s = ""
s += ST[0]
s += ST[1]
print(s)
# Judge status: Accepted
p,q,r = map(int, input().split())
x = max(p, max(q,r))
print(p+q+r-x)
# Judge status: Accepted
def main():
    n, a, b = map(int, input().split())
    quo = n // (a+b)
    rem = n % (a+b)
    ans = quo * a
    if a >= rem:
        ans += rem
    else:
        ans += a
    print(ans)
    
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

#累積和
for _ in range(K):
    B = [0]*N
    for i in range(N):
        l = max(0,i-A[i])
        r = min(N-1, i+A[i])
        B[l] += 1
        if r+1 < N: B[r+1] -= 1
    for i in range(1,N):
        B[i] += B[i-1]
    if min(B) == N: break
    B, A = A, B

print(*A)
# Judge status: Accepted
def resolve():
    N = int(input())
    A_list = list(map(int, input().split()))
    B_list = list(map(int, input().split()))
    C_list = list(map(int, input().split()))

    point = 0

    i_minus = None

    for i in A_list:
        point += B_list[i-1]
        if i_minus is not None:
            if (i - i_minus) == 1:
                point += C_list[i_minus-1]
        i_minus = i

    print(point)

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
def solve():
    S = input()
    ans = ['x' for _ in range(len(S))]
    print(''.join(ans))


if __name__ == '__main__':
    solve()
# Judge status: Accepted
n, m = map(int, input().split())
li = [list(map(int, input().split())) for _ in range(m)]

ball_cnt = [1] * 10**6
check = [0] * 10**6

check[1] += 1

for i in range(m):
    x = li[i][0]
    y = li[i][1]
    
    if check[x] == 1:
        check[y] = 1
    
    ball_cnt[x] -= 1
    ball_cnt[y] += 1
    
    if ball_cnt[x] == 0:
        check[x] = 0
        
print(sum(check))
# Judge status: Wrong Answer
S=input()
if int(S[5]+S[6])>5:
  print('TBD')
else:
  print('Heisei')
# Judge status: Accepted
A, B = list(map(int, input().split()))
if A > B:
  n = A
else:
  n = B
q = list(range(1, n+1))
divisor = []
for i in q:
  if A % i == 0 and B % i == 0:
    divisor.append(i)
gcd = max(divisor)
lcm = int(A * B / gcd)
print(lcm)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
ans = 'No'
 
for i in range(1,b+1):
  if (a*i)%b == c:
    ans = 'Yes'
    break
    
print(ans)
# Judge status: Accepted
N,A,B=map(int,input().split())
Z=0
for i in range(1,N+1):
  X=0
  Y=i
  for j in range(5):
    X+=Y%10
    Y//=10
  if A<=X and X<=B:
    Z+=i
print(Z)
# Judge status: Accepted
# C - Alchemist
# https://atcoder.jp/contests/abc138/tasks/abc138_c

# 書く材料の組み合わせを作成して、一番価値の大きい商品を作り出せばよい。
n = int(input())
v = sorted(list(map(int,input().split())))

tmp = 0

for i in range(n):
    if i == 0:
        tmp = v[i]
    else:
        tmp = (tmp + v[i])/2

print(tmp)
# Judge status: Accepted
n,m=map(int,input().split())
l1=[]
ln=[]

for i in range(m):
    ai,bi=map(int,input().split())
    if ai==1:
        l1.append(bi)
    if bi==n:
        ln.append(ai)
    

if len(set(l1) & set(ln))==0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
# Judge status: Wrong Answer
s=input()
res="AC"
if s[0]!="A":res="WA"
elif s[2:-2].count("C")!=1:res="WA"
else:
    li=list(s)
    li.remove("A")
    li.remove("C")
    for i in li:
        if i!=i.lower():
            res="WA"
print(res)
# Judge status: Accepted
from itertools import permutations

N = int(input())
p = tuple(map(int, input().split(' ')))
q = tuple(map(int, input().split(' ')))

pi = None
qi = None
for index, numbers in enumerate(permutations(range(1, N + 1))):
    if numbers == p:
        pi = index
        if qi is not None:
            break
    if numbers == q:
        qi = index
        if pi is not None:
            break

print(abs(pi - qi))
# Judge status: Accepted


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

def main():
    mod=10**9+7
    s=input()
    print(s[:3])

main()
# Judge status: Accepted
from _collections import deque
n,m=map(int,input().split())
edg=[[] for i in range(n+1)]
for i in range(m):
    a,b=map(int,input().split())
    edg[a].append(b)
    edg[b].append(a)
dep=[-1]*(n+1)
dep[1]=0
data=deque([1])
while len(data)>0:
    p=data.popleft()
    for i in edg[p]:
        if dep[i]==-1:
            dep[i]=dep[p]+1
            data.append(i)
print("POSSIBLE" if dep[n]==2 else "IMPOSSIBLE")
# Judge status: Accepted
S=str(input())
S=list(S)
a=abs(int(S[0]+S[1]+S[2])-753)
for i in range(len(S)-2):
    t=int(S[i]+S[i+1]+S[i+2])
    a=min(a,abs(t-753))
print(a)
# Judge status: Accepted
S=input()
T=input()
count=0
ans1=len(S)+1
ans=0
for i in range(len(S)-len(T)+1):
    count=count+i
    for j in range(len(T)):
        if S[count]!=T[j]:
            ans+=1
        count+=1
    if ans<ans1:
        ans1=ans
    ans=0
    count=0
print(ans1)
# Judge status: Wrong Answer
month, day = map(int, input().split())

ans = day if month > day else month

if ans >= 12:
  print("12")
else:
  print(ans)
# Judge status: Accepted
from collections import Counter

n = int(input())
*arr, = map(int, input().split())


cnt = Counter(arr)

ans = 0

total = 0

for k, v in cnt.items():
    if v > 1:
        total += v * (v - 1) // 2


for v in arr:
    print(total - cnt.get(v, 1) + 1)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    cnt=0
    for i in range(len(s)//2):
        if s[i]!=s[-1-i]:
            cnt+=1
    print(cnt)
resolve
# Judge status: Wrong Answer
X,A,B = list(map(int,input().split()))

if A-B > 0:
  print('delicious')
else:
  if abs(A-B) < X:
    print('safe')
  else:
    print('dangerous')
# Judge status: Wrong Answer
A,B = map(int,input().split())

print((A+B)//2)
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))

roop_num = 1
city = 0
first_city = 0

while True:
    next_city = A[city] - 1
    if next_city == first_city:
        break
    if roop_num == K:
        print(city + 1)
        exit()
    city = next_city
    roop_num += 1

rem_num = K % roop_num
city = 0
num = 0

while True:
    next_city = A[city] - 1
    if num == rem_num:
        print(city + 1)
        exit()
    city = next_city
    num += 1
# Judge status: Wrong Answer
# 等差数列の和　Sn=n(a+1)/2

N = int(input())
# 定義
# 1 <= N <= 100

total = N * ( N + 1)/ 2

print(total)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

res = 0
for i in range(N):
  if A[i] < B[i]:
    res += min(A[i+1]+A[i],B[i])
    A[i+1] = max(A[i+1]+A[i]-B[i],0)
  else:
    res += B[i]
    
print(res)
# Judge status: Accepted
from collections import defaultdict
d = int(input())
c = list(map(int,input().split()))
s = []
for i in range(d):
    s.append(list(map(int,input().split())))
dic = defaultdict(int)
for i in range(1,d+1):
    maxscore = 0
    maxcontest = -1
    for k in range(26):
        score = 0
        score += s[i-1][k-1]
        score += c[k]*(i-dic[k])
        if score > maxscore:
            maxscore = score
            maxcontest = k
    print(maxcontest+1)
    dic[maxcontest] = i
# Judge status: Wrong Answer
a = list(input())
count = 0
for i in range(0, len(a)):
    if a[i] == a[i - 1]:
        count += 1

if count > 0:
    print("no")
elif count == 0:
    print("yes")
# Judge status: Accepted
N = int(input())
S = input()

stk = []
for s in S:
    if len(stk) == 0 or stk[-1] == ')' or s == '(':
        stk.append(s)
    else:
        stk.pop()

print('(' * stk.count(')') + S + ')' * stk.count('('))
# Judge status: Wrong Answer
grid = []
for i in range(3):
    grid.append(list(map(int, input().split())))
flag = True
for i in range(1, 3):
    if grid[i][0] - grid[0][0] == grid[i][1] - grid[0][1] == grid[i][2] - grid[0][2]:
        continue
    else:
        flag = False
        print('No')
if flag:
    print('Yes')
# Judge status: Accepted
S = {alpha:list(input()) for alpha in 'abc'}

s = 'a'

while S[s]:
    s = S[s].pop(0)
print(s.upper())
# Judge status: Accepted
n = int(input())
i = 2
ans = 0
while True:
  if i * i > n:
    break
  if n % i == 0:
    cnt = 0
    while n % i == 0:
      n /= i
      cnt += 1
    k = 1
    while cnt >= k:
      cnt -= k
      k += 1
    ans += k - 1
  i += 1
if n > 1:
  ans += 1
print(ans)
# Judge status: Accepted
N = input()
if "7" in N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse=True)

if a[m-1] * 4 * m >= sum(a):
    print('Yes')
else:
    print('No')