peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
s  = input()
#  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

query = list('keyence')

import re

for p in range(8):
    b = ''.join(query[:p])
    a = ''.join(query[p:])

    pattern1 = r'{}{}'.format(b, a)
    pattern2 = r'{}.*{}'.format(b, a)
    if re.findall(pattern1, s) or re.findall(pattern1, s):
        print('YES')
        break
else:
    print('NO')
# Judge status: Accepted
n,x=map(int,input().split())
l=list(map(int,input().split()))
list=[0]
cnt=0
for i in l:
  i=i+list[cnt]
  list.append(i)
  cnt+=1
ans=0
for i in list:
  if i<=x:
    ans+=1
print(ans)
# Judge status: Wrong Answer
s=input()
t=input()

ans=0
for i in range(len(s)):
    if s[i]==t[i]:
        ans+=1
print(ans)
# Judge status: Accepted
A,B,X=map(int,input().split())
if A+B>=X and A<=X:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
import fractions

n = int(input())
a = list(map(int, input().split()))
b = a[::-1]

left = [0, a[0]]
right = [0, b[0]]
l = a[0]
r = b[0]
for i in range(1, n):
    l = fractions.gcd(l, a[i])
    r = fractions.gcd(r, b[i])
    left.append(l)
    right.append(r)

gcd_max = 0
for i in range(n+1):
    gcd_tmp = fractions.gcd(left[i], right[n-i-1])
    if gcd_tmp > gcd_max:
        gcd_max = gcd_tmp

print(gcd_max)
# Judge status: Wrong Answer
from bisect import bisect_left
n=int(input())
A=[int(input()) for _ in range(n)][::-1]

DP=[A[0]]
for i in range(1,n):
    num=A[i]
    if num>=DP[-1]:
        DP.append(num)
    else:
        index=bisect_left(DP,num)
        DP[index]=num
print(len(DP))
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))

ok = True

for i in l:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            ok = False

if ok:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Accepted
from collections import defaultdict
n = int(input())
tuples = []
for i in range(n):
    a,b,c = map(int,input().split())
    tuples.append((a,b,c))
dp = [defaultdict(int) for _ in range(n+1)]
dp[0][3] = 0
for i in range(n):
    abc = tuples[i]
    for j in range(3):
        for k in dp[i].keys():
            if k != j:
                dp[i+1][j] = max(dp[i][k]+abc[j],dp[i+1][j])
print(max(dp[n].values()))
# Judge status: Accepted
a, b = map(int, input().split())
c = 0
for i in range(a, b+1):
  s = str(i)
  if s == s[::-1]:
    c += 1
print(c)
# Judge status: Wrong Answer
A,B = map(int,input().split())
for i in range(1,10**5):
  if i%A == 0 and i%B == 0:
    print(i)
    break
  else:
    i += 1
# Judge status: Accepted
a,b=map(int,input().split())

print((100**a)*b if b<100 else (100**a)*(b+1))
# Judge status: Accepted
M=10**9+7
x,y=map(int,input().split())
d,m=divmod(x+y,3)
if m or y>2*x or x>2*y: print(0); exit()
x-=d
y-=d
s=t=1
for i in range(min(x,y)):
  s=s*(x+y-i)%M
  t=t*(i+1)%M
print(s*pow(t,M-2,M)%M)
# Judge status: Accepted
import math
n=int(input())
A=list(map(int,input().split()))
num=1
brk=0
for i in range(n):
  if A[i]==num:
    num+=1
  else:
    brk+=1

if num==1 and brk!=0:
  print(-1)
else:
  print(brk)
# Judge status: Accepted
#Tenka1 Programmer Beginner Contest 2019 a
a,b,c=map(int,input().split())
if (a<c and c<b) or (b<c and c<a): 
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())

mod = 10**9+7

all = 10**n 

yobun = 9**n + 9**n- 8**n

ans = all-yobun

print(ans % mod)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))

L.sort()
count = 0
for i in range(N-2):
  a = L[i]
  for j in range(i+1, N-1):
    for k in range(j+1, N):
      b = L[j]
      c = L[k]
      b2 = b/a
      c2 = c/a
      if b2+c2 > 1 and abs(b2-c2) < 1:
        count += 1
      else:
        break
print(count)
# Judge status: Accepted
n, m = map(int, input().split())
if m >= 2*n:
    rem = m - 2*n
    print(n+rem//4)
else:
    print(m//2)
# Judge status: Accepted
# ABC079A
n = input()
print("Yes" if n[0]==n[1]==n[2] or n[3]==n[1]==n[2] else "No")
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
import sys
sys.setrecursionlimit(10**7)
def main():
  n=int(input())
  s=input()
  sw,sb=[0],[0]
  w,b=0,0
  for si in s:
    if si=='#':
      b+=1
    else:
      w+=1
    sw.append(w)
    sb.append(b)
  ans=n
  for i in range(n+1):
    ans=min(ans,sb[n]-sb[i]+sw[i])
  print(ans)
if __name__=='__main__':
  main()
# Judge status: Accepted
an = list(int(input()) for _ in range(5))
k = int(input())

if abs(an[4] - an[0]) <= k:
    print("Yay!")
else:
    print(":(")
# Judge status: Wrong Answer
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] + A[i+1] - x)
        A[i+1] -= max(A[i+1] - (A[i] + A[i+1] - x), A[i+1])

print(ans)
# Judge status: Accepted
s = list(input())
ls = len(s)
key = "keyence"
if "".join(s) == key:
    print("YES")
    exit()
f = False
for l in range(ls):
    for r in range(l + 1, ls):
        f |= "".join(["".join(s[:l]), "".join(s[r:])]) == key

print("YES" if f else "NO")
# Judge status: Accepted
a, b = (int(ab) for ab in input().split())
a_str = str(a)*b
b_str = str(b)*a
if a_str <= b_str:
    print(a_str)
else:
    print(b_str)
# Judge status: Accepted
from collections import Counter
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
c = Counter(A)
diff = len(c.keys()) - K
if diff<=0:
    print(0)
else:
    c_s = sorted(c.items(), key=lambda x: x[1])
    cnt=0
    for _, value in c_s:
        cnt += value
        diff -= 1
        if diff==0:
            break
    print(cnt)
# Judge status: Wrong Answer
k,a,b = map(int,input().split())
if a >= b+2:
  print(k+1)
else:
  d = k-(a-1)
  e = a
  e += (b-a)*(d//2)
  e += d%2
  print(e)
# Judge status: Accepted
a,b,c,d = input()
print("Yes" if (a==b and b==c) or (b==c and c ==d) else "No")
# Judge status: Wrong Answer
a=input()
b=input()
c=input()
n=a
while True:
  if n!="":
    k=n[0]
    if n==a:
      a=a[1:]
    elif k==b:
      b=b[1:]
    else:
      c=c[1:]
    if k=="a":
      n=a
    elif k=="b":
      n=b
    else:
      n=c
  else:
    if n==a:
      print("A")
    elif n==b:
      print("B")
    else:
      print("C")
    print(n)
    break
# Judge status: Accepted
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
for i in range(n):
  x-=a[i]
  if x < 0:
    n=i
    break
if x <=0:
  print(n)
elif x > 0:
  print(n-1)
# Judge status: Wrong Answer
n = int(input())

s = str(n)
val = 0

for letter in s:
    val += int(letter)

if val % 9 == 0 and val >= 9:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

sabun = []
for i in range(n):
    sabun.append([i + 1, abs((t- h[i] * 0.006) - a)])

res = float("inf")
for idx, j in sabun:
    if res > j:
        res = j
        ans = idx

print(ans)
# Judge status: Accepted
S = int(input())
x0,y0,x1,y1 = 0,0,10**9,1

if S % 10**9 == 0:
    x2, y2 = 0, S // 10**9
else:
    x2, y2 = 10**9 - (S % 10**9), S // 10**9 + 1

print(x0,y0,x1,y1,x2,y2)
# Judge status: Accepted
from collections import Counter
N=int(input())
D=list(map(int, input().split() ))
d=dict(Counter(D))
p=998244353
#print(d)
maxi=max(d)

ans=1
if D[0]!=0:
  print(0)
else:
  if d[0]!=1:
    print(0)
  else:
    for i in range(1,maxi+1):
      if i not in d:
        print(0)
        exit()
      else:
        s =  (d[i-1]**d[i])%p
        ans = (ans * s)%p
    print(ans)
# Judge status: Accepted
n=int(input())

if n>=30:
	print("Yes")

else:
	print("No")
# Judge status: Accepted
X = int(input())

ans = 0
x = 0
while x < X:
    ans += 1
    x += ans

print(ans)
# Judge status: Accepted
from fractions import gcd
s=int(input())
t=list(map(int, input().split()))
ans=t[0]
for i in t:
  ans=(ans*i)//gcd(ans,i)
mod=10**9+7
a=0
for j in t:
  a+=ans//j
print(int(a)%mod)
# Judge status: Wrong Answer
n = int(input())

if n == 1:
  print(0)
elif n == 1:
  print(1)
# Judge status: Wrong Answer
n = int(input().strip())
p = list(map(int, input().strip().split()))

for i in range(n):
    p[i]-=1
cnt=0
ans="Yes"
for i,p_i in enumerate(p):
    if i==p_i:
        continue
    cnt+=1
    if cnt>1:
        ans="No"
        break
    for j,p_j in enumerate(p):
        if i==p_j:
            p[j]=p_i
            p[i]=p_j
            break

print(ans)
# Judge status: Accepted
S = list(str(input()))
Q = int(input())

state = 0
start = []
end = []

for i in range(Q):
    x = list(input().split())
    if x[0] == "1":
        state = (state+1)%2
    else:
        x[1] = int(x[1])
        if (state + x[1]) % 2 == 1:
            start.append(x[2])
        else:
            end.append(x[2])

if state == 0:
    start.reverse()
    ans = start + S + end
    
else:
    end.reverse()
    S.reverse()
    ans = end + S + start

print("".join(ans))
# Judge status: Accepted
n = input()
num = int(n[-3:])
if num ==0:
  num = 1000
print(1000-num)
# Judge status: Accepted
import sys

N = int(sys.stdin.readline().strip())
A = list(map(int, sys.stdin.readline().strip().split()))
 
d = [0]*N
ans = 0
for i in range(N):
    a = A[i]
    l,r = i+a, i-a
    if 0 <= l < N:
        d[l] += 1
    if 0 <= r < N:
        ans += d[r]
 
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
if A % 3 == 0 or B % 3 == 0 or (A+B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Wrong Answer
k = int(input())
s = input()

if len(s) >= k:
    print(s[:7]+"...")
else:
    print(s)
# Judge status: Accepted
S = input()
N=len(S)
x="Yes"
for i in range(0,N):
    if i%2==0 and S[i]=="L":
        x="No"
        break
    elif i%2==1 and S[i]=="R":
        x="No"
        break
print(x)
# Judge status: Wrong Answer
import bisect
n = int(input())
li = []
for i in range(10000):
    li.append(i**2)
a = bisect.bisect_right(li, n)
print(li[a-1])
# Judge status: Accepted
n = int(input())
dp = [[0]*3 for _ in range(n)]
c = list(map(int,input().split()))
for i in range(3):
    dp[0][i] = c[i]
for j in range(1,n):
    c = list(map(int,input().split()))
    for k in range(3):
        dp[j][k] = max(dp[j-1][(k+1)%3],dp[j-1][(k+2)%3])+c[k]
print(max(dp[n-1][:]))
# Judge status: Accepted
n,d=map(int,input().split())
dis = [list(map(int,input().split())) for i in range(n)]

def is_square(n):
    res=n**0.5
    return res.is_integer()

cnt = 0
for i in range(n):
    for j in range(i+1,n):
        dist = 0
        for k in range(d):
            #i行目とj行目
            dist += (dis[i][k]-dis[j][k])**2
        if is_square(dist) == True: cnt+=1
print(cnt)
# Judge status: Wrong Answer
S,W = [i for i in input().split(" ")]
if (W>=S) :
    print("safe")
else:
    print("unsafe")
# Judge status: Wrong Answer
# ABC079 B - Lucas Number

n = int(input())
a=[2,1]
a_tes = 0

for i in range(2,n+1):
    a_tes = a[i-1] + a[i-2]
    a.append(a_tes)
print(a[n-1])
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def solve():
    n, a, b = MI()

    ao = n // (a + b)
    r = n % (a + b)
    print(a * ao + min(r, a))


if __name__ == '__main__':
    solve()
# Judge status: Accepted
import itertools
n,m=map(int,input().split())
i = [2]*n
j = [2]*m
p = list(itertools.combinations(i, 2))
q = list(itertools.combinations(j, 2))
print(len(p)+len(q))
# Judge status: Accepted
x,a,b=map(int,input().split())
print('delicious' if 0>=b-a else 'safe' if x>=b-a else 'dangerous')
# Judge status: Accepted
x = int(input())
r,q = divmod(x, 11)
print(r*2 + (q+5)//6)
# Judge status: Accepted
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
ct_list = [n,a,b,c,d,e]
for i in range(5):
  if ct_list[i] < ct_list[i+1]:
    ct_list[i+1] = ct_list[i]

if ct_list[5] >= ct_list[4]:
  if n%ct_list[4] == 0:
    print(4+n//ct_list[4])
  else:
    print(5+n//ct_list[4])
else:
  if n%ct_list[5] == 0:
    print(4+n//ct_list[5])
  else:
    print(5+n//ct_list[5])
# Judge status: Accepted
S = list(input())
ACGT = ["A", "C", "G", "T"]
count = 0
Max = 0
if len(S) == 1:
    if  S[0] in ACGT:
        print(1)
    else:
        print(0)
else:
    for s in S:
        if s in ACGT:
            count += 1
            if count > Max:
                Max = count
        else:
            if count > Max:
                Max = count
            count = 0
    print(Max)
# Judge status: Accepted
N = input()
LISTSTR = list(N)

ans = ''
for i in range(len(LISTSTR)):
    mae = ''
    if i != 0:
        mae = ans[-1]
    str = LISTSTR[i]


    if str != '?':
        ans += str
    elif mae == '?':
        ans += 'D'
    else:
        ans += 'D'


if len(LISTSTR) == 1:
    ans = 'D'



print(ans)
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a,b,c,k = i2()
if k%2 == 0:
	print(a - b)
else:
	print(b - a)
# Judge status: Accepted
n=int(input())
v=list(map(int,input().split()))
while len(v) != 1:
  v.sort()
  v[0] = (v[0]+v[1])/2
  v.pop(1)
print(v[0])
# Judge status: Accepted
s = input()

left = s.find("A")
right = s.rfind("Z")

print(right - left + 1)
# Judge status: Accepted
C=input()
B=ord(C)
B=B+1
print(chr(B))
# Judge status: Accepted
x,a,b = map(int,input().split())

if a >= b:
    print('delicious')
elif b - a <= x:
    print('safe')
else:
    print('dangerous')
# Judge status: Wrong Answer
n,m=map(int,input().split())
x=[input() for i in range(n)]
y=[input() for i in range(m)]

for i in range(n-m+1):
  for j in range(n-m+1):
    if x[i][j]==y[0][0]:
      if m==1:
        print('Yes')
        exit()
      for k in range(m):
        if x[i+k][j:j+n-m+1]!=y[k]:
          continue
          
        print('Yes')
        exit()
        
print('No')
# Judge status: Wrong Answer
print(eval('+'.join(sorted(input()))+'+10'))
# Judge status: Accepted
N, M = map(int,input().split())

H = list(map(int, input().split()))
H.insert(0, 0)

V = [list(map(int, input().split())) for i in range(M)]

count = 0

dic = {}

for i in range(1, N+1):
  dic[i] = set()

for hen in V:
  dic[hen[0]].add(hen[1])
  dic[hen[1]].add(hen[0])

print(sum(all([H[i] > H[hs] for hs in dic[i]]) for i in range(1, N+1)))
# Judge status: Accepted
N = int(input())
even = N//2
odd = N-even
print(odd/N)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

ans = 1000
for i in range(len(s) - 2):
    ans = min(ans, abs(753 - int(s[i:i+3])))
print(ans)
# Judge status: Accepted
l=sorted(map(int,input().split()))
a=2*l[2]-l[1]-l[0]
print((a+3)//2 if a%2 else a//2)
# Judge status: Accepted
r, g, b = list(map(int, input().split()))
print('YES' if (g * 10 + b) % 4 == 0 else 'NO')
# Judge status: Accepted
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True

S = input()
N = len(S)

sta = (N - 1) // 2
end = (N + 3) //2

if is_kaibun(S):
    if is_kaibun(S[0:sta]):
        if is_kaibun(S[end - 1:]):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
# Judge status: Accepted
s=input()
k=int(input())
t=0
one=0
for i in s:
  if i=="1":
    one+=1
  else:
    t=i
    break
if k<=one:
  print(1)
else:
  print(t)
# Judge status: Accepted

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

a.sort()
del a[:n]
print(sum(a[0::2]))
# Judge status: Accepted
s = input()
ans = 0
i = 0
before = '#'
while(i<len(s)):
    if(s[i]!=before):
        before = s[i]
        i += 1
        ans += 1
    else:
        before = '#'
        i += 2
        ans += 1

if(i!=len(s)):
    ans -= 1

print(ans)
# Judge status: Wrong Answer
n = int(input())
w = [input() for i in range(n)]
check = []
prev = ""
for i in range(n-1):
  check.append(w[i])
# Judge status: Wrong Answer
n = int(input())
N = n
ans = 0
d = 0
i = 2
while n>1 and i*i<=N:
  c = 0
  if n % i == 0:
    d == 1
    while n % i == 0:
      n = int(n / i)
      c += 1
    Y=1
    U=2
    while c>=Y:
      ans=ans+1
      Y=Y+U
      U=U+1

  i += 1
      
    
if n > 1:
  ans = 1
print(ans)
# Judge status: Accepted
d = int(input())
print(' '.join(['Christmas'] + ['Eve'] * (25 - d)))
# Judge status: Wrong Answer
s = input()
count = 0
i = 1
while i < len(s):
    if s[i] != s[i-1]:
        s = s[:i] + s[i+1:]
        i -= 1
        count += 2
    i += 1
print(count)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
S=sum(b)-sum(a)
if S<0:print("No")
else:
    cnt=0
    for i in range(n):
        cnt+=max((b[i]-a[i]+1)//2,0)
    if cnt<=S:print('Yes')
    else:print("No")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
A1=-1
A2=-1
A3=-1
B1=-1
B2=-2
B3=-1
flag=0
for i in range(a+1):
    A1=i
    B1=a-A1
    B2=b-A1
    B3=c-A1
    if d-B1==e-B2 and e-B2==f-B3 and g-B1==h-B2 and h-B2 and i-B3:
        flag=1
        break
print('Yes' if flag else 'No')
# Judge status: Accepted
multi = str(input())
if multi == 'ABC':
    print('ARC')
else:
    print('ABC')
# Judge status: Accepted
s=input()
n=len(s)
s1=s[:(n-1)//2]
s2=s[n+3//2:]
def ispalindrome(str):
    if str==str[::-1]:
        s1=s[:(n-1)//2]
        if s1==s1[::-1]:
            s2=s[n+3//2:]
            if s2==s2[::-1]:
                return 'Yes'
            return 'No'
        return 'No'
    else:
        return 'No'
print(ispalindrome(s))
# Judge status: Wrong Answer
import numpy as np
import sys
L ,R ,d = (int(x) for x in input().split())
counter = 0
for i in range(L,R+1,1): 
  mod = i%d
  if mod == 0:
    counter += 1
  else :
    counter += 0   
print("{}以上{}以下の{}範囲内での倍数は{}個あります".format(L,R,d,counter))
# Judge status: Accepted
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

for i in range(K, N):
    if A[i - K] < A[i]:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
w, h, x, y = map(int, input().split())
if (2*x==w) & (2*y == h):
    print(w*h/2, 1)
else:
    print(w*h/2, 0)
# Judge status: Accepted
n=int(input())
cnt=0
for i in range(25):
    for j in range(14):
        if 4*i+7*j==n:
            cnt+=1
if cnt==0:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
import sys
H = int(input())
if H == 1:
    print(1)
    sys.exit()
cnt = 1
i = 1
H //= 2
while H > 0:
    i <<= 1
    cnt += i
    H //= 2
print(cnt)
# Judge status: Wrong Answer
def calord(tmp):
  sumord = 0
  jisu = 1
  for c in reversed(tmp):
    sumord = sumord + ord(c)*jisu
    jisu *= 10
  return int(sumord)

n, l = map(int, input().split())
l1 = [0]*n
for i in range(n):
  tmp = input()
  sum_ord = calord(tmp)
  l1[i] = (sum_ord, tmp)
l2 = sorted(l1)  
r = ""
for i in range(n):
  r = r + l2[i][1]
  
print(r)
# Judge status: Accepted
import math
import sys
import collections
from collections import defaultdict
from sys import stdin, stdout

sys.setrecursionlimit(10**9)
n=int(input())
arr=list(map(int,input().split()))
mult=1
flag=0
if 0 in arr:
    print(0)
else:
    for i in range(n):
        mult*=arr[i]
        if mult>10**18:
            flag=1
            break

    if flag==0:
        print(mult)
    else:
        print(-1)
# Judge status: Wrong Answer
#abc159 a
n,m=map(int,input().split())
ans=n*(n-1)/2+m*(m-1)/2
print(ans)
# Judge status: Accepted
k = int(input())
print(k // 2 * (k - k // 2))
# Judge status: Wrong Answer
x = int(input())
ans = (x//11) * 2 + 1 if x%11 <=5 else (x//11) * 2 + 2
print(ans)
# Judge status: Wrong Answer
import os, sys, re, math

N = int(input())
L = [int(n) for n in input().split()]

counts = [0] * 1001
for i in range(1001):
    counts[i] = len([x for x in L if x == i])

L = sorted(list(set(L)))

triangles = 0
for i in range(len(L) - 2):
    for j in range(i + 1, len(L) - 1):
        for k in range(j + 1, len(L)):
            if L[i] + L[j] > L[k]:
                triangles += counts[L[i]] * counts[L[j]]

print(triangles)
# Judge status: Wrong Answer
import sys

def main():
    # sys.stdin = open('input153a.txt')
     
    h, a = map(int, input().split())

    print(h // a + 1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import collections
import bisect
n,m=map(int,input().split())
p=[[int(j) for j in input().split()] for i in range(m)]
a=collections.defaultdict(list)
for x,y in sorted(p):
    a[x]+=[y]
for x,y in p:
    z=bisect.bisect(a[x],y)
    print("%06d%06d"%(x,z))
# Judge status: Accepted
S = list(input().strip())
ans = [0] * (len(S)+1)

for i in range(len(S)):
    if S[i] == "<":
        ans[i+1] = max(ans[i]+1, ans[i+1])

for i in range(len(S)-1, -1, -1):
    if S[i] == ">":
        ans[i] = max(ans[i], ans[i+1]+1)
print(sum(ans))
# Judge status: Wrong Answer
N, M = map(int, input().split())
shina = list(map(int, input().split()))
shina.sort(reverse=True)
hantei = 0

for i in range(M):
  if shina[i] < 1 / (4 * M):
    hantei += 1

if hantei == 0:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n=int(input())
s=input()
c=0
x=s.rfind(")")
if x==-1:
  print(s+")"*n)
else:
  s1=s[0:x+1]
  s2=s[x+1:]+")"*len(s[x+1:])
  if s1.count("(")>=s1.count(")"):
    print(s1+s2+")"*(s1.count("(")-s1.count(")")))
  else:
    print("("*(-s1.count("(")+s1.count(")"))+s1+s2)
# Judge status: Accepted
S=input()
N=len(S)
count=0
for i in range(N//2):
  if(S[i]!=S[-i-1]):
    count+=1
print(count)
# Judge status: Accepted
from math import gcd
x = int(input())
g = gcd(x,360)
print(((360//g)*(x//g)*g)//x)
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))

cost = [0]*(n)
cost[1] = abs(h[0]-h[1])

for i in range(2,n):
  cost[i] = min(cost[i-2]+abs(h[i]-h[i-2]),cost[i-1]+abs(h[i]-h[i-1]))
  
print(cost[-1])
# Judge status: Wrong Answer
s = input()
t = input()
if len(t) - len(s) == 1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

lmax = a[0]
ans = 0
for i in a:
    ans += max(0, lmax-i)
    lmax = max(lmax, i)
print(ans)
# Judge status: Accepted
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    exams=[]
    sorted_exams=[]
    n = int(input())
    exams=list(map(int,input().split()))
    sorted_exams=sorted(exams)
    half=n//2

    start=sorted_exams[half-1]
    end=sorted_exams[half]

    print(end-start)

if __name__=="__main__":
    main()
# Judge status: Wrong Answer
def main():
    x, y, a, b, c = list(map(int, input().split()))
    P = list(map(int, input().split()))
    Q = list(map(int, input().split()))
    R = list(map(int, input().split()))
    P = sorted(P, reverse = True)[:x]
    Q = sorted(Q, reverse = True)[:y]
    ans = P + Q + R
    print(sum(ans[:x + y]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
for i in range(n-1):
    if a[i] == a[i+1]:
        print('NO')
        exit()
print('YES')
# Judge status: Accepted
input()
s=t=input()
l,r=p='()'
exec("t=t.replace('()','');"*50)
c=t.count
print(l*c(r)+s+r*c(l))
# Judge status: Accepted
l = int(input())

vol = (l/3)**3
print(vol)
# Judge status: Wrong Answer
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
dif = []

for i in range(1, M):
	dif.append(abs(X[i] - X[i-1]))

dif.sort()
difLen = len(dif)
# M - N = (M-1) - (N-1)
ans = sum(dif[0:difLen - (N-1)])

print(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
x = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        x.append(i)
    if a[i] >= 4:
        x.append(i)
x.sort(reverse=True)
print(x[0] * x[1])