peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
count = 0
ans = []
dic = {}
n = int(input())
for i in range(n):
    s = input()
    number = dic.get(s, 0) + 1
    count = max(count, number)
    dic[s] = number
for key in dic:
    if dic[key] == count:
        ans.append(key)
ans.sort()
for k in ans:
    print(k)
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if l[i] != l[j] and l[j] != l[k]:
        if i + j > k:
          if j + k > i:
            if k + i > j:
              ans += 1
              
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
c = 0
m = int(input())
pf={}
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
for i in pf:
    for j in range(pf[i]):
        pf[i] -= j + 1
        c += 1
        if pf[i] < 0:
            c -= 1
            break
        elif pf[i] == 0:
            break
print(c)
# Judge status: Accepted
N,M,K = map(int,input().split())
ans = "No"

for k in range(N+1):
  for l in range(M+1):
    if k*(M-l) + l*(N-k) == K:
      ans = "Yes"
print(ans)
# Judge status: Wrong Answer
import math

a, b, x = map(int,input().split())

if 2 *x <= a *b **2:
    p1 = a * b ** 2
    p2 = 2 * x
else:
    p1 = 2 * (a ** 2 * b - x)
    p2 = a ** 3

sit = math.atan(p1 / p2)
print(math.degrees(sit))
# Judge status: Wrong Answer
from queue import deque
 
    
S = deque(input())
y = 2019
U = [0] * y
t = int(S.pop())
U[0] = 1
k = 10

for s in reversed(S):
    t = t + int(s) * k
    t %= y
    U[t] += 1
    k *= 10
    k %= y

cnt = 0
for u in U:
    cnt = cnt + u * (u - 1) // 2

print(cnt)
# Judge status: Wrong Answer
N = int(input())
A = [int(input()) for _ in range(N)]

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

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

print(ans)
# Judge status: Wrong Answer
N,K=map(int, input().split())
A = list(map(int, input().split()))
where = [0 for k in range(N)]
where[0]=1
loop=0
for k in range(N):
    where[k+1] = A[where[k]-1]

    if where[k+1] in where[0:k]:
        li = where[0:k]
        end = k+1
        start = li.index(where[k+1])
        loop = end -start

        break
loopbefore = K -end

loopafter = loopbefore%loop

where2 = [where[end]]
for k in range(loopafter):
    where2.append(A[where2[k]-1])
print(where2[-1])
# Judge status: Accepted
a,b = map(int,input().split())

list = [2,3,4,5,6,7,8,9,10,11,12,13,1]

if list.index(a) > list.index(b):
  print('Alice')
elif list.index(a) == list.index(b):
  print('Draw')
else:
  print('Bob')
# Judge status: Accepted
from collections import Counter
N,K=map(int,input().split())
B=Counter(input().split())

count=0
values=sorted(B.values())
for i in range(len(B)-K):
    count+=values[i]
    

print(count)
# Judge status: Accepted
S = input()

count = 1
i = 1
word = S[0]
while i < len(S):
    if word != S[i]:
        word = S[i]
        i += 1
    else:
        word = S[i: i+2]
        i += 2
    count += 1

if i != len(S):
    count -= 1
print(count)
# Judge status: Wrong Answer
N,K=map(int,input().split())
a=(N*(N+1)*(N+2)-(K*(K-1)*(3*N-2*K+4)))/6
print(a%(10**9+7))
# Judge status: Accepted
n=int(input())
s=input()

ecount=s.count("E")
wcount=0
mn=n
for i in range(n):
    if s[i]=="E":
        ecount-=1
        count=ecount+wcount
        if mn>count:
            mn=count
    else:
        count=ecount+wcount
        if mn>count:
            mn=count
        wcount+=1

print(mn)
# Judge status: Wrong Answer
A = list(map(int, input().split()))
print(A.index(0))
# Judge status: Accepted
import sys
input = sys.stdin.readline
n,m=map(int,input().split())
num=[0]*(n+1)
numcnt=[0]*(n+1)
ans=0
cnt=0
for i in range(m):
    p,s=map(str,input().split())
    p=int(p)
    if s=="WA":
        num[p]+=1
    if s=="AC" and numcnt[p]!=1:
        ans+=num[p]
        cnt+=1
        numcnt[p]=1
print(cnt,ans)
# Judge status: Wrong Answer
def main():
    n, m = [int(i) for i in input().split()]
    a = [int(i) for i in input().split()]
    
    bc = []
    for _ in range(m):
        b, c = map(int, input().split())
        bc.append((b, c))

    total = 0
    for num, v in sorted(bc, key=lambda x: x[-1]):
        total += num
        a.extend([v]*num)
        if total >= n:
            break
    print(sum(sorted(a)[-n:]))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import math

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

res = 0

for x in range(k+1):
    for y in range(k+1):
        if x+y < s:
            z = s - x - y
            res += 1

print(res)
# Judge status: Accepted
import numpy as np

N,M,X = map(int,input().split())
A = np.array([list(map(int,input().split())) for _ in range(N)])
c = 10**10

for i in range(2**N):
    C = np.array([0]*(M+1))
    for j in range(N):
        if ((i >> j) & 1):
            C += A[j]
    for j in range(1,M+1):
        if C[j] < X:
            break
    else:
        c = min(c,C[0])

if c == 10**10:
    print(-1)
else:
    print(c)
# Judge status: Accepted
#入力
S = input()
#扱いやすくするためリスト化
ls = list(S)
#反転させたものもリスト化する
lsr = list(reversed(ls))
count = 0
#反転前後リストで不一致の要素数をカウント
for i in range(len(ls)):
  if ls[i] != lsr[i]:
    count += 1
#結果(書いてみればわかるが1つ書き直すべき時は反転させたリストと元のリストは2つ不一致が生まれる)
print(count//2)
# Judge status: Accepted
N=int(input())
L=sorted(list(map(int,input().split())))
ans=0
for i in range(0,N-1):
    for j in range(i+1,N):
        D=L[i]+L[j]
        l=j
        r=N
        while r-l>1:
            med=(l+r)//2
            if D>L[med]:
                l=med
            else:
                r=med
        ans+=l-j
print(ans)
# Judge status: Accepted
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
for i in range(n):
  a[i] = a[i]-(i+1)
b = int(np.median(a))
ans = 10**18
ans_lis = [b-1, b, b+1]
for i in ans_lis:
  ans = min(ans, np.sum(np.abs(a-i)))
  
print(ans)
# Judge status: Wrong Answer
mod = 10 ** 9 + 7
n, a, b = map(int, input().split())

comb = [1] * (b + 1)
for i in range(b):
  comb[i+1] = comb[i] * (n - i) // (i + 1) % mod

count = pow(2, n, mod) - 1 - comb[a] - comb[b]
print(count % mod)
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(1,n+1):
  if hoge[j] == 0:
    continue
  else:
    hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))
# Judge status: Accepted
A,B,C=map(int, input().split())
if A<C and B>C:
  print('Yes')
elif B<C and A>C:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N=int(input())
sup=[]
for i in range(0,N):
    sup.append(str(input()))
print(len(list(set(sup))))
# Judge status: Accepted
N, K = map(int, input().split())
p = [int(x) for x in input().split()]
p.sort()

price = 0
if N > 0:
    for j in range(K):
        price += p[j]
print(price)
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())

print(int((a + b) * h / 2))
# Judge status: Wrong Answer
s = list(input())
k = 0
for i in range(0,len(s),2):
    if s[i] == ('R' or 'U' or 'D'):
        k = 1
for j in range(1,len(s),2):
    if s[j] == ('L' or 'U' or 'D'):
        k = 1
    else:
        k = 0
        
if k==1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
tb = [[0 for _ in range(10)] for _ in range(10)]
for i in range(1,n+1):
  t = int(str(i)[0])
  b = int(str(i)[-1])
  tb[t][b] += 1
ans = 0
for l in range(10):
  for m in range(10):
    ans += tb[l][m] * tb[m][l]
print(ans)
# Judge status: Accepted
w = ["Sunny", "Cloudy", "Rainy"]
s = input()
print(w[(w.index(s) + 1) % 3])
# Judge status: Wrong Answer
n = int(input())
a = list(map(int , input().split()))
b = [a[i] - (i+1) for i in range(n)]
print(b)
b.sort()

ans = 10 ** 10
for j in range(3):
    bi = b[((n-1)//2+j)%n]
    s = 0
    for i in range(n):
        s += abs(b[i] - bi)
    print(((n-1)//2+j)%n, s)
    ans = min(ans, s)
print(ans)
# Judge status: Wrong Answer
N = int(input())
H = list(map(int, input().split()))
 
a, b = 0, 0
for i in range(N-1):
  if H[i] >= H[i+1]: b += 1
  else:
    a = max(a, b)
    b = 0
print(a)
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            total = 500 * i + 100 * j + 50 * k
            if X == total:
                ans += 1

print(ans)
# Judge status: Wrong Answer
import math

x,y = map(int,input().split())

num = y//x
ans = int(math.log2(num)) + 1

print(ans)
# Judge status: Accepted
s = int(input())
mod = 10**9 + 7

f = [0]*2001
g = [0]*2001

f[3]=1
f[4]=1
g[3]=1
g[4]=2

for i in range(4,s+1):
    f[i]=1 + g[i-3]
    f[i]%=mod
    g[i]=f[i] + g[i-1]
    g[i]%=mod
print(f[s])
# Judge status: Accepted
W, H ,x, y = map(int, input().split())
if W == H:
  if x == W/2 and y == H/2:
    can = 1
  else:
    can = 0
else:
  if x == W/2 or y == H/2:
    if x == W/2 and y == H/2:
      can = 1
    else:
      can = 0
  else:
    if y == (H/W)*x or y == (-H/W)*x:
      can = 0
    else:
      can = 1
 
print('{:.9f}'.format(W*H/2), can)
# Judge status: Wrong Answer
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print("NO")
    exit()

d = abs(A - B)
s = V - W

if d < s * T:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n,k=map(int,input().split())
s=input()
t=s[0]
ans=0
u=0
f=True
for i in range(1,n):
    if t==s[i]:
        ans+=1
    else:
        t=s[i]
        if f:
            f=False
        else:
            f=True
            u+=1
if k<=u:
    ans+=2*k
if k>u:
    ans=n-1
print(ans)
# Judge status: Wrong Answer
X, Y = map(int, input().split())

print(X + (Y / 2))
# Judge status: Wrong Answer
a, b = map(int, input().split())
c= a*b
if c%2 == 0:
    print('even')
else:
    print('odd')
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
mod=10**9+7
ans=pow(sum(l)%mod,2,mod)
for i in range(n):
    ans-=l[i]**2
    ans%=mod
ans*=pow(2,mod-2,mod)
print(ans%mod)
# Judge status: Wrong Answer
N=int(input())
dp=[[0]*3 for i in range(N+1)]
for i in range(1,N):
  a=list(map(int,input().split()))
  for j in range(3):
    for k in range(3):
      if j==k:
        continue
      dp[i][k]=max(dp[i][k],dp[i-1][j]+a[k])
print(max(dp[-1]))
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
ge = []
l = 1
r = n-1
for i in range(m):
    if i%2:
        ge.append(l)
    else:
        ge.append(r)
    l += 1; r -= 1
ge.sort(reverse = True)
for i in range(m):
    print(i+1,i+1+ge[i])
# Judge status: Wrong Answer
ans = 6
for _ in range(2):
    a = int(input())
    ans += a
print(6 - ans)
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(M):
    N -= A[i]
if N>=0:
    print(N)
elif N < 0:
    print(-1)
# Judge status: Wrong Answer
a=list(map(int,input().split()));print("NYoe s"[sum(a)//2in a::2])
# Judge status: Wrong Answer
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    S = input()
    T = input()

    check = {}
    for s, t in zip(S, T):
        if check.get(t, 0) != 0:
            if check.get(t) != s:
                print("No")
                break
        else:
            check[t] = s
    else:
        print("Yes")


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
S = str(input())
if S == "AAA":
  ans = 'No'
elif S == "BBB":
  ans = 'No'
else:
  ans = 'Yes'
print(ans)
# Judge status: Wrong Answer
a,b = map(int, input().split())
print(((a+b)//2)+1)
# Judge status: Accepted
from heapq import heappush, heappop
from math import ceil, floor
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

ng, ok = 0, 10 ** 9
for _ in range(50) :
  mid = (ng + ok) / 2
  ret = 0
  for a in A :
    ret += floor(a / mid)
  if ret <= K :
    ok = mid
  else :
    ng = mid
    
print(ceil(ng))
# Judge status: Accepted
x=int(input())
if x==3 or x==5 or x==7:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
from math import ceil
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = ceil((N-1)/(K-1))
print(ans)
# Judge status: Accepted
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

a, b, c = lr()
answer = a * b // 2
print(answer)
# Judge status: Accepted
import math 
import collections

N = int(input())
String = []
for i in range (0, N):
	S = str(input())
	S = sorted(S)
	V = str(S[0])
	for j in range (1, 10):
		V = V+str(S[j])
	String.append(V)
    
cnt = collections.Counter()
for word in String:
	cnt[word] += 1

V = cnt.most_common()

count = 0

for i in range (0, len(V)):
	count+=math.comb(V[i][1], 2)
    
print(count)
# Judge status: Accepted
x = int(input())
ans = "YES" if (x == 3 or x == 5 or x == 7) else "NO"
print(ans)
# Judge status: Accepted
nim = int(input())

data = input()

result = ""

for i in data: result+=chr(65+(ord(i)-65+nim)%26)
print(result)
# Judge status: Accepted
n=int(input())
s=list(input())
k=[0]
for i in range(0,n):
    if s[i]=='I':k.append(int(k[i]+1))
    else:k.append(int(k[i]-1))
print(max(k))
# Judge status: Accepted
alpha = input()
ans = 'A' if alpha.isupper() else 'a'
print(ans)
# Judge status: Accepted
# C - Build Stairs

N = int(input())
H = [int(h) for h in input().split()]
ans = 'Yes'
for i in range(1, N):
    if H[i - 1] <= H[i] - 1:
        H[i] -=1
    if H[i] < H[i - 1]:
        print('No')
        break
else:
    print('Yes')
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    r=int(input())
    ans=r**2
    print(ans)
    
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

W,H,N = list(map(int,input().split()))
x0 = 0
y0 = 0
x1 = W
y1 = H

for i in range(N):
    x,y,a = list(map(int,input().split()))

    if a == 1:
        x0 = max(x,x0)
    elif a == 2:
        x1 = min(x,x1)
    elif a == 3:
        y0 = max(y,y0)
    elif a == 4:
        y1 = min(y,y1)
X = [x0,x1,y0,y1]

print(max(0,int((x1-x0)*(y1-y0))))
# Judge status: Wrong Answer
a = input()
b = int(a)

count = 0
for i in range(len(a)-1):
    ichi = b/10
    if ichi == 1:
        count+=1
    
    b %= 10

print(count)
# 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():
    n,m=INTM()
    a=LIST()
    print(max(n-sum(a),-1))
if __name__ == '__main__':
    do()
# Judge status: Accepted
a = int(input())
list = list(map(int, input().split()))

m=[0]*3
for i in list:
    if i%4==0:
        m[0]+=1
    elif i%2==0:
        m[1]+=1
    else:
        m[2]+=1

if(m[0]+1>=m[2]+m[1]%2):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if abs(c-a)<=d:
  print('Yes')
elif abs(b-a)<=d and abs(c-b)<=d:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = 2
X = [1,4]

ans = []
count = 0

for i in range(1,N+1):
    number = 0
    count = 0
    for j in X:
        number = number + ((j-i)**2)
        count = count + 1
        if N == count:
            ans.append(number)

print(min(ans))
# Judge status: Accepted
N = int(input())
count, n1, n2 = 0, 1, 9
while n1 <= N:
    if n2 <= N:
        count += n1 * 9
    else:
        count += (N - n1 + 1)
    n1, n2 = n1 * 100, n1 * 1000 - 1
print(count)
# Judge status: Accepted
N = int(input())

N = N + 1

N_str = str(N)

first_N = int(N_str[0]) - 1
num = len(N_str)-1

print(num*9+first_N)
# Judge status: Accepted
#n=int(input())
n,m=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

import math 
import heapq

hq=[(-1)*val for val in al]
heapq.heapify(hq)

for i in range(m):
    mx=(-1)*(heapq.heappop(hq))
    newval=math.floor(mx/2)
    heapq.heappush(hq,(-1)*newval)

print(-sum(hq))
# Judge status: Accepted
S = str(input())

str_keyence = "keyence"

if S.find("keyence")==0 or S.rfind("keyence")==len(S)-7:
  print("YES")
else:
  for i in range(1,7):
      #print(str_keyence[0:i],str_keyence[i:])
      #print(S.find(str_keyence[0:i]))
      #print(S.find(str_keyence[i:]))
      if S.find(str_keyence[0:i])==0 and S.rfind(str_keyence[i:])==len(S)-len(str_keyence[i:]):
          print("YES")
          break
  else:
      print("NO")
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
ans=0
l=1
for i in a:
  if i!=l:
    ans+=1
  else:
    l+=1
print(ans)
# Judge status: Accepted
D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in [0]*D]
k=[]
for i in range(D):
    l=-1
    p=0
    for j in range(26):
        q=s[i][j]-sum([c[a]for a in k])
        p=max([p,q])
        if p==q:
            l=j
    if l==-1:
        l=k[-1]
    k+=[l]
    print(l+1)
# Judge status: Wrong Answer
N, K = map(int, input().split())
S = list(input())
S[K-1].lower()
C = ''.join(S)
print(C)
# Judge status: Wrong Answer
N,M=map(int,input().split())
A=list(map(int,input().split()))
B=[0]*M
C=[0]*M
D=[]
for i in range(M):
    B[i],C[i]=map(int,input().split())
    D+=[C[i]]*B[i]
D.reverse()
A.sort()

for i in range(sum(B)):
    if A[i] < D[i]:
        A[i]=D[i]
    else:
        break
    if i==N-1:
        break
print(sum(A))
# Judge status: Wrong Answer
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


n = inp()

arr = inlist()
arr = sorted(arr)
n = int(n/2)
kl = int(arr[n-1])
kh = int(arr[n])
print(arr)
print(kl, kh)
print(max(0, kh-kl))
# Judge status: Accepted
N, M = map(int, input().split())

if N <= M/2:
    ans = N + (M - 2*N)//4
else:
    ans = M//2
print(ans)
# Judge status: Accepted
N = int(input())
cnt = 0
ans = 'No'
for i in range(N):
    x,y = [int(x) for x in input().split()]
    if x == y:
        cnt += 1
        if cnt == 3:
            ans = 'Yes'
    else:
        cnt = 0
        

print(ans)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

L, R, d = map(int, input().split())

ans = 0
for i in range(L, R+1):
    if i % d == 0:
        ans += 1
print(ans)
# Judge status: Accepted
n,m,k=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))

ans=0
for i in range(1,n+1):
  A[i]+=A[i-1]


for j in range(1,m+1):
  B[j]+=B[j-1]


b_cnt=m
for a_cnt in range(n+1):
  if A[a_cnt]>k:
    continue
  while A[a_cnt]+B[b_cnt]>k:
    b_cnt-=1 

  ans=max(ans,a_cnt+b_cnt)
print(ans)
# Judge status: Wrong Answer
S =  list(input())
S.sort()
S = set(S)
alphabet = list("abcdefghijklmnopqrstuvwxyz")

for i in alphabet:
    if i in S:
      if i == "z":
        print("None")
      else:
          pass
    elif i not in S:
        print(i)
        break
# Judge status: Wrong Answer
# お尻から見ていってはやく始まる方を数え上げれば良い
N = int(input())
data = []
for _ in range(N):
    X, L = map(int, input().split())
    data.append((X-L+1, X+L-1))
data.sort()

count = 1
j = N-1
for i in range(N-2, -1, -1):
    if data[i][1] <= data[j][0]:
        j = i
        count += 1
print(count)
# Judge status: Accepted
N, A, B = map(int, input().split())
S = input()
student_pass = A + B
abroad_student_pass = B
passed_students = 0
passed_students_abroad = 0


for status in S:
  if status == 'c':
    print('No')
  elif status == 'a':
    if passed_students < student_pass:
      print('Yes')
      passed_students += 1
    else:
      print('No')
  elif status == 'b':
    if passed_students < student_pass and passed_students_abroad < abroad_student_pass:
      print('Yes')
      passed_students += 1
      passed_students_abroad += 1
    else:
      print('No')
# Judge status: Accepted
k=int(input())
a,b=map(int,input().split())
f=0
for i in range(a,b+1):
    if i%k==0:
        f=1
print('OK' if f==1 else 'NG')
# Judge status: Wrong Answer
h1,m1,h2,m2,k=map(int,input().split())
print(h1*60+m1-k-m2-60*h2)
# Judge status: Accepted
x=int(input())
ans=0
for b in range(1,int(x**(1/2)+1)):
    for p in range(1,11):
        if b**p<=x and b**p>ans:
            ans=b**p
print(ans)
# Judge status: Accepted
S=int(input())
M=10**9
Q,R=divmod(S,M)

if R:
    print(0,0,M,1,M-R,Q+1)
else:
    print(0,0,M,1,0,Q)
# Judge status: Wrong Answer
N=int(input())
if (N%1000)>=500:
  print(1000-(N%1000))
else:
  print((N%1000))
# Judge status: Wrong Answer
x = int(input())
i = 1
while (i+1)**2 <= x:
    i += 1
print(i**2)
# Judge status: Wrong Answer
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
cnt = 0
for i in l:
    if d <= x:
        d += i
        cnt+= 1
    
    else:
        cnt -= 1
        print(cnt)
    
print(cnt)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
k = int(input())
list = [a, b, c]
max = max(list)
if a == max:
    print(b+c+a*2*k)
elif b == max:
    print(a+c+b*2+k)
else:
    print(a+b+c*2*k)
# Judge status: Accepted
N, x = map(int, input().split())
a_list = sorted(list(map(int, input().split())))

for i in range(N):
    x = x - a_list[i]
    if x < 0:
        break
if i == N-1 and x == 0:
    i += 1

print(i)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
A = sorted(A)
from bisect import bisect_left
ans = 0
for i in range(0, A[-1]+1):
  cnt = bisect_left(A, i+2) - bisect_left(A, i-1)
  ans = max(ans, cnt)
  #print(i, cnt)
print(ans)
# Judge status: Accepted
A, B, N = map(int, input().split())
r = min(B-1, N)
print(A*r//B)
# Judge status: Accepted
N=int(input())
A=map(int,input().split())
import math
from functools import reduce

print(reduce(math.gcd, A))
# Judge status: Accepted
n = int(input())
b = list(map(int,input().split()))
a = []
a.append(b[0])
for i in range(1,n-1):
    a.append(min(b[i],b[i-1]))
a.append(b[n-2])
print(sum(a))
# Judge status: Accepted
a,b=map(int,input().split())
if a>=13:
  print(b)
elif 6 <= a < 13:
  print(b//2)
else:
  print(0)
# Judge status: Accepted
s = input()

if s == "SUN":
    print(7)
elif s == "MON":
    print(6)
elif s == "TUE":
    print(5)
elif s == "WED":
    print(4)
elif s == "THU":
    print(3)
elif s == "FRI":
    print(2)
else:
    print(1)
# Judge status: Accepted
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
f = True
for i in range(X + 1, Y + 1):
    if x[-1] < i <= y[0]:
        f = False
        break
if f:
    print("War")
else:
    print("No War")
# Judge status: Wrong Answer
s=input()
l=[]
for ss in s:
  l.append(ss)
n=len(s)
cnt=0
i=0
while cnt<=n and i<=len(l)-2:
  if l[i]=='0' and l[i+1]=='1':
    if i<0:
      i=0
    cnt+=2
    del l[i:i+2]
    i=i-1
  elif l[i]=='1' and l[i+1]=='0':
    if i<0:
      i=0
    cnt+=2
    del l[i:i+2]
    i=i-1
  else:
    i+=1
print(cnt)
# Judge status: Accepted
A, B, C = map(int, input().split())

if A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
    print(0)
else:
    l = sorted([A, B, C])
    print(l[0]*l[1])
# Judge status: Wrong Answer
N,X,Y = map(int,input().split())
matrix = [[0 for n in range(0,N)] for nn in range(0,N)]
for n in range(N):
    for i in range(n+1,N):
        s = i+1
        d = n+1
        p1 = abs(s-d)
        p2 = abs(s-X)+abs(d-Y)
        p3 = abs(s-Y)+abs(d-X)
        matrix[n][i] = min(p1,p2,p3)
matrix = sum(matrix,[])
for n in range(1,N):
    print(matrix.count(n))