Harryxun/stf_run huggingface dataset:
N,M = map(int,input().split())

memo = [0]*N

for i in range(M):
    s,c = map(int,input().split())
    if memo[s-1]==0:
        memo[s-1]=c
    elif s==1 and c==0:
        print(-1)
            break
    else:
        if not memo[s-1]==c:
            print(-1)
            break


else:
    if memo[0]==0:
        memo[0]=1
    
    counter = 0
    for iterration,k in enumerate(memo):
        counter += k*(10**(len(memo)-iterration-1))
    print(counter)

### FIXED CODE ###

N,M = map(int,input().split())


li = ["#"]*N
A = "#"
if N==1:
    for i in range(M):
        s,c = map(int,input().split())
        if not c==A and not A=="#":
            print(-1)
            exit()
        else:
            A=c
  
    if A == "#":
        print(0)
    else:
        print(int(A))
    exit()
    

for i in range(M):
    s,c = map(int,input().split())
    if s==1 and c==0:
        print(-1)
        break

    if not li[s-1]=="#" and not li[s-1]==c:
        print(-1)
        break
    if li[s-1]=="#":
        li[s-1]=c
    
else:
    if li[0]=="#":
        li[0]=1
        
    num="".join(map(str,li))
    num_new=num.replace("#","0")
    print(num_new)
a,b=map(int,input().split)
print(a*b,(a+b)*2)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,(a+b)*2)
def gcd(a,b):
  while a>=1 and b>=1:
    a,b=b,a%b
  return int(a)
def lcm(a,b):
  return int(a*b/gcd(a,b))
N=int(input())
List_T=[int(input()) for i in range(N)]
T=1
n=1
for i in List_T:
  T=lcm(T,i)
print(T)

### FIXED CODE ###

def gcd(a,b):
  if a<b:
    a,b=b,a
  while b>0:
    a,b=b,a%b
  return int(a)
N=int(input())
T=1
for i in range(N):
  ti=int(input())
  T=T*ti//gcd(T,ti)
print(T)
N,M=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in range(M)]

Num=0
A=[]
B=[]
C=[]
        
if N==3:
    if M==0:
        print(Num=100)
    
    else:
        for i in s:
            if i[0]==1:
                A.append(i[1])
            
            elif i[0]==2:
                B.append(i[1])
            
            elif i[0]==3:
                C.append(i[1])
    
        if len(A)==0:
            print(-1)
        elif min(A)==0:
            print(-1)
        else:
            Num+=min(A)*100
            if len(B)==0:
                pass
            elif len(B)!=0:
                Num+=min(B)*10
            if len(C)==0:
                pass
            elif len(C)!=0:
                Num+=min(C)
            print(Num)
        
elif N==2:
    if M==0:
        print(Num=10)
    
    else:    
        for i in s:
            if i[0]==1:
                B.append(i[1])
            
            elif i[0]==2:
                C.append(i[1])
        
        if len(B)==0:
            print(-1)
        elif min(B)==0:
            print(-1)
        else:
            Num+=min(B)*10
            if len(C)==0:
                pass
            elif len(C)!=0:
                Num+=min(C)
            print(Num)

elif N==1:
    if M==0:
        print(0)
    else;
        for i in s:
            if i[0]==1:
                C.append(i[1])
        
            if len(C)!=0:
                N+=min(C)
                print(Num)
            else:
                print(Num)
    


### FIXED CODE ###

import sys
N,M=list(map(int, input().split()))

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

a=["a" for _ in range(N)]

if len(s)==0 and N==1:
    print(0)
    sys.exit()
    
elif len(s)==0:
    print(10**(N-1))
    sys.exit()

for i in s:
    if i[1]==0 and i[0]==1 and N!=1:
        print(-1)
        sys.exit()
   
    if a[i[0]-1]=="a":
        a[i[0]-1]=str(i[1])
    
    elif a[i[0]-1]!="a" and a[i[0]-1]==str(i[1]):
        continue
        
    elif a[i[0]-1]!="a" and a[i[0]-1]!=str(i[1]):
        print(-1)
        sys.exit()

num=[int(i) if i!="a" else 0 for i in a ]
    
if N==1:
    print(int(num[-1]))
elif N==2:
    ans=10*int(num[0])+int(num[1])
    if ans//10==0:
        ans+=10
    print(ans)
elif N==3:
    ans=100*int(num[0])+10*int(num[1])+int(num[2])
    
    if ans//100==0:
        ans+=100
    print(ans)
from scipy.special import comb
N, M, K = map(int, input().split())

ans = 0

for i in range(1, M):
    ans += i * (M-i) * N**2 
for i in range(1, N):
    ans += i * (N-i) * M**2

ans *= comb(N*M-2, K-2, exact=True)

print(int(ans % (10**9+7)))


### FIXED CODE ###

def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

N, M, K = map(int, input().split())

ans = 0

for i in range(1, M):
    ans += (i * (M-i) * N**2) % (10**9 + 7) 
for i in range(1, N):
    ans += (i * (N-i) * M**2) % (10**9 + 7)

ans *= comb(N*M-2 , K-2, 10**9+7)

print(int(ans % (10**9+7)))
def digitSum(n):
  #数値を文字列に変換
  s = str(n)
  #1文字ずつ数値化し配列にする
  array = list(map(int,s))
  #合計値を返す
  return sum(array)


N,A,B = map(int,input().split())
sum = 0
for i in range(N+1):
  if digitSum(i) <=B and digitSum(i)>=A:
    sum +=i
print(sum)

### FIXED CODE ###

def digitSum(n):
  #数値を文字列に変換
  s = str(n)
  #1文字ずつ数値化し配列にする
  array = list(map(int,s))
  #合計値を返す
  return sum(array)


N,A,B = map(int,input().split())
a = 0
for i in range(N+1):
  if digitSum(i) <= B and digitSum(i) >= A:
    a +=i
print(a)
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if (m1/=m2):
  print(1)
else:
  print(0)

### FIXED CODE ###

m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if (m1!=m2):
    print(1)
else:
    print(0)
def isPrime(n):
  if n == 2:
    return True
  for p in range(2, n):
      if n % p == 0:
        return False
  return True

x = float(input())
while True:
  if isPrime(x):
    print(x)
    break
  x = x+1

### FIXED CODE ###

def isPrime(n):
  if n == 2:
    return True
  for p in range(2, n):
      if n % p == 0:
        return False
  return True
 
x = int(input())
while True:
  if isPrime(x):
    print(x)
    break
  x = x+1
n,x,y=map(int,input().split())
x-=1
y-=1
ans=[0 for i in range(n)]
for ni in range(n):
    d=[100000 for i in range(n)]
    q=[]
    q.append(ni)
    d[ni]=0
    while q:
        p=q.pop()
        if(p>0 and d[p-1]>d[p]+1):
            q.append(p-1)
            d[p-1]=d[p]+1
        if(p<n-1 and d[p+1]>d[p]+1):
            q.append(p+1)
            d[p+1]=d[p]+1

        if(p==x and d[y]>d[x]+1):
            q.append(y)
            d[y]=d[x]+1
        if(p==y and d[x]>d[y]+1):
            q.append(x)
            d[x]=d[y]+1
        break

    for i in range(n):ans[d[i]]+=1
for i in range(1,n):print(ans[i]//2)

### FIXED CODE ###

n,x,y=map(int,input().split())
x-=1
y-=1
d=[10000 for i in range(n)]
ans=[0 for i in range(n)]
for i in range(n):
    for j in range(i,n):
        m=min(abs(i-j),abs(x-i)+abs(y-j)+1,abs(y-i)+abs(x-j)+1)
        ans[m]+=1

for i in range(1,n):
    print(ans[i])
import sys
input = sys.stdin.readline()
input = input.srip()
input = input.split(" ")
result = ""
for i in input:
    result += i[0].upper
return result

### FIXED CODE ###

strs = raw_input()
strs = strs.split()
print strs[0][0].upper() + strs[1][0].upper() + strs[2][0].upper()
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
ans=0c
for i in range(n):
    a=list(map(int,input().split()))
    res=[a[i]*b[i] for i in range(m)]
    if sum(res)+c>0:
        ans+=1
print(ans)

### FIXED CODE ###

#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
ans=0
for i in range(n):
    a=list(map(int,input().split()))
    res=[a[i]*b[i] for i in range(m)]
    if sum(res)+c>0:
        ans+=1
print(ans)
a=int(input())
s=str(input())
if a=>3200:
    print(s)
elif a<3200:
    print("red")

### FIXED CODE ###

a=int(input())
s=input()
if a >= 3200:
    print(s)
elif a<3200:
    print("red")
n,k=map(int,input().split())
if n<k:
    p=0
    for i in range(1,n+1):
        po=int(log(k/i,2))
        if i*(2**po)!=k:
            po+=1
        p+=(1/n)*((1/2)**po)
    print(p)
else:
    p=(n-k+1)/n
    for i in range(1,k):
        po=int(log(k/i,2))
        if i*(2**po)!=k:
            po+=1
        p+=(1/n)*((1/2)**po)
    print(p)

### FIXED CODE ###

from math import log
n,k=map(int,input().split())
if n<k:
    p=0
    for i in range(1,n+1):
        po=int(log(k/i,2))
        if i*(2**po)!=k:
            po+=1
        p+=(1/n)*((1/2)**po)
    print(p)
else:
    p=(n-k+1)/n
    for i in range(1,k):
        po=int(log(k/i,2))
        if i*(2**po)!=k:
            po+=1
        p+=(1/n)*((1/2)**po)
    print(p)
k, n = map(int, input().split())
aa = map(int, input().split())

B = []
for i in range(1, n):
    B.append(a[i]-a[i-1])
    
B.append(k-sum(B))
print(k-max(B))

### FIXED CODE ###

k, n = map(int, input().split())
aa = list(map(int, input().split()))

B = []

for i in range(1, n):
    B.append(aa[i] - aa[i - 1])

B.append(k - sum(B))
print(k - max(B))
#include <bits/stdc++.h>
using namespace std;

const int INF = 100100100;
const int MOD = (int)1e9 + 7;
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)

int main() {
  int a,b,c;
	cin >> a >> b >> c;
	string ans = "win";
	if (a+b+c>21) ans = "bust";
  cout << ans << endl;
}


### FIXED CODE ###


l = list(map(int,input().split()))
if sum(l) <= 21:
    print('win')
else:
    print('bust')
from collections import Counter
import sys
N = int(input())
A = [int(_) for _ in input().split()]

key_val_lis = []
for key, value in Counter(A).items():
    if value >= 2:
        key_val_lis.append((key, value))

ans_lis = sorted(key_val_lis, key=lambda x: -x[0])

if len(ans_lis) == 1 and ans_lis[0][1] < 4:
    print(0)
    sys.exit()

area_1 = ans_lis[0][0] * ans_lis[1][0]
area_2 = 0
if ans_lis[0][1] >= 4:
    area_2 = ans_lis[0][0] ** 2
print(max(area_1, area_2))


### FIXED CODE ###

from collections import Counter
import sys
N = int(input())
A = [int(_) for _ in input().split()]

key_val_lis = []
for key, value in Counter(A).items():
    if value >= 2:
        key_val_lis.append((key, value))

ans_lis = sorted(key_val_lis, key=lambda x: -x[0])

if len(ans_lis) <= 1 or ans_lis[0][1] is None:
        print(0)
        sys.exit()

area_1 = ans_lis[0][0] * ans_lis[1][0]
area_2 = 0
if ans_lis[0][1] >= 4:
    area_2 = ans_lis[0][0] ** 2
print(max(area_1, area_2))
O=input()
E=input()
for i in range(len(O)*2):
    if i%2==0:
        print(O[i//2],end="")
    else:
        print(E[i//2],end="")

### FIXED CODE ###

O=input()
E=input()
for i in range(len(O)*2-1 if len(O)!=len(E) else len(O)*2):
    if i%2==0:
        print(O[i//2],end="")
    else:
        print(E[i//2],end="")
ec    7340 KB     46 bytes     
?
1
2
input()
print(' '.join(input().split()[::-1]))


### FIXED CODE ###

input()
print(' '.join(input().split()[::-1]))
n = input()
a = list(map(int, input().split()))
flg = True
break_flg = False
total = 0
while True:
  for i, b in enumerate(a):
    if b%2 == 0:
      a[i] = b/2
    else:
      break_flg = True
      break
  if break_flg :
    break
  else:
    total += 1
print(total)


### FIXED CODE ###

a = input()
total = 0
for b in a:
  if b ==  '1':
    total += 1

print(total)
H, W, N = map(int, input().split())
r, c = map(int, input().split())
S = input()
T = input()




S_power = [[0, 0, 0, 0] for i in range(N+1)] #L, R, U, D
for i in range(N):
    if S[i] == "L":
        S_power[i][0] += 1
    elif S[i] == "R":
        S_power[i][1] += 1
    elif S[i] == "U":
        S_power[i][2] += 1
    else:
        S_power[i][3] += 1

T_power = [[0, 0, 0, 0] for i in range(N+1)]
for i in range(N):
    if T[i] == "L":
        T_power[i][0] += 1
    elif T[i] == "R":
        T_power[i][1] += 1
    elif T[i] == "U":
        T_power[i][2] += 1
    else:
        T_power[i][3] += 1

for j in range(4):
    for i in range(N-1):
        S_power[i+1][j] += S_power[i][j]
for j in range(4):
    for i in range(N-1):
        T_power[i+1][j] += T_power[i][j]
T_power.append([0, 0, 0, 0])



flag = 1
power_diff = []
for i in range(N):
    power_diff.append(S_power[i][1]-T_power[i-1][0])
power_diff_max = power_diff[::-1]
for i in range(N-1):
    power_diff_max[i+1] = max(power_diff_max[i+1], power_diff_max[i])
power_diff_max.reverse()

sr = r
for i in range(N):
    if S[i] == "L":
        sr -= 1
    if sr <= 0:
        flag = 0
        break
    if T[i] == "R" and power_diff_max[i] + sr + 1 <= W:
        sr += 1






power_diff = []
for i in range(N):
    power_diff.append(S_power[i][0]-T_power[i-1][1])
power_diff_max = power_diff[::-1]
for i in range(N-1):
    power_diff_max[i+1] = max(power_diff_max[i+1], power_diff_max[i])
power_diff_max.reverse()

sr = r
for i in range(N):
    if S[i] == "R":
        sr += 1
    if sr > W:
        flag = 0
        break
    if T[i] == "L" and power_diff_max[i] + 1 <= sr:
        sr -= 1







power_diff = []
for i in range(N):
    power_diff.append(S_power[i][2]-T_power[i-1][3])
power_diff_max = power_diff[::-1]
for i in range(N-1):
    power_diff_max[i+1] = max(power_diff_max[i+1], power_diff_max[i])
power_diff_max.reverse()

sr = r
for i in range(N):
    if S[i] == "U":
        sr -= 1
    if sr <= 0:
        flag = 0
        break
    if T[i] == "D" and power_diff_max[i] + sr + 1 <= H:
        sr += 1






power_diff = []
for i in range(N):
    power_diff.append(S_power[i][3]-T_power[i-1][2])
power_diff_max = power_diff[::-1]
for i in range(N-1):
    power_diff_max[i+1] = max(power_diff_max[i+1], power_diff_max[i])
power_diff_max.reverse()

sr = r
for i in range(N):
    if S[i] == "D":
        sr += 1
    if sr > H:
        flag = 0
        break
    if T[i] == "U" and power_diff_max[i] + 1 <= sr:
        sr -= 1


if flag == 1:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

H, W = map(int, input().split())
masu = []
for i in range(H):
    masu.append(list(input()))
black = []
for i in range(H):
    for j in range(W):
        if masu[i][j] == "#":
            black.append([i,j])
ans = -1
while len(black) != 0:
    ans += 1
    blacktemp = black[:]
    black = []
    for k in blacktemp:
        for i, j in [[0, -1], [0, 1], [-1, 0], [1, 0]]:
            if 0 <= k[0] + i <= H-1 and 0 <= k[1] + j <= W-1:
                if masu[k[0]+i][k[1]+j] == ".":
                    masu[k[0]+i][k[1]+j] = "#"
                    black.append([k[0]+i, k[1]+j])
print(ans)
N,M = list(map(int, input().split()))
 
s = [list(map(int,input().split())) for i in range(n)]
c = [list(map(int,input().split())) for j in range(n)]
 
for t1 in s:
    l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
    print(l.index(min(l)) + 1)

### FIXED CODE ###

a,b=map(int,input().split())
print((a + b) % 24)
def fact(n):
  for i in range(1,n+1): 
    fact = fact * i 
  return fact


x,y = input().split()
return ((fact(x)/(2*fact(x-2)) + (fact(y)/(2*fact(y-2)))

### FIXED CODE ###

def fact(n):
  fact=1
  for i in range(1,n+1): 
    fact = fact * i 
  return fact


x,y = input().split()
x = int(x)
y = int(y)
print((fact(x)//(2*fact(x-2))) + (fact(y)//(2*fact(y-2))))
import math
print(math.ceil(int(input()/2)))

### FIXED CODE ###

import math
print(math.ceil(int(input())/2))
n,z,w=map(int,input().split())
aa=input().split()
an=int(aa[-1])
if len(aa) > 1:
    am=int(aa[-2])
    print(max(abs(an-w),abs(an-am)))
else:
    print(abs(an-w))

### FIXED CODE ###

n,m=map(int,input().split())
q=(n-m)*100+m*1900
print(q*(1<<m))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = list(map(int,readline().split()))
a.sort()
if a[0] == a[-1]:
  if n > 1:
    print(0)
  else:
    print(1)
  exit()

def divisorize(fct):
    b, e = fct.pop()
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]
 
 
def factorize(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
 
 
def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
    
s = set()
if a[0] < a[1]:
  ans = 1
else:
  ans = 0
s.add(a[0])
for i in a[1:]:
  c = set()
  fct = factorize(i)
  for div in divisorize(fct):
      c.add(num(div))
  if c&s == set():
    ans += 1
  s.add(i)

print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = list(map(int,readline().split()))
a.sort()
if a[0] == a[-1]:
  if n > 1:
    print(0)
  else:
    print(1)
  exit()

if a[0] == 1:
  if a[0] == a[1]:
    print(0)
  else:
    print(1)
  exit()
  
def divisorize(fct):
    b, e = fct.pop()
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def factorize(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
 
 
def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
    
s = set()
if a[0] < a[1]:
  ans = 1
else:
  ans = 0
s.add(a[0])
for nm,i in enumerate(a[1:]):
  c = set()
  fct = factorize(i)
  for div in divisorize(fct):
      c.add(num(div))
  if c&s == set() and ((nm < n-2 and a[nm+2] != i) or nm == n-2):
    ans += 1
  s.add(i)

print(ans)
N=int(input())
l1=list(range(1,N+1))
#l2=sorted(l1,reverse=True)
l2=list(range(2,N+1))
l2.append(1)
M=0
for i in range(N):
    M+=l1[i]%l2[i]
print(M)

### FIXED CODE ###

N=int(input())
print(N*(N-1)//2)
# -*- coding: utf-8 -*-

import numpy
import scipy

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

c = 0
while True:
    for i, a in enumerate(A):
        if a%2 == 0:
            A[i] = A[i]/2
        else:
            break;
    c += 1
print(c)

### FIXED CODE ###

# -*- coding: utf-8 -*-

import numpy
import scipy

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

c = 0
flg = False
while True:
    #print(A)
    for i, a in enumerate(A):
        if a%2 == 0:
            A[i] /= 2
            #pass
        else:
            flg = True
            break
    if flg:
        break
    c += 1
print(c)
num = input().split(' ')
print((int(num[0]) - 1)＊(int(num[1]) - 1))

### FIXED CODE ###

num = input().split(' ')
a = int(num[0]) - 1
b = int(num[1]) - 1
print(a*b)
# それぞれのボールの文字列を取得
a = input()
b = input()

# それぞれのボールの個数を取得
aCount = int(input())
bCount = int(input())
ball = []
ball.append(aCount)
ball.append(bCount)

# 取り出したボールの文字列を取得
selectBall = input()

# それぞれの文字列の文字数を取得
# aLength = len(a)
# bLength = len(b)

# print(aLength)
# print(bLength)

if selectBall == a:
    aCount = aCount-1
    # print(aCount)
    ball[0] = aCount
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bCount = bCount-1
    ball[1] = bCount
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))


### FIXED CODE ###

# それぞれのボールの文字列を取得
a, b = input().split()

# それぞれのボールの個数を取得
aCount, bCount = input().split()
aNumber = int(aCount)
bNumber = int(bCount)

ball = []
ball.append(aNumber)
ball.append(bNumber)

# 取り出したボールの文字列を取得
selectBall = input()

if selectBall == a:
    aNumber = aNumber-1
    ball[0] = aNumber
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bNumber = bNumber-1
    ball[1] = bNumber
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))
N=int(input())
A=list(map(int,input().split()))

while len(set(A))!=1:
#for i in range(2):
    A.sort()
    for i in range(len(A)-1):
        if A.count(0):
            A.remove(0)
            break
        A[i+1]=A[i+1]%A[0]

print(max(A))

### FIXED CODE ###

A,B=map(int,input().split())
if B%A==0:
    print(A+B)
else:print(B-A)
N=int(input())
if N%2==1:
print(2*N)
else:
print(N)



### FIXED CODE ###

N=int(input())
if N%2==1:
	print(2*N)
else:
	print(N)
X = int(input())
Y = int(input())

x = X + Y/2

print(str(x))    

### FIXED CODE ###

X,Y = map(int,input().split())
print(X+Y//2)
n = input()

a = raw_input().split()

min = a[0]
max = a[0]
sum = a[0]

for num in range(len(a-1))
  if num > max:
    max = num
  if num < min:
    min = num
  sum += num 

print ("%d %d %d") %(min, max, sum)

### FIXED CODE ###

n = input()

a = map(int, raw_input().split())

print ("%d %d %d") %(min(a), max(a), sum(a))
s = set(map(int,input.split()))
print(len(s))

### FIXED CODE ###

s = list(set(map(int,input().split())))
print(len(s))
N, R = map(int, input().split(" "))
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - K))

### FIXED CODE ###

N, R = map(int, input().split(" "))
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - N))
N, K, Q = map(int, input().split())
A = [0] * Q
for i in range(Q):
    A[i] = int(input())
list = [K-Q] *N
for i in range(Q):
  list[A[i]] += 1
for i in range(N):
  if list[i] >= 1:
    print('Yes')
  else:
    print('No')
  

### FIXED CODE ###

N, K, Q = map(int, input().split())
A = [0] * Q
for i in range(Q):
    A[i] = int(input())
list = [K-Q] *N
for i in range(Q):
  list[A[i]-1] += 1
for i in range(N):
  if list[i] >= 1:
    print('Yes')
  else:
    print('No')
s = input()
i = 0
j = len(s) -1
t1 = 0
t2 = 0
while True:
  if(s[i] == "A"):
    t1 = i
  if(s[j] == "Z"):
    t2 = j
  if(t1 != 0 and t2 != 0):
    break
  
  i += 1
  j -= 1
print(t2-t1 +1)
  

### FIXED CODE ###

s = input()
i = 0
j = len(s) - 1
t1 = []
t2 = []

while True:
  #print(i,j)
  if(s[i] == "A"):
    t1.append(i)
    #print(t1)
  if(s[j] == "Z"):
    t2.append(j)
  if(len(t1) != 0 and len(t2) != 0):
    break
  i += 1
  j -= 1
  
print(t2[0]-t1[0] +1)
# coding: utf-8
# Your code here!

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

A_dash = [x - i - 1 for i, x in enumerate(A)]

def recursive(X):
    if len(X) == 1:
        return sum([abs(x - X[0]) for x in A_dash])
    elif len(X) == 2:
        if sum([abs(x - X[1]) for x in A_dash]) - sum([abs(x - X[0]) for x in A_dash]) > 0:
            return sum([abs(x - X[0]) for x in A_dash])
        else:
            return sum([abs(x - X[1]) for x in A_dash])
        
    if sum([abs(x - X[len(X)//2]) for x in A_dash]) - sum([abs(x - X[len(X)//2 - 1]) for x in A_dash]) < 0:
        return recursive(X[len(X)//2:])
    else:
        return recursive(X[:len(X)//2 + 1])

print(recursive(list(range(min(A_dash), max(A_dash) + 1))))


### FIXED CODE ###

# coding: utf-8
# Your code here!
 
import statistics
 
N = int(input())
A = list(map(int, input().rstrip().split(' ')))
 
A_dash = sorted([x - i - 1 for i, x in enumerate(A)])
med = int(statistics.median(A_dash))

print(sum([abs(x - med) for x in A_dash]))
a = int(input())
s = input()
if a>=3200:
  print("red")
  else:
    print(s)

### FIXED CODE ###

a = int(input())
s = input()
if a>=3200:
  print(s)
else:
  print('red')
n=int(input())
sun_m=0
for i in range(n+1):
  sum_m+=i
print(sum_n)

### FIXED CODE ###

n=int(input())
sum_n=0
for i in range(n+1):
  sum_n+=i
print(sum_n)
w,h,x,y=map(int,input().split())
square = w*h/2
if 2x==w and 2y==h:
  flag=1
else:
  flag=0
print(square,flag)


### FIXED CODE ###

w,h,x,y=map(int,input().split())
square = w*h/2
if 2*x==w and 2*y==h:
  flag=1
else:
  flag=0
print(square,flag)