peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N,K = map(int, input().split())
A = [int(a) for a in input().split()]

def f(X):
    cnt = 0
    for a in A:
        cnt += int(a/X)
    return max(1, cnt)

l = 1
r = max(A)
while r-l > 0.1:
    m = (r+l)/2
    if f(m) <= K:
        r = m
    else:
        l = m

if K == 0:
    print(max(A))
elif f(r) >= K and int(r) < r:
    print(int(r)+1)
elif int(l) < l:
    print(int(l)+1)
else:
    print(int(l))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
a,b=map(int,input().split())
print("Odd" if a*b%2==0 else "Even")
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
if K<=N:
    next_city=0
    for i in range(K):
        next_city=A[next_city]-1
else:
    next_city=0
    visited=[-1]*N
    visited[0]=0
    for num in range(1,N):
        next_city=A[next_city]-1
        if visited[next_city]!=-1:
            break
        visited[next_city]=num
    K=(K-num)%(num-visited[next_city])
    for i in range(K):
        next_city=A[next_city]-1
print(next_city+1)
# Judge status: Wrong Answer
A,B=input().split()
A=int(A)
B=int(B)
if A==B:
  print("Draw")
if A>B:
  print("Alice")
  if B==1:
    print("Bob")
if B>A:
  print("Bob")
  if A==1:
    print("Alice")
# Judge status: Wrong Answer
sl = list(input())

x, y = 0, 0

for s in sl:
    if s == 'N' or 'S':
        y += 1
    else:
        x += 1

if x%2 == 0 and y%2 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
k=int(input())
s=input()
n=len(s)
if k>n:
  print(s[:k+1]+"...")
else:
  print(s)
# Judge status: Wrong Answer
n=int(input())
ls=[0]*n
x=1
y=1
z=1
p=6
m=int(n**0.5)
for x in range(1,m+3):
  for y in range(1,x+1):
    for z in range(1,y+1):
      k=6
      if x==y:
        k=3
        if x==z:
          k=1
      j=x*x+y*y+z*z+x*y+y*z+x*z
      if j<=n:
        ls[j-1]+=k
      else:
        break
for i in ls:
  print(i)
# Judge status: Wrong Answer
n=int(input())
a=[]
while n:
    a+=n%26,
    n//=26
a=a[::-1]
for i in range(len(a)-1,0,-1):
    if not a[i]:
        a[i]=26
        a[i-1]-=1
i=0
while not a[i]:i+=1
print(''.join(chr(c+96)for c in a[i:]))
# Judge status: Accepted
s=input()
print(s+'es' if s[-1]=='s' else s+'s')
# Judge status: Wrong Answer
# input
H, N = map(int, input().split())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

# process
max_a = max(A)
dp = [10**9]*(H+max_a)
dp[0] = 0

for i in range(len(dp)):
    if dp[i] == 10**4:
        continue
    for j in range(N):
        idx = i+A[j]
        if idx < len(dp) and dp[i]+B[j] < dp[idx]:
            dp[i+A[j]] = dp[i]+B[j]

print(dp)

# output
print(min(dp[H:]))
# Judge status: Wrong Answer
time = list(map(int, input().split()))
h1,m1 = time[0],time[1]
h2,m2 = time[2],time[3]
k = time[4]
ans = 0
full = (h2*60+m2) - (h1*60+m1)
while full - k > 0:
    full-=k
    ans+=k
print(ans)
# Judge status: Accepted
s = int(input())

v = 10 ** 9

x = (v - s%v) % v
y = (s + x) // v  
 
print(0, 0, 10 ** 9, 1, x, y)
# Judge status: Wrong Answer
a,b= map(int,input().split())
if (b+a)%2==0:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")
# Judge status: Accepted
N=int(input())
p=[]
r=0

if N%2==0:
  c=0
  while N%2==0:
    N=N//2
    c+=1
  p.append(c)
for i in range(3,int(N**0.5)+1,2):
  if N%i==0:
    c=0
    while N%i==0:
      N=N//i
      c+=1
    p.append(c)
if N!=1:
  p.append(1)
  
while p:
  r+=int(((8*p.pop()+1)**0.5-1)/2)
  
print(r)
# Judge status: Accepted
import math
h, n = map(int, input().split())
a = list(map(int, input().split()))

if sum(a) >= h:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
  N = int(input())
  A = int(input())

  if N % 500 <= A:
    print("Yes")
  else:
    print("No")

  
if __name__ == "__main__":
  main()
# Judge status: Accepted
from collections import Counter
n=int(input())
num=list(map(int,input().split()))

dic=Counter(num)
ans=0
for k,v in dic.items():
  if k<v:
    ans+=v-k
  elif v<k:
    ans+=v
print(ans)
# Judge status: Accepted
def solve():
    d,n = map(int,input().split())
    if n!=100:
        print(n*(100**d))
    else:
        print(101*(100**d))
if __name__=='__main__':
    solve()
# Judge status: Accepted
from functools import reduce
MOD = 10**9 + 7


def cmb(N, A):
    num = reduce(lambda x, y: x * y % MOD, range(N, N - A, -1))
    den = reduce(lambda x, y: x * y % MOD, range(1, A + 1))
    return num * pow(den, MOD - 2, MOD) % MOD


n, a, b = map(int, input().split())
a %= MOD
b %= MOD


print((pow(2, n, MOD) - 1 - cmb(n, a) - cmb(n, b)) % MOD)
# Judge status: Accepted
D, N = map(int, input().split())
ans = 0
df = 0

if D == 0:
    df = 1
elif D == 1:
    df = 100**1
else:
    df = 100**2

if N < 100:
    ans = df * N
else:
    ans = df * (N+1)

print(ans)
# Judge status: Accepted
n = int(input())
s = input()
for i in range(n):
  if s[:i] == s[i:]:
    print('Yes')
    exit()
print('No')
# Judge status: Wrong Answer
import sys
from math import sqrt, floor
from bisect import bisect_right as bi_r

n, m = map(int, sys.stdin.readline().split())

def factorize(n):
    res = [1]
    for i in range(2, floor(sqrt(n)) + 1):
        if not n % i:
            res.append(i)
    if n >= 2:
        res.append(n)
    return res

def main():
    res = factorize(m)
    ans = res[bi_r(res, m / n) - 1]
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)
# Judge status: Accepted
N = input()
ARU = False
for i in range(len(N)):
    if N[i] == "9":
        ARU= True
if ARU:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
(n,), *d = [[*map(int, o.split())] for o in open(0)]
M = [[x - y for x, y in d], [x + y for x, y in d]]
print(max(max(M[d]) - min(M[d]) for d in [0, 1]))
# Judge status: Wrong Answer
import collections

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

ctr_A = collections.Counter(A).most_common()
less_A = collections.Counter(A)

total = 0

for i in range(len(ctr_A)):
    n = ctr_A[i][1]
    total += n * (n - 1) // 2

for i in range(N):
    summ = total
    num = A[i]
    n = less_A[num]

    if (n <= 2):
        summ -= 1
    else:
        new = (n - 1) * (n - 2) // 2
        old = n * (n - 1) // 2
        summ += new - old
    
    ans = max(0, summ)

    print(ans)
# Judge status: Wrong Answer
n=int(input())
c=list(str(input()))

count=0
w_count=0
r_count=0
w_count2=0
r_count2=0
flag=False

for i in range(n//2):
	if c[i]=="W":
		w_count+=1
	else:
		r_count+=1
for i in range(n//2,n):
	if c[i]=="W":
		w_count2+=1
	else:
		r_count2+=1
if r_count2>=w_count:
	print(w_count)
else:
	print(r_count+r_count2)
# Judge status: Wrong Answer
k = int(input())
a, b = [int(i) for i in input().split()]
ans = 'OK' if - a + b >= k else 'NG'
print(ans)
# Judge status: Accepted
from sys import stdin

P,Q,R = map(int,input().split())
print(min(P+Q,Q+R,P+R))
# Judge status: Accepted
n = list(map(int,input().split()))
m=sorted(n)
print(int((m[2]*10+m[1])+m[0]))
# Judge status: Accepted
X, Y, Z = (int(x) for x in input().split())

ans = (X-Z)//(Y+Z)
print(ans)
# Judge status: Accepted
s = input()
if s == 'Sunny':
    print('Cloudy')
if s == 'Cloudy':
    print('Rainy')
if s == 'Rainy':
    print('Sunny')
# Judge status: Accepted
n = int(input())
s = [int(input()) for i in range(n)]
ans=0
m = sum(s)
if m%10==0:
    f = True
    s.sort()
    for si in s:
        if si%10!=0:
            print(m-si)
            f = False
            break
    if f:
        print(0)
else:
    print(m)
# Judge status: Wrong Answer
N=int(input())
S=input()
T=input()
s=[str(c) for c in (S)]
t=[str(c) for c in (T)]
flag=0
score=N
for i in range (N,2*N):
  for j in range(N+N-i):
    flag=0
    if s[i-N+j]!=t[j]:
      flag=1
  if flag==0:
    score=i
    flag=2
  if flag==2:
    break
if flag==1:
  score=2*N
print(score)
# Judge status: Accepted
n, m = map(int, input().split())

mapAC = [False]*(n+1)
countWA = [0]*(n+1)

for i in range(m):
    p, s = input().split()
    p = int(p)
    if s == 'AC':
        mapAC[p] = True
    else:
        countWA[p] += 1*(not mapAC[p])
countWA = map(lambda x, y: x*y, countWA, mapAC)
print(mapAC.count(True), sum(countWA))
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
a_L = list(map(int,input().split()))
q = int(input())

L = dict(Counter(a_L))
all_sum = sum(a_L)

ans_L = []
for i in range(q):
    b,c = map(int,input().split())
    try:
        diff = (c-b) * L[b]
        all_sum = all_sum+diff
        L[c] += L[b]
    except:
        pass
    ans_L.append(all_sum)


for i in ans_L:
    print(i)
# Judge status: Accepted
n,k=map(int,input().split())
pl=list(map(int,input().split()))

cuml=[]
cum=0
for i in range(n):
    cum+=(pl[i]+1)/2
    cuml.append(cum)
mx=0
for i in range(n-(k-1)):
    if i==0:
        mx=max(cuml[i+k-1],mx)
    else:
        mx=max(cuml[i+k-1]-cuml[i-1],mx)
print('{:.9f}'.format(mx))
# 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():
    N, K = map(int, readline().split())
    S = readline().strip()

    ans = 0
    for i in range(N-1):
        if S[i] == S[i+1]:
            ans += 1

    ans += 2 * K
    if ans > N - 1:
        ans = N - 1

    print(ans)
    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n=int(input())
for i in range(n+1):
  if i*i>n:
    print((i-1)*(i-1))
    break
# Judge status: Accepted
N = int(input())

print(len([0 for n in range(1, N + 1) if len(str(n)) % 2 == 1]))
# Judge status: Accepted
from collections import deque
N,M = map(int,input().split())
A = list(map(int,input().split()))
bc = [tuple(map(int,input().split())) for _ in range(M)]
for x in A:
    bc.append((1,x))
bc.sort(key=lambda x:x[1], reverse=True)
A = []
for b,c in bc:
    while len(A) < N and b > 0:
        b -= 1
        A.append(c)
    if len(A) == N:
        break
A.sort(reverse=True)
print(sum(A))
# Judge status: Wrong Answer
s = input().rstrip()
ans = 0
val = 0
for ch in s:
  if ch == "I":
    val += 1
    ans = max(ans, val)
  elif ch == "D":
    val -= 1
print(ans)
# Judge status: Accepted
from itertools import combinations
c = [list(map(int, input().split())) for _ in range(3)]

row = [[0] * 3 for _ in range(2)]

for i in range(2):
    for j in range(3):
        row[i][j] = c[i+1][j] - c[i][j]

ans = "Yes"
for i in row:
    if any(x != y for x, y in combinations(i, 2)):
        ans = "No"

print(ans)
# Judge status: Wrong Answer
n=int(input())
s=input()

l=[]

for a in s:
  moji=ord(a)
  moji+=n
  print(moji)
  if int(moji)>90:
    moji-=26

  l.append(chr(moji))

print(''.join(l))
# Judge status: Accepted
n = int(input())
s = [list(map(int, input().split())) for i in range(n)]
dp = [[0, 0, 0] for _ in range(n)]
dp[0][:] = s[0][:]
for i in range(1, n):
    for j in range(3):  # dasu te
        for k in range(3):  # maeno te
            if j != k:
                try:
                    dp[i][j] = max(dp[i][j], dp[i-1][k] + s[i][j])
                except:
                    pass

print(max(dp[-1][:]))
# Judge status: Accepted
n = int(input())
al = map(lambda x: int(x) - 1, input().split())
a = []
count = 0
for _ in [0] * n:
    a.append(0)
for x in al:
    a[x] += 1
    count += 1
for x in a:
    print(x)
# Judge status: Accepted
N = int(input())
S = input()

from collections import Counter
c = Counter(S)
ans = 1
for v in c.values():
    ans = ans*(v+1)%(10**9+7)
print(ans-1)
# Judge status: Accepted
n,k = map(int,input().split())
tempk = k
ans = 1
while 1:
    if tempk<=n:
        ans+=1
        tempk*=k
        
    else:
        break



print(ans)
# Judge status: Accepted
H,W = map(int,input().split())
if H ==1 or W ==1:
  print(1)
else:
  a = H*W
  if a%2 == 0:
    print(int(a/2))
  else:
    print(int(a/2)+1)
# Judge status: Accepted
n = int(input())

for i in range(1,10):
    if n % i == 0 and n / i <= 9:
        print("Yes")
        quit()

print("No")
# Judge status: Accepted
S = input()
if S[-1] == 's':
    print(S+'es')
    exit()
print(S+'s')
# Judge status: Wrong Answer
import math
N,D = map(int,input().split())
print(math.ceil(D/N/2))
# Judge status: Wrong Answer
a, b, c, k = map(int, input().split())

if k<=a+b: print(a)
else: print(a-(k-a-b))
# Judge status: Accepted
import copy
n = int(input())
lst1 = list(map(int,input().split()))
lst2 = []
c = copy.deepcopy(lst1)

c.sort()

Kth = c[n//2] #上の方

med_low = Kth
med_high = c[n//2-1]

for i in range(n):
    if lst1[i] < Kth:
        print(med_low)
    else:
        print(med_high)
# Judge status: Accepted
#関数リスト
import sys
input = sys.stdin.readline

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

x,n = MI()
mylist = tuple(MI())

num = 0
while True:
    if not(x - num in mylist):
        print(x- num)
        sys.exit()
    if not(x + num in mylist):
        print(x+ num)
        sys.exit()
    num += 1
# Judge status: Accepted
cases  = [int(i) for i in input().split() if i.isdigit()]
w = input()
print(w[0:cases[1]-1] + w[cases[1]-1].lower() + w[cases[1]:])
# Judge status: Wrong Answer
x = int(input())
ans = [i**5 for i in range(66)]
for i in ans:
    for j in ans:
        if i - j == x:
            print(ans.index(i), ans.index(j))
            exit()
        if i + j == x:
            print(ans.index(i), -ans.index(j))
            exit()
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
cnt = 0
for i in range(N):
    if (cnt!= 0) and (a[i]==a[i-1]+1):
        cnt += c[i-2]

    cnt += b[a[i]-1]

print(cnt)
# Judge status: Accepted
N,K=map(int,input().split())
R,S,P=map(int,input().split())
T=input()

ans=0
chk=[0]*N
for n in range(N):
  c=T[n]
  if n>=K and T[n-K]==c and chk[n-K]==0:
    chk[n]=1 # not used
    continue
  if c=='r':
    ans+=P
  elif c=='s':
    ans+=R
  else:
    ans+=S

print(ans)
# Judge status: Accepted
X,Y,A,B,C=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort()
q.sort()
p.reverse()
q.reverse()
p=p[:X]
q=q[:Y]
 
a=p[:]
a.extend(q)
a.extend(r)
a.sort()
a.reverse()
sum=0
for i in range(X+Y):
  sum+=a[i]
print(sum)
# Judge status: Accepted
n = int(input())
flag = False
for i in range(100):
    for j in range(100):
        price = 4*i + 7*j
        if price==n:
            flag = True
            break
    if flag:
        break
print('Yes' if flag else 'No')
# Judge status: Accepted
a, b = [int(i) for i in input().split()]
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)
# Judge status: Accepted
N = int(input())
S = str(input())

def alpha(a):
    return ord(a)-65

def enum(i):
    return chr(i+65)

list = [enum((alpha(s)+N)%26) for s in list(S)]

print("".join(list))
# Judge status: Accepted
a,b,c = map(int,input().split())

if b//a > c:
    print(c)
else:
    print(b//a)
# Judge status: Accepted
N,M = map(int,input().split())

if M >= 2*N:
    M -= 2*N
    print(N+M//4)
else:
    print(M//2)
# Judge status: Wrong Answer
n = int(input())
from collections import defaultdict
a = list(map(int,input().split()))
ans = 0
dp = defaultdict(int)
for e,i in enumerate(a):
    dp[i+e]+=1
    if i - e >= 0 :ans += dp[i-e]
print(ans)
# Judge status: Wrong Answer
import math
n,a,b = map(int, input().split())
S = 2**n-1
S -= (math.factorial(n)/math.factorial(a))/math.factorial(n-a)
S -= (math.factorial(n)/math.factorial(b))/math.factorial(n-a)
# Judge status: Wrong Answer
n,m,k = map(int,input().split())

for i in range(n+1):
    for j in range(m+1):
        a = n*j + m*i - i*j
        if a == k:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
N,M=map(int,input().split())
M//=2
print(min(M,(N+M)//2))
# Judge status: Wrong Answer
N,K = map(int,input().split())
n = N
x = 0
while n > K:
    n = N // K
    x += 1
print(x)
# Judge status: Accepted
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

x = I()
y = x // 100
z = x % 100
if 0 <= z <= 5*y:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
def pural():
	S = input("Enter String: ") 
	if S.endswith('s') :
		output = S + "es"
	else :
		output = S + "s"
	print(output)
# your code goes here
# Judge status: Wrong Answer
n = int(input())
s = input()

tmp = []
ans = ""
for i in s:
    if i == "(":
        tmp.append("(")
    else:
        if len(tmp) == 0:
            ans = "(" + ans + ")"
        else:
            ans += tmp.pop() + ")"
print(ans)
# Judge status: Accepted
s = list(input())
t = list(input())

for i in range(len(s)-len(t), -1, -1):
    flag = True
    for j in range(len(t)):
        if not(s[i+j] == t[j] or s[i+j] == '?'):
            flag = False 
    if flag :
        for j in range(len(t)):
            s[i+j] = t[j]
        for k in range(len(s)):
            if s[k] == '?':
                s[k] = 'a'
        print(''.join(s))
        exit()
print('UNRESTORABLE')
# Judge status: Accepted
a,b,c = map(int, input().split())
k = int(input())

while(a >= b and k >0 ):
    b = b*2
    k -= 1    

c = c*2**(k)
#print(a,b,c)
if (a<b and  b<c):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, M = map(int,input().split())
z = [list(map(int,input().split())) for i in range(M)]
box = [[1,1]]
for i in range(N-1):
  box.append([0,1])
for i in range(M):
  box[z[i][0]-1][1] -= 1
  box[z[i][1]-1][1] += 1
  if (box[z[i][0]-1][0] == 1):
    box[z[i][1]-1][0] = 1
  if (box[z[i][0]-1][1] == 0):
    box[z[i][0]-1][0] = 0
ans = 0
for i in range(N):
  if (box[i][0] != 0):
    ans += 1
print(ans)
# Judge status: Accepted
from collections import Counter

MOD = 998244353
N = int(input())
D = list(map(int, input().split()))

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

C = sorted(Counter(D).most_common(), key=lambda x: x[0])

if C[0][1] > 1:
    print(0)
    exit()

ans = 1
for i in range(1, len(C)):
    if C[i][0] - C[i-1][0] > 1:
        print(0)
        exit()
    ans *= C[i - 1][1] ** C[i][1]

print(ans % MOD)
# Judge status: Accepted
s = input()

for i, x in enumerate(s):
    if x == "A":
        break

for j, x in enumerate(s[::-1]):
    if x == "Z":
        break

print(len(s) - i - j)
# Judge status: Wrong Answer
s,w = map(int, input().split())

if w>=s/2:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
from math import gcd

k = int(input())
ans = 0
for l in range(1,k+1):
  for m in range(1,k+1):
    for n in range(1,k+1):
      ans += gcd(gcd(l,m),n)

print(ans)
# Judge status: Accepted
inp_ls = input().split(" ")
a,b,c,d = [int(e) for e in inp_ls[:4]]

turn = 0
while True:
	if a <= 0:
		print("No")
		break
	if c <= 0:
		print("Yes")
		break
	if turn % 2 == 0:
		c -= b
	else:
		a -= d
	turn += 1
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if (abs(c - a) <= d or (abs(b - a) <= d and abs(c - b) <= d)):
   print('Yes')
else:
   print('No')
# Judge status: Accepted
s = list(input())
k = int(input())
cnt = 0
ans = ''
for i in range(len(s)):
    cnt = (ord('z') - ord(s[i]) + 1) % 26
    if cnt <= k:
        k -= cnt
        s[i] = 'a'
s[-1] = chr((ord(s[-1]) - ord('a') + k) % 26 + ord('a'))
print(*s, sep='')
# Judge status: Accepted
N = int(input())

A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

d = dict(zip(A, B))
ans = d[A[0]]

for i in range(1, N):
    if A[i] - A[i-1] == 1:
        ans += d[A[i]] + C[A[i-1] -1]
    else:
        ans += d[A[i]]

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

print(a+pow(a,2)+pow(a,3))
# Judge status: Wrong Answer
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = [LI() for _ in range(N)]
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans = 0

def gcd(x, y):
  if x < y:
    x, y = y, x
  if y == 0:
    return x
  while y > 0:
    temp = x % y
    x = y
    y = temp
  return x

L = [0]
R = 0

for i in range(N-1):
  L.append(gcd(A[i], L[i]))
for i in range(N):
  temp = gcd(L[N-i-1], R)
  R = gcd(R, A[N-i-1])
  if ans < temp:
    ans = temp
    
print(ans)
# Judge status: Accepted
S=input()
if int(S[5:7])<=4:
    print("Heisei")
else:
    print("TBD")
# Judge status: Wrong Answer
import fractions
mod = 1000000007

def add(a, b):
    return (a + b) % mod

n = int(input())
a = list(map(int,input().split()))
ans = a[0]
ans_ans = 0
for i in range(1, n):
    ans = ans * a[i] // fractions.gcd(ans, a[i])
#for j in range(0, n):
#  b = ans // a[j]
#  ans_ans = add(ans_ans,b)
  
#print(ans_ans)
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())
dx = tx - sx
dy = ty - sy

print('R' * dx + 'U' * dy + 'R' + 'D' * (dy + 1) + 'L' * (dx + 1) + 'U' + 'U' * dy + 'R' * dy + 'U' + 'L' * (dx + 1) + 'D' * (dy + 1) + 'R')
# Judge status: Accepted
l = []
l.append(2)
l.append(1)
def lyuca(n):
  for i in range(n):
    l.append(l[i]+l[i+1])
  return l[n]

print(lyuca(int(input())))
# 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()

count = 0
for i in b:
  count += bisect.bisect_left(a, i) * (len(c) - bisect.bisect(c, i))
print(count)
# Judge status: Wrong Answer
import math
a, b, x = map(int, input().split())

atan0 = math.degrees(math.atan((a*b**2)/(2*x)))

print(round(atan0, 10))
# Judge status: Accepted
s = input()

if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

num2 = 0
num4 = 0
odd = 0
for i in a:
    if i % 4 == 0:
        num4 += 1
        continue
    elif i % 2 == 0:
        num2 += 1
        continue
    else:
        odd += 1
        continue
if odd<=num4 or (N%2==1 and num4==N//2):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
  num = list(map(int,input().split()))
  if (num[0] in [1,3,5,7,8,10,12] and num[1] in [1,3,5,7,8,10,12] ) or (num[0] in [4,6,9,11] and num[1] in [4,6,9,11] ) or (num[0] ==2 and num[1] ==2):
    print('Yes')
  else:
    print('No')
      
main()
# Judge status: Wrong Answer
# coding: utf-8
a,b=map(int,input().split())
s=input().split('-')
if len(s)!=2:
    print('Yes')
elif len(s[0])!=a or len(s[1])!=b:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
N,M = [int(i) for i in input().split()]
road = [0]*N
for _ in range(M):
    a,b = [int(i)-1 for i in input().split()]
    road[a] += 1
    road[b] += 1
print("\n".join(map(str, road)))
# Judge status: Accepted
N, K = map(int, input().split())

if(N <= K):
    ans = min(abs(N-K), abs(abs(N-K)-K))
    print(ans)
else:
    mod = N%K
    ans = min(abs(mod-K), mod)
    print(ans)
# Judge status: Accepted

N=list(input())

print('Yes') if(('9' in N)==True) else print('No')
# Judge status: Wrong Answer
c = input()
vowel = ['a','i','u','e','o']
if c in vowel:
  print('vowel')
else:
  ('consonant')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
m = 100000000000
count = 0
ans = 0
for i in range(n):
    if a[i] < 0:
        count += 1
    x = abs(a[i]) 
    ans += x
    m = min(m,x)
if count % 2 != 0:
    ans -= 2*m
print(ans)