peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def mapt(fn, *args):
    return list(map(fn, *args))
  

a = [mapt(int, input().split(" ")) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]

for d in b:
    for i in range(3):
        for j in range(3):
            if d == a[i][j]:
                a[i][j] = True; continue

checksum = [i for i in zip(*a)]
checksum2 = [[a[0][0], a[1][1], a[2][2]]]
result = a + checksum + checksum2
print("Yes" if any(a == b == c == True for a, b, c in result) else "No")
# Judge status: Wrong Answer
X = int(input())
if X >= 40:
  print("NO")
else:
  print("YES")
# Judge status: Accepted

N = int(input())
a = list(input()) #１文字ずつ
# print(a)

allW=0
allR=0
for i in range(N):
    if a[i]=='W':
        allW+=1
    elif a[i]=='R':
        allR+=1
# print('allW,allR:',allW,allR)

W=0
R=allR
out = max(W,R)
ans = out
for shikiri in range(N):
    if a[shikiri] =='W':
        W+=1
    elif a[shikiri]=='R':
        R-=1
    out = max(W,R)
    ans = min(ans,out)
    # print('out,ans:',out,ans)

print(ans)
# Judge status: Wrong Answer
n = int(input())
a = input().split()
ar = list(reversed(a))
ans = []
if n == 1:
  print(a[0])
else:
  for i in range(0, n, 2):
    ans.append(ar[i])

  for i in range(0, n, 2):
    ans.append(a[i])

  print(' '.join(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(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
p = p[:X]
q = q[:Y]
r.extend(p)
r.extend(q)
r.sort(reverse=True)
ans = 0
for i in range(X+Y):
    ans += r[i]
print(ans)
# Judge status: Accepted
#071 b-not found
#A~ 65 65+26 a~97 97+26
s=input()
a=[chr(i) for i in range(97,97+26)]
flag=False
for i in range(26):
    if a[i] not in s:
        ans=i
        flag=True
    if flag:
        break
if flag:
    print(chr(97+i))
else:
    print("None")
# Judge status: Accepted
from math import gcd
a,b = map(int,input().split())
val = gcd(a,b)
print(a*b//val)
# Judge status: Wrong Answer
from collections import deque

s = input()
q = int(input())
r = 1
top = deque()
top.append(s)
for _ in range(q):
    inp = input()
    if inp[0] == "1":
        r *= -1
    else:
        o, f, c = inp.split()
        if f == "1" and r == -1 or f == "2" and r == 1:
            top.append(c)
        else:
            top.appendleft(c)
ans = "".join(top)
ans = ans if r == 1 else s[::-1]
print(ans)
# Judge status: Accepted
n = int(input())

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

c = 0
d = c
for i in range(n-1):
    if h[i] >= h[i+1]:
        c += 1
    else :
        d = max([c,d])
        c = 0

print(max([c,d]))
# Judge status: Accepted
l = list(map(int,input().split()))

l.sort()

print(sum(l[:2]))
# Judge status: Wrong Answer
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

def comb(n,r):
  return math.factorial(n)//math.factorial(r)//math.factorial(max(1,n-r))

n = readInt()
d = defaultdict(int)
for i in [input() for i in range(n)]:
  t = defaultdict(int)
  for j in i:
    t[j]+=1
  d[str(sorted(t))]+=1
ans = 0
#print(d)
for i in d:
  ans+=comb(d[i],2)

print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split())
s = [0] + list(input())

num_pass = 0
num_pass_foreign = 0

for i in range(1, n + 1):
	if s[i] == 'c':
		print('No')
	elif s[i] == 'a':
		if num_pass < a + b:
			print('Yes')
			num_pass += 1
		else:
			print('No')
	elif s[i] == 'b':
		if num_pass < a + b and num_pass_foreign < b:
			print('Yes')
			num_pass += 1
			num_pass_foreign += 1
		else:
			print('No')
# Judge status: Wrong Answer
N,C,K = map(int,input().split())
T = [int(input()) for i in range(N)]
T.sort()
busCount = 0
pCount = 0
time = 0
firstTime = 0
for i in range(N):
    time = T[i]
    if firstTime == 0:
        firstTime = T[i]
        busCount += 1
    pCount += 1
    if pCount == C:
        firstTime = 0
        pCount = 0
        continue
    if time >= firstTime + K:
        firstTime = T[i]
        busCount += 1
        pCount = 1
print(busCount)
# Judge status: Wrong Answer
n=int(input())
mod=10**9+7
l=list(map(int,input().split()))
d=len(str(bin(max(l))))-2
ll=[[0,0] for i in range(d)]
ans=0
for i in l:
  f=bin(i)[:1:-1]
  for v in range(len(f)):
    ll[-1-v][int(f[v])]+=1
for i,(a,s) in enumerate(ll):
  ans+=pow(2,i,mod)*a*s%mod
  ans%=mod
print(ans)
# Judge status: Accepted

N, K = map(int, input().split())

x = N % K
print(min(x, abs(K-x)))
# Judge status: Wrong Answer
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
    x = bisect.bisect_left(A, B[i])
    y = N-bisect.bisect_right(C, B[i])
    ans += x*y
print(ans)
# Judge status: Accepted
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
ans = 0
N = int(input())
for n in range(1, N+1):
    if n%2 != 0:
        if len(make_divisors(n)) == 8:
            ans += 1

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 20:47:07 2020

@author: ezwry
"""
import math

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

a.sort(reverse=1)

ans=[]

for i in range(n-1):
    jyun=math.ceil(i/2)
    ans.append(a[jyun])

answer=sum(ans)
print(answer)
# Judge status: Accepted
from functools import reduce

n = int(input())
v = sorted([int(i) for i in input().split()])
ret = reduce(lambda x, y: (x + y) / 2, v)
print (ret)
# Judge status: Accepted
n=int(input())
L=list(map(int, input().split()))
print('Yes' if max(L) < sum(L)-max(L) else 'No')
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if A%2==0 and C%2==0 or A%2==1 and C%2==1:
    print('YES')
elif A%2!=C%2:
    print('NO')
# Judge status: Accepted
s=input();print(sum(a>b for a,b in zip(s,s[::-1])))
# Judge status: Accepted
import sys
input = sys.stdin.readline
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for index, num in enumerate(A):
    B[num-1]=index+1
print(*B)
# Judge status: Wrong Answer
N=int(input())
a=[]
for i in range(N):
	a.append(int(input()))
k=max(a)
count=0
for j in range(N):
	if count==1:
		print(k)
	else:
		if a[j]==k:
			b=a[:j]+a[j+1:]
			count=1
			print(max(b))
# Judge status: Accepted
H, A = map(int, input().split())

tenpH = H
for n in range(10000):
    tenpH = tenpH - A

    if(tenpH <= 0):
        print(int(n+1))
        break
# Judge status: Wrong Answer
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[0 for i in range(n)]
dp[1] = dp[0] + abs(h[1]-h[0])
for i in range(2,n):
  choice=100000
  for j in range(max(i-k,0), i):
    tmp = dp[j]+abs(h[i]-h[j])
    if tmp < choice:
      choice = tmp
  dp[i] = choice
print(dp[n-1])
# Judge status: Wrong Answer
import bisect
n = int(input())
l = sorted(list(map(int,input().split())))
a = l[-1]/2
s = bisect.bisect_left(l,a)
k1 = l[s-1]
if len(l)==2 and l[0]==0:
  print(l[-1],0)
  exit()
k2 = l[s]
s1 = a-k1
s2 = a-k2
if s1<=s2:
  print(l[-1],k1)
else:
  print(l[-1],k2)
# Judge status: Accepted
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    a, b = LI()

    if a <= b:
        print(a)
    else:
        print(a - 1)

if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
N, K = map(int, input().split())
S = input()

S = S.replace(S[K-1], S[K-1].lower())
print(S)
# Judge status: Accepted
w,h,n = map(int, input().split())

o,p,q,r = 0,0,0,0
for _ in range(n):
  x,y,a = map(int, input().split())
  if a == 1:
    o = max(o, x)
  elif a == 2:
    p = max(p, w-x)
  elif a == 3:
    q = max(q, y)
  elif a == 4:
    r = max(r, h-y)

w -= o+p
h -= q+r
if w <= 0 or h <= 0:
  print(0)
else:
  print(w*h)
# Judge status: Accepted
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    n, x = map(int, input().split())
    aaa = list(map(int, input().split()))
    aaa.sort()
    ans = 0
    for a in aaa:
        if x < a:
            break
        ans += 1
        x -= a
    else:
        if x > 0:
            ans -= 1
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n, c, k, *t = map(int, open(0).read().split())
t.sort()
tmp = 0
cnt = 0
limit = t[0] + k
for time in t:
    if tmp == 3 or time > limit:
        limit = time + k
        tmp = 1
        cnt += 1
    else:
        tmp += 1
if tmp != 0:
    print(cnt + 1)
else:
    print(cnt)
# Judge status: Accepted
import sys
from itertools import combinations_with_replacement, product
import numpy as np
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    task=[]
    for _ in range(N):
        A,B=map(int, input().split())
        task.append([A,B])
    task.sort(key=lambda x: x[1])
    task=np.array(task)
    task[:,0]=task[:,0].cumsum()
    if all(task[:,0] <= task[:,1]):
        print('Yes')
    else:
        print('No') 

if __name__ == '__main__':
    main()
# Judge status: Accepted
N=int(input())
p=list(map(int,input().split()))
Q=sorted(p)
count=0
for i in range(N):
    if p[i]!=Q[i]:
        count+=1
if count<=2:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N, M = map(int, input().split())

ans = 0
if N == 1:
    if M == 1:
        ans = 1
    else:
        ans = M-2
elif M == 1:
    ans = N-2
else:
    ans = (N-2)*(M-2)

print(ans)
# Judge status: Accepted
a = int(input())
s = {a}
i=1
lenPrev=len(s)
while i<1000000:
  i+=1
  if a%2==0:
    a=a/2
  else:
    a=3*a+1
  s.add(a)
  
  if len(s) == lenPrev:
    print(i)
    break
  lenPrev=len(s)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i] == l[j] or l[j] == l[k] or l[k] == l[i]:
        continue
      a,b,c = l[i],l[j],l[k]
      if a+b > c and b+c > a and a+c>b:
        cnt += 1
print (cnt)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0

for i in range(N):
    ans += min(A[i], B[i])
    B[i] -= min(A[i], B[i])
    ans += min(A[i+1], B[i])
    A[i+1] -= min(A[i+1], B[i])

print(ans)
# Judge status: Wrong Answer
a, b, k = map(int, input().split())

ans = set()
for i in range(a, a+k):
    ans.add(i)
for i in range(b-k+1, b+1):
    ans.add(i)

ans = list(ans)
ans.sort()
for i in ans:
    print(i)
# Judge status: Accepted
import math
from functools import reduce

def gcd(*nums):
  return reduce(math.gcd, nums)

k = int(input())

total = 0

for i in range(1, k + 1):
  for j in range(i, k + 1):
    for l in range(j, k + 1):
      if i == j == l:
        total += i
      elif i == j and i != l:
        total += gcd(i, l) * 3
      elif i == l and i != j:
        total += gcd(i, j) * 3
      elif j == l and i != j:
        total += gcd(i, j) * 3
      else:
        total += gcd(i, j, l) * 6

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

for i in range(K):
  l = [0]*N
  for i in range(N):
    m,p = i-A[i],i+A[i]
    if p+1 <= N-1:
      l[p+1] -= 1
    if m >= 0:
      l[m] += 1
    if m < 0:
      l[0] += 1
  for i in range(N-1):
    l[i+1] += l[i]
  A = copy.deepcopy(l)
  if A[0] == N:
    break 
print(*A)
# Judge status: Accepted
if ['a', 'e', 'i', 'o', 'u'].count(input()):
    print('vowel')
else:
    print('consonant')
# Judge status: Accepted
n = int(input())
w = list(map(int,input().split()))
c,d,e = 0,sum(w),sum(w)
for i in range(n):
    c += w[i]
    d -= w[i]
    e =min(e,abs(c-d))
print(e)
# Judge status: Accepted
s = list(map(int, input()))
n = len(s)
p = 2019
ans = 0

s.reverse()
cum = [0] * (n+1)
for i in range(n):
    cum[i+1] = (cum[i] + s[i] * pow(10, i, p)) % p
t = [0] * p
for x in cum: t[x] += 1

for x in t:
    ans += x * (x-1) // 2
print(ans)
# Judge status: Wrong Answer
S=str(input())
min_dif = 1000
for i in range(len(S)-2):
  dif = abs( int(S[i:i+3]) - 754)
  if min_dif > dif:
    min_dif = dif
print(min_dif)
# Judge status: Accepted
N, M = map(int, input().split())

A_image = [input() for i in range(N)]
B_image = [input() for i in range(M)]
Flag = False

for i in range(N):
    for j in range(N): # 画像Aをすべてループ
        if i + M <= N and j + M <= N:
            temp = []
            for k in range(M):
                temp.append(A_image[i+k][j : j+M])
            if temp == B_image:
                Flag = True

if Flag is True:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
A,B=map(int,input().split())
l=[2*A-1,A+B,2*B-1]
print(l[0])
# Judge status: Accepted
s = input()
for i in range(1,len(s)):
    if s[:(len(s)-i)//2] == s[(len(s)-i)//2:-i]:
        print(len(s)-i)
        break
# Judge status: Wrong Answer
N, M = list(map(int, input().split(' ')))
A = list(map(int, input().split(' ')))

num = N - sum(A)
if num >= 0:
  print(num)
else:
  print(num)
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = [input().split() for i in range(m)]

solved = [False] * n
ac_cnt = 0
wa_cnt = 0

for i in range(m):
    cn, cj = int(a[i][0]) - 1, a[i][1]
    if not solved[cn]:
        if cj == 'WA':
            wa_cnt += 1
        else:
            ac_cnt += 1
            solved[cn] = True
print(ac_cnt, wa_cnt)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a>=13:
  print(b)
elif 6<=a and a<=12:
  print(b/2)
else:
  print(0)
# Judge status: Accepted
def main():
    s = input()
    f = True
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            f = False
    if f:
        print("Good")
    else:
        print("Bad")

if __name__ == "__main__":
    main()
# Judge status: Accepted
import bisect
N,M = map(int,input().split())
A = list(map(int,input().split()))

A.sort()
while M != 0:
    x = bisect.bisect_left(A,A[-1]/2)
    if N-x <= M:
        M -= N-x
        for i in range(x,N):
            A[i] = A[i]/2
        A.sort()
    else:
        for i in range(N-M,N):
            A[i] = A[i]/2
        M = 0
        A.sort()

print(sum(map(int,A)))
# Judge status: Wrong Answer
from math import ceil
A, B = map(int, input().split(' '))
x0 = ceil(A / 0.08)
x1 = ceil((A+1) / 0.08)
y0 = ceil(B / 0.1)
y1 = ceil((B+1) / 0.1)
if x1 < y0:
  print(-1)
else:
  print(min(max(x0, y0), min(x1, y1)))
# Judge status: Wrong Answer
import math
A, B, H, M = list(map(int, input().split()))

h_deg = (90 - (360 / 12) * H) * (math.pi/180)
m_deg = (90 - (360 / 60) * M) * (math.pi/180)

h_x = A * math.cos(h_deg)
h_y = A * math.sin(h_deg)
m_x = B * math.cos(m_deg)
m_y = B * math.sin(m_deg)

print(math.sqrt((h_x - m_x)**2 + (h_y - m_y)**2))
# Judge status: Accepted
# -*- coding: utf-8 -*-
 
A, B = map(int,input().split())
print(A*B)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int , input().split()))
b = list(set(a))
c = sum(b)
d = round(c / len(b))
if c / len(b) - d == 0.5 :
    d = d + 1
m = 0
for i in range (N):
    m = m +(a[i] - d)**2
if (N % 2) == 0 :
    p =(a[int((N / 2) - 1)] + a[int(N / 2)]) / 2
else:
    p = (a[int((N - 1) /2)])
q = round(p)
if p - q == 0.5 :
    p = p + 1
n = 0
for j in range (N):
    n = n +(a[j] - q)**2
if m > n:
    print(n)
else:
    print(m)
# Judge status: Wrong Answer
line=input().split(" ")
j=0
for i in line:
  j=j+1
  if i==0:
    print(j)
# Judge status: Accepted
n = int(input())

if n % 111 ==0:
    print(n)
    exit()

while n % 111 != 0:
    n += 1
    if n % 111 == 0:
        print(n)
        exit()
# Judge status: Wrong Answer
import math
n, k = list(map(int, input().split()))
print(math.ceil(n / (2 * k)))
# Judge status: Accepted
n = int(input())
a = list(map(lambda x: int(x)%4 , input().split()))

p = a.count(0)
q = a.count(2)
r = n-p-q

if r > p:
    if r -p == 1 and q == 0:
        print("Yes")
    else:
        print("No")
else:
    print("Yes")
# Judge status: Accepted
X=int(input())
ans=0
A=X//500
#print(A)
B=X-500*A
C=B//5
ans=A*1000+C*5
print(ans)
# Judge status: Accepted
def main():
    N = int(input())
    a = list(map(int,input().split(' ')))
    total = 0
    for i in range(N):
        if i % 2 == 0 and a[i] % 2 == 1:
            total += 1
    print(total)
main()
# Judge status: Wrong Answer
from sys import stdin
N = int(stdin.readline().rstrip())
A = []
for i in range(N):
    A.append(int(input()))
    
ans = 0

for j in range(N):
    ans += (A[j]//2)
    A[j] = (A[j]%2)
    
for k in range(1,N):
    ans += min(A[k-1],A[k])
    A[k] = A[k] - min(A[k-1],A[k])
    
print(ans)
# Judge status: Wrong Answer
N = int(input())
X = list(map(int, input().split()))

mini = min(X)
maxi = max(X)
consume = 10000

for i in range(mini, maxi):
    pos = i
    total = sum([(pos - j) ** 2 for j in X])
    consume = min(total, consume)

print(consume)
# Judge status: Wrong Answer
A,B,K = map(int,input().split())
for i in range(K):
  print(A+i)
for j in range(K-1,-1,-1):
  print(B-j)
# Judge status: Wrong Answer
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(1,len(a)):
    if a[i]+a[i-1]>x:
        ans+=a[i]+a[i-1]-x
        if a[i]>x:
            a[i]=0
        else:
            a[i]-=x
print(ans)
# Judge status: Accepted
N = int(input())
mod = 10**9+7

for i in range(1, N):
    N *= i
    N %= mod

print(N % mod)
# Judge status: Accepted
N, M = list(map(int, input().split(' ')))
r = [ None for i in range(N) ]

illegal = False
for i in range(M):
  s, c = list(map(int, input().split(' ')))
  if r[s-1] is not None and r[s-1] != c:
    illegal = True
    break
  r[s-1] = c

v = -1
if not illegal:
  for i in range(N):
    if r[i] is None:
      if i == 0 and N != 1:
        r[i] = 1
      else:
        r[i] = 0
  v = sum(r[i] * 10**(N-1-i) for i in range(N))
  if v < 10**(N-1) and not (N == 1 and v == 0):
    v = -1

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

import math
S = a * b
x /= a

if S < 2*x :
    tanT = 2 * (a * b - x) / (a**2)
else :
    tanT = b ** 2 / (2 * x)

T = math.degrees(math.atan(tanT))
print(T)
# Judge status: Accepted
from collections import Counter
N = int(input())
a = []
x = 2
while x ** 2 <= N:
    if N % x == 0:
        a.append(x)
        N /= x
        x = 2
    else:
        x += 1
else:
    if x <= N:
        a.append(int(N))

a = Counter(a)
ans = 0
for i in a:
    k = 1
    while True:
        if a[i] >= k:
            ans += 1
            a[i] -= k
            k += 1
        else:
            break

print(ans)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if abs(a-b)<=b and abs(b-c)<=b or abs(a-c)<=b:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def resolve():
    import itertools
    AE = [int(input()) for _ in range(5)]
    minA = float("inf")
    for ae in itertools.permutations(AE):
        sumA = 0
        for dish in ae:
            if sumA % 10 != 0:
                sumA += 10 - (sumA % 10)
            sumA += dish
        minA = min(minA, sumA)
    print(minA)


resolve()
# Judge status: Wrong Answer
N,M = map(int,input().split())
e = 0
li = [0]* N
for i in range(M):
    s,c = map(int,input().split())
    s -= 1
    if li[s] == 0:
        li[s] = c
    if li[s] != c:
        e = 1
    if (s == 1) and (c == 0):
        e = 1
if li[0] == 0:
    li[0] = 1
if e == 1:
    print("-1")
    exit()
a = ""
for i in li:
    a += str(i)
print(a)
# Judge status: Wrong Answer
N,K = map(int,input().split())
A = list(map(int,input().split()))
if K==1:
  for i in range(N):
    print('No')
else:
  left = 0
  right = K
  while True:
    if right>=N:
      break
    else:
      if A[right]>A[left]:
        print('Yes')
      else:
        print('No')

      left += 1
      right += 1
# Judge status: Accepted
k, s = map(int, input().split())
cnt = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if z >= 0 and z <= k:
            cnt += 1

print(cnt)
# Judge status: Wrong Answer
import math
n=int(input())
print(1000*math.ceil(n//1000)-n)
# Judge status: Wrong Answer
from numpy import pi
r = int(input('円の半径を入力してください>>'))
c = (r ** 2 * pi) / (1 ** 2 * pi)  #円の面積差
print(int(c))
# Judge status: Accepted
n = int(input())
v = 'abcdefghijk'

w = []
def dfs(s,t):
  if len(s) == n:
    w.append(s)
    return
  u = len(set(s))
  for i in range(u+1):
    dfs(s+v[i],u+1)

dfs('a',1)

for i in w:
  print (i)
# Judge status: Wrong Answer
s = input()
set_s = list(set(s))
ans = ''
if set_s.count('N') == set_s.count('S') == set_s.count('E') == set_s.count('W'):
    ans = 'YES'
elif len(set_s) == 2 and set_s.count('E') == set_s.count('W'):
    ans = 'YES'
elif len(set_s) == 2 and set_s.count('N') == set_s.count('S'):
    ans = 'YES'
else:
    ans = 'NO'
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())

print(min(abs(n % k), abs((n % k) - k)))
# Judge status: Wrong Answer
n, m = [int(x) for x in input().split()]
print('AC' if n == m else 'WA')
# Judge status: Wrong Answer
N,D=map(int,input().split())
if N%(2*D+1)==0:
  n=N%(2*D+1)
else:
  n=N//(2*D+1)+1
print(n)
# Judge status: Accepted
from heapq import heappush, heappop

n, m = map(int, input().split())
jobs = [[] for _ in range(10 ** 5 + 100)]
# 隣接リストっぽく
for i in range(n):
    a, b = map(int, input().split())
    jobs[a].append(b)

hq = []
res, j = 0, 0
for i in range(1, m + 1):
    for v in jobs[i]:
        heappush(hq, -v)
    if len(hq) > 0:
        res += -heappop(hq)
print(res)
# Judge status: Accepted
a,b,c = (map(int,input().split()))
L = [a,b,c]
M = L.sort()

print(L[-1]*10 + L[0] + L[1])
# Judge status: Accepted
a,b = input().split()
x = a + b
x = int(x)
for i in range(10000):
    if i * i == x:
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

q, r = divmod(a, b)

if r < c or r == 0:
    print('NO')
else:
    print('YES')
# Judge status: Wrong Answer
n = int(input())

if n % 3 == 0:
    print((n//3)**3)
else:
    a = n//3
    b = n//3
    c = n - a - b
    print(a * b * c)
# Judge status: Accepted
N= int(input())
A = list(map(int, input().split()))
res = 0
current = A[0]
for i in range(1, N):
    res += (current - A[i]) if current > A[i] else 0
    current = current if current > A[i] else A[i]
print(res)
# Judge status: Accepted
N=int(input())

b=0
for i in range(N):
  a=0
  for j in range(i+1):
   
    if a==9:
      b=b-1
      break
    if (i+1)%2!=0 and (i+1)%(j+1)==0:      
      a=a+1
    if a==8:
      b=b+1

print(b)
# Judge status: Wrong Answer

s=int(input())


if s%3==0:
    if s==3:
       print(3)
    else:
       print(0)
elif s%3==1:
  print(1)
else:
  print(2)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
A.sort()
l = 0
h = 0
i = n-1
while i >= 0:
    if i > 0 and A[i] == A[i-1] and l == 0:
        l = A[i]
        i -= 2
    elif i > 0 and A[i] == A[i-1] and h == 0:
        h = A[i]
        break
    else:
        i-=1
print (l*h)
# Judge status: Wrong Answer
a,b,x = map(int, input().split())
count = (b-a)//x
if a%x == 0 or a==0:
    count += 1

print(count)
# Judge status: Accepted
N,X,T =map(int,input().split())
ans =T*(N//X)
if N%X!=0:
  ans += T
print(ans)
# Judge status: Accepted
N,L=map(int,input().split())
ans=sum(sorted([L+i for i in range(N)],key=abs)[1:])
print(ans)