peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n = int(input())
if n == 0:
  print(0)
  exit(0)
s = ""
while True:
  m = n % -2
  s = str(-m) + s
  n = n // -2
  if n == 1 or n == 0:
    break
  elif m != 0:
    n += 1
print('1'+s)
# Judge status: Accepted
s = input()
k = int(input())
ans = '1'
for i in range(k):
    if s[i]!= '1':
        ans = s[i]
        break
print(ans)
# Judge status: Wrong Answer
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 1
p = abs(a - t - (h[0] * 0.006))
for i in range(1,n):
    if p > abs(a - t - (h[i] * 0.006)):
        p = min(p, abs(a - t - (h[i] * 0.006)))
        ans = i+1
print(ans)
# Judge status: Accepted
n = int(input())
a_l1 = list(map(int, input().split()))
a_l2 = list(map(int, input().split()))
c = 0
m_a_l1 = []
for i in a_l1:
    c += i
    m_a_l1.append(c)
c = 0
m_a_l2 = [0] * n
for i,j in enumerate(reversed(a_l2)):
    c += j
    m_a_l2[-1-i] = c

ans = 0
for i,j in zip(m_a_l1, m_a_l2):
    ans = max(i+j, ans)
print(ans)
# Judge status: Accepted
from collections import Counter
N = int(input())

res =0
cd = {}

for i in range(N):
    w = "".join(sorted(input()))
    if cd.get(w, 0):
        res += cd[w]
        cd[w] += 1
    else:
        cd[w] = 1
print(res)
# Judge status: Accepted
n = input()
count = 0

for i in n:
  count += int(i)

if count % 9 == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
for i in range (1,10):
    for k in range (1,10):
        if i*k == n:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
line = input()
a, b, c= [int(n) for n in line.split()]
x = a*b/2
x = int(x)
print(x)
# Judge status: Accepted
x = int(input())

if x == 7 or x == 5 or x == 3:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n, a, b = map(int, input().split())
s = input()
 
for i in s:
    if (i == "a" and a + b > 0):
        print("Yes")
        a -= 1
    elif (i == "b" and a + b > 0 and b > 0):
        print("Yes")
        b -= 1
    else:
        print("No")
# Judge status: Accepted
n = int(input())
count = -1
for i in range(n+1):
     if len(str(i))%2 != 0:
          count += 1
print(count)
# Judge status: Accepted
from collections import deque
n = int(input())
a = list(map(int, input().split()))

b = deque()

for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])

if n % 2 == 1:
    b.reverse()

print(" ".join(map(str, b)))
# Judge status: Accepted
N,A,B=map(int,input().split())
ans=0
for i in range(N+1):
  if A<=sum(map(int,str(i)))<=B:
    ans+=i
print(ans)
# Judge status: Wrong Answer
arr = []
for _ in range(5):
  x = int(input())
  if 0 < x <= 10:arr.append(10)
  else:
    x//=10
    arr.append(x*10)
    
print(sum(arr))
# Judge status: Wrong Answer
n, x = map(int, input().split())
L = list(map(int, input().split()))
dist = 0
res = 0
for i, l in enumerate(L, 1):
    dist += l
    if dist > x:
        print(i)
        exit()
    elif dist == x:
        print(min(i + 1, n))
        exit()
print(n)
# Judge status: Wrong Answer
#!/usr/bin/env python3

val1 = input()

if int(val1) >= 30:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

print("Yes" if b-a >=c or a-b >= c else "No")
# Judge status: Wrong Answer
import sys
n=int(input())
p=list(map(int,input().split()))
q=sorted(p)
if p==q:
  print("YES")
  sys.exit()
else:
  print("NO")
  sys.exit()
  

for i in range(n-1):
  for j in range(i+1,n):
    s=p[i]
    p[i]=p[j]
    p[j]=s
    if p==q:
      print("Yes")
      sys.exit()
    s=p[i]
    p[i]=p[j]
    p[j]=s
      
print("N0")
# Judge status: Wrong Answer
# AtCoder
N = int(input())
l = [list(map(int, input().split())) for i in range(N)]

m = sorted(l, key=lambda x: x[0])
work = 0
mx = -100
for i in range(N):
    work += m[i][0]
    mx = max(m[i][1], mx)

if mx > work:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
x = int(input())

q, r = divmod(x, 11)

print(q * 2 + (2 if r > 6 else 1 if r > 0 else 0))
# Judge status: Accepted
from sys import stdin

n = int(stdin.readline().strip())
x1 = n // 1.08
x2 = n // 1.08 + 1

if int(x1 * 1.08) == n:
  print(int(x1))
elif int(x2 * 1.08) == n:
  print(int(x2))
else:
  print(":(")
# Judge status: Accepted
def f(s):
  m = len(s)//2
  flag = True
  for i in range(m):
    flag = flag and s[i]==s[-i-1]
  return flag

s = input()
n = (len(s)-1)//2

s1 = s[:n]
s2 = s[n+1:]

if s1==s2 and f(s1):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
aaa = [int(input()) for _ in range(n)]
num = 1
ans = -1
for i in range(n):
    num = aaa[num - 1]
    if num == 2:
        ans = i + 1
        break
print(ans)
# Judge status: Accepted
K = int(input())

if 7%K==0:
    print(1)
else:
    ans = 1
    b = 7%K
    while ans < 10**7+1000:
        b = (b*10+7)%K
        if b == 0:
            print(ans+1)
            break
        else:
            ans += 1
    else:
        print(-1)
# Judge status: Accepted
mod=10**9+7
N=int(input())
A = list(map(int,input().split()))
B=[0]*N
for i in range(N):
 B[i]=str(bin(A[i])).rjust(62,"0")
f=0
for i in range(2,62):
 d=0
 e=0
 for j in range(N):
  c=B[j]
  if c[i]=="1":
   d+=1
  else:
   e+=1
 f+=(d*e*pow(2,61-i,mod))%mod
 f%=mod
print(f)
# Judge status: Wrong Answer
n,d=map(int,input().split())
X=[[int(_) for _ in input().split()] for i in range(n)]
sqr_list=[]
for i in range(70):
    sqr_list.append(i**2)
count=0
for i in range(n-1):
    for j in range(i+1,n):
        sum=0
        for k in range(d):
            sum+=(X[i][k]-X[j][k])**2
        if sum in sqr_list:
            count+=1
print(count)
# Judge status: Wrong Answer
# https://atcoder.jp/contests/agc036/tasks/agc036_a

s = int(input())

x1, y1 = 0, 0
y2 = 0
x3 = 0

i = 1
sq = s ** 0.5
while i <= sq:
    if s % i == 0:
        x2 = i
        y3 = s // i
        break
    i += 1

print(x1, y1, x2, y2, x3, y3)
# Judge status: Accepted
n, m= map(int, input().split())
h = list(map(int, input().split()))

e = [[] for _ in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    e[a-1].append(b-1)
    e[b-1].append(a-1)

ans = 0
for j in range(n):
    if not e[j]:
        ans += 1
        continue
    hs = [h[k] for k in e[j]]
    if h[j] > max(hs):
        ans += 1
print(ans)
# Judge status: Accepted
from math import log
import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(lambda x : log(int(x)), input().split()))
s = 0
for i in range(K):
    s += A[i]
for i in range(K, N):
    t = s - A[i-K] + A[i]
    if t > s:
        print('Yes')
    else:
        print('No')
    s = t
# Judge status: Wrong Answer
li = list(input())
res = []
for x in li:
    if x == "k" or x == "e" or x == "y" or x == "n"or x == "c":
        res.append(x)
if "".join(sorted(set(res))) == "cekny":
    print("YES")
else:
    print("NO")
# Judge status: Accepted
from cmath import rect, pi

def deg_to_rad(deg): return deg * pi / 180

a, b, h, m = map(float, input().split())
zh = rect(a, deg_to_rad((60*h+m) / 2))
zm = rect(b, deg_to_rad(m * 6))
print(abs(zh-zm))
# Judge status: Accepted
N = int(input())
S = input()

ans = 0
for i in range(N):
    X = S[:i]
    Y = S[i:]
    cnt = 0
    for j in range(97,123):
        index = chr(j)
        if X.find(index) != -1 and Y.find(index) != -1:
            cnt += 1
        ans = max(ans,cnt)
print(ans)
# Judge status: Wrong Answer
n, m = list(map(int, input().split()))
if n == m:
  print("Yes")
else: print("NO")
# Judge status: Wrong Answer
n, m = map(int, input().split())
students = [list(map(int, input().split())) for i in range(n)]

targets = [list(map(int, input().split())) for i in range(m)]
x = 0
snumber = [(0, x)] * n
  
def md(s, t):
  d = abs(s[0] - t[0]) + abs(s[1] - t[1])
  return d

for i in range(n):
  x = 2 * 10 ** 8 + 1
  for j in range(m):    
    if x > md(students[i], targets[j]):
      x = md(students[i], targets[j])
      snumber[i] = (j+1, md(students[i], targets[j]))
      
for i in range(n):      
  print(snumber[i][0])
# Judge status: Accepted
S = input()
S_rev = S[::-1]
# amari = [0]
a = 0
from collections import defaultdict
d = defaultdict(int)
d[0]+=1
for i,s_r in enumerate(S_rev):
    x = pow(10,i,2019)
    # print(x)
    a = (a+int(s_r)*x)%2019
    # amari.append(a)
    d[a] += 1


ans = 0
for k in d.keys():
    n = d[k]
    ans += n*(n-1)//2
print(ans)
# Judge status: Accepted
S=list(input())
tmp=""
ans="No"
for s in S:
    if(tmp==""):
        tmp=s
        ans="No"
    else:
        if(s=='i' and tmp=='h'):
            ans="Yes"
            tmp=''
        else:
            ans="No"
            break
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split());print('YNEOS'[b-a!=c-b::2])
# Judge status: Accepted
n = int(input())
s_p_list = []

for i in range(n):
    s_p_list.append(input().split())
    s_p_list[i].append(i+1)

result = sorted(s_p_list, key=lambda x: (x[0], -int(x[1]))) #sortedは非破壊的

for i in result:
  print(i[2])
# Judge status: Accepted
k,a,b=map(int,input().split())
if a-1>=k:
    print(1)
elif a-1<=k:
    if a+1<b:
        if (k+1-a)%2==0:
            print(a+((k+1-a)//2)*(b-a))
        else:
            print(a+1+((k+1-a)//2)*(b-a))
    
    
    elif a+1>=b:
        print(k+1)
# Judge status: Wrong Answer
N = int(input())
mini = float("inf")
for A in range(1,N-2+1):
  mini = min(mini,sum([int(digit) for digit in str(A)])+sum([int(digit) for digit in str(N-A)]))
print(mini)
# Judge status: Accepted
import sys

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

for i in reversed(range(1,k+1)):
    ck = c * (2 ** i)
    bk = b * (2 ** (k-i))
    ak = a * ((2 ** (k - i - (k - i))))
    if ck > bk > ak:
        print('Yes')
        sys.exit()
print('No')
# Judge status: Wrong Answer
# coding:utf-8
coin = int(input())
reward = (coin // 500) *1000
reward += int(((coin - (reward / 2)) // 5) * 10)
print(reward)
# Judge status: Accepted
# coding: utf-8
L, R = map(int, input().split())
mod = 2019
ans = float("inf")
for i in range(L, R + 1):
    i_mod = i % mod
    if i_mod == 0:
        ans = 0
        break
    for j in range(i + 1, R + 1):
        j_mod = j % mod
        if j_mod == 0:
            ans = 0
            break
        else:
            ans = min(ans, i * j % mod)
print(ans)
# Judge status: Wrong Answer
s = list(input())

t = list(reversed(s))

x = 0

for i in range(len(s)):

    if s[i] != t[i]:
        x += 1
        
print(x)
# Judge status: Accepted
s=list(input())

k=int(input())

ans = []

for alf in s:
    if alf == 'a':
        ans.append('a')
    else:
        if 123 - ord(alf) <= k:
            k -= 123 - ord(alf)
            ans.append('a')
        else:
            ans.append(alf)
if 0 < k:
    amari = (ord(ans[-1])-97+k)%26
    ans[-1] = chr(amari+97)
    
print(''.join(map(str,ans)))
# Judge status: Accepted
n=int(input())
a=input().split()
cnt=0
for i in range(0,n,2):
    if(int(a[i])%2!=0):
        cnt=cnt+1
print(cnt)
# Judge status: Accepted
N = int(input())

if N % 2 == 0:
    ans = 0.5
else:
    ans = (N//2 + 1)/N

print(ans)
# Judge status: Accepted
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

N = int(input())
A = list(map(int, input().split()))
acc = [0] * (N + 1)
for i in range(1, N + 1):
    acc[i] = acc[i - 1] + A[i - 1]

ans = INF
for i in range(1, N):
    left = acc[i]
    right = acc[-1] - acc[i]
    ans = min(ans, abs(left - right))
print(ans)
# Judge status: Wrong Answer
import math
X, Y = [int(x) for x in input().split()]
a = math.log2(Y/X)
print(int(a) + 1) if a.is_integer() else print(math.ceil(a))
# Judge status: Accepted
c = str(input())
print(chr(ord(c)+1))
# Judge status: Wrong Answer
from bisect import bisect_left, bisect_right
from itertools import combinations_with_replacement

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

li = list(combinations_with_replacement(l, 2))
li = [x for x in li if x[0] != x[1] and x[1] != max(l)]

ans = 0
for small, mid in li:
    right = bisect_right(l, small + mid - 1)
    left = bisect_left(l, mid)
    ans += max(right - left - 1, 0)

print(ans)
# Judge status: Wrong Answer
N,T=map(int, input().split())
minC = 1000
for i in range(N):
  c,t=map(int, input().split())
  if t<=T and c<minC:
    minT = c
print(c)
# Judge status: Accepted
a = []
 
def dfs(x):
    if x > 3234566667:
        return
    a.append(x)
    for i in range(10):
        if abs(x%10-i) <= 1:
            dfs(x*10+i)

for i in range(1, 10):
  dfs(i)
a = sorted(a)
k = int(input())
print(a[k-1])
# Judge status: Wrong Answer
n, l = map(int, input().split())
list = []
for s in range(n - 1):
  list.append(input())

print(sorted(list))
# Judge status: Wrong Answer
from collections import deque

N,K = map(int,input().split())
H_input = list()
H = deque(maxlen=K)
count = 0

for i in range(N):
    H_input.append(int(input()))
H_input.sort()

for h in H_input:
    if count <= K:
        H.append(h)
    else:
        if abs(H[0]-H[K]) >= abs(H[1]-h):
            H.append(h)
# print(H)
print(abs(H[0]-H[K-1]))
# Judge status: Wrong Answer
a, b = map(int, input().split())
print('Possible' if not (a // 3) or not (b // 3) or not ((a + b) // 3) else 'Impossible')
# Judge status: Accepted
x = int(input())

if x % 11 == 0:
    res = (x // 11) * 2
elif x % 11 <= 6:
    res = (x // 11) * 2 + 1
else:
    res = (x // 11) * 2 + 2

print(res)
# Judge status: Accepted
import bisect

N = int(input())
ans = 0
X = [int(input())for _ in range(N)]
A = []
for a in X[::-1]:
    if len(A) == 0:
        A.append(a)
    elif A[-1] <= a:
        A.append(a)
    else:
        i = bisect.bisect_right(A, a)
        A[i] = a

print(len(A))
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
B_C = B - C
if (B_C % A == 0):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
def main():
    n = int(input())
    joushi = list(map(int,input().split()))
    lst = [0] * n
    for i,j in enumerate(joushi):
        lst[j-1] += 1

    for n in lst:
        print(n)

main()
# Judge status: Accepted
A,B,C=map(int,input().split())

if A+B+C<=21:
    print('win')
else:
    print('bust')
# Judge status: Accepted
K = int(input())

a = 7 % K

for i in range(999983):
    if a == 0:
        print(i+1)
        exit()
    a = (a * 10 + 7) % K

print(-1)
# Judge status: Wrong Answer

def main():
    s = input()
    ans = 0
    seq = 0
    for c in s:
        if c == 'A' or c == 'C' or c == 'T' or c == 'G':
            seq+=1
        else:
            ans = max(ans,seq)
            seq=0
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
inp = list(map(int, input().split()))
if inp[0]/inp[2]<inp[1]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 6)
def input():
	return sys.stdin.readline()[:-1]

n, m = map(int, input().split())
H = list(map(int, input().split()))

edge = [[] for i in range(n)]

for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)

cnt = 0
for i in range(n):
	h = H[i]
	flag = 1
	for nxt in edge[i]:
		# print(nxt)
		# print(H)
		if H[nxt] >= h:
			flag = 0
			break
		elif H[nxt] < h: continue
	if flag: cnt += 1

print(cnt)
# Judge status: Accepted
a, b = input().split()
a = int(a)
b = int(b)

if a > b:
  print('safe')
else:
  print('unsafe')
# Judge status: Wrong Answer
n = int(input())
x = n * 800
y = n / 15
ans = int(x) - int(y*200)
print(str(ans))
# Judge status: Wrong Answer
#57
import decimal
a,b = map(int,input().split())

for i in range(1,10001):
    num1 = int(i*decimal.Decimal("0.08"))
    num2 = int(i*decimal.Decimal("0.1"))
    if num1 == a and num2 == b:
        print(i)
        break
    if i*decimal.Decimal("0.08") > a:
        print("-1")
        break
# Judge status: Accepted
def main3():
    n = int(input())
    s = input()

    ans = s.count("R") * s.count("B") * s.count("G")
    for i in range(n):
        for j in range(i, n):
            k = 2 * j - i
            if k >= n: break
            if s[i] != s[j] and s[j] != s[k] and s[i] != s[k]:
                ans -= 1

    print(ans)

if __name__ == '__main__':
    main3()
# Judge status: Accepted
from math import factorial
n, m = map(int, input().split())
MOD = 1000000007
if abs(n - m) == 1:
    ans = max(n, m)
elif n == m:
    ans = 2
else:
    ans = 0
ans *= ((factorial(min(n, m)) % MOD)) ** 2
ans %= MOD
print(ans)
# Judge status: Accepted
x=sum(list(map(int,input().split())))
if x>=24:
  x-=24
print(x)
# Judge status: Wrong Answer
s=input()
if s=='Sunny':
  print('Cloudy')
if s=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
# Judge status: Wrong Answer
ABCD = [int(s) for s in list(input())]
operators = ["-", "+"]
for bit in range(1 << 3):
    ops = [(bit >> i) & 1 for i in range(3)]
    tmp = ABCD[0]
    for op, val in zip(ops, ABCD[1:]):
        if op:
            tmp += val
        else:
            tmp -= val
    if tmp == 7:
        print(ABCD[0], end="")
        for op, val in zip(ops, ABCD[1:]):
            print(operators[op], val, sep="", end="")
            print("=7")
        exit()
# Judge status: Accepted
n = int(input())
c = input()
r = 0
for i in range(len(c)):
    if c[i] == "R":
        r += 1
m_w = 0
for i in range(r):
    if c[i] == "W":
        m_w += 1
print(m_w)
# Judge status: Accepted
n,a,b=map(int,input().split())
print((n//(a+b))*a + min(n%(a+b),a))
# Judge status: Accepted
n, t = map(int, input().split())
ans =[]
for i in range(n):
  a, b = map(int, input().split())
  if b <= t:
    ans.append(a)
if len(ans) ==0:
  print('TLE')
else:
  print(min(ans))
# Judge status: Accepted
from functools import reduce
import fractions
n=int(input())
lst=list(map(int,input().split()))
print(reduce(fractions.gcd, lst))
# Judge status: Wrong Answer
import math
N = int(input())
max_l = len(str(N))
cnt = 0
for n in range(1, N+1):
    str_n = str(n)
    f_n, l_n = str_n[0], str_n[-1]
    if(f_n == '0' or l_n == '0'):
        continue
    if(f_n == l_n):
        cnt += 1
    i = 0
    while(int(l_n +'0'*i + f_n)<=N):
        cnt += min(math.ceil((N-int(l_n +'0'*i + f_n))/10), 10**i)
        i += 1

print(cnt)
# 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,b,k=INTM()
    if k<=a:
        a=a-k
    elif k<=a+b:
        b=b-(k-a)
        a=0
    else:
        a,b=0,0
    print(a,b)
if __name__ == '__main__':
    do()
# Judge status: Accepted
import math
k =  int(input())
ans = 0

for a in range(1, k+1):
    for b in range(1, k+1):
        if math.gcd(a, b) == 1:
            ans += k
        else:
            for c in range(1, k+1):
                ans += math.gcd((math.gcd(a, b)), c)

print(ans)
# Judge status: Wrong Answer
S = input()
print(S[0])
s = []
for i in range(len(S)):
  s.append('x')
print(''.join(s))
# Judge status: Wrong Answer
a,b=input().split()
a=str(a)
b=str(b)
c=a+b
c=int(c)
for i in range(1,101):
    ans=i*i
    if ans==c :
        print("Yes")
        break
    if i==100:
        print("No")
# Judge status: Wrong Answer
n = int(input())
print(int(1/2*(n-1)*n))
# Judge status: Accepted
n = int(input())
mod = 10**9+7
a = list(map(int,input().split()))
m = 2**59
ans = 0
for i in range(60):
    c0 = 0
    c1 = 0
    for j in range(n):
        if a[j]//m == 1:
            c1 += 1
            a[j] -= m
        else:
            c0 += 1
    ans += (c0*c1*m)%mod
    #print(c0,c1,m,ans)
    ans %= mod
    m //= 2
print(ans)
# Judge status: Accepted
S = list(input())
N = len(S)
len0 = S.count('0')
len1 = S.count('1')
rm = min(len0,len1)
print(2*rm)
# Judge status: Wrong Answer
n = input() 
sum = 0
for i in range(len(n)):
  sum += int(i)
if(sum%9 == 0):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a)
print(b)
for i in a:
  if i==b[-1]:
    print(b[-2])
  else:
    print(b[-1])
# Judge status: Accepted
N, K = map(int, input().split())
d = 0
A = []
l = [1]*N
for i in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for j in range(len(A)):
    l[A[j]-1] = 0
    
print(sum(l))
# Judge status: Accepted
n,m=map(int,input().split())
if n>=13:
  print(m)
elif n>=6:
  print(m//2)
else:
  print(0)
# Judge status: Wrong Answer
import sys
s=0
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a=sum(A)
b=sum(B)
k=0
if a>b:
  print("No")
  sys.exit()
for i in range(N):
  if A[i]-B[i]>0:
    s+=A[i]-B[i]
    k+=1
  elif abs(A[i]-B[i])%2==1:
    k+=1
if b-a<s:
  print("No")
  sys.exit()
if k==N:
  print("No")
  sys.exit()
else:
  print("Yes")
# Judge status: Accepted
K,X = map(int, input().split())
for i in range((K*2)-1):
    print((X-K)+(i+1), end = ' ')
# Judge status: Accepted
n,k = map(int,input().split())
h = sorted(list(map(int,input().split())))#小から右へ
ans = 0
if n-k-1 >= 0:
    print(sum(h[:n-k]))
    exit()
print(ans)
# Judge status: Accepted
N = int(input())
s = [input() for _ in range(N)]
M = int(input())
t = [input() for _ in range(M)]

cnt = 0
for x in s:
    cnt = max(s.count(x) - t.count(x), cnt)
print(cnt)
# Judge status: Wrong Answer
n,m = map(int,input().split())
print((max(1,n-2))*(max(1,m-2)))
# Judge status: Wrong Answer
N = int(input())
s = N+1
import math
m = int(math.sqrt(N))
for i in range(2,m):
  if N%i==0:
    a = i
    b = N/a
    s = min(a+b, s)
print(int(s)-2)
# Judge status: Wrong Answer
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

import math

n = ni()
nn = n
mn = 10**12
nums = [1]

i=2
while i<=math.ceil(math.sqrt(n)+1):
  nums.append(i)
  i+=1

for num in nums:
  other = nn//num
  mn = min(mn, num+other-2)

print(mn)
# Judge status: Accepted
from bisect import bisect,bisect_left
N=int(input())
A=sorted(list(map(int,input().split())))
B=sorted(list(map(int,input().split())))
C=sorted(list(map(int,input().split())))
ans=0
for b in B:
  i=bisect_left(A,b)
  j=bisect(C,b)
  ans+=i*(N-j)
print(ans)
# Judge status: Accepted
from sys import exit, stdin

input = stdin.readline
import copy

# from collections import deque,Counter
import numpy as np

nmod = 1000000007

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

ans = 0
tsum = 0
for i in range(N - 1, 0, -1):
    tsum += A[i]
    tsum %= nmod
    tmp = (A[i - 1] * tsum) % nmod
    ans += tmp
    ans %= nmod

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

# print(a[-1])

hon = ['2', '4', '5', '7', '9']
pon = ['0', '1', '6', '8']

for h in hon:
    if a[-1] == h:
        print('hon')

for p in pon:
    if a[-1] == p:
        print('pon')

if a[-1] == '3':
    print('bon')
# Judge status: Accepted
k = int(input())
if k % 2 == 0:
    print(int((k / 2) ** 2))
else:
    print((k // 2) * ((k // 2) + 1))
# Judge status: Wrong Answer
n = int(input())
A = sorted (list(map(int,input().split())))
x = A[0]

while True:
    for v in A:
        a = v%x
        if a != 0 and a < x:
            x = a
            continue
    break
print (x)
# Judge status: Wrong Answer
X = int(input())
up = 599
down = 400
i=8
while(X <= 400 and X >= 1999):
    if(X <= up and X >= down):
        print(i)
        break
    else:
        up += 200
        down += 200
        i-=1
# Judge status: Wrong Answer
A, B = map(int, input().split())
price = 0

if A<=5:
  price+=0
elif 6<=A<=12:
  price+=B/2
else:
  price+=B

print(price)
# Judge status: Accepted
a=input()
if a[-1] == "3":
  print("bon")
elif a[-1] == "0" or a[-1] == "1" or a[-1] == "6" or a[-1] == "8":
  print("pon")
else:
  print("hon")
# Judge status: Wrong Answer
A, s, C = input().split()
print(A + s[0] + C)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()
free=0
cset=set()
for rate in a:
    color = int(rate / 400)
    if color >=8:
        free+=1
    else:
        cset.add(color)

colormin=len(cset)
colormax=colormin+free

print(str(max(1,colormin)), colormax)