peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n = int(input())
A = list(map(int,input().split()))
i = 0
ans = 0 
A.sort()
A.reverse()
if A[n-1] == 1:
    if A[n-2] != 1:
        print(1)
        exit()
    else:
        print(0)
        exit()
while i <= n-2:
    for j in range(i+1,n):
        if A[i] % A[j] == 0:
            break
        elif j == n - 1:
            ans = ans + 1
    i = j + 1
if A[n-1] == A[n-2]:
    print(ans)
else:
    print(ans+1)
# Judge status: Accepted
n, l = map(int, input().split())
s = [input() for i in range(n)]
s.sort()
for x in s:
  print(x, end="")
print()
# Judge status: Accepted
x = int(input())

a = 100
i = 0
while a < x:
    a = int(a*1.01)
    i+= 1
print(i)
# Judge status: Wrong Answer
#coding: utf-8

sx, sy, tx, ty = map(int,input().split())
ans = ''
for i in range(tx-sx):
    ans += 'R'
for i in range(ty-sy):
    ans += 'U'
for i in range(tx-sx):
    ans += 'L'
for i in range(ty-sx+1):
    ans += 'D'

#ans += 'D'
for i in range(tx-sx+1):
    ans += 'R'
for i in range(ty-sy+1):
    ans += 'U'
ans += 'L'

ans += 'U'
for i in range(tx-sx+1):
    ans += 'L'
for i in range(ty-sy+1):
    ans += 'D'
ans += 'R'

print(ans)
# Judge status: Wrong Answer

import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    n, m = [int(i) for i in input().strip().split()]
    if n == m * 2:
        print(n)
    elif n > m * 2:
        print(m // 2)
    else:
        print(n + (m - 2 * n) // 4)


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

# 約数の全列挙
def divisors(n):
    divisors = []
    R = int(n**(0.5)) + 1
    for i in range(1, R):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    # divisors.sort(reverse=True)  # ソート
    return divisors

ans = 1
for d in divisors(M):
    if d * N <= M:
        ans = max(ans, d)
print(ans)
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
c = 0
for i in range(1,n+1):
    if a <= i//10000 + (i//1000)%10 + (i//100)%10 + (i//10)%10 + i&10 <= b:
        c = c + i
print(c)
# Judge status: Wrong Answer
a = list(map(int,input().split()))
a.sort()
k=0
r1=(a[2]-a[0])//2
r2=(a[2]-a[1])//2
k += r1+r2
a[0] += r1
a[1] += r2
if a[0]==a[1] and a[0]<a[2]:
  print(k+1)
elif a[0]<a[1] and a[1]==a[2]:
  print(k+2)
elif a[0]==a[2] and a[0]>a[1]:
  print(k+2)
else:
  print(k)
# Judge status: Accepted
import sys
import math
import bisect

def main():
    n, m = map(int, input().split())
    A = [0] * n
    for i in range(m):
        a, b = map(int, input().split())
        A[a-1] += 1
        A[b-1] += 1
    for a in A:
        print(a)

if __name__ == "__main__":
    main()
# Judge status: Accepted
# 入力
A, B = map(int,input().split())

# 処理
if A == B:
    print('Draw')
elif A == 1:
    print('Alice')
elif B == 1:
    print('Bob')
elif A > B:
    print('Alice')
else:
    print('Bob')
# Judge status: Accepted
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]

h.sort()
ans = max(h)
for i in range(0, n - k + 1):
    h_diff = h[i + k - 1] - h[i]
    ans = min(ans, h_diff)
print(ans)
# Judge status: Accepted
n=list(map(int,input().split()))
ans=sum(n)
print("Yes" if ans%9==0 else "No")
# Judge status: Accepted
s = input()
print("No" if s[0] == s[1] == s[2] else "Yes")
# Judge status: Accepted
a,b,k = map(int,input().split())
l = []
for i in range(1,max(a,b)+1):
  if a%i==0 and b%i==0:
    l.append(i)
print(l[-k])
# Judge status: Accepted
N, K = map(int, input().split())
arr = list(map(int, input().split()))

ans = float('inf')
for i in range(N+1-K):
    if arr[i]<= 0 and arr[i+K-1]>0:
        preans = min(abs(arr[i]*2) + arr[i+K-1], abs(arr[i]) + arr[i+K-1]*2)
    elif arr[i]<=0 and arr[i+K-1]<=0:
        preans = abs(arr[i])
    elif arr[i]>=0 and arr[i+K-1]>=0:
        preans = arr[i+K-1]
    ans = min(ans,preans)

print(ans)
# Judge status: Accepted
import itertools

antenna = [int(input()) for _ in range(5)]
k = int(input())

count = 0
for p in itertools.permutations(antenna, 2):
    x, y = p
    if abs(x - y) > k:
        count += 1

if count == 0:
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
K = int(input())
g = K//2
k = K//2+K%2
print(g*k)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    abc=MI()
    s=set(abc)
    print(len(s))

main()
# Judge status: Wrong Answer
n,k,s=map(int,input().split())
gu=s//2
ki=s-gu
for i in range(1,10**5):
    if s!=i+gu and s!=i+ki:
        kz=i
        break
for i in range(n):
    if i==k+1:
        print((str(kz)+" ")*(n-k-1))
        exit()
    if i%2==0:
        print(gu,end=" ")
    elif i%2==1:
        print(ki,end=" ")
# Judge status: Wrong Answer
O = list(input())
E = list(input())




array = []
ans = ''
for i in range(1,len(O)+len(E)+1):
    if(i % 2 != 0):
        array.append(O.pop())
    else:
        array.append(E.pop())
array = list(reversed(array))
for j in array:
    ans += j

print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
fact = []
if m % n == 0:
    print(m // n)
    exit()
ans = 1
for i in range(1, 40000):
    if m % i == 0:
        if m // i >= n:
            ans = i
print(ans)
# Judge status: Wrong Answer
import re
word = input()
substring = input()
word = word.replace('?','.')
N = len(word) - len(substring)
found = False
for i in range(N+1):
    regexp = re.compile(word[i:i+len(substring)])
    if regexp.search(substring):
        found = True
        res = word[0:i] + substring + word[len(substring)+1:-1]
        print(res.replace('.','a'))
        break

if found == False:
    print('UNRESTORABLE')
# Judge status: Accepted
n = int(input())
if n % 2 == 1:
	print(0)
	exit()
n //= 10
ans = n
while n > 0:
	n //= 5
	ans += n
print(ans)
# Judge status: Accepted
from collections import Counter
s = list(input())
c = Counter(s)

print(min(c['0'],c['1'])*2)
# Judge status: Wrong Answer
N, M = map(int, input().split())

if N==0:
  N=1
if M==0:
  M=1
print(N*(N-1)/2+M*(M-1)/2)
# Judge status: Accepted
N=int(input())
A = list(map(int,input().split(' ')))
B = list(map(int,input().split(' ')))
a=0
b=0
for i,j in zip(A,B):
    if j-i>=0:
        a += (j-i)//2
    else:
        b += i-j
if a >= b:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N=int(input())
p=list(map(int,input().split()))
r=[i+1 for i in range(N)]
ans=False
for i in range(0,N-1):
    for j in range(i+1,N):
        p[i],p[j]=p[j],p[i]
        if p==r:
            ans=True
        #print(p)
        p[i], p[j] = p[j], p[i]
if p==r:
    ans = True
print('YES' if ans else 'NO')
# Judge status: Accepted
n, m = map(int, input().split())
odd = m if m%2 else m-1 # m以下の最大の奇数
even = m-1 if m%2 else m # m以下の最大の偶数
mid = 1 + odd + 1 # 右半分の開始点

for i in range(1, (1+odd)//2+1):
    print(i, i+odd)
    odd -= 2
    
for i in range(mid, mid + even//2):
    print(i, i+even)
    even -= 2
# Judge status: Accepted
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))

a = cino()
l = cina()
ans = 10**18
for i in range(-100,101):
    cost = 0
    for j in range(len(l)):
        cost += (i-l[j])**2
    ans = min(ans,cost)
print(ans)
# Judge status: Accepted
coffee = input()

if len(coffee) != 6:
    print("文字数が異なります")

if coffee[2] == coffee[3] and coffee[4] == coffee[5]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
A = int(input())
 
if N // 500 <= A: print('Yes')
else: print('No')
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
count=0
for i in range(n):
    if p[i]!=i+1:
        count+=1
if count==0 or count==2:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N=int(input())
X=list(map(int,input().split()))
A=sorted(X)
for i in range(N):
    if X[i]<=A[N//2-1]:
        print(A[N//2])
    else:
        print(A[N//2-1])
# Judge status: Wrong Answer
import sys

n=int(input())
if n==1:
  print(0)
  sys.exit()
result = 0
for i in range(n):
  a = n-i
  while True:
    if a % 2 == 1:
      break
    else:
      if a == 2:
        print(n-i)
        sys.exit()
      else:
        a /= 2
# Judge status: Accepted
N = int(input())
A = tuple(map(int, input().split(' ')))
MOD = 10 ** 9 + 7

zeros = [0] * 60
ones = [0] * 60

for a in A:
    for i, bit in enumerate(reversed(format(a, '060b'))):
        if bit == '0':
            zeros[i] += 1
        else:
            ones[i] += 1

base = 1
ans = 0

for i in range(len(zeros)):
    ans += zeros[i] * ones[i] * base
    ans %= MOD
    base *= 2
    base %= MOD

print(ans)
# Judge status: Accepted
if int(input()) in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 35, 36, 42, 45, 48, 49, 54, 56, 63, 64, 72, 81):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
# alpha = [chr(ord("a")+i) for i in range(10)]
ans = [[] for _ in range(N)]
ans[0].append("a")
for i in range(N-1):
    for e in ans[i]:
        idx = ord(e[-1]) - ord("a")
        for j in range(idx+2):
            ans[i+1].append(e+chr(ord("a")+j))
for i in range(len(ans[N-1])):
    print(ans[N-1][i])
# Judge status: Accepted
n = int(input())
ans = 10 ** 5
for a in range(1, n):
    ak = sum([int(a) for a in str(a)])
    bk = sum([int(b) for b in str(n - a)])
    if ans > ak + bk:
        ans = ak + bk
print(ans)
# Judge status: Wrong Answer
s = list(input())
x = len(s)
a = []

for i in range(x):
  if s[i] == '0':
    a.append(0)
  elif s[i] == '1':
    a.append(1)
  elif s[i] == 'B':
    if a != []:
      a.remove(a[-1])
    else:
      continue

print(*a)
# Judge status: Accepted
N,D = map(int,input().split())

if N % (2*D+1) == 0:
    print(N//(2*D+1))
else:
    print(N//(2*D+1)+1)
# Judge status: Accepted
def main():
    color = set(input().split())
    print(len(color))

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
S = input()

cnt = S[1:].count("E")
ans = cnt

for i in range(1,N):
  if S[i-1] == "W":
    cnt += 1
  if S[i] == "E":
    cnt -= 1
  ans = min(ans, cnt)
  
print(ans)
# Judge status: Accepted
import math

n = int(input())
l = [int(input()) for _ in range(5)]
print((math.ceil(n / min(l)) - 1) + 5)
# Judge status: Accepted
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
seq = [i+1 for i in range(n)]
# a = 0
# b = 0
from itertools import permutations
per = list(permutations(seq,n))
# for i in range(len(per)):
#     if per[i] == p:
#         a = i
#     if per[i] == q:
#         b = i
print(abs(per.index(p)-per.index(q)))
# Judge status: Wrong Answer
import itertools
N,M,X = map(int,input().split())
A = [list(map(int,input().split())) for i in range(N)]

z = [i for i in range(1, N)]
m = [1000000000000000000]

for i in range(N):
    x = list(itertools.combinations(z,i+1))

    for s in x:
        for k in range(1,M+1):
            C = sum(A[j-1][k] for j in s)
            if C < X:
                break
        else:
            m.append(sum(A[o-1][0] for o in s))
print(min(m) if min(m)!=1000000000000000000 else -1)
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))
L.sort()

ans=0
for i in range(N-2):
    for j in range(i+1,N):
        ng=N
        ok=j
        while abs(ok-ng)!=1:
            med =(ok+ng)//2
            if L[med]<L[i]+L[j]:
                ok=med
            else:
                ng=med
        ans+=ok-j
print(ans)
# Judge status: Wrong Answer
n = int(input())
tsk = []
for i in range(n):
	a,b = map(int,input().split())
	tsk.append([a,b,b-a])

tsk.sort(key = lambda x:x[2])

t = 0
ans = 'Yes'

for i in range(n):
	l = tsk[i]
	t += l[0]
	if l[1]<=t:
		ans = 'No'
		break
print(ans)
# Judge status: Wrong Answer
S = input()
T = input()

if T.startswith(S):
    if len(T) == (len(S) + 1):
        print('YES')
else:
    print('No')
# Judge status: Wrong Answer
def ABC_108_A():
    K = int(input())

    if K%2 == 0:
        print(K/2*K/2)
    else:
        print(int(K/2)*int(K/2)+int(K/2))

if __name__ == '__main__':

    ABC_108_A()
# Judge status: Accepted
l,r = map(int,input().split())

cand = []
for i in range(l,r+1):
  cand.append(i%2019)
  if len(cand) == 2020*2:
    break
    
ans = float('inf')
for i in range(len(cand)):
  for j in range(len(cand)):
    if i==j:
      continue
    ans = min(ans, (cand[i]*cand[j])%2019)
    if ans ==0:
      break
  else:
    continue
  break
print(ans)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n = int(readline())
s = readline().rstrip().decode('utf-8')
res = s.count(".")
ans = res
for i in range(n):
    if s[i] == "#":
        res += 1
    else:
        res -= 1
    ans = min(ans,res)

print(ans)
# Judge status: Accepted

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

if b <= c:
    print(0)
elif a <= c <= b <= d:
    print(b-c)
elif a <= c <= d <= b:
    print(d-c)
elif c <= a <= d <= b:
    print(d-a)
elif c <= d <= a <= b:
    print(0)
elif c <= a <= b <= d:
    print(b-a)
# Judge status: Accepted
a, b, n = map(int, input().split())
if n < b:
    k = n
else:
    k = b - 1
print((a*k)//b - a*(k//b))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
s = set(a)

d = {}
for i in s:
    d[i] = 0
for i in a:
    d[i] += 1

ans = 0
for i in d:
    c = d[i]
    if c < i:
        ans += c
    elif c >= i:
        ans += c - i
print(ans)
# Judge status: Accepted
N = int(input())
for i in range(9):
  if N % (i+1) == 0:
    if N / (i+1) < 10:
      print('Yes')
      exit()
print('No')
# Judge status: Wrong Answer
from math import ceil
n = int(input())
ls = list(map(int, input().split()))
sqsm = 0
for i in range(n):
    sqsm += ls[i] * ls[i]
sm = sum(ls)
print(ceil(sqsm - sm * sm / n))
# Judge status: Accepted
X, A, B = map(int,input().split())
if A - B + X < 0:
    print('dangerous')
elif A - B < 0:
    print('safe')
else:
    print('delicious')
# Judge status: Accepted
s,k=open(0)
k=int(k)
*s,t=s
for q in s:
 if(p:=(123-ord(q))%26)<=k:t+="a";k-=p
 else:t+=q
print(t[1:-1]+chr((ord(t[-1])-97+k)%26+97))
# Judge status: Wrong Answer
n, m = map(int, input().split())
check = {'AC' : [],
        'WA' : 0}

for i in range(m):
    q, result = input().split()
    q = int(q)
    if result == 'AC':
        if q not in check['AC']:
            check['AC'].append(q)
    else:
        if q not in check['AC']:
            check['WA'] += 1

print(str(len(check['AC'])) + " " + str(check['WA']))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

min = 10**9
minus = 0
for i in range(len(A)):
    if A[i] < 0:
        minus += 1
    if abs(A[i]) < min:
        min = abs(A[i])
    A[i] = abs(A[i])

if minus % 2 == 0:
    print(sum(A))
else:
    print(sum(A) - 2 * min)
# Judge status: Accepted
Count = 0
Array = []
for i in range(int(input())):
    Dice_1, Dice_2 = map(int, input().split())
    if Dice_1 == Dice_2:
        Array.append(1)
    else:
        Array.append(0)

ans = []
j_1 = 0
for j in range(len(Array)):
    if j_1 == 1 and Array[j] == 1:
        Count = Count + 1
    else:
        Count = 0
    j_1 = Array[j]
    ans.append(Count)
if max(ans) >= 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
li=list(input())
li.sort()
if len(li)%2:
    print("No")
    exit()
while True:   
    if len(li)==0:
        print("Yes")
        break
    elif li[0]==li[1]:
        li.pop(0)
        li.pop(0)
    else:
        print("No")
        break
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
x = tx - sx
y = ty - sy
ans = ""
ans += "U"*y
ans += "R"*x
ans += "D"*y
ans += "L"*(x+1)
ans += "U"*(y+1)
ans += "R"*(x+1)
ans += "D"
ans += "R"
ans += "D"*(y+1)
ans += "L"*(x+1)
ans += "U"
print(ans)
# Judge status: Accepted
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
jobs = [tuple(map(int, input().split())) for _ in range(N)]
jobs.sort(key=lambda t: t[1])
t = 0
for a, b in jobs:
    t += a
    if t > b:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
k = {"ABC":"ARC","ARC":"ABC"}
print(k[input()])
# Judge status: Wrong Answer
s = input()
ss = sorted(set(s))
cnt = ord('a')
for c in ss:
    if ord(c) == cnt:
        cnt += 1
        print(cnt)
    else:
        print(chr(cnt))
        exit()
if cnt == ord('{'):
    print('None')
else:
    print(chr(cnt))
# Judge status: Accepted
A,B,C,X=[int(input()) for i in range(4)]
print(sum(500*a+100*b+50*c==X for a in range(A+1) for b in range(B+1) for c in range(C+1)))
# Judge status: Accepted
n=int(input())
 
print((n/3)**3)
# Judge status: Wrong Answer
s = input()
if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('Rainy')
# Judge status: Accepted
def solve(n, k):
    ans = []
    for dice in range(1, n+1):
        c = 0
        while dice < k:
            dice *= 2
            c += 1
        ans.append((1/n) * 1/(2**c))

    return sum(ans)


if __name__ == '__main__':
    n, k = map(int, input().split())
    print(round(solve(n, k), 10))
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


k,x = list(map(int, input().split()))
ans = list(range(x-k+1, x+k))
print(" ".join(map(str, ans)))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

min_idx = 0
min_val = float('inf')

for i, a in enumerate(A):
    if abs(a) < min_val:
        min_idx = i
        min_val = abs(a)


for i in range(min_idx):
    if A[i] < 0:
        A[i] *= -1
        A[i + 1] *= -1


for i in range(N - 2, min_idx - 1, -1):
    if A[i + 1] < 0:
        A[i] *= -1
        A[i + 1] *= -1


print(sum(A))
# Judge status: Wrong Answer
A, B, C=map(int, input().split())
K = int(input())
M = max(A, B, C)
G=A+B+C-M
print(G+M**K)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
n = int(input())
import collections
chk = collections.deque([])
for i in range(n):
  s = input()
  s = sorted(s)
  chk.append(''.join(s))
#chk = list(chk)
c = collections.Counter(chk)
c = dict(c)
ans = 0
for i in c.values():
  if i == 1:
    break
  else:
    ans += i*(i-1)//2
print(ans)
# Judge status: Accepted
s = input()
ans = len(s)
temp1 = 0 #Sが連続
for i in range(len(s)):
  if s[i] == "S":
    temp1+=1
  elif s[i] == "T":
    if temp1 > 0:
      temp1-=1
      ans-=2
    else:
      temp1=0
  else:
    temp1=0
print(ans)
# Judge status: Accepted
x, a, b = map(int, input().split())
expire_limit = x + a
if b > expire_limit:
  print('dangerous')
elif b > a and a - b < expire_limit:
  print('safe')
else:
  print('delicious')
# Judge status: Wrong Answer
#B
# import math
# n, d = map(int, input().split())
# print(math.ceil(n/(d*2+1)))

#C
from collections import Counter
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
first = sorted(set(a))[-1]
if sorted(set(a))[0] == sorted(set(a))[-1]:
    pass
else:
    second = sorted(set(a))[-2]
for i in a:
    if i == first:
        print(first)
    else:
        print(second)
# Judge status: Wrong Answer
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
coupon = {}
for i in range(M):
  x,y,c = map(int,input().split())
  coupon[(x,y)] = c
values = []
for i, p in enumerate(a):
  for j, q in enumerate(b):
    if (i+1,j+1) in coupon:
      values.append(p+q-coupon[(i+1,j+1)])
    else:
      values.append(p+q)
print(min(values))
# Judge status: Wrong Answer
n = int(input())
a = sorted(list(map(int,input().split())))
ans = 0
for i in range(n):
    ans += a[n+i]
print(ans)
# Judge status: Wrong Answer
n, m = map(int,input().split())

l1 = []
l2 = []
for i in range(m):
    a,b = map(int,input().split())

    if a==1:
        l1.append(b)
    elif b==n:
        l2.append(a)

for l in l2:
    if l in l1:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

if not l2:
    print('IMPOSSIBLE')
# Judge status: Accepted
def gcd(p, q):
    if (p%q == 0):
        return q
    return gcd(q, p%q)
K = int(input())
result = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            result += gcd(gcd(i, j), k)
print(result)
# Judge status: Accepted
# coding: utf-8
n,m = map(int, input().split())

if n*4>=m and n*2<=m and (n*4-m)%2==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,a,b = map(int,input().split())
if a <= b:
    print(max(0,(b * (n - 1) + a) - (a * (n - 1) + b) + 1))
elif a > b:
    print("0")
# Judge status: Accepted
Xd, K, D = map(int,input().split())
X = abs(Xd)

if X > K*D or abs(X-K*D)<=D:
    print(abs(X-K*D))
    exit()

if (K - Xd//D)%2==0:
    print(Xd%D)
else:
    print(abs(Xd%D-D))
# Judge status: Wrong Answer
N = int(input())
max=1
for i in range(1, N):
  if max<i**2<=N:
    max=i**2
  else:
    break
print(int(max))
# Judge status: Accepted
n=int(input())
lst=list(map(int,input().split()))

for i in range(n):
    lst[i]-=(i+1)
lst.sort()
b=lst[n//2]
ans=0
for i in range(n):
    ans+=abs(b-lst[i])
print(ans)
# Judge status: Accepted
from bisect import bisect_left, bisect_right
N = int(input())

L = [111,222,333,444,555,666,777,888,999]

ans =bisect_left(L,N)
print(L[ans])
# Judge status: Accepted
S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
l, r, d = map(int, input().split())
num = 0
for i in range(r - l + 1):
    if  (i + r)/ d == int((i + r) / d):
        num += 1
print(num)
# Judge status: Accepted
s=input()
x=s.find('A')
s2=s[x:]
y=s.rfind('Z')
print(y-x+1)
# Judge status: Accepted
from collections import Counter

def combination2(n):
    return int(n * (n-1) / 2)

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

c = Counter(a)
s = 0

for i in c.values():
    s += combination2(i)

for i in a:
    n = c[i]
    ans = s - combination2(n) + combination2(n-1)
    print(ans)
# Judge status: Accepted
S = input().split("/")
YY,MM,DD = map(int,S)
if (YY>2019) or (YY==2019 and MM>4):
    print("TBD")
else:
    print("Heisei")
# Judge status: Accepted
H1, M1, H2, M2, K = [int(s) for s in input().split()]
if H2 < H1:
    H2 += 24
elif H2 == H1 and M1 > M2:
    H2 += 24
print(int(H2 * 60 + M2 - (H1 * 60 + M1) - K))
# Judge status: Wrong Answer
n = int(input())
word_list = ["z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
             "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
             "w", "x", "y", "z"]
ans = []
while n>0:
    ans.append(word_list[n%26])
    if n%26 == 0:
      break
    n = n//26
    
    

ans.reverse()
print(''.join(ans))
# Judge status: Wrong Answer
n = int(input())
A = [int(input()) for i in range(n)]

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


for i in range(n):
    ans += A[i] // 2
print(ans)
# Judge status: Accepted
a, b, m = map(int,input().split())
a_l = list(map(int,input().split()))
b_l = list(map(int,input().split()))
m_l = []
for i in range(m):
    m_l.append(list((map(int,input().split()))))

m_l.sort(key=lambda x: x[2])
a_l_s = sorted(a_l)
b_l_s = sorted(b_l)
ans = a_l_s[0] + b_l_s[0]

for j in range(m):
    price = a_l[m_l[j][0]-1] + b_l[m_l[j][1]-1] - m_l[j][2]
    if price < ans:
        ans = price

print(ans)
# Judge status: Wrong Answer
X, A, B = list(map(int, input().split()))
if -A+B < 0:
  print("delicious")
elif -A+B < X:
  print("safe")
else:
  print("dangerous")
# Judge status: Wrong Answer
import copy
n = int(input())
c = [list(map(int, input().split())) for i in range(n-1)]
for i in range(n):
    t = 0
    for j in range(i, n-1):
        if t < c[j][1]:
            t = c[j][1]
        elif t%c[i][2] == 0:
            pass
        else:
            t += c[j][1] - t%c[j][2]
        t += c[j][0]
    print(t)
# Judge status: Accepted
N = int(input())

print(N*(N+1)//2)