peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#B
N, D = map(int, input().split())
P= [list(map(int, input().split())) for i in range(N)]

x=[]
y=[]
for i in P:
    x.append(i[0])
    y.append(i[1])

d=[]
for i, j in zip(x, y):
    dist =(i**2 + j**2)**(1/2)
    if dist <= D:
        d.append(dist)
        
print(len(d))
# Judge status: Accepted
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
A = np.sort(A)[::-1]

div, mod = divmod(N, 2)

print(2 * np.sum(A[:div]) + (A[div] if mod==1 else 0) - A[0])
# Judge status: Wrong Answer
k,x=map(int,input().split())
s=[0]*((2*(k-1))+1)
for i in range((2*(k-1))+1):
  s[i]=x-(k-1)+i
  
print(s)
# Judge status: Accepted
a, b, k = map(int, input().split())

if b-a>=2*k:
    for i in range(a, a+k):
        print(i)

    for j in range(b-k+1, b+1):
        print(j)
else:
    for n in range(a, b+1):
        print(n)
# Judge status: Accepted
s = input()
cnt = 1
maxcnt=1
for i in range(1,4):
  if s[i] == s[i-1]:
    cnt += 1
  else:
    maxcnt = max(maxcnt,cnt)
    cnt = 1
maxcnt = max(maxcnt,cnt)
if maxcnt>=3:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
c = []
for _ in range(3):
    tmp = list(map(int, input().split()))
    c.extend(tmp)
    # c.append(tmp)

# print('c', c)
if sum(c) % 3:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
s=input()

for i in range(3):
    if (s[i]==s[i+1]):
        print("Bad")
        exit()

print("Good")
# Judge status: Accepted
N, M = map(int, input().split())

if M//2 < N:
    print(M//2)
elif M//2 == N:
    print(N)
else:
    print((N+(M-N*2)//4))
# Judge status: Accepted
import collections
N = int(input())
A = [int(x) for x in input().split()]
A.sort(reverse=True)
B = []
i = 0
while i < N-1:
    if A[i]==A[i+1]:
        B.append(A[i])
        i += 2
    else:
        i += 1
if len(B)<2:
    print(0)
else:
    print(B[0] * B[1])
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (10**6+1)
ans = 0
for a in A:
    if B[a] == 0:
        ans += 1
        B[a] = 2
        tmp = 2*a
        while tmp <= 10**6:
            B[tmp] = 1
            tmp += a
    elif B[a] == 2:
        B[a] = 1
        ans -= 1
print(ans)
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
s = input()

a = a-1
b = b-1
c = c-1
d = d-1

for i in range(a+1, d):
    if s[i-1] == '#' and s[i] == '#':
        print('No')
        exit()

if c < d:
    print('Yes')
    exit()

for i in range(b+1, d+1):
    if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
        print('Yes')
        exit()
print('No')
# Judge status: Accepted
n, m = map(int, input().split())
ok = [1] * n
for i in range(m):
    x = int(input())
    ok[x-1] = 0
mod = 1000000007
dp = [0] * (n+2)
dp[1] = 1
for i in range(n):
    dp[i+2] = (dp[i+1] + dp[i])%mod if ok[i] else 0

print(dp[n+1])
# Judge status: Accepted
X = int(input())

print(max([pow(b, p) for b in range(1, 1001) for p in range(2, 11) if pow(b, p) <= X]))
# Judge status: Accepted
import sys
def input():
    return sys.stdin.readline()[:-1]
def main():
    a, b = map(int,input().split())
    if a > 0 and b > 0:
        print("Positive")
    elif a*b <= 0:
        print("Zero")
    else:
        if (b-a)%2 == 1:
            print("Positive")
        else:
            print("Negative")
if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
S=[]
T=[]
data=set()
for i in range(n):
  s=input()
  S.append(s)
  data.add(s)
m=int(input())
for i in range(m):
  t=input()
  T.append(t)
  data.add(t)
ans=0
for i in data:
  ans=max(ans,S.count(i)-T.count(i))
print(ans)
# Judge status: Accepted
x = int(input())

def prime(n):
    ans = "yes"
    for i in range(2,round(n**0.5)+1):
        if n%i == 0:
            ans = "no"
            break
        else:
            continue
    if ans == "yes":
        return n
    else:
        return prime(n+1)
    

if x == 2 or x == 3:
    print(x)
else:
    print(prime(x))
# Judge status: Accepted
from sys import exit, setrecursionlimit
setrecursionlimit(10**6)

def array2D(row, col ,val=0):
    return [[val]*col for i in range(row)]

s = input()
print('Yes' if s[2]==s[3] and s[4] == s[5] else 'No')
# Judge status: Accepted
import math
A,B,C=map(int,input().split())
s=[A,B,C]
t=sorted(s)
u=(t[2]-t[0],t[2]-t[1],0)
if u[0]%2==0 and u[1]%2==0:
    print(round(((u[0]+u[1])/2)))
elif u[0]%2==1 and u[1]%2==1:
    print(round((1+u[0]//2+u[1]//2)))
elif u[0]%2==1 and u[1]%2==0:
    print(round(((u[0]+1)/2+u[1]/2+1)))
else:
    print(round(((u[1]+1)/2+u[0]/2+1)))
# Judge status: Wrong Answer
import fractions
import sys
input = sys.stdin.readline


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


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)


mod = 10**9+7
lcm = 1
for i in range(N):
    lcm = (lcm*A[i]) * modinv(fractions.gcd(lcm, A[i]))

ans = 0
for i in range(N):
    ans += (lcm // A[i]) % mod
    ans %= mod

print(ans)
# Judge status: Accepted
N, x = map(int, input().split())

a = list(map(int, input().split()))

ans = 0
for i in range(N-1):
    if a[i]+a[i+1] > x:
        if -a[i]+x > 0:
            ans += a[i+1]+a[i]-x
            a[i+1] = x-a[i]
        else:
            ans += a[i+1]
            a[i+1] = 0
            ans += a[i]-x
            a[i] -= a[i]-x

    # print(i)
    # print(a)
    # print(ans)

print(ans)
# Judge status: Wrong Answer
n, p = map(int, input().split())
a = list(map(int, input().split()))

length = len(a)
even = len([i for i in a if i % 2 == 0])
odd = len([i for i in a if i % 2 == 1])

if length == even and p == 1 or length == odd and p == 0 and odd % 2 == 1:
    print(0)
elif length == even:
    print(2 ** n)
else:
    print(2 ** n // 2)
# Judge status: Accepted
N=int(input())
a=0
for i in range(1,N):
  a+=(N-1)//i
print(a)
# Judge status: Accepted
s = input()
s = s[:-1]
while len(s) % 2 != 0 or s[:len(s)//2] != s[len(s)//2:]:
  s = s[:-1]
print(len(s))
# Judge status: Accepted
w,a,b=map(int,input().split())
print(max(abs(a-b)-w,0))
# Judge status: Accepted
q, h, s, d = map(int, input().split()); n = int(input())
h = min(q*2, h); s = min(h*2, s); d = min(s*2, d); x = 0
x += n//2*d; n %= 2; x += n//1*s
print(x)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

operation = sum(B) - sum(A)

cntp = 0
cntn = 0
for a, b in zip(A, B):
    c = b - a
    if c > 0:
        cntp += c
        if c % 2 != 0:
            operation -= 1
    elif c < 0:
        cntn += -c


if operation >= cntn:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b, c, d, e, k = list(int(input()) for _ in  range(6))
print(':(' if (e - a) > k else 'Yay!')
# Judge status: Accepted
A = list(map(int, input().split()))
A = sorted(A)

if (A[2]-A[0]-(A[2]-A[1]))%2==0:
  ans = A[2]-A[1]+(A[2]-A[0]-(A[2]-A[1]))//2
else:
  ans = A[2]-A[1]+(A[2]-A[0]-(A[2]-A[1]))//2+2
                   
print(ans)
# Judge status: Wrong Answer
import numpy as np
n = int(input())
a = list(map(int,input().split()))

a.sort()
na = np.array(a)
#for i in na:
cnt = 0
while cnt < len(a):
    #na = na[na % i != 0]
    tmp = na[0]
    na = na[na % a[cnt] != 0]
    #print(na)
    na = np.append(na, tmp)
    #print(na)
    cnt +=1


ans = len(set(na))
if ans == 1:
    print(0)
    exit()

print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
X = [int(x) for x in input().split()]
X.sort(reverse=True)
X_diff = []
for i in range(len(X)-1):
    X_diff.append(X[i] - X[i+1])
X_diff.sort()
if N < M:
    print(sum(X_diff[:M-N]))
else:
    print(0)
# Judge status: Wrong Answer
n = int(input())
t,a = map(int,input().split())
h = list(map(int, input().split()))
a = 10**9
for i in range(n):
    c = h[i]*0.006
    if abs(a-c)<a:
        a=abs(a-c)
        d=i
print(d+1)
# Judge status: Wrong Answer
N = int(input())
count_1,count_2 = 0,0
for i in range(1,N+1,2):
  for j in range(1,i+1,2):
    if N % j == 0:
      count_1 += 1
  if count_1 == 8:
    count_2 += 1
  count_1 = 0
print(count_2)
# Judge status: Accepted
D,T,S = map(int,input().split())
print("Yes" if D <= S*T else "No")
# Judge status: Wrong Answer
x,y=map(int,input().split())
count=0
while y>=x:
    y=y/2
    count+=1
print(count)
# Judge status: Wrong Answer
import statistics

N = int(input())
A = []
B = []
for i in range(N):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
Am = statistics.median(A)
Bm = statistics.median(B)

if N % 2 == 0:
    print(2 * round(Bm - Am) + 1)
else:
    print(Bm - Am + 1)
# Judge status: Accepted
# 数値の取得
num_cnt = int(input())
num_list = list(map(int,input().split()))

# 数値の検査後メッセージを出力
judge = "APPROVED"
for cnt in range(0,num_cnt,1):
    if num_list[cnt] % 2 == 0\
    and num_list[cnt] % 3 != 0\
    and num_list[cnt] % 5 != 0:
      judge = "DENIED"
      
print(judge)
# Judge status: Accepted
n,p = map(int,input().split())
a = list(map(int,input().split()))

o, e = 0, 0
for i in a:
    if i % 2 == 0:
        e += 1
    else:
        o += 1

def comb(n, r):
    ret = 1
    for i in range(r):
        ret *= n - i
        ret //= i + 1
    return ret

res = 0 
if p == 0:
    for i in range(0, o + 1, 2):
        res += comb(o, i)
else:
    for i in range(1, o + 1, 2):
        res += comb(o, i)
res *= 2 ** e
print(res)
# Judge status: Accepted
def chmin(a,b):
    if a > b:
        return b
    else:
        return a


N, K = map(int, input().split())
h = list(map(int, input().split()))
INF = float('inf')
dp = [INF] * N
dp[0] = 0


for i in range(N):
    for j in range(1,K+1):
        if i+j < N:
            dp[i+j] = chmin(dp[i+j], dp[i] + abs(h[i] - h[i+j]))

print(dp[N-1])
# Judge status: Accepted
import itertools
N, M, X = map(int,input().split())
arr = []
for i in range(N):
    arr.append(list(map(int,input().split())))

costl = []

for p in itertools.product([0,1],repeat=N):
    f = [0]*M
    cost = 0
    for i in range(N):
        if p[i] == 1:
            for j in range(M):
                f[j] += arr[i][j+1]
            cost += arr[i][0]
    if all(point >= X for point in f):
        costl.append(cost)

print(min(costl) if len(costl) >= 1 else -1)
# Judge status: Accepted
h1, m1, h2, m2, k = map(int, input().split())
time1 = 60*h1 + m1
time2 = 60*h2 + m2
print(time2 - time1 - k)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
sortedA = sorted(A, reverse=True)

for a in A:
    if sortedA[0] != a:
        print(sortedA[0])
    else:
        print(sortedA[1])
# Judge status: Wrong Answer
n = int(input())

if(n>=400 and n<600):print(8)
elif(n>=600 and n<800):print(7)
elif(n>=800 and n<1000):print(6)
elif(n>=1000 and n<1200):print(5)
elif(n>=1200 and n<1400):print(4)
elif(n>=1400 and n<1600):print(3)
elif(n>=1600 and n<1700):print(2)
# Judge status: Accepted
import copy
N,M = [int(hoge) for hoge in input().split()]
Ball = [False]*N
BallNum = [1] * N
Ball[0] = True
for i in range(M):
    x,y = [int(hoge) - 1  for hoge in input().split()]
    BallNum[x] -= 1
    BallNum[y] += 1
    if Ball[x]:
        Ball[y] = True 
    if BallNum[x] == 0:
        Ball[x] = False
print(sum(Ball))
# Judge status: Wrong Answer
import math

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

if math.log(n,k) == int(math.log(n,k)):
  res=math.log(n,k) + 1
else:
  res=int(math.log(n,k)) + 1

print(res)
# Judge status: Accepted
x, y = map(int, input().split())
ans = False
 
for i in range(101):
	for j in range(101):
		if i+j == x and 2*i+4*j == y:
			ans = True
if ans:
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
import math
N=int(input())

han=999999999999999999999999999999999999999999
b=0



for a in range(1,int(math.sqrt(N))+1):
    if N%a==0:
        A=N/a
        if A>a:
            gou=A-a
        else:
            gou=a-A
        b=a
        if gou<han:
            han=gou
            kot=A+a
if b==A:
    print(int(kot)-1)
else:
    print(int(kot)-2)
# Judge status: Accepted
n = int(input())
d = {}
ans = 0
for i in range(n):
    s = "".join(sorted(input()))
    if s in d:
        d[s] += 1
        ans += d[s]
    else:
        d[s] = 0
print(ans)
# Judge status: Accepted
# A - Circle Pond
import math 

r = int(input())

print(r*2*math.pi)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

ans=1
x=y=0
c=A[0]

for i in range(1,N):
    if c < A[i]:
        x=1
    elif c>A[i]:
        y=1
    
    if x==1 and y==1:
        ans+=1
        x=y=0
    
    c=A[i]

print(ans)
# Judge status: Wrong Answer
a,b,c,d,e,k = [int(input()) for i in range(6)]
print('Yey!' if e-a <k else ':(')
# Judge status: Accepted
#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B = map(int, input().split())
# A = list(map(int, input().split()))
if (A + B) % 2 == 0:
    print((A + B) // 2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
n = int(input())
memo = [-1]*(n+1)

def func(i):
    if i == 0:
        return 2
    if i == 1:
        return 1
    
    if memo[i] != -1:
        return memo[i]
    
    memo[i] = func(i-2) + func(i-1)
    return memo[i]

print(func(n))
# Judge status: Accepted
inf = 10 ** 15
mod = 10 ** 9 + 7
am,b = map(int, input().split())
print(am*b)
# Judge status: Accepted
n,h = map(int,input().split())
A = []
B = []
m = 0
for j in range(n):
    a,b = map(int,input().split())
    m = max(a,m)
    A.append(a)
    B.append(b)
B.sort(reverse=True)
for i in range(n):
    if B[i] > m:
        h -= B[i]
    else:
        print(i+1+(h-1)//m)
        break
    if h <= 0:
        print(i+1)
        break
else:
    print(n+1+(h-1)//m)
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))
tairyoku = [0]*100

for i in range(100):
    t=0
    for j in range(N):
        t += (X[j]-i)**2
        tairyoku[i]=t

print(min(tairyoku))
# Judge status: Accepted
import math
a, b, x = map(int, input().split())
if(x < ((a*a*b)/2)):
  print(math.degrees(math.atan( a*b*b/(2 * x) )))
else:
  print(math.degrees(math.atan( 2*(a*a*b - x)/(a*a*a) )))
# Judge status: Accepted
a, b = map(int, input().split())
print('Yay!' if a <= 8 and b <= 8 else ':(')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

mx = 0
ans = 0
for i in a:
    if i<=mx:
        ans+=1
    mx = max(mx,i)
print(ans)
# Judge status: Wrong Answer
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())
N_chr = str(N)
c = N_chr[0]

acc = int(c) + 9 * (len(N_chr) - 1)
if N == acc:
    print(acc)
else:
    print(acc - 1)
# Judge status: Wrong Answer
A,B,C,D=map(int,input().split())
count1=0
count2=0
for i in range(A<=0):
    A=A-D*i
    count1+=1
for n in range(C<=0):
    C=C-B*n
    count2+=1
if count1<=count2:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b=map(int,input().split())
if (a==1):
  a=14
if (b==1):
  b=14
if (a>b):
  print('Alice')
elif (b>a):
  print('Bob')
else:
  print('draw')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
    if i%2 == 1: continue
    if a[i]%2 == 1:
        ans += 1

print(ans)
# Judge status: Wrong Answer
n = int(input())
lst = list(map(int,input().split()))
ans = [0] * n

for i in lst:
    ans[i] += 1
ans.remove(0)
ans.append(0)
print(ans)
# Judge status: Accepted
X,Y = map(int, input().split())

mod=10 ** 9 + 7
def binomial(n,k):
    x=1
    y=1
    for i in range(k):
        x=x*(n-i)%mod
        y=y*(i+1)%mod
    return x*pow(y,mod-2,mod)%mod

if (2*X-Y)%3==0 and  (2*Y-X)%3==0:
    a=(2*X-Y)//3
    b=(2*Y-X)//3
    if a<0 or b<0:
        print(0)        
    else:
        print(binomial(a+b,a)%mod)
else:
    print(0)
# Judge status: Accepted
s = set(list(input()))
if s=={'N','W','S','E'} or s=={'N','S'} or s=={'W','E'}:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n=int(input())
x=int(n/1.08)
if int(x*1.08)==n:
    print(x)
else:
    print(":(")
# Judge status: Accepted
N = int(input())

heights = tuple(map(int, input().split(' ')))

dp = [0] * (N + 1)

dp[1] = 0
dp[2] = abs(heights[0] - heights[1])

for hi, i in enumerate(range(3, N + 1), start=2):
    dp[i] = min(
        dp[i - 1] + abs(heights[hi] - heights[hi - 1]),
        dp[i - 2] + abs(heights[hi] - heights[hi - 2]),
    )

print(dp[N])
# Judge status: Accepted
a, b, c, d = map(int, input())

if a == b or b == c or c == d:
    print("Bad")
else:
    print("Good")
# Judge status: Accepted
a = int(input())
print(max(j ** i for j in range(32) for i in range(2, 10) if j ** i <= a))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
m = max(l)
num = l.index(m)
for i in range(num, len(l)):
    if l[i] + 2 <= m:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
N=int(input())
P=list(range(100))
for y in range(100):
 P[y]=0
for i in range(N):
 if i+1<=9:
  c=(i+1)*11
  P[c]+=1
 else:
  z=str(i+1)
  d=len(z)
  e=int((i+1)/(10**(d-1)))
  f=(i+1)%10
  g=10*e+f
  P[g]+=1
k=0
for i in range(9):
 for j in range(9):
  s=(i+1)*10+(j+1)
  t=(j+1)*10+(i+1)
  z=P[s]*P[t]
  k+=z
print(k)
# Judge status: Accepted
n=int(input())
s=input()

r_cnt=s.count('R')
g_cnt=s.count('G')
b_cnt=s.count('B')

ans=r_cnt*g_cnt*b_cnt

for i in range(n):
    for d in range(n):
        j=i+d
        k=j+d
        if k>=n:break
        if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
            ans-=1
            
print(ans)
# Judge status: Accepted
N = int(input())

ans = 0
for i in range(1,N+1):
    for j in range(6):
        if 10 ** j <= i and i < 10**(j+1):
            if j % 2 == 0:
                ans += 1
                break

print(ans)
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))
C = [1] * (N + 1)
B = [True, True] + [False] * (N - 1)
flg = False
for _ in range(M):
    x, y = list(map(int, input().split()))
    if B[x]:
        B[y] = True
    if x == 1 and not flg and C[1] == 1:
        B[1] = False
        flg = True
    if y == 1 and not flg:
        flg = True
    C[x] -= 1
    C[y] += 1
res = 0
for i in range(1, N + 1):
    if B[i] and C[i] > 0:
        res += 1
print(res)
# Judge status: Wrong Answer
import math

a,b,k=map(int,input().split())
cnt=0

for i in range(math.gcd(a,b),1,-1):
    if a%i==0 and b%i==0:
        cnt += 1
    
    if cnt==k:
        print(i)
        break
# Judge status: Accepted
# coding: utf-8
# Your code here!

N, K = map(int, input().split())
H = list(map(int, input().split()))
newH = sorted(H)

if K >= N:
    print(0)
else:
    for i in range(K):
        newH.pop()
    print(sum(newH))
# Judge status: Accepted
x = int(input())
print(0 if x == 1 else 1)
# Judge status: Accepted
import math

A,B = map(int,input().split())
G = math.gcd(A,B)

N = G
#素因数分解
sep = []
for i in range(2,int(math.sqrt(N))+2,1):
    if N % i ==0:
        count = 0
        while N % i == 0:
            N = N//i
            count += 1
        sep.append([i,count])
if N != 1:
    sep.append([N,1])

print(len(sep)+1)
# Judge status: Wrong Answer
C1 = input()
C2 = input()
ans = 'YES'
if C1[0] != C2[2]:
  ans = 'NO'
if C1[1] != C2[1]:
  ans = 'NO'
if C1[2] != C2[1]:
  ans = 'NO'
print(ans)
# Judge status: Accepted
N = int(input())
xy = [map(int, input().split()) for _ in range(N)]


def get_output():
    dist = [0 for _ in range(N)]
    X, Y = [], []

    for i, (x, y) in enumerate(xy):
        x, y = x-y, x+y
        X.append(x)
        Y.append(y)

    a = max(X) - min(X)
    b = max(Y)-min(Y)
    return max(a, b)


print(get_output())
# Judge status: Accepted
a, b, c, x, y = [int(x) for x in input().split()]

if x <= y:
    ans = min(a + b, 2 * c) * x
    ans += min(b, 2 * c) * (y - x)
else:
    ans = min(a + b, 2 * c) * y
    ans += min(a, 2 * c) * (x - y)

print(ans)
# Judge status: Wrong Answer
s = "".join(sorted(input()))
t = "".join(sorted(input(), reverse=True))

if s < t: print("Yes")
else: print("No")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
l=[0]
r=[0]
ans=0
from  fractions import gcd
for i in range(n-1):
    l.append(gcd(l[i],a[i]))
    r.append(gcd(r[i],a[-1-i]))
for i in range(n):
    ans=max(ans,gcd(l[i],r[-1-i]))

print(ans)
# Judge status: Wrong Answer
N = int(input()) #1行目のNを取得する
s = [input() for i in range(N)] #複数行の数値の入力を取得
print(len(s))
# Judge status: Accepted
n = int(input())
nums = [int(x) for x in input().split()]
nums.sort(reverse=True)
print(sum(nums[::2]) - sum(nums[1::2]))
# Judge status: Wrong Answer
n=input()
maxa=-1
mina=10000000000
maxb=-1
minb=10000000000

for i in range(int(n)):
    x,y=map(int,input().split())
    maxa=max(maxa,x+y)
    mina=min(mina,x+y)
    maxb=max(maxb,x-y)
    minb=min(minb,x-y)

print(max(abs(maxa-mina),abs(maxb-minb)))
# Judge status: Accepted
import numpy as np
N, M = map(int, input().split())
A = np.array([list(input()) for _ in range(N)])
B = np.array([list(input()) for _ in range(M)])
for i in range(N-M+1):
  for j in range(N-M+1):
    if (A[i:i+M, j:j+M] == B).all():
      print('Yes')
      exit()
print('No')
# Judge status: Accepted
n,p = map(int, input().split())
lis = list(map(int, input().split()))

odd = [i for i in lis if i % 2==1]
even = [i for i in lis if i % 2 == 0]

if len(odd) == 0:
    if p == 0:
        print(2**n)
    else:
        print(0)
else:
    odd_m = len(odd)
    even_m = len(even)
    t1 = 2**even_m
    t2 = 2**(odd_m-1)
    print(t1*t2)
# Judge status: Accepted
w,h,n = map(int, input().split())
x1,x2,y1,y2 = 0,w,0,h
for _ in range(n):
  xi,yi,ai = map(int, input().split())
  if ai==1: x1 = max(xi,x1)
  elif ai==2: x2 = min(xi,x2)
  elif ai==3: y1 = max(yi,y1)
  else: y2 = min(yi,y2)
dx = max(0, x2-x1)
dy = max(0, y2-y1)
print(dx*dy)
# Judge status: Accepted
a,b=map(int,input().split())
if a<=b:print(a)
else:print(a-1)
# Judge status: Accepted
a,b,c=map(int,input().split())
k=int(input())

for ai in range(k):
  for bi in range(k):
    if ai + bi > k:
      continue
    ci = k - (ai+bi)
    tmpa = a * (2 ** ai)
    tmpb = b * (2 ** bi)
    tmpc = c * (2 ** ci)
    if tmpa < tmpb and tmpb < tmpc:
      print('Yes')
      exit(0)
print('No')
# Judge status: Wrong Answer
n  = int(input())

count = 0
for i in range(1, n):
    count += i
    if count >= n:
        print(i)
        exit()
# Judge status: Accepted
def func(X,A,B):
    count = 0
    for i in range(X,100):
        j = str(i)
        z = j[1]+j[0]
        for y in range(10):
            tmp = int(str(i)+str(y)+z)
            if A <= tmp and tmp <= B:
                count += 1
            elif tmp > B:
                return count
    return count
a,b = input().split()
x = a[:2]
A = int(a)
B = int(b)
X = int(x)
print(func(X,A,B))
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1):
    if i%2 == 1:
        cnt = 0
        for j in range(1, i+1):
            if i%j == 0:
                cnt += 1
        if cnt == 8:
            ans += 1
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
h=list(map(int,input().split()))
ab=[]
for _ in range(m):
    ab.append(list(map(int,input().split())))

good=[1]*n
for i in range(m):
    if h[ab[i][0]-1]<h[ab[i][1]-1]:
        good[ab[i][0]-1]=0
    else:
        good[ab[i][1]-1]=0
print(sum(good))
# Judge status: Accepted
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

a,b=mi()
ans=max(a+a-1,a+b)
ansans=max(ans,b+b-1)
print(ansans)
# Judge status: Wrong Answer
n,q = map(int,input().split())
s = list(input())
base = [0]*n

for i in range(n-1):
  if (s[i] == "A") and (s[i+1] == "C"):
    base[i] = 1

for i in range(q):
  l,r = map(int,input().split())
  temp = base[(l-1):r]
  ans = sum(temp)
  
  if s[r-1] == "A":
    ans = ans - 1
    
  print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

n, a, b = map(int, input().split())
mod = 10**9 + 7
a = min(a, n-a)
b = min(b, n-b)
com = [1] * (max(a, b) + 1)
for i in range(1,len(com)):
    com[i] = (com[i-1] * pow(i, mod-2, mod) * (n-i+1)) % mod
print((pow(2, n, mod) + mod - 1 - com[a] - com[b]) % mod)
# Judge status: Wrong Answer
S = input()
if S[0] == "<":
  a = S.count(">")
else:
  a = S.count("<")
print(a * (a + 1) // 2)
# Judge status: Accepted
n, m, a, b = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(a)
y.append(b)

if max(x) < min(y):
    print('No War')
else:
    print('War')