peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N = int(input())
Vs = list(map(int, input().split()))

Vs.sort()

print(Vs)

initialGousei = (Vs[0] + Vs[1]) / 2

for i in range(2, N):
    initialGousei = (initialGousei + Vs[i]) / 2

print(initialGousei)
# Judge status: Wrong Answer
print("Yes" if len(input())==3 else "No")
# Judge status: Wrong Answer
import collections
n=int(input())
a=list(map(int,input().split()))
b=list(collections.Counter(a).items())
lst=[]
for i in range(len(b)):
  if b[i][1]>1:
    lst.append(int(b[i][0]))
if len(lst)<2:
  print(0)
else:
  lst.sort(reverse=True)
  print(lst[0]*lst[1])
# Judge status: Wrong Answer
n,W=map(int,input().split())
lst=[[0,0]]
for i in range(n):
  w,v=map(int,input().split())
  lst.append([w,v])
nap=[]
for i in range(n+1):
  nap.append([0]*(W+1))
for i in range(1,n+1):
  for j in range(1,W+1):
    if lst[i][0]<=j:
      nap[i][j]=max(nap[i-1][j],nap[i-1][j-lst[i-1][0]]+lst[i-1][1])
    else:
      nap[i][j]=nap[i-1][j]
print(nap[n][W])
# Judge status: Accepted
n,x=map(int,input().split())
li=list(map(int,input().split()))
s=[0]
a=0
for i in li:
  a+=i
  s.append(a)
l=[i for i in s if i<=x]
print(len(l))
# Judge status: Accepted
N,M=map(int,input().split());print((min(2*N,M)+M)//4)
# Judge status: Accepted
h,n = list(map(int, input().split()))
a = list(map(int, input().split()))

if sum(a) >= h:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
R = int(input())

print(2*R*3.14)
# Judge status: Accepted
n = int(input())
ab = [map(int, input().split()) for _ in range(n)]
a, b = [list(i) for i in zip(*ab)]
 
a.reverse()
b.reverse()
ans = 0
 
for j in range(n):
  a[j] += ans
  if a[j] % b[j] != 0:
    ans += b[j] -(a[j] % b[j])
 
print(ans)
# Judge status: Accepted
N = int(input())

ans = N*(N-1)//2

print(ans)
# Judge status: Accepted
A,B = map(int,input().split())
if A >= B:
  if A-1 >= B:
    print(A*2-1)
  else:
    print(A+B)
else:
  if B-1 >= A:
    print(B*2-1)
  else:
    print(A+B)
# Judge status: Accepted
import random
 
for i in range(365):
	print(random.randrange(1,27))
# Judge status: Accepted
S = list(input())

for i in range(len(S)-1):
  if S[i] == S[i+1]:
    print('Bad')
    break
else:
  print('Good')
# Judge status: Accepted
import bisect
from itertools import accumulate
N, X = map(int, input().split())
L = list(map(int, input().split()))
Lsum = list(accumulate(L))
ind = bisect.bisect_right(Lsum, X)
print(ind+1)
# Judge status: Wrong Answer
a=input()
ans="No"

for i in range(1,len(a)):
	if a[i-1]+a[i]=="hi":
		ans="Yes"
	else:
		ans="No"
		break
print(ans)
# Judge status: Accepted
count=0
n=int(input())
l=list(map(int,input().split()))
if n==1 or n==2:
    print(0)
else:
    for i in range(n-2):
        for j in range(i+1,n-1):
            for k in range(j+1,n):
                if l[i]!=l[j] and l[j]!=l[k] and l[i]!=l[k] and abs(l[i]-l[j])<l[k]<l[i]+l[j]:
                    count+=1
                    
    print(count)
# Judge status: Accepted
a,b,c = map(int,(input().split()))
ans = 0
if a%2 + b%2 + c%2 == 1:
    if a%2 == 0:
        a += 1
    if b%2 == 0:
        b += 1
    if c%2 == 0:
        c += 1
    ans += 1
if a%2 + b%2 + c%2 == 2:
    if a%2 == 1:
        a += 1
    if b%2 == 1:
        b += 1
    if c%2 == 1:
        c += 1
    ans += 1

A = max(a,b,c) -a
B = max(a,b,c)- b
C = max(a,b,c) -c

print(ans+(A+B+C)//2)
# Judge status: Accepted
rgb = int("".join(input().split()))
print("YES" if rgb % 4 == 0 else "NO")
# Judge status: Wrong Answer
acgt = ['A', 'T', 'G', 'C']
word = input()
res = 0
count = 0

for s in word:
    if s in acgt:
        count += 1
    elif res < count:
        res = count

print(res)
# Judge status: Wrong Answer
a = int(input())
b = a/500
c = b%500
d = c/5
print(b+d)
# Judge status: Accepted
s = input()
n = len(s)

pre = s[0]
now = ''
cnt = 1
for i in range(1,n):
    if pre != now + s[i]:
        pre = now + s[i]
        now = ''
        cnt += 1
    else:
        now = now + s[i]
print(cnt)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
from collections import Counter
C = Counter(A)
e = []
for k,v in C.items():
    if v >= 2: e.append(k)
    if v >= 4: e.append(k)
e.sort(reverse=True)
if len(e) >= 2:
    print(e[0]*e[1])
else:
    print(0)
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a < b:
  ans = 'Bob'
elif a == b:
  ans = 'Draw'
else:
  ans = 'Alice'
print(ans)
# Judge status: Accepted
money = int(input())

output = 0
if money <= 1000:
  output = 1000 - money
elif money % 1000 == 0:
  output = 0
else:
  output = 1000 - (money % 1000)
  
print(output)
# Judge status: Accepted
n= int(input())
if n%1000==0:
	print(0)
else:
	print(1000-n%1000)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,int(n**0.5)+1):
    x = n // i - 1 if n % i == 0 else n // i
    x -= i-1
    ans += x * 2
    if i * i < n:
        ans -= 1 
print(ans)
# Judge status: Accepted
nm = list(map(int, input().split()))
sc = []
for _ in range(nm[1]):
    sc.append(list(map(int, input().split())))

for i in range(1000):
    i = str(i)
    if len(i) == nm[0]:
        for j in sc:
            if int(i[j[0]-1]) == j[1]:
                continue
            else:
                break
        else:
            print(int(i))
            exit()

print(-1)
# Judge status: Accepted
## coding: UTF-8
from fractions import gcd
s = input().split()
t = [int(p) for p in s]
#print(t)

A = t[0]
B = t[1]
C = t[2]

#print(A)
#print(B)
Gcd = gcd(A, B)
#print(Gcd)

#print(C)

if(C % Gcd == 0):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
S = input()
T = input()

def match(k):
    flag = True
    for i in range(len(T)):
        if S[i+k] != T[i] and S[i+k]!="?":
            flag = False
            break
    return flag

flag = False
for k in reversed(range(len(S)-len(T)+1)):
    # print(k)
    if match(k):
        S = S[:k] + T + S[k+len(T):]
        flag = True
        break
    
if flag:
    ans = S.replace("?","a")

if not flag:
    ans = "UNRESTORABLE"

print(ans)
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in l[:len(l) - 1]:
    cnt += 1
if cnt > l[len(l) - 1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
D,T,S = list(map(int, input().split()))

if S*T >= D:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
from collections import deque

def main():
    k = int(input())
    q = deque(range(1, 10))
    for _ in range(k):
        x = q.popleft()
        y = x * 10 + x % 10
        if x % 10 > 0:
            q.append(y - 1)
        q.append(y)
        if x % 10 < 9:
            q.append(y + 1)
    print(x)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n, x, t = map(int, input().split())

import math

print(t*math.ceil(n/x))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
k = 1
x = y = 0
c = A[0]
for i in A[1:]:
    if c < i:
        x = 1
    elif c > i:
        y = 1
    if x == 1 and y == 1:
        k += 1
        x = y = 0
    c = i
print(k)
# Judge status: Accepted
A,B,N = map(int,input().split())
if N >= (B-1):
        x = B -1
else:
        x = N
print((A * x // B) - A * (x//B))
# Judge status: Wrong Answer
X = int(input())
if X <= 30:
  print("NO")
else:
  print("YES")
# Judge status: Accepted
N,M = map(int, input().split())

dp = [1] * N
red = [False] * N
red[0] = True
for i in range(M):
    xi,yi = map(int, input().split())
    xi-=1
    yi-=1
    dp[yi] += 1
    red[yi] = red[yi] or red[xi]
    dp[xi] -= 1
    if dp[xi] == 0:
        red[xi] = False

ans = sum(red)
print(ans)
# Judge status: Accepted
k,s = map(int, input().split())
ans = 0

for x in range(k+1):
  for y in range(k+1):
    if 0<=s-x-y and s-x-y <=k:
      ans+=1
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import math
n = int(input())
txy = [map(int, input().split()) for _ in range(n)]
t, x, y = [list(i) for i in zip(*txy)]

gt = 0
gx = 0
gy = 0

for i in range(n):
    wt = t[i] -gt
    ww = abs(x[i] - gx) + abs(y[i] - gy)
    if (wt < ww) or ((wt - ww) % 2 == 1):
        print("No")
        break

    gt = t[i]
    gx = x[i]
    gy = y[i]

else:
    print("Yes")
# Judge status: Accepted
n = int(input())
for i in range(1, 10):
    ans = i * 111
    if ans >= n:
        print(ans)
        break
# Judge status: Accepted
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    a, b, t = map(int, input().split())
    print((t // a) * b)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
# Judge status: Accepted
s=sorted(input())
print('Yes'if(s[::2]==s[1::2]!=s[::-2])else'No')
# Judge status: Wrong Answer
k = int(input())
a, b = map(int, input().split())

c = a % k
for i in range(a, b+1):
    if i % k == 0:
        print('OK')
        break
    else:
        print('NG')
        break
# Judge status: Accepted
import sys
from math import atan, degrees

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    a, b, x = map(int, readline().split())

    if x > a * a * b / 2:
        ans = atan(2 * (a * a * b - x) / (a ** 3))
    else:
        ans = atan(a * b * b / (2 * x))

    print(degrees(ans))
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
x,y=map(int,input().split())
count=0
while x<=y:
    x*=2
    count+=1
print(count)
# Judge status: Accepted
c=[list(map(int,input().split())) for i in range(3)]
x=c[0][2]-c[0][1]
y=c[0][1]-c[0][0]
for i in range(1,3):
    if c[i][1]-c[i][0]!=y:
        print("No")
        break
    if c[i][2]-c[i][1]!=x:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
N,K=map(int,input().split())
if N%K==0 :
  print(0)
else :
  print(1)
# Judge status: Wrong Answer
import math
n,k=map(int, input().split())
an = list(map(int, input().split()))

min_place = an.index(min(an))
left = math.ceil((min_place)/(k-1))
if (min_place+1)<k:
    min_place2 = k
else:
    min_place2 = min_place
right = math.ceil((n-min_place2-1)/(k-1))
Ans = left + right
if Ans==0:
    Ans += 1
print(Ans)
# Judge status: Wrong Answer
N = int(input())
if N >= 105:
    print(1)
else:
    print(0)
# Judge status: Accepted
N,Y = map(int,input().split())

for i in range(N+1):
    for j in range(N+1):
            m = Y - (10000*i+j*5000)
            if m >= 0 and (i+j+m//1000) == N:
                print(i,j,m//1000)
                exit()
print(-1,-1,-1)
# Judge status: Accepted
N = int(input())
X = []
Y = []
sum=0
#距離の和を計算
for _ in range(N):
  x,y=map(int,input().split())
  for i, [x_,y_] in enumerate(zip(X,Y)):
    sum+=((x-x_)**2+(y-y_)**2)**(0.5)
  X.append(x)
  Y.append(y)

print(sum*2/N)
# Judge status: Wrong Answer
def wtf(x):
    twos = 0
    fives = 0
    for j in range(1, 60):
        bs = 2 ** j
        twos = twos + x // bs
        bs = 2 * 5 ** j
        fives = fives + x // bs
    return min(twos, fives)
x = int(input())
print(wtf(x) if x % 2 == 0 else 0)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if a<=0 and b<=0 and c<=0 and d<=0:
  print(a*c)
elif a>=0 and b>=0 and c>=0 and d>=0:
  print(b*d)
else:
  print(b*d)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)

ans = 0
for i in range(n):
    ans += a[2 * i + 1]
print(ans)
# Judge status: Accepted
N=int(input())

M=10**9
for i in range(1,N//2+1):
    a=list(str(i))
    b=list(str(N-i))
    #print(a,b)
    k=0
    for q in range(len(a)):
        k+=int(a[q])
    for p in range(len(b)):
        k+=int(b[p])
    M=min(M,k)
print(M)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print((a+b+c)/2)
# Judge status: Wrong Answer
from fractions import gcd


def invmod(j):
    return pow(j, MOD - 2, MOD)


N = int(input())
A = list(map(int, input().split()))

MOD = 10 ** 9 + 7


l = 1
ans = 0
for i in range(N):
    g = gcd(l, A[i])
    multip = A[i] * invmod(g)
    l *= multip
    ans *= multip
    ans += l * invmod(A[i])
    if ans >= MOD:
        ans -= MOD

print(ans % MOD)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
pdiff = 0
ndiff = []
for i, j in zip(a, b):
    if i-j>0:
        pdiff += i-j
    elif i-j<0:
        ndiff.append(j-i)

while ndiff:
    tmp = ndiff.pop()
    pdiff -= tmp//2
if pdiff<=0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, M = map(int, input().split())

if (2 * N > M):
    print(M // 2)
    exit()
elif (2 * N == M):
    print(M // 2)
    exit()
else:
    # 2 * N< M のときはMに余裕があるときはcを2つ使ってSを作成する
    # Mこのうちk個使ってSを作成
    # Mが奇数or偶数で分ける
    if (M % 2 == 0):
        k = M // 2 - N
    else:
        k = (M // 2) - N - 1
    print(min(((M - k) // 2), (N + (k // 2))))
# Judge status: Wrong Answer
N = int(input())

alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
ans = []
original = []
for i in range(N):
    original.append("a")

usechr = original[:]
for chr in range(N):
    usechr = original[:]
    ans.append("".join(usechr[:-chr-1] + alphabet[:chr+1]))
ans.sort()

for a in ans:
    print(a)
# Judge status: Accepted
import math
N = int(input())
X = N / 1.08

floor = math.ceil(N/1.08)
ceil = math.ceil((N+1)/1.08)

for i in range(floor,ceil):
    print(i)
    break
else:
    print(":(")
# Judge status: Accepted
K = int(input())
ans = -1
if K%2 == 0:
    pass
elif K%5 == 0:
    pass
else:
    num = 7
    ans = 0
    while True:
        ans += 1
        if num % K == 0:
            break
        else:
            num = (num * 10 + 7)%K
print(ans)
# Judge status: Accepted
def resolve():
	S = input()
	if S[-1] =='s':
		print(S+'es')
	else:
		print(S+'s')
resolve()
# Judge status: Wrong Answer
n=input()
m=list(n)
l=[int(i) for i in m]
l.reverse()
l.append(0)
k=l
ans=0
for i in range(len(l)):
  if k[i]<=5:
    ans+=k[i]
  else:
    ans+=10-k[i]
    k[i+1]+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
lst1 = [list(map(int,input().split())) for i in range(n-1)]
ans = []
for i in range(n-1):
    res = 0
    for j in range(i,n-1):
        if res < lst1[j][1]:
            res = lst1[j][1]
        else:
            res += (res-lst1[j][1])%lst1[j][2] #駅を経つまでの時間を加算
        res += lst1[j][0]
        
    ans.append(res)

ans.append(0)

for i in ans:
    print(i)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

odd = [a[i] for i in range(n) if i % 2 == 0]
even = [a[i] for i in range(n) if i % 2 == 1]

if n % 2 == 1:
   b = odd[::-1]
   b.extend(even)
else:
   b = even[::-1]
   b.extend(odd)
print(*b)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
t = sum(a)
b = 0

for i in range(n):
    b += a[i]
    tmp = abs(2*b-t)
    ans = tmp if i==0 else min(ans, tmp)

print(ans)
# Judge status: Accepted
n = int(input())
w = list(map(int, input().split()))

a = sum(w)
b = 0
ans = float("inf")
for i in range(n):
    a -= w[i]
    b += w[i]
    ans = min(ans, abs(a-b))

print(ans)
# Judge status: Wrong Answer
A = list(map(int, input().split()))

if A[0] == A[1] == A[2] or A[0] != A[1] and A[0] != A[2]:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
a = int(input())
b = int(input())
if (a == 1 and b == 2) or (a == 2 and b == 2):
  print(3)
elif (a == 1 and b == 3) or (a == 3 and b == 1):
  print(2)
else:
  print(1)
# Judge status: Wrong Answer
a = input()
b = chr(ord(a))
print(b)
# Judge status: Accepted
A,B,C,D = map(int,input().split())
if max(A,C) <= min(B,D):
    print(abs(max(A,C)-min(B,D)))
else:
    print(0)
# Judge status: Wrong Answer
def solve():
  S = input()
  one,zero = 0,0
  for s in S:
    if s=='0':
      zero += 1
    else:
      if zero>0:
        one += 1
  ans = min(one,zero)*2
  return ans
print(solve())
# Judge status: Accepted
N = int(input())
s = input()
t = input()
lcm = 0
for i in range(N):
    f = False
    c = 0
    idx = 0
    for j in range(i, N):
        if s[j] == t[idx]:
            c += 1
        else:
            break
        idx += 1
    lcm = max(lcm, c)
print(N*2-lcm)
# Judge status: Wrong Answer
x, lists, d = eval(input()), list(map(str, input().split())), {}
for item in lists:
   if item in d:
       d[item] += 1
   else:
       d[item] = 1
print(len(d))
# Judge status: Accepted
a, b, c = map(int, input().strip().split(" "))
m = max(a, b, c)

if (m*3) % 2 == (a+b+c) % 2:
    M = m * 3
else:
    M = (m+1) * 3

M -= (a+b+c)
print(M//2)
# Judge status: Wrong Answer
N,K=map(int,input().split())
a=map(int,input().split())
ans = sorted(a)
answer = ans[:3]
aaa = sum(answer)
print(aaa)
# Judge status: Accepted
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
q=int(input())
S = [list(map(int, input().split())) for _ in range(q)]
C=Counter(a)
#print(C)
ans=0
for k,v in C.items():
    ans+=k*v
#print(ans)
for i in range(q):
    if S[i][0] in C:
        if C[S[i][0]]>=1:
            ans+=(S[i][1]-S[i][0])*C[S[i][0]]
            C[S[i][1]]+=C[S[i][0]]
            C[S[i][0]]=0
    print(ans)
# Judge status: Accepted
n, k = map(int, input().split())

if n%k==0:
  print(0)
else:
  print(1)
# Judge status: Wrong Answer
s = input()

for i in range(len(s)):
  if s[i] == "A":
    st = i-1
    break
for i in range(len(s)):
  if s[-i] == "Z":
    en = len(s)-i
    break;
print(en - st)
# Judge status: Wrong Answer
n,x = list(map(int,input().split()))
a = list(map(int,input().split()))
op=0
for i in range(len(a)-1):
    s = a[i]+a[i+1]
    if (s < x):
        continue
    else:
        diff = s - x
        op += diff
        if a[i] >= a[i+1]:
            a[i] -= diff
        else:
            a[i+1] -= diff
print(op)
# Judge status: Wrong Answer
from operator import mul
from functools import reduce


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


N = int(input())
ans = 0
amari = int(N % 3)
shou = int(N // 3)

for i in range(shou):

    ans = (ans + combinations_count((amari + shou - 1), amari)) % (10**9 + 7)
    amari += 3
    shou -= 1
    print(ans)
print(ans)
# Judge status: Wrong Answer
import sys;input = lambda : sys.stdin.readline()
n,m = map(int,input().split())
print(n+(m-2*n)//4)
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))

homework = sum(A)

if sum(A) <= N:
  print(N - sum(A))
  
else:
  print(-1)
# Judge status: Accepted
s = input()
s = '0' + s[::-1]
dp = [[0, 0] for _ in range(len(s) + 1)]
for i in range(len(s)):
    for j in range(2):
        if j == 0: #ぴったり
            dp[i + 1][j] = min(dp[i]) + int(s[i])
        else: #1枚多めに払う
            dp[i + 1][j] = min(dp[i][1] + 9 - int(s[i]), dp[i][0] + 11 - int(s[i]))

print(min(dp[-1]))
# Judge status: Accepted
s = str(input())
t = str(input())

ds = {}
dt = {}

for i in range(len(s)):
    if s[i] not in ds:
        ds[s[i]] = 1
    else:
        ds[s[i]] += 1

for i in range(len(t)):
    if t[i] not in dt:
        dt[t[i]] = 1
    else:
        dt[t[i]] += 1

vs = list(ds.values())
vt = list(dt.values())

vs.sort()
vt.sort()
#print(vs)
#print(vt)

if vs == vt:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = input()
dlist = []

for i in range(len(s)-2):
    x = s[i:i+3]
    x = int(x)
    d = x - 753
    
    if d < 0:
        d = -d
        dlist.append(d)
    else:
        dlist.append(d)
        
print(min(dlist))
# Judge status: Wrong Answer

N = input()
L_list = [int(l) for l in input().split()]
L_list = list(set(sorted(L_list)))[::-1]
count = 0
for i in range(len(L_list)):
    for j in range(i, len(L_list)):
        for k in range(i, len(L_list)):
            if L_list[i] + L_list[j] > L_list[k]:
                if L_list[i] != +L_list[j] and L_list[k] != L_list[j] and L_list[k] != L_list[i]:
                    count += 1
print(count)
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())

ans = 0

if A + B >= K:
    print(A)
else:
    print(A - (K-(A+B)))
# Judge status: Accepted
k, x = map(int, input().split())
if ((500 * k) >= x):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def actual(N):
    for i in range(N, 0, -1):
        is_square_number = (i ** 0.5) % 1 == 0

        if is_square_number:
            return i

N = int(input())
print(actual(N))
# Judge status: Accepted
A, B = map(int, input().split())

ans = 0
for i in range(A, B+1):
    s = list(str(i))
    s.reverse()
    s = ''.join(s)
    if s == str(i):
        ans += 1

print(ans)
# Judge status: Accepted
import sys

def main():
    A, B = map(int, input().split())
    ab = abs(A+B)
    if ab % 2 == 1:
        print('IMPOSSIBLE')
    else:
        print(ab // 2)
    return


if __name__ == "__main__":
    main()
    sys.exit(0)
# Judge status: Wrong Answer
a=list(map(int,input().split()))
b=sum(a)
 
if (b%3 ==0 or a[0]%3 ==0 or a[1]==0) :
  print('Possible')
else :
  print('Impossible')
# Judge status: Accepted
N = int(input())

S = {}

for i in range(N):
    temp = input()
    S[temp] = 1

ans = 0
for i in S:
    ans += 1

print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = (10**5+1)*[0]
ans = 0

for a in A:
  if a<=10**5:
    B[a]+=1
  else:
    ans+=1

for n in range(10**5):
  if B[n]<n:
    ans+=B[n]
  elif n<B[n]:
    ans+=B[n]-n

print(ans)
# Judge status: Wrong Answer
N = int(input())
S = input()
arr = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
c = ""
for s in S:
    c = c + arr[arr.find(s)+2:arr.find(s)+3]
print(c)
# Judge status: Accepted
x = int(input())

m = 100
r = 1.01
i = 0
while m < x:
    m = int(m*1.01)
    i += 1

print(i)
# Judge status: Wrong Answer
S = list(input())
C = S[2:-1]
if S[0] == "A" and "C" in C:
    print("AC")
else:
    print("WA")
# Judge status: Accepted
H, A = map(int,input().split())
count = 0
while H > 0:
  H -= A
  count += 1
  
print(count)
# Judge status: Wrong Answer
a,b = map(int,input().split())
#L = list()map(int,input().split())
if a*500 >= b:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
ans = 0
for s in reversed(input()):
    n = int(s)
    if n < 6:
        ans += n
    else:
        ans += (10 - n) + 1

print(ans)
# Judge status: Accepted
n = int(input())
sp = []
for i in range(n):
    s, p = input().split()
    sp.append([s, int(p)])

sorted_sp = sorted(sp, key=lambda x: x[1], reverse=True)
sorted_sp = sorted(sorted_sp, key=lambda x: x[0])

for i in range(n):
    print(sp.index(sorted_sp[i]) + 1)
# Judge status: Wrong Answer
from fractions import gcd

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

L=[0]*n
R=[0]*n
L[0]=A[0]
R[n-1]=A[n-1]
res=0

for i in range(1,n):
	L[i]=gcd(L[i-1],A[i-1])
for i in range(0,n-1):
	R[n-i-2]=gcd(R[n-i-1],A[n-i-1])

for i in range(1,n-1):
	res=max(res,gcd(L[i-1],R[i+1]))
	
res=max(res,L[n-1],R[0])
print(res)
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())
print(n//max(h,w))
# Judge status: Accepted
import math
a, b, h, m = map(int, input().split())

C = 2 * math.pi * (60*h - 11*m) / 720
c = a**2 + b**2 - 2*a*b*math.cos(C)
print(math.sqrt(c))
# Judge status: Accepted
def yes_no(flg):
    """
        if True return Yes
        if False return No
    """
    if flg:
        print('Yes')
    else:
        print('No')

n = int(input())
flg = False
for y in range(1,10):
    for x in range(1,10):
        if y * x == n:
            flg = True
yes_no(flg)
# Judge status: Accepted
x=int(input())
a=[]
for i in range(2,11):
    for j in range(1,32):
        a.append(j**i)
a=[l for l in a if l <= x]
print(max(a))
# Judge status: Wrong Answer
X,Y=list(map(int,input().split()))
print(X+Y/2)
# Judge status: Wrong Answer
s=list(input())
k=int(input())

cnt=0
for i in range(len(s)):
    num_al=ord(s[i])
    a_=123-num_al
    if k==0:break
    if s[i]=='a':continue
    if a_<=k:
        k-=a_
        s[i]='a'
    elif a_>k and i<len(s)-1:continue
    else:
        s[i]=chr(num_al+k)
        k=0
print(''.join(s))
# Judge status: Wrong Answer
for i in range(1,26):
  print(i)
# Judge status: Accepted
N=int(input())
ans=0
li=[]
for i in range(N):
    s=list(input())
    s.sort()
    li.append(s)
li.sort()
temp=1
for j in range(N-1):
    if li[j]==li[j+1]:
        temp+=1
    else:
        ans+=temp*(temp-1)//2
        temp=1
        
ans+=temp*(temp-1)//2
print(ans)