peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,m=map(int, input().split())
r = 0
if n>=2:
	r += n*(n-1)//2
if m>=2:
	r += m*(m-1)//2
print(r)
# Judge status: Accepted
import math
N,K=map(int,input().split())
print(math.ceil((N-1)/(K-1)))
# Judge status: Accepted
import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))
# Judge status: Wrong Answer
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    A = [Z() for _ in range(N)]
    output = 0
    for i in range(N-1):
        x = min(A[i], A[i+1])
        output += x
        A[i] -= x
        A[i+1] -= x
        output += A[i]//2
        A[i] %= 2
    output += A[N-1]//2
    print(output)

    return

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

result = ''
for i in range(0,len(S)):
  num = ord(S[i])
  new = chr(num+N)
  result += new

print(result)
# Judge status: Wrong Answer
a = list(map(int, input().split()))
n = []
for i in range(len(a)):
  if a[i] % 2 == 0: n.append(i+1)
if len(n) == 3:
  a.sort()
  ans = (a[2] - a[0]) // 2 + (a[2] - a[1]) // 2
elif len(n) == 2:
  N = 3 - sum(n) - 1 #奇数のインデックス
  ans = 0
  if a[N] != max(a):
    while a[N] < max(a):
      a[N] += 2
      ans += 1
  a.sort()
  ans += (a[1] - a[0]) // 2 + a[2] - a[1]
else:
  a.sort()
  ans = (a[2] - a[0]) // 2 + (a[2] - a[1]) // 2
print(ans)
# Judge status: Accepted
from math import factorial, sqrt

def dist(x1, y1, x2, y2):
    return sqrt((x1 - x2)**2 + (y1 - y2)**2)


N = int(input())
x, y = [0]*N, [0]*N
for i in range(N):
    x[i], y[i] = map(int, input().split())

ans = 0
count = (N-1) * factorial(N) / (N * (N-1) / 2)

for i in range(N-1):
    for j in range(i+1, N):
        ans += dist(x[i], y[i], x[j], y[j]) * count

ans = ans / factorial(N)

print(ans)
# Judge status: Accepted
l = list(map(int, input().split()))
l.sort()
c = l[-1]
a = l[0]
b = l[1]
if (a + b) % 2 == 0:
    print((2 * c - (a + b))//2)
else:
    print((2*(c+1)-(a+b+1))//2 + 1)
# Judge status: Accepted
S=input()
N = len(S) + 1
ary = [0] * N
for i in range(N-1):
    if S[i] == "<":
        ary[i+1] = ary[i] + 1

for i in range(N-2,-1,-1):
    if S[i] == ">":
        ary[i] = max(ary[i], ary[i+1] + 1)

print(sum(ary))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

s = sum(A)
l = 0
for i in range(N):
  l += A[i]
  if l>= s/2:
    ans = min([abs(l-A[i]-sum(A[i:])),abs(l-sum(A[i+1:]))])
    print(round(ans))
    break
# Judge status: Wrong Answer
N=int(input())
S=input()
ans=S.count("R")*S.count("G")*S.count("B")
for i in range(0,N-1):
  for j in range(i+1,N):
    k=2*j-i
    if k >=N:
      break
    if S[i]!=S[j] and S[j]!=S[k]:
      ans-=1
print(ans)
# Judge status: Wrong Answer
S = input()
S = int(S.replace("/",""))
if S < 20190430:
  print("Heisei")
else:
  print("TBD")
# Judge status: Accepted
K, X = map(int, input().split())
print(*[x for x in range (X-K+1, X+K)])
# Judge status: Accepted
A, B = map(int,input().split())
X = 0
if A > B:
    X = A
    A -= 1
    if A > B:
        X += A
        print(X)
    else:
        X += B
        print(X)    
else:
    X = B
    B -= 1
    if A > B:
        X += A
        print(X)
    else:
        X += B
        print(X)
# Judge status: Accepted
import math
N = int(input())

X = math.ceil(N / 1.08)

if (math.floor(X * 1.08) == N):
    print(X)
    exit()
print(':(')
# Judge status: Wrong Answer
A, B = map(int, input().split())
print((A+B)//2) if (A-B)%2 !=0 else print("IMPOSSIBLE")
# Judge status: Accepted
n = int(input())
lst = []
for i in range(n):
  s, p = input().split()
  p = int(p)
  lst.append((s, p, i+1))
lst_sorted = sorted(lst, key=lambda x: (x[0], -x[1], x[2]))
for _, _, num in lst_sorted:
  print(num)
# Judge status: Wrong Answer
N=input()
S=int(N)
count = 0
for i in range(len(N)):
    if int(N[i])>=6:
        count+=10-int(N[i])+1
    else:
        count+=int(N[i])
print(count)
# Judge status: Wrong Answer
S = list(input())
T = list(input())

S = [ord(s) for s in S]
T = [ord(s) for s in T]

S.sort()
T.sort(reverse=True)

LS = len(S)
LT = len(T)

ok = False
for i in range(min(LS,LT)):
  s = S[i]
  t = T[i]
  if s < t:
    ok = True
    break
  elif s == t:
    continue
  elif t < s:
    ok = False
    break

if ok:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
D = int(input())
C = list(map(int ,input().split()))
S = [list(map(int, input().split())) for i in range(D)]
sumc = sum(C)
last = [0 for i in range(26)]

for i in range(D):
    ans = 0
    m = 0
    t = 0
    for k in range(26):
        last[t-1] = i+1
        ans += S[i][t-1]
        for j in range(26):
            ans -= C[j]*(i+1 - last[j])
        if ans > m:
            m = ans
            t = k + 1
    print(t)
# Judge status: Accepted
#a,b,c=map(int,input().split())
#d=list(map(int,input().split()))
#n=int(input())
#d,x=map(int,input().split())
#a=[int(input()) for i in range(n)]

      
h1,m1,h2,m2,k=map(int,input().split())

t1=h1*60+m1
t2=h2*60+m2

print(t2-t1-k)
# Judge status: Wrong Answer
H, W =[int(i) for i in input().split()]
print(max(H-2, 0)*max(W-2, 0))
# Judge status: Accepted
import math

a,b = map(int,input().split())
x = math.gcd(a,b)
s = [1]
for i in range(2,int(math.sqrt(x)+1)):
    if x%i == 0:
        while x%i == 0:
            x //= i
        s.append(i)
if x != 1:
    s.append(x)
l = len(s)
print(l)
# Judge status: Wrong Answer
days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI',  'SAT']
s = raw_input()
for j in range(len(days)):
	if days[j] == s: #raw_inpu
		break
d =0
while(days[j] != 'SUN'):
	j += 1
	j %= len(days)
	d += 1

print d
# Judge status: Accepted
N = int(input())
L = sorted(list(map(int, input().split()))) 

ans = 0

import bisect

for a in range(N):
    for b in range(a):
        A=L[a]
        B=L[b]
        c=bisect.bisect_left(L, A+B)
        ans+=c-a-1

print(ans)
# Judge status: Accepted
n = int(input())
ans = [0 for a in range(10050)]


for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      
      if v<10050:
        ans[v]+=1

for i in range(n):
  print(ans[i+1])
# Judge status: Wrong Answer
n, x = map(int, input().split())
l = list(map(int,input().split()))

total = 0
ans = 0
for i in range( len( l )):
  total += l[ i ]
  if total > x:
    ans = i
    break
print( i + 1 )
# Judge status: Wrong Answer
N,K = map(int,input().split())
 
if K % N == 0:
	print(int(0))
else:
	print(int(1))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**7)
N = int(input())
memo = [-1]*(N+1)
def rec(n):
    if n == 0:
        return 0
    if memo[n] != -1:
        return memo[n]
    res = n
    m = 1
    while m <= n:
        res = min(res,rec(n-m)+1)
        m *= 6
    m = 1
    while m <= n:
        res = min(res,rec(n-m)+1)
        m *= 9
    memo[n] = res
    return memo[n]

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

# 0~a-1でいくつあるか
if a == 0:
    count_a = 0
else:
    count_a = (a-1) // x + 1


# 0~bでいくつあるか
count_b = b // x + 1

print(count_b - count_a)
# Judge status: Wrong Answer
nm=input().split()
h=input().split()
ans=set(range(int(nm[0])))
for i in range(int(nm[1])):
    ab=input().split()
    a=int(ab[0])-1
    b=int(ab[1])-1
    if(h[a]>=h[b]):
        ans.discard(b)
    if(h[b]>=h[a]):
        ans.discard(a)
print(len(ans))
# Judge status: Accepted
a,b,c,k = (map(int, input().split()))

if a-b>10**18:
  print("Unfair")
elif k%2==0:
  print(a-b)
else:
  print(b-a)
# Judge status: Accepted
import collections
w = list(input())
c = collections.Counter(w)
for i in c.values():
    if (i % 2 == 1):
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
N, K = map(int, input().split())
P = sorted(list(map(int, input().split())))

print(sum(P[:K]))
# Judge status: Wrong Answer
A,B,C,X = [int(input()) for i in range(4)]
sum(100*a + 50*b + 10*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1))
print(sum)
# Judge status: Accepted
N = int(input())
print((N*(N-1))//2)
# Judge status: Wrong Answer
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    n = int(input())
    for a in range(1,10**6+1):
        if n%a==0:
            b=n//a
        ans=a+b-2
    print(ans)

if __name__=="__main__":
    main()
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
if a!=0:
    if n<a+b:
        print(a)
    else:
        res = n - (a+b)
        num = (res+1)//2
        print(a+num)
else:
    print(0)
# Judge status: Accepted
n,a,b=map(int,input().split())
mn=(n-1)*a+b
mx=(n-1)*b+a
print(max(mx-mn+1,0))
# Judge status: Accepted
n = int(input())
for i in range(1,10):
    if (i-1)*111 < n <= i*111:
        print(i*111)
        break
# Judge status: Wrong Answer
S = list(input())
S[3] = "8"
print(S[0:])
# Judge status: Accepted
l=[input() for _ in range(5)]
i=0
m=9
for s in l:
    s=int(s[-1])
    if s==0:
        i+=1
        continue
    m=min(m,s)
a=0
for s in l:
    a+=(int(s)+9)//10*10
print(a if i==len(l) else a-10+m)
# Judge status: Accepted
n=int(input())
csf=[list(map(int,input().split())) for _ in range(n-1)]

ans_list=[]

for i in range(n):
    now=0
    for g in range(i,n-1):
        c,s,f=csf[g]
        if now<=s:
            now=s
        if now%f==0:
            now+=c
        else:
            now+=(f-now%f)+c
    ans_list.append(now)

for l in range(n):
    print(ans_list[l])
# Judge status: Accepted
# coding: utf-8
import sys
from collections import defaultdict, Counter

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

"""
dicで各要素の数を保持
"""
N = ir()
A = lr()
Q = ir()
counter = Counter(A)
dic = defaultdict(int)
for k, v in counter.items():
    dic[k] = v

total = sum(A)
answer = []
for _ in range(Q):
    b, c = lr()
    num = dic[b]
    total -= num * b
    total += c * num
    dic[b] = 0
    dic[c] += num
    answer.append(total)

print('\n'.join(map(str, answer)))
# Judge status: Accepted
import heapq

n,m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n) :
  a[i] *= -1

heapq.heapify(a)
for i in range(m) :
  at = -1*(-1*heapq.heappop(a)//2)
  heapq.heappush(a, at)

print(sum(a)*-1)
# Judge status: Wrong Answer
h=int(input())
w=int(input())
n=int(input())

ans=0
cnt=0
while cnt < ans:
  if h<w:
    cnt+=w
    w-=1
    ans+=1
  else:
    cnt+=h
    h-=1
    ans+=1
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
p, q, r = map(int, input().split())
print(min(p+q, q+r, r+p))
# Judge status: Wrong Answer
numeros = [int(x) for x in input().split()]
k = int(input())
index_maior = 0
maior = 0
for index, value in enumerate(numeros):
    if value > maior:
        maior = value
        index_maior = index
numeros[index_maior] = numeros[index_maior] * 2 * k
print(sum(numeros))
# Judge status: Accepted
print('0' if input()=='1' else '1')
# Judge status: Accepted
def INT():
    return int(input())

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

def LI():
    return list(map(int, input().split()))

A, B, T = MI()

print(B * int((T + 0.5) // A))
# Judge status: Wrong Answer
import math
n,d=map(int,input().split())

x=[]
for i in range(n):
  x.append(list(map(int,input().split())))

cnt=0

for i in range(n-1):
  for j in range(i+1,n):
    d=0
    for k in range(d):
      d+=(x[i][k]-x[j][k])**2
    if int(math.sqrt(d))**2==d:
      cnt+=1
print(cnt)
# Judge status: Accepted
n = int(input())
s = input()

ans = [0]*(n+1)
for i in range(n):
  if s[i] == 'E':
    ans[i+1] = ans[i] + 1
  else:
    ans[i+1] = ans[i]
    
print(min(i-ans[i]+ans[n]-ans[i+1] for i in range(n)))
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=list(map(int,input().split()))
import bisect
a.sort

for i in range(m):
  b=a.pop()
  b//=2
  index=bisect.bisect_left(a,b)
  a.insert(index,b)
  
  
print(sum(a))
# Judge status: Accepted
S = list(input())
y = 1000*int(S[0])+100*int(S[1])+10*int(S[2])+int(S[3])
m = 10*int(S[5])+int(S[6])
d = 10*int(S[8])+int(S[9])

if y < 2019 :
    print("Heisei")
elif y == 2019 and m <= 4 :
    print("Heisei")
else :
    print("TBD")
# Judge status: Accepted
a,b, = map(int,input().split())
ans = 0
for i in range(a,b+1):
	stri = str(i)
	if stri[0] == stri[-1] and stri[1] == stri[-2]:
		ans += 1
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 01:22:46 2020

@author: shinba
"""

L = [2,1]

for i in range(85):
    L.append(L[-2]+L[-1])

print(L[int(input())])
# Judge status: Wrong Answer
N, Y = map(int, input().split())

cond = 0
for a in range(N):
	
	for b in range(N):
		res = Y-10000*a-5000*b
		if res < 0:
			continue
		s,t = divmod(res,1000)
		if (0 <= s) and (a+b+s == N) and (t == 0):
			cond = 1
			break
	if cond:
		break
if cond:
	print(a,b,s)
else:
	print('-1 -1 -1')
# Judge status: Accepted
x,y = map(int,input().split())
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
g3=[2]
if x in g1 and y in g1:
    print('Yes')
elif x in g2 and y in g2 :
    print('Yes')
elif x in g3 and y in g3 :
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import math
import queue

n = int(input())

q = queue.Queue()
q.put("a")

while True:
    c = q.get()
    if len(c) > n:
        break
    if len(c) == n:
        print(c)

    nx = c[-1]
    if nx != "a":
        q.put(c + chr(ord(nx) - 1))
    q.put(c + nx)
    q.put(c + chr(ord(nx) + 1))
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]

dp=[0]*(n+1)
dp[0]=1
for i in range(m):
    dp[a[i]]=-1

for i in range(1,n+1):
    if dp[i]==-1:continue
    if dp[i-1]!=-1:
        dp[i]+=dp[i-1]
    if i>1 and dp[i-2]!=-1:
        dp[i]+=dp[i-2]
print(dp[-1])
# Judge status: Accepted
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a, b = map(int, input().split())
print(len(set(prime_factorize(a)) & set(prime_factorize(b))) + 1)
# Judge status: Accepted
N = int(input())
print(((N+110)//111)*111)
# Judge status: Accepted
a,b,c,d=map(int,input().split())

x=a//d
if a%d!=0:
  x+=1
y=c//b
if c%b!=0:
  y+=1

if x<y:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
u=max(l)
d=0
i=0
while l[i]!=u:
  if l[i]>l[i+1]:
    d=d+abs(l[i+1]-l[i])
  i=i+1
r=i
for b in range(r,n):
    d=d+(u-l[b])
print(d)
# Judge status: Accepted
import bisect,copy,heapq,string
from collections import *
from math import *
from itertools import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = [LIST() for i in range(n)]
ans = 0

for x in a[::-1]:
        if ( x[0] + ans ) % x[1] != 0:
                ans += x[1] - ( x[0] + ans ) % x[1]
print(ans)
# Judge status: Wrong Answer
n = int(input())
w = list(map(int, input().split()))

t = round(sum(w)/2)

x = 0
y = 0
for i in w:
  if x < t:
    x += i
  else:
    y += i
print(abs(x-y))
# Judge status: Wrong Answer
n = int(input())
res = 0
for i in range(1, n+1):
    x = n//i
    res += i*x*(x+1)/2
    
print(res)
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))

# 二分探索の為のKey関数
def f(m):
  cut=0
  for aa in a:
    cut+=(aa-1)//m
    if cut > k:
      return False
  return True

l,r=0,10**9
while r-l>1:
  m=(l+r)//2
  if f(m):
    r=m
  else:
    l=m

print(r)
# Judge status: Accepted
n,k = map(int,input().split())
h = [int(input()) for _ in range(n)]
h.sort()
ans = float('inf')
for i in range(n-k+1):
    ans = min(ans,(h[i+k-1] - h[i]))
print(ans)
# Judge status: Wrong Answer
n = int(input())
r = list(map(int, input().split()))
o = (max(r) + min(r)) // 2
old = None
for x in range(o//2, max(r)):
  t = sum([(i - x) ** 2 for i in r])
  if not old:
      old = t
      continue
  if t < old:
    old = t
print(old)
# Judge status: Accepted
A, B, C, D = map(int, input().split())

for i in range(999999):
    C -= B
    if C <= 0:
        print('Yes')
        break
    A -= D
    if A <= 0:
        print('No')
        break
# Judge status: Accepted
h, k = map(int, input().split())
h = sorted(map(int, input().split()), reverse=True)

n = sum(h[k:])

print(n)
# Judge status: Accepted
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


def inpl():
    return list(map(int, input().split()))


N = int(input())

ans = 0
for i in range(1, N + 1):
    if i % 3 == 0 or i % 5 == 0:
        continue
    ans += i

print(ans)
# Judge status: Accepted
s = input()
t = input()
s_list = sorted(list(s))
t_list = sorted(list(t),reverse=True)
s_hoge = ''.join(s_list)
t_hoge = ''.join(t_list)
if s_hoge < t_hoge:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s = input()
t = input()

ans = 0
if s == t:
    print(ans)
else:
    for i in range(len(s)):
        if s[i] != t[i]:
            ans += 1
    print(ans)
# Judge status: Accepted
A = ['Sunny','Cloudy','Rainy']
S = input()
for i in range(3):
  if A[i] == S:
    ans = A[(i+1)%3]
print(ans)
# Judge status: Accepted
args = input().split(' ')

N = int(args[0])
M = int(args[1])

isAccepted = (N == M)

print("Yes" if isAccepted else "No")
# Judge status: Wrong Answer
n = int(input())
s = input()

if s[:n] == s[n:]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
for i in range(n):
    if b[i] <= a[i]:
        c = c + b[i]
    else:
        d = min(b[i]-a[i],a[i+1])
        c = c + a[i] + d
        a[i+1] = a[i+1] -d
print(c)
# Judge status: Accepted
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    A, B, C = in_nn()
    ans = min(B // A, C)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n, m = map(int, input().split())
stores = [tuple(map(int, input().split())) for _ in range(n)]
dict_stores = dict(stores)
sorted_dict = sorted(dict_stores.items(), key=lambda x: x[0])
total = 0
ans = 0
for cost, number in sorted_dict:
    total += number
    if total >= m:
        diff = m - (total - number)
        ans += cost * diff
        break
    else:
        ans += cost * number
print(ans)
# Judge status: Accepted
n=int(input())
a=0
for i in range(n+1):
  a+=i
print(a)
# Judge status: Accepted
n = int(input())
primes = {}
for i in range(2, int(n**0.5)+1):
    if n%i==0:
        cnt = 0
        while n%i==0:
            n //= i
            cnt += 1
        primes[i] = cnt
    if n==1:
        break
else:
    if n!=1:
        primes[n] = 1
ans = 0
for i in primes.values():
    for j in range(1, 100000):
        if j*(j+1)//2<=i:
            ans += 1
        else:
            break
print(ans)
# Judge status: Wrong Answer
import math

num, dist = map(int, input().split())
count = 0
for i in range(0,num):
    x, y = map(int, input().split())
    distance = math.sqrt(x**2 + y**2)
    if distance >= dist:
        count += 1

print(count)
# Judge status: Accepted
x=int(input())
print(x//500*1000+x%500//5*5)
# Judge status: Accepted
#116A
# 1.値を正しく取得
a, b, c = (int(x) for x in input().split())

# 2.正しく処理
print(min(b//a,c))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
x = 1
ans = 0

for i in a:
    if i == x:
        ans += 1
        x += 1

if ans == 0:
    print(-1)
else:
    print(len(a)-ans)
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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


if (b > 9 or a > 9):
    print(-1)
else:
    print(a*b)
# Judge status: Accepted
from itertools import permutations

N = int(input())
dist = [list(map(int, input().split())) for _ in range(N)]

ans = []
for case in permutations([i for i in range(N)]):
    total = 0
    for i in range(len(case)-1):        
        total += ((dist[case[i]][0]-dist[case[i+1]][0])**2 + (dist[case[i]][1]-dist[case[i+1]][1])**2)**(1/2)
    ans.append(total)

print(sum(ans)/len(ans))
# Judge status: Wrong Answer

[A,B,C] = list(map(int,input().split()))
X = [A,B,C]

saidai=max(X)
#print(saidai)
#print(sum(X))

i=1
while True:
    dammy = 3 * (saidai+i) - sum(X)
    if dammy %2 == 0:
        print(dammy//2)
        break
    i+=1
# Judge status: Wrong Answer
n,m=(int(i) for i in input().split())
l=[int(i) for i in input().split()]
if(sum(l)>=m):
	print(n-sum(l))
else:
	print(-1)
# Judge status: Accepted
n = int(input())
w = [int(x) for x in input().split()]
ans = 1e9
for i in range(n):
  s1 = sum(w[:i])
  s2 = sum(w[i:])
  s = abs(s1 - s2)
  ans = min(s, ans)
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
arr = [0]*(n+1)
ans = 0
mod = 10**9+7
for i in range(n):
  arr[i+1] += arr[i]+a[i]
  
for i in range(n):
  ans += (a[i]*(arr[n]-arr[i+1]))%mod
print(ans%mod)
# Judge status: Accepted
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xx=max(x)
yy=min(y)
t1=max(X,xx)
t2=min(Y,yy)
if t1<t2:
    print("No War")
else:
    print("War")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

def gcd(x,y):
    while y != 0:
        x,y = y,x%y
    return x

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

ans = 0
for i in range(n):
    ans = max(ans,gcd(l[i],r[n-i-1]))
print(ans)
# Judge status: Wrong Answer
a=int(input())
print("christmas"+"Eve"*(25-a))
# Judge status: Wrong Answer
n,k=map(int,input().split())
x=list(map(int,input().split()))
a=[x[i] for i in range(n) if x[i]<0]
b=[x[i] for i in range(n) if x[i]>=0]
na=len(a)
nb=len(b)

ans=10**10
if k<=nb:
    ans=b[k-1]
for i in range(1,na+1):
    if 0<=k-i-1<=nb-1:
        ans=min(ans,min(-2*a[-i]+b[k-i-1],-a[i-i]+2*b[k-i-1]))
    elif k-i<0:
        ans=min(ans,-a[-k])
print(ans)
# Judge status: Accepted
v = ["a", "e", "i", "o", "u"]
if input() in v:
    print("vowel")
else:
    print("consonant")
# Judge status: Wrong Answer
n,k=map(int,input().split())
lst_1=list(map(int,input().split()))
# print(lst_1)
lst_2=[]
for i in range(n-k+1):
    temp=1
    temp=lst_1[i+k-1]/lst_1[i]
    lst_2.append(temp)
for i in range(len(lst_2)-1):
    if lst_2[i]<lst_2[i+1]:
        print("Yes")
    else:print("No")
# Judge status: Accepted
x, y = map(int,input().split())

if x*y < 0: #異符号→反転可能性あり
    print(abs(abs(x)-abs(y))+1)

elif x*y == 0:
    if x <= y:
        print(y-x)
    else:
        print(x-y+1)

else: #同符号→反転可能性なし
    if x <= y:
        print(y-x)
    else:
        print(x-y+2)
# Judge status: Accepted
from collections import defaultdict
ans = defaultdict(int)
N = int(input())

for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            ans[i*i+j*j+k*k+i*j+j*k+k*i] += 1
for i in range(N):
    print(ans[i+1])
# Judge status: Wrong Answer
x, y = map(int, input().split())
if y % x == 0:
    print(-1)
else:
    print(x)
# Judge status: Accepted
x = int(input())
i, j = 0, 0
while j < x:
    i += 1
    j += i
print(i)
# Judge status: Accepted
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
z = [x + y for x, y in xy]
w = [x - y for x, y in xy]
z.sort()
w.sort()

ans = max(z[-1] - z[0], w[-1] - w[0])
print(ans)
# Judge status: Wrong Answer
n,m = map(int,input().split())
li = []
for _ in range(m):
    li.append(list(input().split()))
li.sort(key=lambda x:x[0])
already = False
cnt_ans = 0
cnt_penalty = 0
prev = 0
checked = []
for p,s in li:
    if p in checked:
        continue
    else:
        prev = p
        if s == "WA":
            cnt_penalty += 1
        else:
            cnt_ans += 1
            checked.append(p)
print(cnt_ans,cnt_penalty)
# Judge status: Accepted
n = int(input())
s = set()
for _ in range(n):
    s.add(input())
print(len(s))