Harryxun/stf_run huggingface dataset:
import numpy as np

def main():
    n = int(input())
    junbi_num = list(map(int, input().split()))
    exam_num = list(map(int, input().split()))

    min = -1

    if sum(junbi_num) < sum(exam_num):
        print(min)
        exit()

    sabun_list = np.array(junbi_num) - np.array(exam_num)

    min = np.count_nonzero(sabun_list < 0)
    
    plus_list = sabun_list[sabun_list > 0]
    plus_list = np.sort(plus_list)[::-1]

    minus = sum(sabun_list[sabun_list < 0])

    i = 0
    while(minus < 0):
        minus += plus_list[i]
        i += 1
        min += 1

    print(min)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np

def main():
    n = int(input())
    junbi_num = list(map(int, input().split()))
    exam_num = list(map(int, input().split()))

    min = -1

    if sum(junbi_num) < sum(exam_num):
        print(min)
        exit()

    sabun_list = np.array(junbi_num) - np.array(exam_num)

    min = np.count_nonzero(sabun_list < 0)
    
    plus_list = sabun_list[sabun_list > 0]
    plus_list = np.sort(plus_list)[::-1]

    minus = sum(sabun_list[sabun_list < 0])

    i = 0
    while(minus < 0):
        minus += plus_list[i]
        i += 1
        min += 1

    print(min)

if __name__ == '__main__':
    main()
n=int(input())
color=[-1 for i in range(n)]
color[0]=1
G=[[] for i in range(n)]
for i in range(n-1):
  a,b,d=map(int,input().split())
  G[a-1].append([b-1,d])
  G[b-1].append([a-1,d])
  
def dfs(x):
  
  for i,dis in G[x]:
    
    if color[i] != -1: continue
    if dis %2==1:
      color[i]=1-color[x]
    else:
      color[i]=color[x]
    dfs(i)
dfs(0)
for i in range(n):
  print(color[i])
      


### FIXED CODE ###

import copy ; import sys ; sys.setrecursionlimit(11451419)
n=int(input())
color=[-1 for i in range(n)]
color[0]=1
G=[[] for i in range(n)]
for i in range(n-1):
  a,b,d=map(int,input().split())
  G[a-1].append([b-1,d])
  G[b-1].append([a-1,d])
  
def dfs(x):
  
  for i,dis in G[x]:
    
    if color[i] != -1: continue
    if dis %2==1:
      color[i]=1-color[x]
    else:
      color[i]=color[x]
    dfs(i)
dfs(0)
for i in range(n):
  print(color[i])
N=int(input("enter number of people"))
A=int(input("enter the cost of train"))
B=int(input("enter the cost of taxi"))
t1=N*A
t2=N*B
if t1<t2:
      tmin=t1
      print("minimum total travel expense",tmin)
else:
      tmin=t2
      print("minimum total travel expense",tmin)
      

### FIXED CODE ###

n,a,b=map(int,input().split())
if(n*a>=b):
    print(b)
else:
    print(n*a)
a,b,c,d = map(input().split())

if (a+b > c+d):
    print("Left")
elif (a + b < c + d):
    print("Right")
else:
    print(("Balanced"))

### FIXED CODE ###

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

if (a[0]+a[1] > a[2]+a[3]):
    print("Left")
elif (a[0]+a[1] < a[2]+a[3]):
    print("Right")
else:
    print(("Balanced"))
import numpy as np
import sympy
A, B, K = map(int, input().split())
N = sympy.divisors(np.gcd(A, B))
N.sort(reverse=True)
print(N[K-1])

### FIXED CODE ###

import numpy as np

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

if __name__ == '__main__':
    A, B, K = map(int, input().split())
    N = make_divisors(np.gcd(A, B))
    N.sort(reverse=True)
    print(N[K-1])
import sys
input = sys.stdin.readline
def solve():
  n = int(input())
  query = []
  candi = []
  for i in range(n):
    x,y,h = (int(i) for i in input().split())
    query.append((x,y,h))
  if n == 1:
    print(*[x,y,h])
    exit()
  for cx in range(0,101):
    for cy in range(0,101):
      judge = True
      x,y,h = query[0]
      karih = h +abs(cx-x)+abs(cy-y)
      for i in range(n-1):
        nx,ny,nh = query[i+1]
        if nh == max(karih-abs(nx-cx)-abs(ny-cy),0):
          pass
        else:
          judge = False
      if judge:

        candi.append((cx,cy,karih))
  print(*candi[0])
        
          
      
      
solve()

### FIXED CODE ###

import sys
input = sys.stdin.readline
def solve():
  n = int(input())
  query = []
  candi = []
  for i in range(n):
    x,y,h = (int(i) for i in input().split())
    query.append((x,y,h))
  if n == 1:
    print(*[x,y,h])
    exit()
  for cx in range(0,101):
    for cy in range(0,101):
      judge = True
      for j in range(n):
        x,y,h = query[j]
        if not h == 0:
          karih = h +abs(cx-x)+abs(cy-y)
          karih2 = 0
      for i in range(n):
        nx,ny,nh = query[i]
        if nh == max(karih-abs(nx-cx)-abs(ny-cy),0):
          pass
        else:
          judge = False
      if judge:
        candi.append((cx,cy,karih))
        
      judge = True 
      for i in range(n-1):
        nx,ny,nh = query[i+1]
        if nh == max(karih2-abs(nx-cx)-abs(ny-cy),0):
          pass
        else:
          judge = False
      if judge:
        candi.append((cx,cy,karih2))
  print(*candi[0])
        
          
      
      
solve()
a,b= map(int,raw_input().split());
if a<b ;
  print "a<b";
else if a>b ;
  print "a>b";
else
  print "a==b" ;

### FIXED CODE ###

a,b= map(int,input().split());
if a < b :
	print("a < b" );
elif a > b :
	print("a > b" );
elif a == b :
	print("a == b") ;
# 分割されていない文字列をどうやって分けるか
a = [*input()] #　これで一文字ずつになる
cnt = 0
for i in a:
        if i == "1":
                cnt +=1          
print(cnt)





### FIXED CODE ###

# 分割されていない文字列をどうやって分けるか
a = list(input())#　これで一文字ずつになる
cnt = 0
for i in a:
        if i == "1":
                cnt +=1          
print(cnt)
N = int(input().rstrip())
v = input().rstrip().split(" ")
v.sort()
#print(v)
a = (int(v[0])+int(v[1])) / 2
i = 2
while i <= (N-1):
  a = (a + int(v[i])) / 2
  i += 1
print(':.6f'.format(a))

### FIXED CODE ###

a = input()
a = int(a)
if a >= 3200:
  s = input()
  print(s)
else:
  print('red')
import math
import collections

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

n=list(map(int, input().split()))
a=math.gcd(n[0], n[1])
c = collections.Counter(prime_factorize(a))
b=list(c.keys())
d=len(b)
print(d+1)

### FIXED CODE ###

import fractions
import collections

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

n=list(map(int, input().split()))
a=fractions.gcd(n[0], n[1])
c = collections.Counter(prime_factorize(a))
b=list(c.keys())
d=len(b)+1
print(d)
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
static const int PLAYERS = 1025;
static const int ROUND = 11;

double ratings[PLAYERS];
double p[PLAYERS][ROUND];
int n;

double win(int p1, int p2) {
	return 1.0 / (1.0 + pow(10, (ratings[p2] - ratings[p1])/400.0));
}

double wp(int i, int k) {
  if (p[i][k] > 0) return p[i][k];
  if (k == 0) return p[i][k] = 1.0;
  /**
   * ?????????????????¢????????°??§????????????????§£?????¨????????????????????????
   */
  int index = i / (int)pow(2.0, k-1);
  int player;
  if (index % 2 == 0) {
    player = (index+1)*pow(2, k-1);
  } else {
    player = (index-1)*pow(2, k-1);
  }

  for (int j = 0; j < pow(2, k-1); j++){
    p[i][k] += wp(i,k-1)*win(i, player + j)*wp(player+j, k-1);
  }
  
  return p[i][k];
}

void solve_by_loop() {
	for (int i = 0; i < (int)pow(2.0, n); i++) {
		p[i][0] = 1.0;
	}
	for (int k = 1; k <= n; k++) {
		for (int i = 0; i < (int)pow(2.0, n); i++) {
			int index = i / (int)pow(2.0, k-1);
			int player;
			if (index % 2 == 0) {
				player = (index+1)*pow(2,k-1);
			} else {
				player = (index-1)*pow(2,k-1);
			}
			for (int j = 0; j < pow(2, k-1); j++) {
				p[i][k] += p[i][k-1]*win(i, player+j)*p[player+j][k-1];
			}
		}
	}
	for (int i = 0; i < pow(2, n); i++) {
		printf("%.10lf\n", p[i][n]);
	}
}
void solve() {
	for (int i = 0; i < (int)pow(2.0, n); i++) {
		printf("%.10lf\n", wp(i, n));
	}
}

int main() {
	cin >> n;
	for (int i = 0; i < (int)pow(2.0, n); i++) {
		cin >> ratings[i];
	}
	solve();
	//solve_by_loop();
	return 0;
}

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys

def assignColor():
    for i in range(n):
        if C[i] == -1:
            DFS(i)

#@profile
def DFS(start):
    S = [start]
    C[start] = start
    while len(S) != 0:
        u = S.pop(0)
        for i in adj_list[u]:
            if C[i] == -1:
                C[i] = start
                S.append(i)

if __name__ == "__main__":
    _input = sys.stdin.readlines()
    n, m = list(map(int, _input[0].split()))
    adj_list = [[] for i in range(n)]
    C = [-1] * n
    
    for i in range(m):
        s, t = list(map(int, _input[i+1].split()))
        adj_list[s].append(t)
        adj_list[t].append(s)
    assignColor()
    q = int(_input[m+1])
    for i in range(q):
        s, t = list(map(int, _input[m+i+2].split()))
        if C[s] == C[t]:
            print("yes")
        else:
            print("no")
import copy,bisect

s=input()
N=len(s)
t=input()
M=len(t)

dp=[[0 for i in range(0,M)] for i in range(0,N)]

for i in range(0,N):
    if s[0:i+1].count(t[0])>0:
        dp[i][0]=1

for i in range(0,M):
    if t[0:i+1].count(s[0])>0:
        dp[0][i]=1

for i in range(1,N):
    for j in range(1,M):
        if s[i]==t[j]:
            dp[i][j]=dp[i-1][j-1]+1
        else:
            if dp[i][j-1])>dp[i-1][j]:
                dp[i][j]=dp[i][j-1]
            else:
                dp[i][j]=dp[i-1][j]

print(dp[N-1][M-1])


### FIXED CODE ###

s=input()
N=len(s)
t=input()
M=len(t)

alphabetlist=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
def al(str):
    return alphabetlist.index(str)+1

dp=[[0 for i in range(0,M+1)] for i in range(0,N+1)]

for i in range(0,N):
    for j in range(0,M):
        if s[i]==t[j]:
            dp[i+1][j+1]=dp[i][j]+1
        else:
            if dp[i+1][j]>dp[i][j+1]:
                dp[i+1][j+1]=dp[i+1][j]
            else:
                dp[i+1][j+1]=dp[i][j+1]

ans=[]
i=N
j=M
while i>0 and j>0:
    if dp[i][j]==dp[i-1][j]:
        i-=1
    elif dp[i][j]==dp[i][j-1]:
        j-=1
    else:
        ans.append(s[i-1])
        i-=1
        j-=1

ans=ans[::-1]
print(''.join(ans))
N = int(input())
li=[int(it) for it in input().split()]
lia=li[::2]
lib=li[1::2]

import collections
ca = list(collections.Counter(lia).items())
cb = list(collections.Counter(lib).items())
na = len(lia)
nb = len(lib)
ca.sort(key=lambda x:-x[1])
cb.sort(key=lambda x:-x[1])
s = 0
if ( ca[0][0] != cb[0][0] ):
  s += na - ca[0][1]
  s += nb - cb[0][1]
else:
  if ( ca[0][1] > cb[0][1]   ):
    s += na - ca[0][1]
    if ( len(cb)>1 ):
      s += nb - cb[1][1]
    else:
      s += nb
  elif ( ca[0][1] < cb[0][1]   ):
    s += nb - cb[0][1]
    if ( len(ca)>1 ):
      s += na - ca[1][1]
    else:
      s += na
  else:
    s += na - ca[0][1] + nb - min(ca[1][1],cb[1][1])
print (s)
  

### FIXED CODE ###

N = int(input())
li=[int(it) for it in input().split()]
lia=li[::2]
lib=li[1::2]

import collections
ca = list(collections.Counter(lia).items())
cb = list(collections.Counter(lib).items())
na = len(lia)
nb = len(lib)
ca.sort(key=lambda x:-x[1])
cb.sort(key=lambda x:-x[1])
s = 0
if ( ca[0][0] != cb[0][0] ):
  s += na - ca[0][1]
  s += nb - cb[0][1]
else:
  if ( ca[0][1] > cb[0][1]   ):
    s += na - ca[0][1]
    if ( len(cb)>1 ):
      s += nb - cb[1][1]
    else:
      s += nb
  elif (ca[0][1] < cb[0][1]) :
    s += nb - cb[0][1]
    if ( len(ca)>1 ):
      s += na - ca[1][1]
    else:
      s += na
  else:
    p1 = cb[0][1]
    p2 = ca[0][1]
    if (len(ca)>1):
      p1+=ca[1][1]
    if (len(cb)>1):
      p2+=cb[1][1]
    s += na + nb - max(p1,p2)
    
print (s)
p = [1]*51
t = [1]*51
def f(n,x):
    if n==0:
        return f
    if x==1:
        return 0
    if x==t[n]:
        return p[n]
    if x==p[n]:
        return p[n-1]+1
    if x<p[n]:
        return f(n-1,x-1)
    return p[n-1]+f(n-1,x-p[n])+1

for i in range(1,51):
    p[i] = p[i-1]*2+1
    t[i] = t[i-1]*2+3
n,x = map(int,input().split())    
print(f(n,x))

### FIXED CODE ###

p = [1]*51
t = [1]*51
def f(n,x):
    if n==0:
        return 1
    if x==1:
        return 0
    if x==t[n]:
        return p[n]
    if x==p[n]:
        return p[n-1]+1
    if x<p[n]:
        return f(n-1,x-1)
    return p[n-1]+f(n-1,x-p[n])+1

for i in range(1,51):
    p[i] = p[i-1]*2+1
    t[i] = t[i-1]*2+3
n,x = map(int,input().split())    
print(f(n,x))
N = int(input)
S = input()
count = 0
if N >= 3 and N <= 50:
	for i in range(1,N-1):
  		if S[i-1] + S[i] + s[i+1] == "ABC":
    	count = count + 1
print (count)

### FIXED CODE ###

N = int(input())
S = input()
print(S.count("ABC"))
a = int(input())
e = int(input())
k = int(input())
if e-a =< k:
  print("Yay!")
else:
  print(":(")
  

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e-a <= k:
	print("Yay!")
else:
	print(":(")
s = input()
a=0
b=0
c=0
for charas in s:
  if charas=='a':
    a += 1
  elif charas == 'b':
    b += 1
  else:
    c += 1
if max(a,b,c)-min(a,b,c)<= 1:
  print('YES')
else:
  primt('NO')
        

### FIXED CODE ###

s = input()
a=0
b=0
c=0
for charas in s:
  if charas=='a':
    a += 1
  elif charas == 'b':
    b += 1
  else:
    c += 1
if max(a,b,c)-min(a,b,c)<= 1:
  print('YES')
else:
  print('NO')
N = int(input())
An = [int(_) for _ in input().split()]
An.sort()

old_val = 0
ans = 0
same_flag = False
# 割り切れるものの数を数える
def dfs(An):
    global ans, old_val, same_flag
    if(len(An) == 0):
        return
    val = An.pop(-1)
    # 同じ数に対してのループの場合
    if(val == old_val):
        same_flag = True
    if((same_flag == True) and (val != old_val or len(An) == 1)):
        ans += 1
        same_flag = False
    for i in An:
        # 割り切れる場合はansに数を足して今のループを抜ける
        if(val % i == 0):
            ans += 1
            break
    old_val = val
    # どの数でも割り切れなかった場合は一度抜ける
    dfs(An)

dfs(An)
print(N - ans)

### FIXED CODE ###

"""
考え方のポイント
・自分以外では割り切れないような数の個数を求める
　→ 数列の各項に対して〇（割り切れない）×がついていって、〇の個数を数える
・[2, 2]みたいな入力は、他の数で割り切れるようになるので、同じ数が入っていると絶対に×になる。

まずは入力が全部異なる前提で進める。
範囲内の整数からなる全て配列dを用意する。
→ 入力の数列を約数としてもつ数にチェックをしていく（Anに2が含まれていれば、2の倍数全てにチェック（+1)する）
→ チェック後にd[i]をみたとき、d[i]の約数がan中に何個存在するかが示されていることになる。（2∈Aiならd[5](=6)の値は必ず1以上になってる)
"""
N = int(input())
An = [int(i) for i in input().split()]
An.sort()
max_val = 10**6+1
d = [0] * max_val


# O(N) = O(2*10^5)
# d[i]のうち、配列の値の位置を+1しとく。
for i in An:
    d[i] += 1
    # O(MlogM) = 6*10^6
    # 始めてその倍数がきたときだけ
    if(d[i] == 1):
        # [2, 2]などの重複がない場合（既にカウントされているものではない場合)
        # 倍数の位置にも2としておいて以降はみないようにする
        for val in range(i*2, max_val, i):
            d[val] = 2

print(d.count(1))
import sys
def main():
  N, K = map(int, input().split())
  input = sys.stdin.readline
  wd = [tuple(map(int, input().split())) for i in range(N)]
  wd.sort()
  d = 0
  dp = [0]*N
  l = 0
  r = wd[0][0] + wd[0][1]*K
  while(r - l > 1):
    tmp = (l+r)//2
    num = 0
    for w, d in wd:
      if w <= tmp:
          num += ((tmp - w) // d) + 1
    if num >= K:
      r = tmp
    else:
      l = tmp
  print(r)
main()


### FIXED CODE ###

import sys
N, K = map(int, input().split())
input = sys.stdin.readline
wd = [tuple(map(int, input().split())) for i in range(N)]
wd.sort()
d = 0
dp = [0]*N
l = 0
r = wd[0][0] + wd[0][1]*K
while(r - l > 1):
    tmp = (l+r)//2
    num = 0
    for w, d in wd:
        if w <= tmp:
            num += ((tmp - w) // d) + 1
    if num >= K:
        r = tmp
    else:
        l = tmp

print(r)
import sys
sys.setrecursionlimit(100000)

def MST(n, E):
    def par(m):
        if UF[m] == m:
            return m
        ret = par(UF[m])
        UF[m] = ret
        return ret
    
    UF = [i for i in range(n)]
    E = sorted(E, key=lambda x: x[2])
    ans = 0
    for i, j, d in E:
        if par(i) != par(j):
            ans += d
            UF[par(i)] = par(j)
    return ans

N = int(input())

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

F = []
Y = sorted(X, key = lambda x: x[1])
for i in range(len(Y)-1):
    F.append((Y[i][0], Y[i+1][0], abs(Y[i+1][1]-Y[i][1])))

Y = sorted(X, key = lambda x: x[2])
for i in range(len(Y)-1):
    F.append((Y[i][0], Y[i+1][0], abs(Y[i+1][2]-Y[i][2])))

print(MST(N, F))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def MST(n, E):
    def par(m):
        if UF[m] == m:
            return m
        ret = par(UF[m])
        UF[m] = ret
        return ret
    
    UF = [i for i in range(n)]
    E = sorted(E, key=lambda x: x[2])
    ans = 0
    for i, j, d in E:
        if par(i) != par(j):
            ans += d
            UF[par(i)] = par(j)
    return ans

N = int(input())

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

F = []
Y = sorted(X, key = lambda x: x[1])
for i in range(len(Y)-1):
    F.append((Y[i][0], Y[i+1][0], abs(Y[i+1][1]-Y[i][1])))

Y = sorted(X, key = lambda x: x[2])
for i in range(len(Y)-1):
    F.append((Y[i][0], Y[i+1][0], abs(Y[i+1][2]-Y[i][2])))

print(MST(N, F))
a,b,c = map(int, input().split())

if a==b:
  print(c)
elif a==c:
  print(b)
else b==c:
  print(a)

### FIXED CODE ###

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

if a==b:
  print(c)
elif a==c:
  print(b)
elif b==c:
  print(a)
a = [int(input()) for i in range(2)]
n = a[0] % 500
if a >= n:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a = [int(input()) for i in range(2)]
n = a[0] % 500
if a[1] >= n:
  print('Yes')
else:
  print('No')
if int(input()) == 1:
	print(0)
elif int(input()) == 0:
    print(1)

### FIXED CODE ###

num = int(input())
if num == 1:
	print(0)
elif num == 0:
    print(1)
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))

### FIXED CODE ###

import fractions

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

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(A, B))
# -*- coding : utf-8 -*-

S = str(input())

w = ""
for i in range(len(S)):
  if S[i] = "B":
    if w == "":
      w = ""
    else :
      w = w.rstrip()
  else:
    w + S[i]

print(w)


### FIXED CODE ###

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

S = str(input())

w = ""

for i in range(len(S)) :
  if S[i] == "B" :
    if w == "":
      w = ""
    else :
      w = w[:-1]
  else :
    w = w + S[i]
    
print(w)
s = list(input())
t = list(input())
print(sum[s[i] == t[i] for i in range(3)])


### FIXED CODE ###

s = input()
t = input()
print(sum(s[i] == t[i] for i in range(3)))
N = int(input())
K = int(input())
L = len(str(N))

suu = []
for i in range(L):
    suu.append(int(str(N)[i]))

DP_1 =[[0 for k in range(L+1)] for i in range(L+1)]
DP_2 =[[0 for k in range(L+1)] for i in range(L+1)]
DP_2[0][0] = 1
for i in range(L):
    for k in range(L+1):
        DP_1[i+1][k] = DP_1[i][k] + DP_1[i][k-1] * 9 
        if suu[i]:
            DP_1[i+1][k] += DP_2[i][k] + DP_2[i][k-1] * max(suu[i] - 1, 0)
            DP_2[i+1][k] = DP_2[i][k-1]
        else:
            DP_2[i+1][k] = DP_2[i][k]
print(DP_1[L][K]+ DP_2[L][K])

### FIXED CODE ###

S, T = map(str, input().split())
A, B = map(int, input().split())

dic = {S: A, T: B}
U = input()
dic[U] = dic[U]-1
print(dic[S], dic[T])
x = int(input())
def prime(n):
  for j in range(2, int(n**(0.5))+1):
    if n%j == 0:
      return False
  return True
for i in range(x, 10**(5) + 1):
  if prime(i):
    ans = i
    break
print(ans)

### FIXED CODE ###

x = int(input())
def prime(x):
  for i in range(2, int(x**0.5)+1):
    if x%i == 0:
      return False
  return True
for i in range(x, 100003 + 1):
  ans = prime(i)
  if ans:
    break
print(i)
a, b, c = map(int, input().split())
diff_max = 3*max(a, b, c) - sum(a, b, c)
if diff_max % 2:
    print((diff_max + 3) // 2)
else:
    print(diff_max // 2)

### FIXED CODE ###

a, b, c = map(int, input().split())
diff_max = 3*max(a, b, c) - sum([a, b, c])
if diff_max % 2:
    print((diff_max + 3) // 2)
else:
    print(diff_max // 2)
import numpy as np
N = int(input())
a = list(map(int,input().split()))
a = np.array(a)
a = np.sort(a)[::-1]
MAX = np.abs(np.prod(a))
#print (MAX)
Flag = True
q = 0
add = a[0]
sum = 0
max = np.sum(a)-len(a)
n = a[0]*q+a[0]-1
while True:
    st = np.sum(n%a)
    if sum < st:
        sum = st
    if sum == max:
        break
    ind = np.where(a - n%a == 1)[0]
    #print (ind)
    c = a[ind]
    n += np.prod(c)
    if n > MAX:
        break
    #print (sum)
print (sum)


### FIXED CODE ###

import numpy as np
a = list(map(int,input().split()))
a = np.array(a)
a = np.sort(a)[::-1]
sum = a[0]-a[2]
print (sum)
N=int(input())
L=[]
a=True
for i in range(n):
  L.append(input())
if len(L)!=len(set(L)):
  print('No')
else:
  for i in range(1,len(L)):
    if L[i][0]==L[i-1][-1]:
      continue
    else:
      a=False
  if a is True:
    print('Yes')
  else:
    print('No')



### FIXED CODE ###

n=int(input())
L=[]
a=True
for i in range(n):
  L.append(input())
if len(L)!=len(set(L)):
  print('No')
else:
  for i in range(1,len(L)):
    if L[i][0]==L[i-1][-1]:
      continue
    else:
      a=False
  if a is True:
    print('Yes')
  else:
    print('No')
N, K, S = map(int, input().split())

if S != 10 ** 9:
    print(*[S] * K, *[10 ** 9] * (N - K))
else:
    print(*[10 ** 9] * K, *[1] * (N - K))


### FIXED CODE ###

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

if S != 10 ** 9:
    print(' '.join(map(str, [S] * K)),' '.join(map(str, [10 ** 9] * (N - K))))
else:
    print(' '.join(map(str, [S] * K)), ' '.join(map(str, [1] * (N - K))))
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
def groupby():
    global a
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2
b=groupby()
b.sort(key=lambda x:x[1],reverse=True)
l=len(b)
ans=0
for i in range(k,l):
    ans+=b[i][1]
print(ans)

### FIXED CODE ###

st = input()
tl = 0
for s in st[:]:
  tl += int(s)
print(tl)
a=int(input())
b=int(input())
c=int(input())
X=int(input())
counter=0
for i1 in range(a):
  for i2 in range(b):
    for i3 in range(c):
      if 500*i1+100*i2+50*i3==x:
        counter+=1
print(counter)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
x=int(input())
counter=0
for i1 in range(0,a+1):
  for i2 in range(0,b+1):
    for i3 in range(0,c+1):
      if 500*i1+100*i2+50*i3==x:
        counter=counter+1
print(counter)
hitachi = True
s = input()
for i in range(0, len(s), 2):
    if(s[i] != 'h' or s[i + 1] != 'i'):
        hitachi = False
        break
if(hitachi):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

hitachi = True
s = input()
if(len(s) % 2 != 0):
    hitachi = False
for i in range(0, len(s), 2):
    if(hitachi == False):
        break
    if(s[i] != 'h' or s[i + 1] != 'i'):
        hitachi = False
if(hitachi):
    print('Yes')
else:
    print('No')