Harryxun/stf_run huggingface dataset:
N,M = map(int, input().split())
 
# 隣接リスト
l = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int, input().split())
    l[a].append(b)
    l[b].append(a)

nodes_color = {node:0 for node in range(1, N+1)}#set([a for ab in ab_list for a in ab])}

def func(v,c):
    if nodes_color[v] == c:
        return True
    if nodes_color[v] == -c:
        return False
    
    if nodes_color[v] == 0:
        nodes_color[v] = c
    for node in l[v]:
        if not func(node, -c):
            return False
    
    return True

chk = func(1,1)

if chk:
    b,w = Counter(nodes_color.values()).values()
    print(int(b*w-M))
else:
    print(int(N*(N-1)/2-M))

### FIXED CODE ###

from collections import Counter
import sys
sys.setrecursionlimit(1000000)
N,M = map(int, input().split())
 
# 隣接リスト
l = [[] for i in range(N+1)] 
for i in range(M):
    a, b = list(map(int, input().split()))
    l[a].append(b)
    l[b].append(a)

nodes_color = {node:0 for node in range(1, N+1)}#set([a for ab in ab_list for a in ab])}

nibu = True
stack = [1]

nodes_color[1] = 1

while stack:
    node = stack.pop()
    for next_node in l[node]:
        if nodes_color[next_node]==0:
            stack.append(next_node)
            nodes_color[next_node] = - nodes_color[node]
        else:
            if nodes_color[next_node]==nodes_color[node]:
                nibu = False
                break
    if not nibu:
        break

if nibu:
    b,w = Counter(nodes_color.values()).values()
    print(int(b*w-M))
else:
    print(int(N*(N-1)/2-M))
import sys
import numpy as np

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

# 累積和、dp、しゃくとり
MOD = 998244353
N, S = lr()
A = lr()
# dp[k][j] kから始めた合計の個数
dp = np.array([[0] * 3000 for _ in range(N)])
dp[:, 0] = 1
answer = 0
cur = [0] * (N)
#print(dp)
for i, a in enumerate(A):
    # iが現在地
    for j in range(i+1):
        prev = dp[j].copy()
        dp[j][a:] += prev[:-a]
        temp = dp[j][S] - cur[j]
        answer += temp * (N-i)
        cur[j] = dp[j][S]

print(answer % MOD)


### FIXED CODE ###

import sys

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

MOD = 998244353
N, S = lr()
A = lr()
dp = [0] * (S+1)
answer = 0
for a in A:
    dp[0] += 1 # Lの数は１個ずつ加わる
    prev = dp.copy()
    for i in range(S-a+1):
        dp[i+a] += prev[i]
    answer += dp[-1] # その位置Rとした時

print(answer % MOD)
# 26
a = input().split()

n = int(a[0])
m = int(a[1])

b = input().split()

x = [int(i) for i in b]

s = sum(x)
lim =int(s / (m*4) + 1

c = 0

for i in range(0,n):
    if(x[i] > lim):
      c = c + 1
    else:
      continue

if(c >= m):
  print("Yes")
else:
  print("No")
      


### FIXED CODE ###

a = input().split()

n = int(a[0])
m = int(a[1])

b = input().split()

x = [int(i) for i in b]

s = sum(x)
lim = s / (m*4)

c = 0

for i in range(0,n):
    if(x[i] >= lim):
      c = c + 1
    else:
      continue

if(c >= m):
  print("Yes")
else:
  print("No")
import math
import copy
H,N=map(int,input().split())

dp=[]
dp.append([None]*(H+1))

for i in range(N):
    A,B=map(int,input().split())
    new_dp=copy.deepcopy(dp[-1])
    for i in range(A,H+1):
        if dp[-1][i-A]==None:
            if i%A==0 and dp[-1][i]==None:
                new_dp[i]=B*i//A
            elif i%A==0:
                new_dp[i]=min(dp[-1][i],B*i//A)
            else:
                new_dp[i]=None

            continue

        if dp[-1][i]==None:
            new_dp[i]=dp[-1][i-A]+B
        else:
            new_dp[i]=min(dp[-1][i],dp[-1][i-A]+B)
        
    if new_dp[-1]==None:
        new_dp[-1]=math.ceil(H//A)*B
    else:
        new_dp[-1]=min(new_dp[-1],math.ceil(H//A)*B)

    for i in range(A):
        if dp[-1][1+H-A+i]==None:
            pass
        else:
            new_dp[-1]=min(new_dp[-1],dp[-1][1+H-A+i] + B)
    

    dp.append(new_dp)

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

### FIXED CODE ###

import math

def main():
    H,N=map(int,input().split())

    inf=float('inf')
    dp=[0]+[inf]*H

    for i in range(N):
        A,B=map(int,input().split())
        if A>=H:
            #dp[-1]=min(B,dp[-1])
            if B < dp[-1]:
                dp[-1]=B
        else:
            for j in range(A,H+1):
                #dp[j]=min(dp[j-A]+B,dp[j])
                if dp[j-A]+B<dp[j]:
                    dp[j]=dp[j-A]+B

                if j > H-A:
                    #dp[-1]=min(dp[-1],dp[j]+B)
                    if dp[j]+B < dp[-1]:
                        dp[-1]=dp[j]+B

    print(dp[-1])

main()
import math
N, X = map(int,input().split())
xlst = list(map(int,input().split()))

lst = []
for n in xlst:
    difference = abs(X - n)
    lst.append(difference)
ans = lst[0]
for i in range(1,N):
    ans = math.gcd(ans, lst[i])
print(ans)

### FIXED CODE ###

import fractions
N, X = map(int,input().split())
xlst = list(map(int,input().split()))

lst = []
for n in xlst:
    difference = abs(X - n)
    lst.append(difference)

ans = lst[0]
for i in range(1,N):
    ans = fractions.gcd(ans, lst[i])
print(ans)
A, B, K = map(int,input().split())

if K <= A:
  a -= K
elif A < K <= A + B:
  a = 0
  b = B + A - K
elif A + B < K:
  a = b = 0

print(str(a) + ' ' + str(b))

### FIXED CODE ###

A, B, K = map(int,input().split())
a = 0
b = 0

if K <= A:
  a = A - K
  b = B
elif A < K <= A + B:
  b = B + A - K

print(str(a) + ' ' + str(b))
N,X = (map(int, input().split()))
m = [0] * N
for i in range(N):
    m[i] = int(input())

for i in range(N):
    X = X - m[i]

min_value = min(m)
ind = m.index(min_value)
count = N

while X - m[ind]=> 0:
    X = X - m[ind]
    count += 1

print(count)


### FIXED CODE ###


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

for i in range(N):
    X = X - m[i]

min_value = min(m)
ind = m.index(min_value)
count = N

while X - m[ind] >= 0:
    X = X - m[ind]
    count += 1

print(count)
N = int(input())
d_list = list(map(int, input().split()))
d_list.sort()

n1 = d_list[N//2]
print(d_list[n1 + 1] - d_list[n1])

              

### FIXED CODE ###

N = int(input())
d_list = list(map(int, input().split()))
d_list.sort()

n1 = N//2
print(d_list[n1] - d_list[n1 - 1])
n = int(input())
dl = list(map(int,input().split()))
m = int(input())
tl = list(map(int,input().split()))
d_dic = dict()
t_dic = dict()
for d in dl:
  if d in d_dic:
    d_dic[d] += 1
  else:
    d_dic[d] = 1
for t in tl:
  if t in t_dic:
    t_dic[t] += 1
  else:
    t_dic[t] = 1
for v in t_dic.keys():
  if t_dic[v] > d_dic[v]:
    print('NO')
    exit()
print('YES')

### FIXED CODE ###

n = int(input())
dl = list(map(int,input().split()))
m = int(input())
tl = list(map(int,input().split()))
d_dic = dict()
t_dic = dict()
for d in dl:
  if d in d_dic:
    d_dic[d] += 1
  else:
    d_dic[d] = 1
for t in tl:
  if t in t_dic:
    t_dic[t] += 1
  else:
    t_dic[t] = 1
for v in t_dic.keys():
  if not v in d_dic.keys():
    print('NO')
    exit()
  if t_dic[v] > d_dic[v]:
    print('NO')
    exit()
print('YES')
# coding: utf-8
# Here your code !
import numpy as np
N, M = map(int, input().split())

A = []
b = []

for _ in range(N):
    A.append([int(i) for i in input().split()])
    
for _ in range(M):
    b.append([int(input())])

A = np.matrix(A)
b = np.matrix(b)

c = A.dot(b)

print("\n".join([str(int(c[i])) for i in range(N)]))

### FIXED CODE ###

# coding: utf-8
# Here your code !
N, M = map(int, input().split())

A = []
b = []

for _ in range(N):
    A.append([int(i) for i in input().split()])
    
for _ in range(M):
    b.append(int(input()))
    
for i in range(N):
    print(sum([A[i][j] * b[j] for j in range(M)]))
a=input()
k=int(input())
i=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
    else: k=-1    
print(a[i])

### FIXED CODE ###

a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])
sec = int(input())
print('{}:{}:{}'.format(sec//3600, (sec//60)%60, sec%60)javascript:void(0)

### FIXED CODE ###

sec = int(input())
print('{}:{}:{}'.format(sec//3600, (sec//60)%60, sec%60))
a,b,c,d,e,f=map(int,input().split())
w_m=(f*100/(100+e))//100*100
s_m=f*e//(100+e)
answ=float('inf')
anss=0
for i in range(w_m//(a*100)+1):
    for j in range((w_m-i*a*100)//(b*100)+1):
        w=(i*a+j*b)*100
        if w!=0:
            for k in range(s_m//c+1):
                for l in range((s_m-k*c)//d+1):
                    s=k*c+l*d
                    if (anss*(s+w)<s*(anss+answ)) and (s*(100+e)<=e*(s+w)):
                        answ=w
                        anss=s
print(answ+anss,anss)


### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
w_m=int((f*100/(100+e)))//100*100
s_m=f*e//(100+e)
answ=100*a
anss=0
for i in range(w_m//(a*100)+1):
    for j in range((w_m-i*a*100)//(b*100)+1):
        w=(i*a+j*b)*100
        if i==0 and j==0:
            w=min(100*a,100*b)
            s_m=f-w
        for k in range(s_m//c+1):
            for l in range((s_m-k*c)//d+1):
                s=k*c+l*d
                if (anss*(s+w)<s*(anss+answ)) and (s*(100+e)<=e*(s+w)):
                    answ=w
                    anss=s
print(answ+anss,anss)
S=list('keyekeyencence')
N=len(S)
for i in range(0,N+1):
    for j in range(i,N+1):
        if "".join(S[:i] + S[j:]) == 'keyence':
            print("YES")
            exit(1)
else:
    print('NO')

### FIXED CODE ###

S=input()
N=len(S)
for i in range(0,N+1):
    for j in range(i,N+1):
        if  S[:i] + S[j:] == 'keyence':
            print("YES")
            exit(0)
else:
    print('NO')
n = int(inpout())
numbers = map(int, input().split())

even_numbers = []
for i in numbers:
  if i % 2 == 0:
    even_numbers.append(i)

answers = []
for i in even_numbers:
  if i % 3 == 0 or i % 5 == 0:
    answers.append(i)

if even_numbers == answers:
  print('APPROVED')
else:
  print('DENIED')

### FIXED CODE ###

n = int(input())
numbers = map(int, input().split())

even_numbers = []
for i in numbers:
  if i % 2 == 0:
    even_numbers.append(i)

answers = []
for i in even_numbers:
  if i % 3 == 0 or i % 5 == 0:
    answers.append(i)

if even_numbers == answers:
  print('APPROVED')
else:
  print('DENIED')
n,a,b = map(int,input().split())

mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

fac = [0]*(n+1)
fac[0] = 1
fac[1] = 1
for i in range(2,n+1):
    fac[i] = fac[i-1] * i % mod
    
c = pow(2,n,mod)
c -= 1
c -= ( fac[n] * modinv(fac[a]) )%mod * modinv(fac[n-a]) % mod
c -= (fac[n] * modinv(fac[b])) % mod * modinv(fac[n-b]) % mod
print(c%mod)

### FIXED CODE ###

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

mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def com(n,k,mod=10**9+7):
    u = 1
    s = 1
    for i in range(n,n-k,-1):
        u = u*i % mod
    for i in range(k,0,-1):
        s = s*i % mod
    return u * modinv(s)

c = pow(2,n,mod)
c -= 1
c -= com(n,a)
c -= com(n,b)
print(c%mod)
s = map(int, input().split())
n = 0
i = 0
cout = 0
for i in s:
  if s[i] % 2 == 0:
    cout += 1
  else:
    cout += 0
print(cout)

### FIXED CODE ###

s = input()
n = 0
for a in s:
  if a =='1':
    n += 1
print(n)
import fractions
n,m=map(int,input().split())
s=input()
t=input()
p=fractions.gcd(n,m)
ans=n*m//p
tt=[""]*ans
for i in range(n):
	tt[i*(ans//n)]=s[i]
print(ans)

### FIXED CODE ###

from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
p=gcd(n,m)
ans=n*m//p 
for i in range(n):
	if abs((i*(ans//n)/(ans//m))-int(i*(ans//n)/(ans//m)))<=10**(-7):
		if s[i]==t[(i*(ans//n)//(ans//m))]:
			continue
		else:
			print(-1)
			exit()
print(ans)
n,k = [int(i) for i in input().split()]
td = [[int(i) for i in input().split()] for _ in range(n)]

###dが大きい順にソート
td.sort(key = lambda x: x[1],reverse=True)

###なるべくtの種類を多いなかで、dを最大化する
###まず各tでdが最大のものを1つずつ選ぶ
eated_kind = []
eated = []
for i in range(n):
  t,d = td[i]
  if t not in eated_kind:
    eated_kind.append(t)
    eated.append([t,d])
    
    ###tがk種類存在したら、残りのtを扱うことはない
    ###またdも最大化されているため、これ以降のtdを使うことはない
    if len(eated_kind) == k:
      td = td[:i+1]
      break

eated_kind_num = len(eated_kind)
not_eated = [i for i in td if i not in eated]

###tがk種類存在しなかったら、k個になるまでtに関係なくdを最大化する
if eated_kind_num < k:
  eated.append(not_eated[:k-cnt])
  not_eated = not_eated[k-cnt:]
  eated.sort(key = lambda x: x[1],reverse=True)
  
###dの最大化を目指すが、tの種類が減る場合どちらのほうが良いか判断する必要がある
for t,d in not_eated:
  eated_last_t, eated_last_d = eated[-1]
  if d < eated_last_d:
    break
  t_point_sub = (eated_kind_num-1)**2 - eated_kind_num**2
  d_point_sub = d - eated_last_d
  if t_point_sub + d_point_sub > 0:
    eated = [[t,d]] + eated[:-1]
    eated_kind_num -= 1
  else:
    break
    
#print(eated)

t_point = eated_kind_num**2
d_point = sum([i[1] for i in eated])
point = t_point + d_point
print(point)
  
  


### FIXED CODE ###

n,k = [int(i) for i in input().split()]
td = [[int(i) for i in input().split()] for _ in range(n)]

###dが大きい順にソート
td.sort(key = lambda x: x[1],reverse=True)

###各tでdが最大のものを格納
fix_eated_d=[]
###各tでdが最大でないものを格納。tの種類を増やす際の削除候補
change_eated_d=[]

eated_t = set()
d_point = 0

###まずdを最大化
for t,d in td[:k]:
  
  ###すでにtが選ばれているなら最大のdではないのでchangeへ
  if t in eated_t:
    change_eated_d.append(d)
    
  ###まだtが選ばれていないなら最大のdだからfixへ
  else:
    fix_eated_d.append(d)
    eated_t.add(t)
    
  d_point += d
  
point = len(eated_t)**2 + d_point

###tの種類を増やす
for t,d in td[k:]:
  ###削除候補がなくなれば終了
  if not change_eated_d:
    break
  
  ###すでにtが選ばれているならskip
  if t in eated_t:
    continue
    
  ###まだtが選ばれていないなら追加、change中dが最小のものを削除
  eated_t.add(t)
  d_point += d - change_eated_d.pop()
  point = max(point, len(eated_t)**2 + d_point)
  
print(point)
n = int(input())
s = input()
l = []
for i in range(2, n-1):
    head = set(s[:i])
    back = set(s[i:])
    l.append(len(head & back))
ans = max(l)
print(ans)


### FIXED CODE ###

n = int(input())
s = input()
l = [0]
for i in range(2, n-1):
    head = set(s[:i])
    back = set(s[i:])
    l.append(len(head & back))
ans = max(l)
print(ans)
# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]
times_list = [txy_list[i][0] - txy_list[i+1][0] for i in range(n-1)]

before_x, before_y = 0, 0
for i, txy in enumerate(txy_list):
	t, x, y = txy
	rela_x, rela_y = x - before_x, y - before_y
	remaining = times_list[i] - (abs(rela_x) + abs(rela_y))
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()
print("Yes")

### FIXED CODE ###

# Relative rela
import sys

n = int(input())
txy_list = [[int(n) for n in input().split()] for i in range(n)]
times_list = [txy_list[0][0]] + [txy_list[i+1][0] - txy_list[i][0] for i in range(n-1)]

before_x, before_y = 0, 0
for i, txy in enumerate(txy_list):
	t, x, y = txy
	rela_x, rela_y = x - before_x, y - before_y
	remaining = times_list[i] - (abs(rela_x) + abs(rela_y))
	if 0 <= remaining and remaining % 2 == 0:
		before_x, before_y = x, y
	else:
		print("No")
		sys.exit()
print("Yes")
import sys,collections as cl,bisect as bs,random
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

d = onem()

c = l()

s = []
sel = [0 for i in range(365)]

day = [[0 for i in range(26)] for j in range(365)]
ans = 0
for i in range(d):
	s.append(l())
	ss = [[s[-1][i]-c[i],i+1] for i in range(26)]
	ss.sort(reverse = True)
	data = i % 26
	sel[i] = ss[data-1][1]
	ans += s[i][data-1]

	for j in range(26):
		if j == data - 1:
			day[i][j] = i
		else:
			day[i][j] = day[i-1][j]
			ans -= c[j] * (i - day[i][j] + 1)



for _ in range(140000):
	ima = random.randrange(365)
	po = [[s[ima][i]-c[i],i+1] for i in range(26)]
	po.sort(reverse = True)
	while True:
		data = random.randrange(10)
		if sel[ima] != data:
			break
	data = po[data][1]-1
	ppp = 0
	for i in range(26):
		if ima == day[ima][i]:
			now = i
	for i in range(ima+1,365):
		if day[i][data] == i:
			ppp += (i - ima) * c[data]
			break
	else:
		ppp += (364-ima) * c[data]

	for i in range(ima+1,365):
		if day[i][now] == i:
			ppp += (i - ima) * c[now]
			break
	else:
		ppp -= (364-ima) * c[now]
	if ppp > 0:
		for i in range(ima,365):
			if day[i][data] != i:
				day[i][data] = ima
			else:
				break
		po = ima - 1 if ima != 0 else 0
		for i in range(ima,365):
			if day[i][now] != i:
				day[i][now] = po
			else:
				break
		sel[ima] = data+1

for i in sel:
	print(i)

### FIXED CODE ###

for i in range(365):
  print(i%26 + 1)
# -*- coding: utf-8 -*-

import matplotlib

a = input().split()
A = input().split()

for i in range(0, len(a)):
    a[i] = int(a[i])

for i in range(0, len(A)):
    A[i] = int(A[i])

count = 0
for i in range(0, a[2]):
    if(A[i] < a[2]):
        count = count + 1


if(count > (len(A) -  count)):
        count = len(A) -  count

print(count)


### FIXED CODE ###

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

a = input().split()
A = input().split()

for i in range(0, len(a)):
    a[i] = int(a[i])

for i in range(0, len(A)):
    A[i] = int(A[i])

count = 0
for i in range(0, len(A)):
    if(A[i] < a[2]):
        count = count + 1


if(count > (len(A) -  count)):
        count = len(A) -  count

print("{0}".format(count))
n, k = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))

loop = []
visited = set()
stack = [1]
loop_creating = False
last = 1

while True:
  if loop_creating and len(visited) == 0:
    break

  nex = a[last - 1]

  if nex in visited:
    visited.remove(nex)
    loop.append(nex)
    loop_creating = True
  elif nex in stack:
    visited.add(nex)
  else:
    stack.append(nex)

  last = nex

if k <= len(stack):
  print(stack[k])
elif k > len(stack):
  rem = k - len(stack)
  print(loop[rem % len(loop)])


### FIXED CODE ###

from collections import deque

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

loop = []
visited = set()
s = set([1])
loop_creating = False
last = 1

while True:
  if loop_creating and len(visited) == 0:
    break
  
  if k == len(s) - 1:
    print(last)
    exit(0)

  nex = a[last - 1]

  if nex in visited:
    visited.remove(nex)
    loop.append(nex)
    loop_creating = True
  elif nex in s:
    visited.add(nex)
  else:
    s.add(nex)

  last = nex

rem = k - len(s)
print(loop[rem % len(loop)])
N = int(input())
c = str(input())

head = 0
tail = -1
count = 0

while head < N:
    if c[head] == "W":
        while c[tail] == "W":
            tail -= 1
        if head >= N + tail:
            print(count)
            exit()
        tail -= 1
        count += 1
    head += 1
print(count)

### FIXED CODE ###

N = int(input())
c = str(input())

head = 0
tail = -1
count = 0

while head < N:
    if c[head] == "W":
        while tail >= -N and c[tail] == "W":
            tail -= 1
        if head >= N + tail:
            print(count)
            exit()
        tail -= 1
        count += 1
    head += 1
print(count)
N = int(input())
points = [list(map(int, input().split())) for i in range(N)]


def main(N, points):
    points.sort(key=lambda x: x[2], reverse=True)
    for x in range(101):
        for y in range(101):
            # 初期化
            H = -1
            for point in points:
                h = abs(point[0] - x) + abs(point[1] - y) + point[2]
                if point[2] > 0:
                    if H == -1:
                        H = h
                    elif H != h:
                        H = -1
                        break
                else:
                    if H > h:
                        H = -1
                        break
            if H > 0:
                print(x, y, h)
                return


main(N, points)



### FIXED CODE ###

n = int(input().rstrip())
if n == 1:
    print("Hello World")
else:
    a = int(input().rstrip())
    b = int(input().rstrip())
    print(a+b)
lis = list(input().split())
lis.sort()
if lis = [5,5,7]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

lis = list(map(int,input().split()))
lis.sort()
if lis == [5,5,7]:
  print('YES')
else:
  print('NO')
#C
import numpy as np
flg = True
n,m,x = map(int,input().split())
algo = []
tmp = []
for _ in range(n):
    algo.append(list(map(int,input().split())))
    

algo_n = np.array(algo)
algo_sum = algo_n.sum(axis=0)
gokei = algo_sum.tolist()
money = gokei[0]
gokei = gokei[1:]

#チェックする
for i in range(m):
    if gokei[i] < x:
        flg = False
        print(-1)
        break

algo.sort(key= lambda x:x[0],reverse=True)

#print(algo)
#print(gokei)
# 計算用の関数
def hikizan(lst1,lst2):
#lst1 - lst2
    lst_ans = [0 for _ in range(len(lst1))]
    for i in range(len(lst1)):

        l1 = lst1[i]
        l2 = lst2[i]
        l1 -= l2
        lst_ans[i] = l1
    return lst_ans

def check_lst(lst1,target):
    for i in range(len(lst1)):
        if lst1[i] < target:
            return False
        
    return True

if flg:
    for k in range(n):
        gokei_t = gokei[:]
        money_t = money
        for i in range(k,n):
            if check_lst(hikizan(gokei_t,algo[i][1:]),x):
                gokei_t = hikizan(gokei_t,algo[i][1:])
                money_t -= algo[i][0]
                tmp.append(money_t)
            
            
 

    print(min(tmp))


        

### FIXED CODE ###

#ABC167-C
import itertools
flg = True
n,m,x = map(int,input().split())
algo = []
tmp = []
for _ in range(n):
    algo.append(list(map(int,input().split())))
    
book = list(itertools.product([0,1],repeat=n))
abi = [0 for _ in range(m)]

for pattern in book:
    #値の初期化
    abi = [0 for _ in range(m)]
    money = 0
    flg = True
    
    for i in range(len(pattern)):
        for j in range(m):
            abi[j] += algo[i][j+1] * pattern[i]
        money += algo[i][0] * pattern[i]
        
    abi_min = [p for p in abi if p < x]
        
    if len(abi_min) != 0:
        flg = False
    if flg:
        tmp.append(money)

if len(tmp) > 0:
    print(min(tmp))
else:
    print(-1)
S=input()
mem_mod = [0 for i in range(0,2019,1)]
N = len(S)
counter = 0
S_num_tmp = list(S)
S_num = list(map(int, S_num_tmp))
tmp=10

for i in range(1,N,1):
    S_num[N-i-1] = S_num[N-i] + S_num[N-i-1]*pow(10,i,2019)

for i in range(0,N,1):
    X = S_num[N-i-1] % 2019
    if X==0:
        counter+=1
    counter += mem_mod[X]
    mem_mod[X] += 1
print(counter)

### FIXED CODE ###

e = list(map(int,input().split(sep=" ")))
if e[0]<=e[1]:
    print("unsafe")
else:
    print("safe")
import math
l1=input().split(" ")
t80=int(l1[0])
t100=int(l1[1])
t80_min=math.ceil(t80/0.08)
t80_max=math.ceil((t80+1)/0.08)
t100_min=math.ceil(t100/0.1)
t100_max=math.ceil((t100+1)/0.1)
f=0
for i  in range(min(t80_min,t100_min),max(t100_max,t100_max)):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        sys.exit()
print(-1)

### FIXED CODE ###

import sys
 
a,b = map(int,input().split())
low = int(min(a//0.08,b//0.1))
high = int(max((a+1)//0.08,(b+1)//0.1))
for i in range(low,high+1):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    sys.exit()
print(-1)