Harryxun/stf_run huggingface dataset:
n = int(input())
h = [int(i) for i in input().split()]

# 無限大の値
f_inf = float('inf')

# メモ用のDP テーブルを初期化　(最小化問題なので INF に初期化)
dp = [f_inf] * (10**5+10)

# dpの最小値を変更する関数
def chmin(a, b):
    if a > b:
        return b
    else:
        return a

# メモ化再帰の関数
def rec(i):
    # DPの値が更新されている場合はその値を返す
    if dp[i] <  f_inf:
        return dp[i]
    
    # 再帰の終了条件。足場0のコストは0
    if i == 0:
        return 0
    
    # i-1, i-2　を再帰
    res = f_inf
    # i-1 から来た場合
    res = chmin(res, rec(i-1) + abs(h[i] - h[i-1]))
    # i-2 から来た場合
    if i > 1:
        res = chmin(res, rec(i-2) + abs(h[i] - h[i-2]))
    
    # 結果をメモする
    dp[i] = res
    return res

ans = rec(n-1)
print(ans)

### FIXED CODE ###

n = int(input())
h = [int(i) for i in input().split()]

# dpの最小値を変更する関数
def chmin(a, b):
    if a > b:
        return b
    else:
        return a
    
# 無限大の値
f_inf = float('inf')

# DP テーブルを初期化　(最小化問題なので INF に初期化)
dp = [f_inf] * (10**5+10)

# 初期条件
dp[0] = 0

# 足場 i-1 から足場 i へ移動する。コストは|h[i]−h[i-1]|
# 足場 i-2 から足場 i へと移動する コストは |h[i]−h[i-2]|
for i in range(1, n):
    dp[i] = chmin(dp[i], dp[i - 1] + abs(h[i] - h[i-1]))
    # 一番目の足場では一つ前しか存在しない
    if i > 1:
        dp[i] = chmin(dp[i], dp[i - 2] + abs(h[i] - h[i -2]))

print(dp[n-1])
while True:
    x, y = sorted(map(int, input().split()))
    if x==y==0:
    print(x, y)
    x,y = sorted(map(int, input().split()))


### FIXED CODE ###

while True :
    x, y = sorted(map(int, input().split()))
    if x == y and y == 0 : break
    print(x, y)
from collections import deque


h, w = map(int, input().split())
time1 = time.time()
a = []
d = deque([])
memo = [[-1] * w for j in range(h)]
for i in range(h):
    a.append(list(input()))
    for j, s in enumerate(a[i]):
        if s == '#':
            d.append([i, j])
            memo[i][j] = 0


def d_list_update(d, hmax, wmax):
    move = [[1, 0], [0, 1], [-1, 0], [0, -1]]
    dh, dw = d.popleft()
    for i, j in move:
        if (0 <= dh + i < hmax) and (0 <= dw + j < wmax):
            if memo[dh + i][dw + j] == -1:
                memo[dh + i][dw + j] = memo[dh][dw] + 1
                d.append([dh + i, dw + j])
    return d


while(d):
    d = d_list_update(d, h, w)
ans = max([max(e) for e in memo])
print(ans)

### FIXED CODE ###

from collections import deque
 
 
h, w = map(int, input().split())
hs, ws = set(range(h)), set(range(w))
d = deque()
memo = [[-1] * w for j in hs]
move = [[1, 0], [0, 1], [-1, 0], [0, -1]]
a = tuple(input() for _ in hs)
b = [[i, j] for i in hs for j in ws if a[i][j] == '#']
for i, j in b:
    d.append((i, j))
    memo[i][j] = 0
while d:
    dh, dw = d.popleft()
    for i, j in move:
        dhn, dwn = dh + i, dw + j
        if (0 <= dhn < h) and (0 <= dwn < w) and (memo[dhn][dwn] < 0):
            d.append((dhn, dwn))
            memo[dhn][dwn] = memo[dh][dw] + 1
ans = max([max(e) for e in memo])
print(ans)
# ABC047A - キャンディーと2人の子供 / Fighting over Candies
a, b, c = sorted(list(map(int, input().rstrip().split())))
print("Yes" if a + B == c else "No")

### FIXED CODE ###

# ABC047A - キャンディーと2人の子供 / Fighting over Candies
a, b, c = sorted(list(map(int, input().rstrip().split())))
print("Yes" if a + b == c else "No")
n,m = map(int,input().split())
a = sorted(map(int,input().split()))

for i in range(m):
    a[-1] //= 2
    
    if a[-2] > a[-1]:
        a = sorted(a)
    
print(sum(a))

### FIXED CODE ###

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

import heapq
a = list(map(lambda x:x*(-1),a))
heapq.heapify(a)

for i in range(m):
    b = heapq.heappop(a)
    heapq.heappush(a,-(-b//2))
    
print(sum(a)*(-1))
import math
N, A, B = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)


def enough(T):
    num = 0
    for i in range(N):
        if H[i] >= B * i:
            num += math.ceil((H[i] - B * T) / (A - B))
    return T > num


left, right = 1, max(H) // B + 1
while right - left > 1:
    mid = (left + right) // 2
    if enough(mid):
        right = mid
    else:
        left = mid

print(mid)

### FIXED CODE ###

N, A, B = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)


def enough(T):
    num = 0
    for i in range(N):
        if H[i] - B * T > 0:
            num += (H[i] - B * T) // (A - B)
            num += int((H[i] - B * T) % (A - B) != 0)
    return T >= num


left, right = 0, 10 ** 9 + 1
mid = (left + right) // 2
while right - left > 1:
    mid = (left + right) // 2
    if enough(mid):
        right = mid
    else:
        left = mid

print(right)
a = list(map(int,input().split()))
b = a[0] - a[2]
if b <= 0:
  ans = a[1] + b
  print('0 {}'.format(ans))
elif b == 0:
  print('0 {}'.format(a[1]))
elif ans < 0:
  print('0 0')
else:
  print('{} {}'.format(b, a[1]))

### FIXED CODE ###

a = list(map(int,input().split()))
b = a[0] - a[2]
if b <= 0:
  ans = a[1] + b
  if ans < 0:
    print('0 0')
  else:
    print('0 {}'.format(ans))
elif b == 0:
  print('0 {}'.format(a[1]))

elif b > 0:
  print('{} {}'.format(b, a[1]))
k = int(input())
 
def gcd2(a,b):
    if b == 0:
        return a
    return gcd2(b,a%b)

def gcd3(a,b,c):
    return gcd2(gcd2(a,b), c)

ans = 0
for a in range(1,k+1):
    for b in range(i,k+1):
        for c in range(j, k+1):
            if a == b == c:
                ans += gcd3(a,b,c)
            elif a == b or b == c:
                ans += gcd3(a,b,c)*3
            else:
                ans += gcd3(a,b,c)*6

print(ans)

### FIXED CODE ###

n=int(input())+1
import math
ans=0
for i in range(1,n):
    ans+=n-i
    for j in range(i+1,n):
        p=math.gcd(n-i,n-j)
        ans+=p*6
        for k in range(j+1,n):
            ans+=math.gcd(p,n-k)*6
print(ans)
from sys import exit
H,W,N = [int(n) for n in input().split()]
dxy = [[1,0],[0,1],[-1,0],[0,-1],[1,-1],[-1,1],[1,1],[-1,-1],[0,0]]
# ansdic = {0:(H-2)*(W-2),1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0}
ansdic = {}
# memo = [[0 for _ in range(W-1)] for __ in range(H-1)]
# print(memo)

for i in range(N):
    ab = [int(n) for n in input().split()]
    ab[0]-=1
    ab[1]-=1
    for d in dxy:
        per = [ab[0] + d[0],ab[1] + d[1]]
        if(1 <= per[0] <= H-2 and 1 <= per[1] <= W-2):
            rep = "".join([str(per[0]),str(per[1])])

            if not rep in ansdic:
                ansdic[rep] = 1
            else:
                ansdic[rep] +=1
            # ansdic[memo[per[0]][per[1]]]-=1
            # memo[per[0]][per[1]]+=1
            # ansdic[memo[per[0]][per[1]]]+=1
ans = {0:(H-2)*(W-2),1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0}
for k in ansdic.keys():
    ans[ansdic[k]]+=1
    ans[0]-=1
for k in ans.keys():
    print(ans[k])
# S = str(input())
# L = len(S)
# T = str(input())
exit()


### FIXED CODE ###

from collections import defaultdict
H,W,N = [int(n) for n in input().split()]
# N = int(input())
dxy = [[0,0],[1,0],[0,1],
[-1,0],[0,-1],[1,1],
[-1,-1], [1,-1], [-1,1]]

effdic = defaultdict(int)
for i in range(N):
    a,b = [int(n)-1 for n in input().split()]
    for d in dxy:
        ta, tb = a+d[0], b+d[1]
        if(1 <= ta < H-1 and 1 <= tb < W-1):
            effdic[(ta,tb)] += 1
print((H-2)*(W-2) - len(effdic))
for i in range(1,10):
    tmp=0
    for v in effdic.values():
        if(v == i):
            tmp+=1
    print(tmp)
a,b,x = map(int,input().split())
import math
m_cm3 = a*b*a
if(x >= (m_cm3/2)):
    s = 2*b - (2*x)/(a**2)
    s /= a
    ans = math.degrees(math.atan(s))
else:
    s = (2*x)/(a*b*b)
    ans = math.degrees(math.acos(s))

print(ans)

### FIXED CODE ###

a,b,x = map(int,input().split())
import math
m_cm3 = a*b*a
if(x >= (m_cm3/2)):
    s = 2*b - (2*x)/(a**2)
    s /= a
    ans = math.degrees(math.atan(s))
else:
    s = (a*b*b)/(2*x)
    ans = math.degrees(math.atan(s))

print(ans)
# -*- coding: utf-8 -*-
import numpy as np

def mk_prime_list(num):
    num_list = np.array(range(2, num + 1))
    prime_list = np.array([])

    i = num_list[0]
    while i <= np.sqrt(num):
        prime_list = np.append(prime_list, i)
        num_list = num_list[~(num_list % i == 0)]
        i = num_list[0]

    return prime_list


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

if a > b:
    max_num = int(np.sqrt(a))
else:
    max_num = int(np.sqrt(b))

num_list = np.array(range(2, max_num + 1))
#prime_list = np.array([])

ans = 1
i = num_list[0]
while i <= max_num:
    if a % i == 0 and b % i == 0:
        ans += 1
    num_list = num_list[~(num_list % i == 0)]
    if num_list.size == 0:
        break
    i = num_list[0]

#prime_list = mk_prime_list(max_num)
#print(prime_list)

#ans = 1

#for i in prime_list:
#    if a % i == 0 and b % i == 0:
#        ans += 1

print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np

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

soin_a = np.array([], dtype='int')
for i in range(2, int(np.sqrt(a)) + 1):
    if a % i == 0:
        soin_a = np.append(soin_a, i)
        while a % i == 0:
            a //= i
if a != 1:
    soin_a = np.append(soin_a, a)

soin_b = np.array([], dtype='int')
for i in range(2, int(np.sqrt(b)) + 1):
    if b % i == 0:
        soin_b = np.append(soin_b, i)
        while b % i == 0:
            b //= i
if b != 1:
    soin_b = np.append(soin_b, b)

ans = 1
for j in soin_a:
    if soin_b[soin_b == j].size != 0:
        ans += 1

print(ans)
def memo(v):
    if dp[v]!=-1:return dp[v]
    ans = 0
    for next_v in g[v]:
        ans = max(ans,memo(next_v)+1)
    dp[v] = ans
    return dp[v]

n,m = map(int,input().split())
g = [[] for _ in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    g[x].append(y)
    
dp = [-1]*(n+1)

ans = 0
for v in range(n):
    ans = max(ans, memo(v))
    
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5+10)
def memo(v):
    if dp[v]!=-1:return dp[v]
    ans = 0
    for next_v in g[v]:
        ans = max(ans,memo(next_v)+1)
    dp[v] = ans
    return ans

n,m = map(int,input().split())
g = [[] for _ in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    g[x].append(y)
    
dp = [-1]*(n+1)

ans = 0
for v in range(1,n+1):
    ans = max(ans, memo(v))
    
print(ans)
import sys 
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    n = I()
    a = LI()
    ava = [1]*n

    for i in range(n):
        x = a[i]
        for j in range(i+1,n):
            print(ava)
            if not ava[i] and not ava[j]:
                break
            y = a[j]
            if ava[i]:
                if not x%y:
                    ava[i] = 0
            if ava[j]:
                if not y%x:
                    ava[j] = 0    
    print(ava.count(1))
    return
 
if __name__=='__main__':
    main()

### FIXED CODE ###

import sys

def solve(a,n):
    m = a[-1]+1
    ava = [0]*m
    for rep in a:
        ava[rep] += 1
        if ava[rep]:
            for i in range(2*rep,m,rep):
                ava[i] += 2
    return ava.count(1)
 
if __name__=='__main__':
    n = int(sys.stdin.readline().rstrip())
    a = list(map(int,sys.stdin.readline().rstrip().split()))
    a.sort()
    print(solve(a,n))
H, W, A, B = map(int, input().split())

M = [[0 for w in range(W)] for h in range(H)]

i = 0
for h in range(H):
    for a in range(A):
        w = i + a
        if w == W:
            w = 0
        M[h][w] = 1
    i = w + 1
    if i == W:
        i = 0

for w in range(W):
    col = 0
    for h in range(H):
        col += M[h][w]
    if col not in [B, H - B]:
        print('No')
        exit()

for h in range(H):
    print(''.join(list(map(str, M[h]))))

### FIXED CODE ###

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

M = [[0 for w in range(W)] for h in range(H)]

for h in range(B):
    for w in range(A):
        M[h][w] = 1

for h in range(B, H):
    for w in range(A, W):
        M[h][w] = 1

for h in range(H):
    print(''.join(list(map(str, M[h]))))
= int(input())
s = str(input())
if n%2 == 1:
    print('No')
else:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n = int(input())
s = str(input())
if n%2 == 1:
    print('No')
else:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')
n,m = map(int,input().split())
data = [tuple(map(int,input().split())) for i in range(n)]
data.sort(key = lambda tup:tup[0])
salary =[]
ans=0
prev=0
memo=0
for day in range(m):
	for i in range(memo,n):
		if data[memo][0]<=(day+1):
			salary.append(data[memo][1])
			memo+=1
		else:
			break
	ans+=max(salary ,default=0)
	if max(salary ,default=0) !=0:
		salary[salary.index(max(salary))]=0
print(ans)








### FIXED CODE ###

import heapq
n,m = map(int,input().split())
AB =[tuple(map(int,input().split())) for i in range(n)]
ans,memo=0,0
hq=[]
AB.sort(key=lambda tup:tup[0])
for day in range(m):
	for i in range(memo,n):
		if AB[i][0]<=(day+1):
			heapq.heappush(hq,-AB[i][1])
			memo+=1
		else:
			break
	if len(hq):	
		ans += -heapq.heappop(hq)
print(ans)
N,K = map(int,input().split())
x = list(map(int,input().split()))
xp = [i for i in x if i >= 0]
xn = [i for i in x if i < 0]
xn.reverse()
lp = len(xp)
ln = len(xn)
pc = min(K,lp)
pp = xp[pc-1]
if K>lp:
    nc = K-lp
    np = -xn[nc-1]
else:
    nc = 0
    np = 0
ans = pp + np + min(pp,np)
for i in range(pc-1):
    if nc == ln:
        break
    pp = xp[pc-i-2]
    np = -xn[nc]
    nc += 1
    ans = min(ans,pp + np + min(pp,np))
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
x = list(map(int,input().split()))
xp = [i for i in x if i >= 0]
xn = [i for i in x if i < 0]
xn.reverse()
lp = len(xp)
ln = len(xn)
if lp == 0:
    print(-xn[K-1])
    exit()
if ln == 0:
    print(xp[K-1])
    exit()
pc = min(K,lp)
pp = xp[pc-1]
if K>lp:
    nc = K-lp
    np = -xn[nc-1]
else:
    nc = 0
    np = 0
ans = pp + np + min(pp,np)
for i in range(pc-1):
    if nc == ln:
        break
    pp = xp[pc-i-2]
    np = -xn[nc]
    nc += 1
    ans = min(ans,pp + np + min(pp,np))
print(ans)
import sys
if __name__ == '__main__':
    N,x = list(map(int,input().split()))
    if 1 < x < 2*N - 1:
        print('Yes')
        L = [i+1 for i in range(2*N - 1)]
        L[L.index(x+1)],L[N-2] = L[N-2],x+1
        L[L.index(x)],L[N-1] = L[N-1],x
        L[L.index(x-1)],L[N] = L[N],x-1
        L[L.index(x+2)],L[N+1] = L[N+1],x+2
        for i in L:
            print(i)
    else:
        print('No')


### FIXED CODE ###

import sys
if __name__ == '__main__':
    N,x = list(map(int,input().split()))
    if 1 < x < 2*N - 1:
        print('Yes')
        for i in range(2*N - 1):
            print(1+ ((x-N+i)%(2*N - 1)))
    else:
        print('No')
N = int(input())
yakusuu_list = []
for i in range (1,N+1):
  if N % i == 0:
    yakusuu_list.append([i,N/i])
kyori_list =[]
for a in yakusuu_list:
  [i,j] = a
  kyori_list.append(i+j-2)
print(min(kyori_list)
  

### FIXED CODE ###

N = int(input())
import math 
yakusuu_list = []
for i in range (int(math.sqrt(N)),0,-1):
  if N % i == 0:
    yakusuu = i
    break
print(i+ N//i -2)
n = int(input())
graph = [[] for _ in range(n)]
for _ in range(n-1):
  a, b, c = map(int, input().split())
  a-=1
  b-=1
  graph[a].append((b, c))
  graph[b].append((a, c))
q, k = map(int, input().split())
k-=1
xy = []
for _ in range(q):
  x, y = map(int, input().split())
  xy.append((x-1, y-1))

l = [0]*n
def DFS(node, p_node, length):
  l[node] = length
  for i, j in graph[node]:
    if i==p_node:
      continue
    DFS(i, node, length+j)
DFS(k, -1, 0)
for x, y in xy:
  print(l[x]+l[y])

### FIXED CODE ###

import sys
n = int(input())
graph = [[] for _ in range(n)]
for _ in range(n-1):
    a, b, c = map(int, input().split())
    a-=1
    b-=1
    graph[a].append((b, c))
    graph[b].append((a, c))
q, k = map(int, input().split())
k -= 1
xy = []
for _ in range(q):
    x, y = map(int, input().split())
    x-=1
    y-=1
    xy.append((x, y))

def DFS(node, p_node, length):
    l[node] = length
    for i, j in graph[node]:
        if i==p_node:
            continue
        DFS(i, node, length+j)
sys.setrecursionlimit(2 * n)
l = [0]*n
DFS(k, -1, 0)
for x, y in xy:
    print(l[x]+l[y])
import math

a = input().split()
s1 = a[0]
s2 = a[1]
num1 = int(s1)
num2 = int(s[0])*100 + int(s[2]+s[3])

print((num1*num2)//100)

### FIXED CODE ###

a = input().split()
s1 = a[0]
s2 = a[1]
num1 = int(s1)
num2 = int(s2[0])*100 + int(s2[2]+s2[3])

print((num1*num2)//100)
def main():
    N = input()
    A = list(map(int,input().split()))

    if 0 in A:
        print(0)
        return

prod = 1
for a in A:
    prod *= a
    if prod > 10000000000000000000:
        print(-1)
        return

print(prod)

main()


### FIXED CODE ###

N = input()
A = list(map(int,input().split()))
def main(A):
    if 0 in A:
        print(0)
        return

    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return

    print(prod)

main(A)
a,b = map(int,input())

if a <= 5:
  print("0"
        
elif a <= 12:
        print(b/2)
        
else:
        print(b)
	

### FIXED CODE ###

a,b = map(int,input().split())
 
if a <= 5:
	print(0)
        
elif a <= 12:
	print(int(b/2))
        
else:
	print(b)
from scipy.special import comb
M,N = list(map(int,input().split()))

A = comb(M,2,exact = True)
B = comb(N,2,exact = True)
print(A+B)

### FIXED CODE ###

import math
M,N = list(map(int,input().split()))
def comb(n,r):
    if n >= r:
        return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))
    else:
        return 0
   
 
A = comb(M,2)
B = comb(N,2)
print(A+B)
a= int(input())
b= int(input())
c= int(input())
k= int(input())
ans= 0

for i in range(0,4):
  if a < b*(2**i) < c*(2**(k-i)):
    ans+=1
  else:
    ans+=0
  
print(Yes if ans>=1 else No)

### FIXED CODE ###

a, b, c = map(int, input().split())
k = int(input())
ans= 0
 
for i in range(k):
  if a < b*(2**i) < c*(2**(k-i)):
    ans+=1
  else:
    ans+=0
  
if ans>=1:
  print("Yes")
else:
  print("No")
w,h,x,y = list(map(int,input().split()))
ans = 0
if y/x == h/w:
    print(h * w /2,1)
else:
    ans = max(abs(w-x) * h,abs(h-y) * w)
    print(ans,0)

### FIXED CODE ###

w,h,x,y = list(map(int,input().split()))
ans = 0
if x == 0 and y == 0:
    print(h * w /2 , 0)
elif x == 0:
    print(h * w /2,0)
elif y == 0:
    print(h * w / 2, 0)
else:
    if x == (w /2) and y == (h / 2):
        print(h * w /2,1)
    else:
         
        print(h * w /2,0)
N = int(input())

def fx(N):
  ans = 0
  while N // 10 != 0:
    ans += N % 10
    N = N //10
  return ans
  
if N % fx(N) == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = int(input())

def fx(N):
  ans = 0
  for i in str(N):
    ans += int(i)
  return ans
  
if N % fx(N) == 0:
  print("Yes")
else:
  print("No")
def gcd(x, y):
    if x < y:
        x = tmp
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

if __name__ == '__main__':
    a, b = [int(x) for x in input().split()]
    print (gcd(a, b))


### FIXED CODE ###

def gcd(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

if __name__ == '__main__':
    a, b = [int(x) for x in input().split()]
    print (gcd(a, b))
i=True
while i:
  
  N,K=map(int,input().split())
  
  if N > K:
  
  	wide = N - K
  
  elif N = K:
    
    wide = 0
    
  else:
    
    wide = 1
    
print(wide)

### FIXED CODE ###

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

if N > K and K !=1:
	wide = N - K
elif N == K or K==1:
  	wide = 0
else:
    wide = 0
    
print(wide)
a, b = input().split()
print(min(0, a - b * 2))

### FIXED CODE ###

a, b = input().split()
print(max(0, int(a) - int(b) * 2))
def management(N,array):
	res = []
	for i in range(N):
      res[array[i]] += 1
    for j in range(len(res)):
      print(res[j])
     
    
    
N = int(input())
array = list(map(int,input().split())
mamagememt(N,array))

### FIXED CODE ###

def management(N,array):
  res = [0]*N
  for i in range(len(array)):
    res[array[i]-1] += 1
  for j in range(len(res)):
    print(res[j])

if __name__ == '__main__':
  N = int(input())
  array = list(map(int,input().split()))
  management(N,array)
num = int(input())
l = list(map(int, input().split()))
max = l.pop(max(l))
for i in range(len(l)):
    if max < l[i]:
        print('No')
        exit(0)
print('Yes')


### FIXED CODE ###

num = int(input())
l = list(map(int, input().split()))
max = l.pop(l.index(max(l)))
sum = 0
for i in range(len(l)):
    sum = sum + l[i]
if sum <= max:
    print('No')
else:
    print('Yes')
int main() {
	char s[3]
  	scanf("%s",s)
  	if(s[0]=="7" ||s[1]=="7"||s[2]=="7"){
    	printf("Yes")
    }
  	else{
    	printf("No")
    }
}

### FIXED CODE ###

n = input()
if "7" in n:
  print("Yes")
else:
  print("No")
from collections import defaultdict

def c():
    n, m = map(int, input().split())
    graph = defaultdict(list)
    a1 = None
    for i in range(n):
        a, b = map(int, input().split())
        if i == 0:
            a1 = a
        graph[a].append(b)
        graph[b].append(a)
    stack = []
    count = 0

    if a1:
        stack.append((a1, set()))

    while stack:
        val, visited = stack.pop()
        visited.add(val)
        if len(visited) == m:
            count += 1
            continue

        for g in graph[val]:
            if g not in visited:
                stack.append((g, set(visited)))

    print(count)


if __name__ == '__main__':
    c()


### FIXED CODE ###

from collections import defaultdict


def c():
    n, m = map(int, input().split())
    graph = defaultdict(list)
    for i in range(m):
        a, b = map(int, input().split())
        graph[a].append(b)
        graph[b].append(a)
    stack = []
    count = 0

    stack.append((1, set()))

    while stack:
        val, visited = stack.pop()
        visited.add(val)
        if len(visited) == n:
            count += 1
            continue

        for g in graph[val]:
            if g not in visited:
                stack.append((g, set(visited)))

    print(count)


if __name__ == '__main__':
    c()
import numpy as np
#from scipy.interpolate import interpld
from matplotlib import pyplot as plt
%matplotlib inline
import sys
x, y = [int(i) for i in input().split()]
list = [1,3,5,7,8,10,12,4,6,9,11,2,0]
slice1 = list[0:7]
slice2 = list[7:11]
slice3 = list[11:12]

if x in slice1 and y in slice1:
    print('Yes')
elif x in slice2 and y in slice2:
    print ('Yes')
elif x in slice3 and y in slice3:
    print ('Yes')
else:
    print ('No')

### FIXED CODE ###

import sys
x, y = [int(i) for i in input().split()]
list = [1,3,5,7,8,10,12,4,6,9,11,2,0]
slice1 = list[0:7]
slice2 = list[7:11]
slice3 = list[11:12]

if x in slice1 and y in slice1:
    print('Yes')
elif x in slice2 and y in slice2:
    print ('Yes')
elif x in slice3 and y in slice3:
    print ('Yes')
else:
    print ('No')
#-------------
N = int(input())
A = list(map(int, input().split()))
#-------------

kabu = 0
money = 1000
for i in range(N-1):
  if A[i] < A[i+1]:
    mod,money = divmod(money , A[i])
    kabu += mod
  if A[i] > A[i+1]
    money = money + A[i+1] * kabu
    kabu = 0

money = money + A[N-1]*kabu
print(money)

### FIXED CODE ###

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

kabu = 0
money = 1000
for i in range(N-1):
  if A[i] < A[i+1]:
    mod,money = divmod(money , A[i])
    kabu += mod
  if A[i] > A[i+1]:
    money = money + A[i] * kabu
    kabu = 0

money = money + A[N-1]*kabu
print(money)
N = int(input())
n=[]
s=range(N)
for i in range(N):
    n.append([int(x) for x in input().split()])
Q = list(itertools.permutations(s))
L=0
for i in range(int(len(Q)/2)):
    for j in range(N-1):
        L+= np.sqrt((n[Q[i][j+1]][0] - n[Q[i][j]][0])**2 + (n[Q[i][j+1]][1] - n[Q[i][j]][1])**2)
print(L/(len(Q)/2))

### FIXED CODE ###

import itertools
import numpy as np


N = int(input())
n=[]
s=range(N)
for i in range(N):
    n.append([int(x) for x in input().split()])
Q = list(itertools.permutations(s))
L=0
for i in range(int(len(Q))):
    for j in range(N-1):
        L+= np.sqrt((n[Q[i][j+1]][0] - n[Q[i][j]][0])**2 + (n[Q[i][j+1]][1] - n[Q[i][j]][1])**2)
print(L/(len(Q)))