peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n, m = map(int, input().split())
if n % 2 != 0:
    for i in range(1, m + 1):
        print(i, n - i)
else:
    flag = False
    j = 0
    for i in range(1, m + 1):
        if i == n / 2:
            flag = True
        if flag:
            j += 1
        print(i, n - j)
        j += 1
# Judge status: Accepted
import sys

def input():
    return sys.stdin.readline()[:-1]


H1, M1, H2, M2, K = map(int, input().split())
start_time = H1*60 + M1
end_time = H2*60 + M2

print(end_time - start_time - K)
# Judge status: Accepted
# coding: utf-8
# Your code here!
N=int(input())

if len(str(N))==1:
    ans=N
else:
    
    if 1==len(set(list(str(N))[1:])) and int(str(N)[1])==9:
        ans=9*(len(str(N))-1) + int(str(N)[0])
    else:
        ans=9*(len(str(N))-1) + int(str(N)[0])-1

print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())

print(max(min(b,d)-max(a,c),0))
# Judge status: Accepted
L, R = map(int, input().split())
ans = 2019
    
if L//2019 != R//2019:
    print(0)
    exit(0)
else:
    L = L%2019
    R = R%2019

    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans = min(ans,(i*j)%2019)

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

for i, h in enumerate(H[:-1]):
  for j in range(1, min(K + 1, N - i)):
    cost_step = abs(H[i] - H[i + j])
    cost_total = dp_list[i] + cost_step
    if dp_list[i + j] > cost_total:
      dp_list[i + j] = cost_total
      
print(dp_list[-1])
# Judge status: Wrong Answer
X = int(input())

for i in range(-1000, 1000):
    for j in range(-10, 10):
        if i**5 - j**5 == X:
            print(i, j)
            exit()
# Judge status: Accepted
import sys
import math

input = sys.stdin.readline


def main():
    N, M = [int(x) for x in input().split()]

    MOD = 10 ** 9 + 7

    if abs(M - N) >= 2:
        print(0)
        return

    d = math.factorial(N)
    m = math.factorial(M)
    if N == M:
        d *= 2
    print(d * m % MOD)



    
    

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np

n, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
a = np.sort(a)

cnt = 0
for a_ in a:
    cnt += 1
    if a_ <= x:
        x -= a_
    elif a_ > x:
        break
print(cnt if x == 0 else cnt - 1)
# Judge status: Wrong Answer
N, K = [int(n) for n in input().split()]
P = sorted([int(n) for n in input().split()])
print(sum(P[0:3]))
# Judge status: Wrong Answer
S=input()

num0=0
num1=1

for i in range(len(S)):
    if S[i]=='0':
        num0+=1
    else:
        num1+=1
print(min(num0,num1))
# Judge status: Accepted
S = str(input())

if S[0] == S[1]:
  if S[1] == S[2]:
    print("No")
    quit()
    
print("Yes")
# Judge status: Accepted
a,b,c = map(int,input().split())
if(b < c and a > c):
	print("Yes")
elif(a < c and b > c):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
import math
a,b,n=map(int,input().split())

def func(a,b,x):
    return math.floor(a*x/b)-a*math.floor(x/b)

print(func(a,b,min(b-1,n)))
# Judge status: Accepted
def LI():return list(map(int,input().split()))
def yes():print("YES")
def no():print("NO")

a,v=LI()
b,w=LI()
t=int(input())

if a<b:
    if a+v*t>=b+w*t:
        yes()
    else:
        no()
if a>b:
    if a-v*t<=b-w*t:
        yes()
    else:
        no()
# Judge status: Wrong Answer
n = input()
print(n,'is followed by',chr(ord(n) + 1))
# Judge status: Wrong Answer
n = int(input())
S = [input() for i in range(n)]
m = int(input())
T = [input() for j in range(m)]

ANS = []
for i in range(len(S)):
  p = 0
  q = 0
  for j in range(len(S)):
    if S[i]== S[j]:
      p += 1
  for k in range(len(T)):
    if S[i] == T[k]:
      q += -1
  ANS.append(p+q)

print(S)
# Judge status: Accepted
s = input()
ans = s.split('hi')
if ''.join(ans) == '':
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n,d = map(int,input().split())
x = [list(map(int,input().split())) for i in range(n)]
l = []
s = []
for i in range(n):
    for j in range(i+1,n):
        t = 0
        for k in range(d):
            t += abs(x[i][k] - x[j][k]) ** 2
        l.append(t)
m = max(l)
i = 1
while i ** 2 <= l[-1]:
    s.append(i ** 2)
    i += 1
ans = 0
for i in range(len(s)):
    ans += l.count(s[i])
print(ans)
# Judge status: Wrong Answer
n = int(input())
a =  list(map(int, input().split()))

b = sorted(set(a))
len_a = len(a)
len_b = len(b)
ans = len_a - len_b

if b[0] != 1:
    print(-1) 
elif b[0] == 1 and b[len_b-1] == len_b:
    print(ans)
# Judge status: Wrong Answer
S = input()
print("*"*len(S))
# Judge status: Accepted
a, b = map(int, input().split())
c = max(a,b)
d = min(a,b)
e = 0
for i in range(c):
  e += d*(10**i)
print(e)
# Judge status: Wrong Answer
n,x=map(int,input().split())
a=list(map(int,input().split()))
asum=[0]*(n-1)
for i in range(n-1):
    asum[i]+=(a[i]+a[i+1])
temp=0
for j in range(n-1):
    if asum[j]>=x:
        if j!=n-2:
            asum[j+1]-=(asum[j]-x)
        temp+=(asum[j]-x)
            
print(temp)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())

from math import factorial
ans = 0

if n % 2 == 1:
    for i in range(1, n // 2 + 1):
        ans += factorial(n) // factorial(i) // factorial(n - i)
    ans *= 2 + 1
else:
    for i in range(1, n // 2):
        ans += factorial(n) // factorial(i) // factorial(n - i)
    ans *= 2
    ans += factorial(n) // factorial(n // 2) // factorial(n - n // 2) + 1

ans -= factorial(n) // factorial(a) // factorial(n - a)
ans -= factorial(n) // factorial(b) // factorial(n - b)
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
money=1000
num=0
for i in range(n-1):
    if a[i]==a[i+1]:
        money=money
    elif a[i]<a[i+1]:
        num+=money//a[i]
        money-=(money//a[i])*a[i] 
    elif a[i]>a[i+1]:
        money+=a[i]*num
        num=0
if a[-1]>a[-2]:
    money+=a[-1]*num
elif a[-1]<=a[-2]:
    money=money
print(money)
# Judge status: Accepted
N, M = map(int, input().split())

dic = {i+1:[] for i in range(N)}

for i in range(M):
  p, y = map(int, input().split())
  dic[p].append((i,y))

for i in range(N):
  dic[i+1].sort(key=lambda x:x[1])
  
ans = [0] * M
for k, vs in dic.items():
  order = 1
  for c, y in vs:
    ans[c] = (k, order)
    order += 1

for city, order in ans:
  print(str(city).zfill(6)+str(order).zfill(6))
# Judge status: Wrong Answer
import math

S = list(input().split())
a = int(S[0])
b = S[1].replace('.', '')
B = int(b)

ans = (a * B) // 100
print(ans)
# Judge status: Accepted
n=int(input())

list=[]
for i in range(n):
 x,l=map(int,input().split())
 list.append([x-l,x+l])
list=sorted(list,key=lambda x:x[1])

cnt=0
min=-10**18

for r,l in list:
 if min<=r:
  cnt+=1
  min=l
print(cnt)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
print(A)
count = 0
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count +=1
    print(A)
print(count)
# Judge status: Accepted
n = int(input())
v = list(map(int,input().split(" ")))

v.sort()
# print(v)
w = []

w0 = (v[0] + v[1])/2
w.append(w0)

for i in range(1,n-1):
    y = (v[i+1] + w[i-1])/2
    w.append(y)
    # print(w)
# print(w)
print(w[n-2])
# Judge status: Accepted
#!/usr/bin/env python
import sys 
import copy
input = sys.stdin.readline

n = int(input())
x = list(map(int, input().split()))
xx = sorted(x)

l = xx[(n-1)//2]
r = xx[n//2]
mid = (l+r)/2

for i in range(n):
    if x[i] >= mid:
        print(l)
    else:
        print(r)
# Judge status: Accepted
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N = int(readline())

    pay = (N + 1000 - 1) // 1000 * 1000
    ans = pay - N
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import deque

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

cnt_2 = 0
cnt_4 = 0
for i in range(n):
    a = A[i]
    if a%4==0:
        cnt_4+=1
    elif a%2==0:
        cnt_2+=1
cnt_else = n-cnt_2-cnt_4
cnt_else += cnt_2%2

if cnt_else-1 <= cnt_4:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from fractions import gcd
N,M = map(int,input().split())
a = list(map(int,input().split()))

def count_2(x):
    count = 0
    while x%2 == 0:
        count += 1
        x /= 2
    return count

flag = True

for i in range(N-1):
    if count_2(a[i]) != count_2(a[i+1]):
        flag = False
        break
    
if not flag:
    print(0)
    exit()

lcm=1
for i in range(N):
    lcm = lcm*a[i]//gcd(a[i],lcm)

ans=0
if lcm//2<=M:
    ans=(M-lcm//2)//lcm+1

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * (10 ** 6 + 1)
a.sort()
ans = 0


for i in a:
    cnt[i] += 1

a = set(a)

for k in a:
    for l in range(k * 2, (10 ** 6 + 1), k):
        cnt[l] += 1

for m in a:
    if cnt[m] == 1:
        ans += 1
    


print(ans)
# Judge status: Accepted
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v-1] += 1
    cnt[v+1] += 1
    
print(max(cnt))
# Judge status: Accepted
a,b,c=map(str,input().split())
print("A"+b[0]+"C")
# Judge status: Wrong Answer
s = input()
a = [0]*(len(s)+1)

for i in range(len(s)):
    if s[i] == '<':
        a[i+1] = max(a[i+1], a[i]+1)

for i in range(len(s)-2, -1, -1):
    if s[i] == '>':
        a[i] = max(a[i], a[i+1]+1)

print(sum(a))
# Judge status: Wrong Answer
strlist = list(input())
findlist="qazwsxedcrfvtgbyhnujmikolp"
flist=list(findlist)
flag = "Yes"
for a in flist:
    if not strlist.count(a) % 2:
        flag = "No"
print(flag)
# 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:
        ans += A[i+1]+A[i]-x
        A[i+1] = max(0,x-A[i])
print(ans)
# Judge status: Accepted
N,M=list(map(int, input().split()))
K=M-2*N
if K>=0:
  print(N+K//4)
else:
  print(min(N, M//2))
# Judge status: Wrong Answer
N,*D=map(int,open(0).read().split())
c=[0]*N
for i in D:c[i]+=1
if D[0]>0 or c[0]>1:print(0);exit()
a=1
for i in range(max(D)):a*=c[i]**c[i+1]
print(a)
# Judge status: Accepted
# solution

data=int(input())

array=[]

for i in range(1,34):
  for j in range(2,11):
    if (i**j)<=data:
      array.append(i**j)

print(max(array))
# Judge status: Wrong Answer
n=sum(list(map(int,input().split())));print(n-24 if n>24 else n)
# Judge status: Accepted
n=int(input())
cnt=0
*s,=map(int,input().split())
for i in range(n-2):
	if (s[i]<s[i+1]<=s[i+2])or(s[i+2]<s[i+1]<=s[i]):
		cnt += 1
	else:
		pass
print(cnt)
# Judge status: Accepted
score = list(map(int,input().split()))
if score[0] == 1:
    evennum = 0
else:
    evennum = score[0]*(score[0]-1)/2
if score[1] == 1:
    oddnum = 0
else:
    oddnum = score[1]*(score[1]-1)/2
print(int(evennum+oddnum))
# Judge status: Wrong Answer
X = int(input())
DP=[0]*(X+1)

def dp(n):
  if n<100:
    return 0
  if 100<=n and n<=105:
    return 1
  res = 0
  for i in range(100,106):
    res |= DP[n-i]
  return res

for i in range(X):
  DP[i] = dp(i)
ans=DP[X]
#print(DP)
print(ans)

#print(*ans, sep='/n')
# Judge status: Wrong Answer
s = list(input())
t = list(input())
f = False
l = len(s)
p = list("a"*l)
for i in range(l):
	if s == p: 
		f = True
		break
	for j in range(l):
		p[(j+i)%l] = t[j]
if f: print("Yes")
else: print("No")
# Judge status: Accepted
s = list(input())
x = len(s)
a = []

for i in range(x):
  if s[i] == '0':
    a.append('0')
  elif s[i] == '1':
    a.append('1')
  elif s[i] == 'B':
    if a == []:
      continue
    else:
      a.pop(-1)
b = ''.join(a)
print(b)
# Judge status: Wrong Answer
from functools import lru_cache
N = int(input())
# A * B <= N - 1はいくつありますか？
count = 0
for A in range(1, N-1):
    # B <= (N - 1) // A
    count += (N - 1) // A
print(count)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
if N ==1:
    print(a[1])
else:
    for n in range(N):
        ans += a[2*n-1]
    print(ans)
# Judge status: Wrong Answer
for a in range (1, 101):
    for b in range (1, 101):
        print(a * b)
# Judge status: Wrong Answer
n = int(input())

an = map(int, input().split())

an = list(an)

if len(set(an)) == n :
    print("Yes")

else :
    print("No")
# Judge status: Accepted
S = input()
rS = "".join([S[-i] for i in range(1,len(S)+1) ])

c = 0
for i in range(len(S)):
    if S[i] != rS[i]:
        c +=1
        
print(int(c/2))
# Judge status: Accepted

N,X,Y = list(map(int,input().split()))
X,Y = X-1,Y-1
ans = [0]*N

for i in range(N):
    for j in range(i+1,N):
            a = min(j-i,abs(X-i)+abs(Y-j)+1,abs(X-j)+abs(Y-i)+1)
            ans[a]+=1
            #print(i,j,a)

print(*ans[1:],sep="\n")
# Judge status: Accepted
from numba import jit

N = int(input())

@jit
def f():
    ret = [0] * 10001

    for i in range(1, 200):
        for j in range(1, 200):
            for k in range(1, 200):
                z = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if z < 10001:
                    ret[z] += 1

    return ret


ans = f()

for x in range(1, N+1):
    print(ans[x])
# Judge status: Accepted
N, K = map(int, input().split())
m = float("inf")
x = sorted(list(map(int, input().split())))
for i in range(N-K+1):
    m = min(abs(x[i])+abs(x[i+K-1]-x[i]), abs(x[i+K-1])+abs(x[i]-x[i+K-1]), m)
print(m)
# Judge status: Wrong Answer
n = int(input())
bott = 0
rem = -1
for i in range(10000):
    bott = i*(i+1)//2
    bott2 = (i+1)*(i+2)//2
    if(bott<=n and n<bott2):
        rem = n-bott
        bott = i
        break
ans = []
for i in range(bott):
    ans.append(i+1)

ans[-1] += rem

for i in range(bott):
    print(ans[i])
# Judge status: Wrong Answer
n, k = map(int, input().split())
t = n % k
if t < k:
    print(t)
else:
    print(k)
# Judge status: Accepted
n=int(input())
ans = 1
while ans <= n:
    ans = ans*2
print(ans//2)
# Judge status: Accepted
import bisect
import collections
N = int(input())
A = [int(input()) for i in range(N)]
q = collections.deque([-1])
for x in A:
    id = bisect.bisect_left(q, x)
    # print(id, x, q)
    if id == 0:
        q.appendleft(x)
    else:
        q[id-1] = x
print(len(q))
# Judge status: Accepted
H, N = list(map(int, input().split()))
A = list(map(int, input().split()))
print('Yes' if sum(A) >= H else 'No')
# Judge status: Accepted
n = int(input())
c = input()
rl = [ i for i,_ in enumerate(c) if _ == 'R' ]

cnt = 0
loc = 0
rid = -1
while True:
	try:
		if c[loc] == 'W':
			rloc = rl[rid]
			rid -= 1
			if rloc < loc:
				break
			else:
				cnt += 1
		loc += 1
		if loc == n:
			break
		#print(c,cnt)
	except:
		break
print(cnt)
# Judge status: Accepted
a, b = map(int, input().split())

cum = [0]
for i in range(1000):
    cum.append(cum[-1] + i)

for i in range(len(cum)-1):
    if cum[i+1] - cum[i] == (b-a):
        print(cum[i] - a)
        exit()
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
if a == b and b == c and c == a:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
import numpy as np
import itertools as it

n = int(input())
city = [np.array(list(map(int,input().split()))) for i in range(n)]

dist = [[[] for i in range(n)] for i in range(n)]
for i in range(n):
    for j in range(n):
        v = city[i] - city[j]
        dist[i][j] = np.linalg.norm(v, ord=2)

ps = it.permutations([i for i in range(n)])
anss = []
for p in ps:
    ans = 0
    print(p)
    for i in range(n-1):
        ans += dist[p[i]][p[i+1]]
    anss.append(ans)

print(anss)
print(np.average(anss))
# Judge status: Wrong Answer
# https://atcoder.jp/contests/agc021/tasks/agc021_a

n = input()
ans = int(n[0]) - 1 + 9 * (len(n) - 1)
print(ans)
# Judge status: Wrong Answer
c=input()
if c=="a" or c=="b" or c=="c" or c=="d" or c=="e":
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
s=input()
fdl=s.find("A")
fdr=s.rfind("Z")
print((fdr-fdl)+1)
# Judge status: Wrong Answer
n, r = map(int,input().split())
print(r)
if n < 10:
    r = r + 100*(10-n)
print(r)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
tate = 0
yoko = 0
i = 0
while i < (N - 1):
    if A[i] == A[i + 1]:
        if tate == 0:
            tate = A[i]
        else:
            yoko = A[i]
        if tate > 0 and yoko > 0:
            break
        i += 1
    i += 1
print(tate * yoko)
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
a = Counter(map(int, input().split()))
xy = [0] * 2
for i in a.items():
    if i[1] >= 2:
        if i[0] > xy[0] and i[0] > xy[1]:
            xy[1] = xy[0]
            xy[0] = i[0]
        elif i[0] > xy[1]:
            xy[1] = i[0]
    else:
        pass
print(xy[0] * xy[1]) if xy[0] != 0 and xy[1] != 0 else print(0)
# Judge status: Wrong Answer
N,A,B = map(int,input().split())
S =input()

for i in range(N):
  if S[i]=='a' and i < A+B:
    print('Yes')
  elif S[i]=='b' and i < B:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
N = int(input())
if (N*100)%108 == 0 :
    print(int(N/1.08))
else :
    for i in range(1,100) :
        if (N*100+i) % 108 == 0 :
            print(int((N*100+i)/108))
            break
    else :
        print(":(")
# Judge status: Accepted
import sys
n = int(input())
a = [int(input()) for a in range(n)]
cnt = 1
a.insert(0,0)
if a[1] ==2:
	print(1)
	sys.exit()
sel = a[1]
for i in range(n+1):
	if a[sel] == 2:
		cnt += 1
		print(cnt)
		sys.exit()
	else:
		cnt += 1
		sel = a[sel]
print(-1)
# Judge status: Wrong Answer
#Between Two Integers
def ABC_61_A():
    A,B,C = map(int, input().split())
    
    if C>=A and C<=B:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':

    ABC_61_A()
# Judge status: Accepted
def gcd(n,m):
    if n%m==0:
        return m
    elif m%n==0:
        return n
    elif n>m:
        n=n%m
        return gcd(n,m)
    else:
        m=m%n
        return gcd(n,m)

N,X=map(int,input().split())
x=list(map(int,input().split()))
m=0
for i in range(0,N):
    if i==0:
        m=abs(X-x[i])
    else:
        m=gcd(m,abs(X-x[i]))
print(m)
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
L = [Counter(sorted(str(input()))) for _ in range(n)]
ans = ''
for k in L[0]:
    for i in range(n):
        m = L[0][k]
        if L[i][k] < L[0][k]:
            m = min(m, L[i][k])
    ans = ans + k * m
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
flag = [False]*n
balls = [1]*n
flag[0]= True
for i in range(m):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    balls[x] -=1
    balls[y] += 1
    if flag[x] == True:
        flag[y] =True
    if flag[x] == True and balls[x] == 0:
        flag[x] = False

cnt = 0
for i in range(n):
    if flag[i] == True and balls[i]>=1:
        cnt += 1
print(cnt)
# Judge status: Accepted
N = int(input().rstrip())
l1 = [int(i) for i in input().rstrip().split()]
l2 = sorted(l1)
result = 'YES'
dnum = 0
for i in range(N):
    if l1[i] != l2[i]:
        dnum = dnum + 1

    if dnum > 2:
        result = 'NO'
        break

print(result)
# Judge status: Wrong Answer
def main():
    import sys
    N = int(input())
    input_2 = sys.stdin.readline
    P_list = list(input_2().split())
    i_num = 0
    for i in range(N):
        if P_list[i] <= min(P_list[:i+1]):
            i_num += 1
    print(i_num)

if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))
    Da=[-(-(b-a)//2) for a,b in zip(A,B) if a<b]
    Db=[a-b for a,b in zip(A,B) if a>b ]
    if sum(B)-sum(A)>=max(sum(Da),sum(Db)):print("Yes")
    else:print("No")

if __name__=='__main__':
    main()
# Judge status: Wrong Answer
n,d=map(int,input().split())
x=[0 for i in  range(n)]
for i in range(n):
    x[i]=list(map(int,input().split()))
a=0
for i in range(i):
    if x[i][0]**2+x[i][1]**2<=d**2:
        a+=1

print(a)
# Judge status: Accepted
s=input()

if (s == 'AAA') or (s == 'BBB'):
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
N = int(input())
X = [[input().split(), i + 1] for i in range(N)]
print(X)
X = sorted(X, key = lambda x:(x[0][0], -int(x[0][1])))
print(X)
for i in range(N):
	print(X[i][1])
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
A = sorted(map(int, input().split()), reverse=True)

c = Counter(A)
check = 0
for i in range(N):
    if (c[A[i]] > 1):
        check += 1
if (check <= 1):
    print(0)
    exit()

L = []
for i, v in c.items():
    if (v > 1):
        L.append(i)

L.sort(reverse=True)

print(L[0] * L[1])
# Judge status: Wrong Answer
N, M = map(int, input().split())
if (M >= 2*N):
  print(N+(M-2*N)//4)
else:
  print(N//2)
# Judge status: Accepted
n = int(input())
xn = [int(num) for num in input().split()]

answer = []
for n in range(1,max(xn)+1):
  sum = 0
  for x in xn:
    sum += (x-n)**2
  answer.append(sum)

print(min(answer))
# Judge status: Wrong Answer
import bisect
N=int(input())
A=[int(input()) for _ in range(N)]
color=[]
A=A[::-1]
for a in A:
    i=bisect.bisect_left(color,a)
    if i==len(color):
        color.append(a)
    else:
        color[i]=a
print(len(color))
# Judge status: Wrong Answer
N=int(input())
lst=list(map(int,input().split()))[:N]
Q=int(input())
for i in range(Q):
    x,y=map(int,input().split())
    lst.sort()
    for i in range(len(lst)):
        if lst[i]==x:
            lst[i]=y
        else:
            break
    print(sum(lst))
# Judge status: Accepted
n = input()
data = input()

w = []
r = []
for i in range(len(data)):
  if data[i] == "W":
    w.append(i)
  else:
    r.append(i)

ans = 0
if len(w) == 0:
  print(ans)
elif len(r) == 0:
  print(ans)
else:
  r = r[::-1]
  for i in range(min(len(w), len(r))):
    tmp_w = w[i]
    tmp_r = r[i]
    if tmp_w <= tmp_r:
      r.append(tmp_w)
      w.append(tmp_r)
      ans += 1
    else:
      break
  print(ans)
# Judge status: Wrong Answer
inf = 10**10
H, N = map(int, input().split())
A = []
B = []
for n in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
dp = [inf] * (H + 10 ** 4)
for n in range(N):
    for h in range(H):
        if dp[h] == inf:
            continue
        dp[h + A[n]] = min(dp[h + A[n]], dp[h] + B[n])
print(min(dp[H:]))
# Judge status: Accepted
from fractions import gcd
A,B = map(int, input().split())
print(int((A * B) / gcd(A, B)))
# Judge status: Accepted
n = int(input())
counts = {'AC': 0, 'TLE': 0, 'WA': 0, 'RE': 0}
for i in range(n):
  s = input()
  counts[s] += 1
print("AC x "+str(counts['AC']))
print("WA x "+str(counts['WA']))
print("TLE x "+str(counts['TLE']))
print("RE x "+str(counts['RE']))
# Judge status: Accepted
# -*- coding: utf-8 -*-
s = input()

if s == 'RRR':
    print(3)
elif 'RR' in s:
    print(2)
elif 'R' in s:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
s = [x for x in input()]
t = [y for y in input()]
count = 0
for _ in range(len(s)):
    if s[_] == t[_]:
        count+=1
print(count)
# Judge status: Wrong Answer
n = str(input())
iL = len(n)
count = 0
for i in range(1,iL+1):
  
  if i != iL and i % 2 != 0:
    count += (100**(i//2))*9
  elif i == iL and i% 2 != 0:
    count += int(n) - 100**(i-2)+1
print(count)
# Judge status: Accepted
x,a,b = map(int,input().split())
if abs(a-x) > abs(b-x):
  print('B')
else:
  print('A')
# Judge status: Accepted
def solve():
    X = int(input())
    
    n = X // 100
    if X - n * 100 <= n * 5:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    solve()
# Judge status: Accepted
from bisect import bisect_left, bisect_right

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()
len_c = len(c)
total = 0
for num in b:
    idx_a = bisect_left(a, num)
    idx_c = bisect_right(c, num)
    cnt = idx_a * (len_c - idx_c)
    total += cnt
print(total)
# Judge status: Accepted
import bisect
(n,),aa,bb,cc = [sorted(list(map(int, s.split()))) for s in open(0)]

ans = 0
for b in bb:
    ans += (bisect.bisect_left(aa,b))*(n-bisect.bisect_right(cc,b))

print(ans)