Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline

n,m = (int(x) for x in input().split())
a = list(map(int, input().split()))

b = [0]*(n*n)
ans = 0

for i in range(n):
	for j in range(n):
		b[i*n+j] = a[i]+a[j]

b.sort(reverse=True)

for i in range(m):
	ans += b[i]

print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
# 昇順ソートされた配列の挿入位置indexを返す O(logN)
from bisect import bisect_left

def isOver(a,n,x):
	cnt = 0
	for i in range(n):
		cnt += n-bisect_left(a,x-a[i])
	return cnt

def calX(a,n,m,l,r):
	while r-l>1:
		# x: 握手で得たい最低パワー値
		x = (l+r)//2
		if isOver(a,n,x) >= m:
			l = x
		else: #握手する限界回数すら満たせないほど大きいxなら
			r = x 
	return l

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

#累積和の下準備
a.sort()
s = [0]*(n+1)
for i in range(n):
	s[i+1] = s[i]+a[i]

x = calX(a,n,m,a[0]*2,a[n-1]*2)

out = 0
for i in range(n):
	idx = bisect_left(a,x-a[i])
	out += s[n]-s[idx]+a[i]*(n-idx)

out -= (isOver(a,n,x)-m)*x

print(out)
import math
a, b = map(int, input().split)
print(math.ceil((b-1)/(a-1)))

### FIXED CODE ###

import math
a, b = map(int, input().split())
print(math.ceil((b - 1) / (a - 1)))
n = int(input())
b = list(map(int, input().rstrip().split()))
c = max(b)
d = 0
for i in b:
  d +=i
d -= c
if c < d:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

n = int(input())
b = list(map(int, input().rstrip().split()))
c = max(b)
d = 0
for i in b:
  d +=i
d -= c
if c < d:
  print("Yes")
else:
  print("No")
import numpy as np
from scipy.sparse.csgraph import connected_components
n,m,k=[int(i) for i in input().split()]

frends=np.zeros(shape=(n,n))
blocks=np.zeros(shape=(n,n))

for i in range(m):
    a,b=[int(j)-1 for j in input().split()]
    frends[a][b]=1
    frends[b][a]=1

for i in range(k):
    a,b=[int(j)-1 for j in input().split()]
    blocks[a][b]=1
    blocks[b][a]=1

l,labels=connected_components(frends)
labels
group=[np.array([0]*n) for i in range(l)]

group
labels=list(labels)
for i in range(n):
    group[labels[i]][i]=1

group_num=[0 for i in range(l)]
for i in range(n):
    group_num[labels[i]]+=1
group_num

def get_group_num(i):
    return group_num[labels[i]]

frends=np.ones((n,n))-frends
blocks=np.ones((n,n))-blocks

def get_frend_num(i):
    check=frends[i]*group[labels[i]]
    return int(sum(check)-1)
def get_block_num(i):
    check=blocks[i]*group[labels[i]]
    return int(sum(check)-1)


for i in range(n):
    frend_group_num=get_group_num(i)-1
    frend_num=get_frend_num(i)
    block_num=get_block_num(i)
    print(abs(frend_group_num-frend_num-block_num))
    

### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

import sys
sys.setrecursionlimit(10**9)
n,m,k=[int(i) for i in input().split()]
frends_num=[0 for i in range(n)]
def make_frends(m,n):
    data=[1 for i in range(m)]

    row=[]
    col=[]
    for k in range(m):
        i,j=[int(l) for l in input().split()]
        new_i=min(i,j)-1
        new_j=max(i,j)-1
        row.append(new_i)
        col.append(new_j)
        frends_num[new_i]+=1
        frends_num[new_j]+=1
    frend_sparce_matrix=csr_matrix((data, (row, col)),shape=(n,n))
    return frend_sparce_matrix


frends=make_frends(m,n)
l,labels=connected_components(frends)
labels
labels=list(labels)

class Group:
    def __init__(self,labels):
        self.labels=labels
        self.group_num=[0 for i in range(l)]
        for i in labels:
            self.group_num[i]+=1
    def get_group_num(self,i):
        return self.group_num[self.labels[i]]

group=Group(labels)


def get_frend_num(i):
    return frends_num[i]


def make_block(k,n):
    block_num=[0 for i in range(n)]
    for p in range(k):
        i,j =[int(l)-1 for l in input().split()]
        new_i=min(i,j)
        new_j=max(i,j)
        if labels[new_i]==labels[new_j]:
            block_num[i]+=1
            block_num[j]+=1
    return block_num

block=make_block(k,n)

def get_block_num(i):
    return block[i]

ans=[]
for i in range(n):
    ans.append(str(group.get_group_num(i)-1-get_frend_num(i)-get_block_num(i)))
print(" ".join(ans))
X, N = map(int,input().split(' '))
if N == 0:
    print(X)
    exit()

p = input().split(' ')
p =[int(i) for i in p]
num_list = [int(i+1) for i in range(100)]
[num_list.remove(p[i]) for i in range(N)]
tmp = [0] * int(len(num_list))


for i in range(len(num_list)):
    tmp[i] = abs(num_list[i] - X)

ans = tmp.index(min(tmp))
# print(num_list)
# print(ans)
print(num_list[ans])


### FIXED CODE ###

X, N = map(int,input().split(' '))
if N == 0:
    print(X)
    exit()

p = input().split(' ')
p =[int(i) for i in p]
if X not in p:
    print(X)
    exit()

num_list = [int(i) for i in range(102)]
[num_list.remove(p[i]) for i in range(N)]
tmp = [0] * int(len(num_list))


for i in range(len(num_list)):
    tmp[i] = abs(num_list[i] - X)

ans = tmp.index(min(tmp))

print(num_list[ans])
C1 = list(map(int, input().split()))
C2 = list(map(int, input().split()))
C3 = list(map(int, input().split()))

C = [C1, C2, C3]
A = [0] * 3
B = [0] * 3

B = C1
A[1] = C2[0] - B[0]
A[2] = C3[0] - B[0]

flg = True
for a in range(A[1], A[2]):
    for b in range(B[1], B[2]):
        if C[a][b] != a + b:
            flg = False

if flg is True:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

C1 = list(map(int, input().split()))
C2 = list(map(int, input().split()))
C3 = list(map(int, input().split()))

C = [C1, C2, C3]
A = [0] * 3
B = [0] * 3

B = C1
A[1] = C2[0] - B[0]
A[2] = C3[0] - B[0]
flg = True
for i, a in enumerate(A):
    for j, b in enumerate(B):
        if C[i][j] != a + b:
            flg = False

if flg is True:
    print("Yes")
else:
    print("No")
S=input()
    T=input()
    if S==T[0:len(S)]:
      print("Yes")
    else:
      print("No")

### FIXED CODE ###

S=input()
T=input()
if S==T[0:len(S)]:
  print("Yes")
else:
  print("No")
a,b,x = list(map(int,input().split()))

if x*2 > b:
    import math

    y = 0
    y = 2*x/(a**2)-b

    print(90-math.degrees(math.atan(a/(y-b))))
else:
    import math

    y = 0
    y = 2*x/(a*b)

    print(90-math.degrees(math.atan(y/b)))

### FIXED CODE ###

import math
a,b,x=list(map(int,input().split()))
maxv=a*a*b
sukima=maxv-x
teimenseki=sukima/a
y=teimenseki*2/a
 
if x > (maxv/2):
    print(math.degrees(math.atan(y/a)))
else:
    tei=x/a
    z=tei*2/b
    print(math.degrees(math.atan(b/z)))
N, M = list(map(int, input().split()))
paths = [list(map(int, input().split())) for _ in range(M)]

result = []
passed_room = [1]
depth = 1

while paths and depth<N:
  tmp_passed = passed_room.copy()
  
  for i, path in enumerate(paths):
   
    if path[0] in passed_room:
      if path[1] in passed_room:
        del paths[i]
        continue
      result.append((path[1], path[0]))
      tmp_passed.append(path[1])
      del paths[i]
      continue
    
    if path[1] in passed_room:
      if path[0] in passed_room:
        del paths[i]
      result.append((path[0], path[1]))
      tmp_passed.append(path[0])
      del paths[i]
      continue
  depth += 1
  passed_room  = passed_room + tmp_passed
  if len(tmp_passed) == 0:
    print('No')
    exit()
  
    
result = sorted(result)
print('Yes')
for i, j in result:
  print(j)

### FIXED CODE ###

last_num = input()[-1]

if last_num in ['2', '4', '5', '7', '9']:
  print('hon')
elif last_num in ['0', '1', '6', '8']:
  print('pon')
elif last_num in ['3']:
  print('bon')
h,w=map(int,input().split())
lll=[list("."*(w+2))]
G=[list("."+input()+".") for _ in range(h)]
G=lll+G+lll
print(G)
for i in range(1,w+1):
  for j in range(1,h+1):
    if G[i][j]=="#" and G[i-1][j]==G[i+1][j]==G[i][j-1]==G[i][j+1]==".":
      print("No")
      exit()
print("Yes")  


### FIXED CODE ###

h,w=map(int,input().split())
lll=[list("."*(w+2))]
G=[list("."+input()+".") for _ in range(h)]
G=lll+G+lll
#print(G)
for i in range(1,h+1):
  for j in range(1,w+1):
    if G[i][j]=="#" and G[i-1][j]==G[i+1][j]==G[i][j-1]==G[i][j+1]==".":
      print("No")
      exit()
print("Yes")
N, K = map(int, input().split())
S = input()

if (S[K] == 'A'):
  S[K] = 'a'
elif (S[K] == 'B'):
  S[K] = 'b'
else:
  S[K] = 'c'
    
print(S)



### FIXED CODE ###

N, K = map(int, input().split())
S = list(str(input()))

if (S[K-1] == 'A'):
  S[K-1] = 'a'
elif (S[K-1] == 'B'):
  S[K-1] = 'b'
elif (S[K-1] == 'C'):
  S[K-1] = 'c'
  
ans = ''.join(S)
    
print(ans)
s = list(input())
s_ = sorted(s)
t = list(input())
t_ = sorted(t,reverse=True)
print('Yes' if s_< t_ else 'No')

### FIXED CODE ###

import math
a, b = input().split()
a = int(a)
b = int(b)
mean = (a + b) / 2
print(math.ceil(mean))
10
1 8 10 5 8 12 34 100 11 3

### FIXED CODE ###

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

L.sort()
L.reverse()

if L[0] < sum(L)-L[0]:
    print('Yes')
else:
    print('No')
A=list(map(int,input().split()))
a=[]
for n in range(0,a[0]+1):
    m=A[0]-n
    if 2*n+4*m=A[1]:
      a.append(1)
    
if 1 in a:
  print('yes')
else:
  print('No')
      
  


### FIXED CODE ###

X, Y = map(int, input().split()) 
ans = 'No'
for a in range(X + 1):
	b=X-a
	if 2 * a + 4 * b == Y:
		ans = 'Yes' 
print(ans)
import sys

r = map(int, sys.stdin.readline().rstrip())

def main():
    if r < 1200:
        return 'ABC'
    elif r < 2800:
        return 'ARC'
    else:
        return 'AGC'

if __name__ == '__main__':
    ans = main()
    print(ans)

### FIXED CODE ###

#                         author:  kagemeka 
#                         created: 2019-11-08 18:39:24(JST)
### modules
## from standard library
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   # if use comb function on AtCoder, 
# import scipy.misc      # select scipy.misc.comb (old version)  
# imort numpy as np 

def main():
    r = int(sys.stdin.readline().rstrip())
    if r < 1200:
        ans = 'ABC'
    elif r < 2800:
        ans = 'ARC'
    else:
        ans = 'AGC'

    print(ans)


if __name__ == "__main__":
    # execute only if run as a script
    main()
a,b = map(int, raw_input().split());

print 2*(a+b) a*b;

### FIXED CODE ###

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

print a*b, 2*(a+b)
from scipy.sparse.csgraph import *

n,m = map(int,input().split())
edges = [[int(x) for x in input().split()] for i in range(m)]
graph = [[0]*n for i in range(n)]
for a, b, c in edges :
    graph[a-1][b-1] = c

graph = csgraph_from_dense(graph)
dist = dijkstra(graph, directed=False).astype(int)

used = [0]*m
for s in range(n-1) :
    for t in range(s+1, n) :
        for i in range(len(edges)) :
            a, b, c = edges[i]
            a -= 1
            b -= 1
            if dist[s][a] + c + dist[b][t] == dist[s][t] :
                used[i] = 1
ans = m - sum(used)
print(ans)


### FIXED CODE ###

from scipy.sparse.csgraph import csgraph_from_dense, dijkstra

n,m = map(int,input().split())
edges = [[int(x) for x in input().split()] for i in range(m)]
graph = [[False]*n for i in range(n)]
for a, b, c in edges :
    graph[a-1][b-1] = c

graph = csgraph_from_dense(graph)
dist = dijkstra(graph, directed=False).astype(int)

ans = 0
for a, b, c in edges :
    if dist[a-1][b-1] != c :
        ans += 1

print(ans)
#!/usr/bin/env python3
import sys

# from math import gcd
from fraction import gcd

def coprime2(a, b):
    return gcd(a, b) == 1

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors



def solve(A: int, B: int):
    x = list(set(make_divisors(A)) & set(make_divisors(B)))
    
    ans = 0
    nn = len(x)
    for i in range(nn):
        t = [x[i]]
        for j in range(i+1,nn):
            f = True
            for k in t:
                if(coprime2(x[j],k) != 1):
                    f = False
            if(f):
                t.append(x[j])
                ans = max(ans, len(t))
    if(len(x) == 1 and x[0] == 1):
        print(1)
    else:
        print(ans)
            
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

# from math import gcd
from fractions import gcd

def isprime(x :int):
    if(x == 1):
        return False

    for i in range(2, int(x**0.5)+1):
        if(x%i == 0):
            return False

    return True


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


def solve(A: int, B: int):

    x = list(set(make_divisors(A)) & set(make_divisors(B)))
    
    ans = 1
    for i in x:
        if(isprime(i)):
            ans += 1

    print(ans)
            
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()
L=int(input())
L1=(L//3)
L2=L%3
while L2>=10**-16:
    L1+=(L2/3)
    L2=(L2/3)

print(L1**3)

### FIXED CODE ###

N,M=map(int,input().split())
print(int((N*(N-1)/2)+(M*(M-1)/2)))
from collections import defaultdict
MAX_N = 10 ** 3 + 10
MAX_M = 2 * (10 ** 3) + 1
INF = -(10 ** 100)

def bfs(graph, N, M):
    que = []
    que.append([0, 0])
    visited = defaultdict(list)
    result = INF
    while (len(que) > 0):
        now = que[0]
        que.pop(0)

        pos = now[0]
        cost = now[1]

        if (pos in visited):
            visited_cost = visited[pos][0]
            visited_cnt = visited[pos][1]
            if (visited_cost >= cost):
                continue
            if (visited_cnt >= MAX_N):
                return (0, False)
            visited[pos] = [cost, visited_cnt + 1]
        else:
            visited[pos] = [cost, 1]

        if (pos == N - 1):
            result = max(result, cost)

        for val in graph[pos]:
            nxt = val[0]
            nxt_cost = val[1]
            if (nxt not in visited):
                que.append([nxt, nxt_cost + cost])
            elif(nxt_cost + cost > visited[nxt][0]):
                que.append([nxt, nxt_cost + cost])
    return (result, True)


if __name__ == "__main__":
    N, M = map(int, input().split())
    graph = defaultdict(list)
    for x in range(M):
        a,b,c = map(int, input().split())
        a -= 1
        b -= 1
        graph[a].append([b, c])
    res,ok = bfs(graph, N, M)
    if (not ok):
        assert(False)
    else:
        print (res)


### FIXED CODE ###


MAX_N = 10 ** 3 + 10
MAX_M = 2 * (10 ** 3) + 1
INF = 10 ** 13

def bfs(graph, N, M):
    que = []
    que.append([0, 0])
    visited = [-INF for x in range(MAX_N)]
    update_cnt = [0 for x in range(MAX_N)]
    result = -INF
    while (len(que) > 0):
        now = que[0]
        que.pop(0)

        pos = now[0]
        cost = now[1]
        if (visited[pos] > cost):
            continue
        for val in graph[pos]:
            nxt = val[0]
            nxt_cost = val[1]

            if (cost + nxt_cost > visited[nxt] and update_cnt[nxt] < MAX_M):
                visited[nxt] = cost + nxt_cost
                update_cnt[nxt] += 1
                que.append([nxt, nxt_cost + cost])

    if (update_cnt[N - 1] >= MAX_N):
        return (0, False)
    return (visited[N - 1], True)


if __name__ == "__main__":
    N, M = map(int, input().split())
    graph = [[] for x in range(MAX_N)]
    for x in range(M):
        a,b,c = map(int, input().split())
        a -= 1
        b -= 1
        graph[a].append([b, c])
    res,ok = bfs(graph, N, M)
    if (not ok):
        print ('inf')
    else:
        print (res)
N,A,B=map(int,input().split())
C=A+B
if (0<C<10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue=("a"*A+"b"*B)*N
    number=queue.count("a",0,N)
    print(number)
else:
  None


### FIXED CODE ###

N,A,B=map(int,input().split())
if (0<A+B<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    if N%(A+B)<=A:
        c=(N//(A+B))*A+N%(A+B)
        print(c)
    else:
        d=(N//(A+B))*A+A
        print(d)
from math import factorial

N, A, B = map(int, input().split())
V = sorted(list(map(int, input().split())), reverse=True)

print(sum(V[:A]) / A)
if V[0] == V[A - 1]:
    n = sum([1 for v in V if v == V[0]])
    print(sum([factorial(n) // factorial(r) // factorial(n - r)
               for r in range(A, B + 1)]))
else:
    n = sum([1 for v in V if v == V[A - 1]])
    r = sum([1 for v in V[:A] if v == V[A - 1]])
    print(factorial(n) // factorial(r) // factorial(n - r))


### FIXED CODE ###

from math import factorial

N, A, B = map(int, input().split())
V = sorted(list(map(int, input().split())), reverse=True)

print(sum(V[:A]) / A)
if V[0] == V[A - 1]:
    n = sum([1 for v in V if v == V[0]])
    print(sum([factorial(n) // factorial(r) // factorial(n - r)
               for r in range(A, min(n, B) + 1)]))
else:
    n = sum([1 for v in V if v == V[A - 1]])
    r = sum([1 for v in V[:A] if v == V[A - 1]])
    print(factorial(n) // factorial(r) // factorial(n - r))
N,Q=input().split()
N=int(N)
Q=int(Q)
s=input()
t=['']*Q
d=['']*Q
for i in range(Q):
    t[i],d[i]=input().split()

    
t.reverse()
d.reverse()

golem=set()

for i in range(Q):
    tmp=set()
    for gtmp in golem:
        if gtmp>1:
            if s[gtmp-1]==t[i] and d[i]=='R':
                tmp.add(gtmp-1)
        if gtmp<N-1:
            if s[gtmp+1]==t[i] and d[i]=='L':
                tmp.add(gtmp+1)
    golem=golem.union(tmp)
    if t[i]==s[0] and d[i]=='L':
        golem.add(0)
    elif t[i]==s[-1] and d[i]=='R':
        golem.add(N-1)

        
print(N-len(golem))


### FIXED CODE ###

A=[int(x) for x in input().split()]

A=sorted(A)

if A[0]==A[1] and A[0]==A[2]:
    print('Yes')
else:
    print('No')
a = int(input())
import math
r = a * a * math.pi
r2 = a * 2 * math.pi

print("%.10f %.10f" % (r, r2))

### FIXED CODE ###

import math

a = float(input())

r = a * a * math.pi
r2 = a * 2 * math.pi

print("%.10f %.10f" % (r, r2))
from collections import deque
n = int(input())
l = deque()
count = set([])
for _ in range (n):
    cmd = input().split(' ')
    if cmd[0]=='insert':
        l.appendleft(int(cmd[1]))
        if not int(cmd[1]) in count:
            count.add(int(cmd[1]))
    if cmd[0]=='delete':
        if len(l) !=0 and int(cmd[2]) in count:
            l.remove(int(cmd[1]))
    if cmd[0]=='deleteFirst':
        l.popleft()
    if cmd[0]=='deleteLast':
        l.pop()
print(*l)


### FIXED CODE ###

from collections import deque
n = int(input())
l = deque()
for _ in range (n):
    cmd = input().split(' ')
    if cmd[0]=='insert':
        l.appendleft(cmd[1])  
    if cmd[0]=='delete':
        try:l.remove(cmd[1])
        except :pass
    if cmd[0]=='deleteFirst':
        l.popleft()
    if cmd[0]=='deleteLast':
        l.pop()
print(*l)
n = int(input())
print(n(n-1)/2)

### FIXED CODE ###

n = int(input())
print(int(n*(n+1)/2))
import sys
#大きすぎるとダメ
sys.setrecursionlimit(2000)
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]
inf=1000000000000000
d=[[inf]*w for i in range(h)]


def dfs(i,j):
    global h,w,s
    nex=[(0,-1),(0,1),(-1,0),(1,0)]
    for k in range(4):
        l,m=i+nex[k][0],j+nex[k][1]
        if 0<=i+nex[k][0]<h and 0<=j+nex[k][1]<w:
            if s[l][m]=="." and d[l][m]>d[i][j]+1:
                d[l][m]=d[i][j]+1
                dfs(l,m)
d[0][0]=0
dfs(0,0)
ans=0
for i in range(h):
    for j in range(w):
        if s[i][j]==".":
            ans+=1
if d[h-1][w-1]==inf:
    print(-1)
else:
    print(ans-d[h-1][w-1]-1)




### FIXED CODE ###

#一個だけRE、わからねえ
#解答見る
import sys
sys.setrecursionlimit(1005)
h,w=map(int,input().split())

def go_next(I,J,n):
    n+=1
    global dp,w,h
    if n>1000:
        return
    if 0<=I<h-1:
        if x[I+1][J]=="." and dp[I+1][J]>dp[I][J]+1:
            dp[I+1][J]=dp[I][J]+1
            go_next(I+1,J,n)
    if 0<I<=h-1:
        if x[I-1][J]=="." and dp[I-1][J]>dp[I][J]+1:
            dp[I-1][J]=dp[I][J]+1
            go_next(I-1,J,n)
    if 0<=J<w-1:
        if x[I][J+1]=="." and dp[I][J+1]>dp[I][J]+1:
            dp[I][J+1]=dp[I][J]+1
            go_next(I,J+1,n)
    if 0<J<=w-1:
        if x[I][J-1]=="." and dp[I][J-1]>dp[I][J]+1:
            dp[I][J-1]=dp[I][J]+1
            go_next(I,J-1,n)

x=[]
for i in range(h):
    x.append(list(input()))
#print(x)
c=0
for i in range(h):
    for j in range(w):
        if x[i][j]==".":
            c+=1
dp=[[10000000000 for i in range(w)]for j in range(h)]
dp[0][0]=1
go_next(0,0,0)
if dp[h-1][w-1]==10000000000:
    print(-1)
else:
    print(c-dp[h-1][w-1])
x, y = map(int, input().split())
f = False
for i in range(x+1):
    for j in range(x+1):
        if (y == (i*2 + j*4)):
            if (x == i + j):
                f = True
                break
    if f:
        breakif f:
    print("Yes")
else:
    print("No")            


### FIXED CODE ###

x, y = map(int, input().split())
f = False
for i in range(x+1):
    for j in range(x+1):
        if (y == (i*2 + j*4)):
            if (x == i + j):
                f = True
                break
    if f:
        break
if f:
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline
N = int(input())
a = [0]
reva = [[] for _ in range(N + 1)]
for _ in range(N - 1): a.append(int(input()))
for i in range(N):
  if a[i] == 0: continue
  reva[a[i]].append(i + 1)

dp = [-1] * (N + 1)
def dfs(x):
  global dp
  if len(reva[x]) == 0:
    dp[x] = 1
    return 1
  t = []
  for i in range(len(reva[x])):
    y = reva[x][i]
    t.append(dfs(y))
  t.sort(reverse = True)
  for i in range(len(reva[x])):
    t[i] += i + 1
  dp[x] = max(t)
  return dp[x]
print(dfs(1) - 1)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
N = int(input())
a = [0]
reva = [[] for _ in range(N + 1)]
for _ in range(N - 1): a.append(int(input()))
for i in range(N):
  if a[i] == 0: continue
  reva[a[i]].append(i + 1)
dp = [-1] * (N + 1)
def dfs(x):
  global dp
  if len(reva[x]) == 0:
    dp[x] = 1
    return 1
  t = []
  for y in reva[x]:
    t.append(dfs(y))
  t.sort(reverse = True)
  for i in range(len(t)):
    t[i] += i + 1
  dp[x] = max(t)
  return dp[x]
print(dfs(1) - 1)
X,Y=int(input())
print(int(X+Y/2))

### FIXED CODE ###

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