Harryxun/stf_run huggingface dataset:
n,m,r = map(int,input().split())
r = list(map(int,input().split()))
node = [list(map(int,input().split())) for _ in range(m)]
dic = {}
for i in range(1,n+1):
    dic[i] = {}
    for j in range(1,n+1):
        dic[i][j]=10**6
for a,b,c in node:
    dic[a][b] = c
    dic[b][a] = c
dp = [[10**8]*(n+1) for _ in range(n+1)]
for i in range(n+1):
    dp[0][i] = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        dp[i][j] = dic[i][j]
        for k in range(1,n+1):
            dp[i][j] = min(dp[i][j], dic[i][k]+dic[k][j])
def dfs(dv,nv,cost):
    if sum(dv)==len(dv):
        return cost
    ret = []
    for i in range(len(dv)):
        if dv[i]==1:
            continue
        dv_ = dv.copy()
        dv_[i] = 1
        ret.append(dfs(dv_,r[i],cost+dp[nv][r[i]]))
    return min(ret)
print(dfs([0]*len(r),0,0))

### FIXED CODE ###

n,m,r = map(int,input().split())
r = list(map(int,input().split()))
node = [list(map(int,input().split())) for _ in range(m)]
dp = [[float('inf')]*(n+1) for _ in range(n+1)]
for x,y,z in node:
    dp[x][y] = z
    dp[y][x] = z
for i in range(n+1):
    dp[i][i] = 0
def wf(d,n):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                if d[i][j]>d[i][k]+d[k][j]:
                    d[i][j] = d[i][k]+d[k][j]
    return d
dp = wf(dp,n+1)
import copy
import sys
rest = set(r[:])
def dfs(cost,pre,rest):
    if 0==len(rest):
        return cost
    ret = sys.maxsize
    for i in rest:
        if pre==None:
            next_cost = 0
        else:
            next_cost = cost + dp[pre][i]
        next_rest = copy.copy(rest)
        next_rest.remove(i)
        tmp_ret = dfs(next_cost, i, next_rest)
        ret = min(ret,tmp_ret)
    return ret
print(dfs(0,None,rest))
N, K = map(int,input().split())
ans = 0
for i in range(1, N+1):
  if K%i == 0:
    p = i * (1/n)*(1/2)**(K//i)
  else:
    p = i * (1/n)*(1/2)**(K//i+1)
  ans += p
print(ans)
  

### FIXED CODE ###

N, K = map(int,input().split())
ans = 0
for i in range(1, N+1):
  k = i
  c = 0
  while K > k:
    k = k*2
    c += 1
  p = (1/N)*((1/2)**c)
  ans += p
print(ans)
N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>x:
    return True
  else:
    return False
    
for i in range(N+1):
  height += List[i]
  res +=1
  if checkF(height,X):
    res = res-1
    break
print(res)

### FIXED CODE ###

N,X=map(int,input().split())
List = list(map(int, input().split()))
height = 0
res = 1
def checkF(k,x):
  if k>x:
    return True
  else:
    return False
    
for i in range(N):
  height += List[i]
  res +=1
  if checkF(height,X):
    res = res-1
    break
print(res)
n,m=map(int,input().split())
if m=0:
  print(0)
else:
  sc= [list(map(int,input().split())) for i in range(m)]
  ans = -1
  s=[[0 for i in range(2)] for i in range(n)]
  for j in range(10**n):
  k=str(j)
    for l in range(len(k)):
      s[l][0]=l+1
      s[l][1]=int(k[l])
    if all(elm in s for elm in sc) == 1:
      ans=j
      break
  print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
if m==0:
  if n ==1:
    print(0)
  else:
    print(10**(n-1))
else:
  sc= [list(map(int,input().split())) for i in range(m)]
  ans = -1
  for j in range(10**(n-1)-1,10**n):
    k=str(j)
    s=[[0 for i in range(2)] for i in range(len(k))]
    for l in range(len(k)):
      s[l][0]=l+1
      s[l][1]=int(k[l])
      if all(elm in s for elm in sc) == 1:
        ans=j
        break
    if ans==j:
      break
  print(ans)
temp = input().split(' ')
monter_count = int(temp[0])
kill_count = int(temp[1])

temp = input().split(' ')
# 数値の配列に変換
temp = [int(s) for s in temp]
# 体力の多い順にソート
temp.sort(reverse=True)
del(temp[0:monter_count])
print(temp.sum())

### FIXED CODE ###

import math

temp = input().split(' ')
monter_count = int(temp[0])
kill_count = int(temp[1])
 
temp = input().split(' ')
# 数値の配列に変換
temp = [int(s) for s in temp]
# 体力の多い順にソート
temp.sort(reverse=True)
del(temp[0:kill_count])

print(sum(temp))
N,T = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(N)]
x=[]
for i in range(N):
  if a[i][1]<=T:
    x.append(a[i])
if len(x)==0:
  print("TLE")
else:
  x.sort(key=lambda x:x[0])
print(x[0][0])

### FIXED CODE ###

N,T = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(N)]
x=[]
for i in range(N):
  if a[i][1]<=T:
    x.append(a[i])
if len(x)==0:
  print("TLE")
else:
  x.sort(key=lambda x:x[0])
  print(x[0][0])
a,b=map(int,input().split())
cnt=0
while a>0:
  a//=b
  cnt+=1
print(x)

### FIXED CODE ###

a,b=map(int,input().split())
cnt=0
while a>0:
  a//=b
  cnt+=1
print(cnt)
import sys
i = 0
x = []
for line in open('in1.txt','r'):#sys.stdin:
    if i==0:
        x.append(int(line))
    else:
        s1 = 'SHCD'.index(line[0])
        s2 = int(line[2:])
        x.append((s1,s2))
    i = 1

r4 = range(4)
r13 = range(13)
lx = x.pop(0)
cards = [[0 for i in r13] for j in r4]
for j,i in x: cards[j][i-1] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0: print 'SHCD'[j],str(i+1)
print

### FIXED CODE ###

r4 = range(4)
r13 = range(13)
cards = [[0 for i in r13] for j in r4]

n = input()
for i in range(n):
    s1, s2 = raw_input().split()
    s1 = 'SHCD'.index(s1)
    s2 = int(s2)-1
    cards[s1][s2] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0:
            print 'SHCD'[j],i+1
#problem-c
n = int(input())
p = list(map(int, input().split()))
cnt = 0
min_p = p[0]
for i in range(n):
    if p[i]<=min_p:
        cnt += 1
        min_p = p[i]
    else:
print(cnt)


### FIXED CODE ###

#problem-c
n = int(input())
p = list(map(int, input().split()))
cnt = 0
min_p = p[0]
for i in range(n):
    if p[i]<=min_p:
        cnt += 1
        min_p = p[i]
print(cnt)
#include <bits/stdc++.h>
using namespace std;

int main()
{
  int64_t n, k;
  cin >> k >> n;
  vector<int64_t> li(n * 2);
  for (int i = 0; i < n; ++i)
  {
    cin >> li[i];
    li[i + n] = li[i] - k;
  }
  sort(li.begin(), li.end());
  int64_t ans = 10e9;
  for (int i = 0; i < 2 * n - (n - 1); ++i)
    ans = min(ans, abs(li[i] - li[i + n - 1]));
  cout << ans << "\n";
}

### FIXED CODE ###

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

tmp = [0] * n
for i in range(n):
    tmp[i] = li[i] - k
li = li + tmp
li.sort()
ans = 10**9
for i in range(len(li) - n+1):
    ans = min(ans, abs(li[i] - li[i + n-1]))
print(ans)
a = int(input())
b = int(input())
add = a+b
minus = a-b
cross = a*b
lis = [add, minus, cross]
print(max(lis))

### FIXED CODE ###

a,b=input().split()
a = int(a)
b = int(b)
ad = a+b
minus = a-b
cross = a*b
lis = [ad, minus, cross]
print(max(lis))
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=b[0]
d=b[n-1]
if d-c==0or1
  print("Yes")
else:
  print("No")



### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=0
c=a.reverse()
d=0
for i in range(n-1):
  if a[i]-a[i+1]==-1:
    a[i+1]=a[i+1]-1
  elif a[i]-a[i+1]<=-2:
    b+=1
  else:
    d=d
    
if b==0:
  print("Yes")
else:
  print("No")
import sys
input = sys.stdin.readline
N, M = map(int, input().split())

N0 = 2**((N+1).bit_length())
INF = 10**18
data = [0]*(2*N0)
lazy = [0]*(2*N0)

def gindex(l, r):
    L = l + N0; R = r + N0
    lm = (L // (L & -L)) >> 1
    rm = (R // (R & -R)) >> 1
    while L < R:
        if R <= rm:
            yield R
        if L <= lm:
            yield L
        L >>= 1; R >>= 1
    while L:
        yield L
        L >>= 1

def propagates(*ids):
    for i in reversed(ids):
        v = lazy[i-1]
        if not v:
            continue
        lazy[2*i-1] += v; lazy[2*i] += v
        data[2*i-1] += v; data[2*i] += v
        lazy[i-1] = 0
        
def update(l, r, x):
    L = N0 + l; R = N0 + r
    while L < R:
        if R & 1:
            R -= 1
            lazy[R-1] += x; data[R-1] += x
        if L & 1:
            lazy[L-1] += x; data[L-1] += x
            L += 1
        L >>= 1; R >>= 1

    for i in gindex(l, r):
        data[i-1] = max(data[2*i-1], data[2*i]) + lazy[i-1]

def update2(k, x):
    k += N0-1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = max(data[2*k+1], data[2*k+2])

def query(l, r):
    propagates(*gindex(l, r))
    L = N0 + l; R = N0 + r
    s = -INF
    while L < R:
        if R & 1:
            R -= 1
            s = max(s, data[R-1])
        if L & 1:
            s = max(s, data[L-1])
            L += 1
        L >>= 1; R >>= 1
    return s

xs = [0]*(N+1)
ys = [[] for _ in range(N+1)]
for _ in range(M):
    l, r, a = map(int, input().split())
    xs[l] += a
    ys[r].append((l,a))

for i in range(1, N+1):
    update(0,i,xs[i])
    update2(i, query(0, i))
    for l, a in ys[i]:
        update(0, l, -a)
print(query(0,N+1))


### FIXED CODE ###

N, = map(int, input().split())
Xs = []
for i in range(N):
    X, Y, Z = map(int, input().split())
    Xs.append((X,Y,Z,i))
Xs.sort(key=lambda x : x[0]+x[1])

dp = [0]*(2*(10**4)+1)
for x,y,z,i in Xs:
#    print(i+1,x,y,z)
    for i in range(y+1):
        i = y-i
        dp[i+x] = max(dp[i+x], dp[i]+z)
#    print(dp[:10])
print(max(dp))
def cost(x1,y1,x2,y2):
    return abs(x1-x2) + abs(y1-y2)


n = int(input())

x = []
y = []
for i in range(n):
    a,b = map(int,input().split())
    x.append(a)
    y.append(b)
ans = - math.inf
for i in range(n):
    for j in range(i+1,n):
        ans = max(ans,cost(x[i],y[i],x[j],y[j]))
print(ans)

### FIXED CODE ###

n = int(input())

x = []
y = []
for i in range(n):
    a,b = map(int,input().split())
    x.append(a)
    y.append(b)
d1_max = x[0]+y[0]
d1_min = x[0]+y[0]
d2_max = x[0] - y[0]
d2_min = x[0]-y[0]
ans = -1
for i in range(1,n):
    d1_max = max(d1_max,x[i]+y[i])
    d1_min = min(d1_min,x[i]+y[i])
    d2_max = max(d2_max,x[i] - y[i])
    d2_min = min(d2_min,x[i]-y[i])
    ans = max((d1_max-d1_min),(d2_max-d2_min))
print(ans)
s=input()
t=input()
result=='No'
for i in range(len(s)-1):
  s=s[-1]+s[:len(s)-1]
  if s==t:
    result='Yes'
print(result)

### FIXED CODE ###

s=input()
t=input()
result='No'
for i in range(len(s)):
  s=s[-1]+s[:len(s)-1]
  if s==t:
    result='Yes'
print(result)
N = int(input())
A = [int(s) for s in input().split()]

PRIME_LENGTH = 10**6

prime_list = [[] for _ in range(PRIME_LENGTH)]

for i in range(2, PRIME_LENGTH):
    if not prime_list[i]:
        idx = i
        while (idx < PRIME_LENGTH):
            prime_list[idx].append(i)
            idx += i

vote = [0] * (PRIME_LENGTH)

for a in A:
    for v in prime_list[a]:
        vote[v] += 1

if max(vote) == len(A):
    print("not coprime")
elif sum(map(lambda x: x > 1, vote)) > 0:
    print("setwise coprime")
else:
    print("pairwise coprime")


### FIXED CODE ###

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

PRIME_LENGTH = (10**6 + 1)

prime_list = [[] for _ in range(PRIME_LENGTH)]

for i in range(2, PRIME_LENGTH):
    if not prime_list[i]:
        idx = i
        while (idx < PRIME_LENGTH):
            prime_list[idx].append(i)
            idx += i

vote = [0] * (PRIME_LENGTH)

for a in A:
    for v in prime_list[a]:
        vote[v] += 1

if max(vote) == len(A):
    print("not coprime")
elif sum(map(lambda x: x > 1, vote)) > 0:
    print("setwise coprime")
else:
    print("pairwise coprime")
N, K = map(int, input().split())
X = list(map(int, input().split()))

minus = [0]
plus = [0]
for x in X:
    if x < 0:
        minus.append(abs(x))
    elif x == 0:
        K -= 1
    else:
        plus.append(x)

#負の数の方を絶対値に基づき並べなおす
minus.sort()

ans = []
for i in range(max(0, K - (len(plus) - 1)), min(len(minus) + 1, K)):
    ans.append(min(minus[i] * 2 + plus[K - i], minus[i] + plus[K - i] * 2))

if len(X) == 1:
    ans.append(X[0])

print(min(ans))

### FIXED CODE ###

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

minus = [0]
plus = [0]
for x in X:
    if x < 0:
        minus.append(abs(x))
    elif x == 0:
        K -= 1
    else:
        plus.append(x)

#負の数の方を絶対値に基づき並べなおす
minus.sort()

a = len(minus) - 1
b = len(plus) - 1

ans = []
for i in range(max(0, K - b), min(a, K) + 1):
    ans.append(min(minus[i] * 2 + plus[K - i], minus[i] + plus[K - i] * 2))

if len(X) == 1:
    ans.append(X[0])

print(min(ans))
l=sorted(map(int,input().split()))
print(l[::2]-l[1::2])

### FIXED CODE ###

n=input() 
l=sorted(map(int,input().split()),reverse=True)
print(sum(l[::2])-sum(l[1::2]))
n = int(intput())
if(n%2 == 1):
  print(n//2)
else:
  print((n//2)-1)

### FIXED CODE ###

n = int(input())
if(n%2 == 1):
  print(n//2)
else:
  print((n//2)-1)
import numpy as np
A, B, Q = map(int,input().split())
s_list = np.array([int(input()) for i in range(A)])
t_list = np.array([int(input()) for i in range(B)])
x_list = [int(input()) for i in range(Q)]

def get_dist_to_first_cp(x,li):
    dist1 = li -x
    abs_dist1 = abs(dist1)
    dist_to_first_cp = min(abs_dist1)
    first_cp_num = np.argmin(abs_dist1)
    first_cp_pos = x + dist1[first_cp_num]
    return dist_to_first_cp, first_cp_pos
    


u_list = s_list + t_list
for i, x in enumerate(x_list):
    # shrine first
    dist_to_first_cp, first_cp_pos = get_dist_to_first_cp(x,s_list)
    dist2 = abs(np.array(t_list) - first_cp_pos)
    dist_to_sec_cp = min(dist2)
    ans_s = dist_to_first_cp + dist_to_sec_cp
    # temple first
    dist_to_first_cp, first_cp_pos = get_dist_to_first_cp(x,t_list)
    dist2 = abs(np.array(s_list) - first_cp_pos)
    dist_to_sec_cp = min(dist2)
    
    ans_t = dist_to_first_cp + dist_to_sec_cp

    print(min(ans_s,ans_t))


### FIXED CODE ###

import bisect

A, B, Q = map(int,input().split())
INF = 10**18
s_list = [-INF] +  [int(input()) for i in range(A)] + [INF]
t_list = [-INF] + [int(input()) for i in range(B)] + [INF]
x_list = [int(input()) for i in range(Q)]

for x in x_list:
    
    b, d = bisect.bisect_right(s_list, x), bisect.bisect_right(t_list, x)
    a = b - 1
    c = d - 1 
    ans = INF
    for s in [s_list[a], s_list[b]]:
        for t in [t_list[c], t_list[d]]:
            dist1 = abs(s-x) + abs(t-s)
            dist2 = abs(t-x) + abs(t-s)
            ans = min(ans, dist1,dist2)
    print(ans)
N = input()

d = {'M':0,'A':0,'R':0,'C':0,'H':0}

for i in range(N):
    s = input()
    if s[0] in 'MARCH':
        d[s[0]]+=1

v = list(d.values())
ans = 0

for i in range(5):
    for j in range (i+1,5):
        for k in range (j+1,5):
            ans += v[i]*v[j]*v[k]

print(ans)

### FIXED CODE ###

N = int(input())

d = {'M':0,'A':0,'R':0,'C':0,'H':0}

for i in range(N):
    s = input()
    if s[0] in 'MARCH':
        d[s[0]]+=1

v = list(d.values())
ans = 0

for i in range(5):
    for j in range (i+1,5):
        for k in range (j+1,5):
            ans += v[i]*v[j]*v[k]

print(ans)
N = int(input())
As = list(map(int, input().split()))
As.insert(0, 0)
Ans = [0 for _ in range(N + 1)]
Ans[N] = As[N]
for i in range(N - 1, 0, -1):
    p = i * 2
    s = 0
    while p <= N:
        s += Ans[p]
        p += i
    Ans[i] = 0 if s % 2 == As[i] else 1
M = sum(Ans)
print(M)
if M > 0:
    bs = ""
    for i in range(1, N + 1):
        if Ans[i] != 0:
            bs += "%d " % i
    bs = bs.rstrip(" ")
    print(bs)

### FIXED CODE ###

r = int(input())
print(3 * r * r)
home = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
n = int(raw_input())
for i in range(n):
    b, f, r, v = map(int, raw_input().split())
    home[b-1][f-1][r-1] += v

for i in range(4):
    for j in range(3):
        print "",
        print " ".join(map(str, home[i][j]))
        if j == 2 and i != 3


### FIXED CODE ###

n = int(input())
house = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]
for i in range(n):
    b, f, r, v = map(int, input().split())
    house[b-1][f-1][r-1]+=v
    
for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" "+str(house[i][j][k]), end="")
        print()
    if i != 3:
        print("#"*20)
import queue
N,M = map(int,input().split())
tree = [[] for _ in range(M+1)]
for i in range(M):
    a,b = map(int,input().split())
    tree[a].append([b,a])
    tree[b].append([a,b])

que = queue.Queue()
que.put(1)
result = [[-1,100000] for _ in range(N+1)]
result[1][1] = 0

while(True):
    if que.empty():
        break
    nex = que.get()
    
    for i in tree[nex]:
        if result[i[0]][0] == -1  :
            result[i[0]][0] = nex
            result[i[0]][1] = result[nex][1] +1

            
            que.put(i[0])
print(*result)

for i in range(2,N+1):
    for j in tree[i]:
        if result[j[0]][1] == result[i][1] -1:
            result[i][0] = j[0] 
result = result[2:]
if result.count(-1) !=0:
    print("No")
else :
    print("Yes")
    for i in result:
        print([i[0]])




### FIXED CODE ###

import queue
N,M = map(int,input().split())
tree = [[] for _ in range(N+1)]
for i in range(M):
    a,b = map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)

que = queue.Queue()
que.put(1)
result = [-1]*(N+1)
result[1] = 0
while(True):
    if que.empty():
        break
    start = que.get()
    for i in tree[start]:
        if result[i] == -1:
            result[i] = start
            que.put(i)

if -1 in result[2:]:
    print("No")
else:
    print("Yes")
    for i in result[2:]:
        print(i)
n = int(input())
vac = []
for i in range(n):
    arr =  [int(x) for x in input().strip().split()]
    vac.append(arr)
dp = {}
dp[0] = vac[0]

def solve(n):
    if n in dp:
        return dp[n]
    prev = solve(n-1)
    dp[n] = [None, None, None]
    dp[n][0] = max(prev[1],prev[2])+vac[n][0]
    dp[n][1] = max(prev[0],prev[2])+vac[n][1]
    dp[n][2] = max(prev[1],prev[0])+vac[n][2]
    return dp[n]

res = solve(n-1)
print(max(res))


### FIXED CODE ###

n = int(input())
vac = []
for i in range(n):
    arr =  [int(x) for x in input().strip().split()]
    vac.append(arr)
dp = [[None, None, None] for _ in range(n)]
dp[0] = vac[0]
for i in range(1,n):
    dp[i][0] = max(dp[i-1][1], dp[i-1][2])+vac[i][0]
    dp[i][1] = max(dp[i-1][0], dp[i-1][2])+vac[i][1]
    dp[i][2] = max(dp[i-1][1], dp[i-1][0])+vac[i][2]

print(max(dp[n-1]))
import bisect
N = int(input())
seq = [-int(input()) for i in range(N)] 
LIS = [seq[0]]
for i in range(1,len(seq)):
    if seq[i] > LIS[-1]:
        LIS.append(seq[i])
    else:
        LIS[bisect.bisect_right(LIS, seq[i])] = seq[i]
print(len(LIS))

### FIXED CODE ###

import bisect
N = int(input())
seq = [-int(input()) for i in range(N)] 
LIS = [seq[0]]
for i in range(1,len(seq)):
    if seq[i] >= LIS[-1]:
        LIS.append(seq[i])
    else:
        LIS[bisect.bisect_right(LIS, seq[i])] = seq[i]
print(len(LIS))
n, m = [ int(v) for v in input().split() ]
connect_list = [ [] for i in range(n) ]
for i in range(m):
    a, b = [ int(v)-1 for v in input().split() ]
    connect_list[a].append(b)
    connect_list[b].append(a)


def dfs(a):
    color = [ 0 for i in range(n) ]
    color[a] = 1
    stack = collections.deque([a])
    r = 0

    while stack:
        s = stack.pop()
        color[s] = 2
        r += 1
        for i in connect_list[s]:
            if color[i] == 0:
                color[i] = 1
                stack.append(i)
    return r

x, y = dfs(0), dfs(1)
x, y = max(x, y), min(x, y)

def part_edge(a):
    return a*(a-1)//2

x = n - y
total_edge = part_edge(x) + part_edge(y)
print(total_edge-m)


### FIXED CODE ###

import collections

n, m = [ int(v) for v in input().split() ]
connect_list = [ [] for i in range(n) ]
for i in range(m):
    a, b = [ int(v)-1 for v in input().split() ]
    connect_list[a].append(b)
    connect_list[b].append(a)


def dfs(a):
    color = [ 0 for i in range(n) ]
    color[a] = 1
    stack = collections.deque([a])
    r = 0

    while stack:
        s = stack.pop()
        color[s] = 2
        r += 1
        for i in connect_list[s]:
            if color[i] == 0:
                color[i] = 1
                stack.append(i)
    return r

x, y = dfs(0), dfs(1)
x, y = max(x, y), min(x, y)

def part_edge(a):
    return a*(a-1)//2

x = n - y
total_edge = part_edge(x) + part_edge(y)
print(total_edge-m)
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
ans=''
x,y=map(int,input().split(' '))
ans='Yes' if x==y
for c in (a,b):
    ans='Yes' if x in c and y in c
ans='No' if ans==''
print(ans)

### FIXED CODE ###

a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
ans=''
x,y=map(int,input().split(' '))
if x==y: ans='Yes'
else:
    for c in [a,b]:
        if (x in c)*(y in c):
            ans='Yes'
            break
if ans=='': ans='No'
print(ans)
import itertools
s=['S','H','C','D']
n=[str(i) for i in range(1,14)]
c=[x+' '+y for x,y in itertools.product(s,n)]
for _ in range(input()):
 c.remove(input())
print('\n'.join(c))

### FIXED CODE ###

n=int(input())
e=[input()for _ in[0]*n]
for s in"SHCD":
 for r in range(1,14):
  if f'{s} {r}'not in e:print(s,r)
class UFTree():
  def __init__(self,n):
    self.N = n
    self.parent = {i:i for i in range(1,n+1)}
    
  def root(self,n):
    if self.parent[n]==n: return n
    else:
      self.parent[n] = self.root(self.parent[n])
      return self.parent[n]
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx>ry: rx,ry = ry,rx
    if rx!=ry: self.parent[rx] = ry
      
  def size(self,x):
    n = 0
    return sum([self.root(i+1)==x for i in range(self.N)])
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A,B)
print(max({i+1:uft.size(i+1) for i in range(N)}.values()))

### FIXED CODE ###

class UFTree():
  def __init__(self,n):
    self.N = n
    self.parents = [-1]*n
    
  def root(self,n):
    if self.parents[n]<0: return n
    else:
      self.parents[n] = self.root(self.parents[n])
      return self.parents[n]
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx==ry: return
    if rx>ry: rx,ry = ry,rx
    self.parents[rx] += self.parents[ry]
    self.parents[ry] = rx
      
  def size(self,x):
    return -self.parents[self.root(x)]
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A-1,B-1)
print(max([uft.size(i) for i in range(N)]))
from itertools import combinations_with_replacement

X = list(input())
tmp = X
num = int("".join(tmp))

X.pop()
X.pop()
X = int("".join(X))

food = [100, 101, 102, 103, 104, 105, 106]

for i in combinations_with_replacement(food, X):
    if sum(i) == num:
        print(1)
        exit()

print(0)


### FIXED CODE ###

from itertools import combinations_with_replacement

X = list(input())
tmp = X
num = int("".join(tmp))

if num < 100:
    print(0)
    exit()

X.pop()
X.pop()
X = int("".join(X))

food = [100, 101, 102, 103, 104, 105]

for i in combinations_with_replacement(food, X):
    if sum(i) == num:
        print(1)
        exit()

print(0)
n,m = [int(i) for i in input().split()]
e = [[int(i) for i in input().split()] for i in range(n)]

s=[]
for t in e:
  b_list=0
  for x in t[1:]:
    b_list = b_list | pow(2,x-1)
  s.append(b_list)
result=pow(2,30)-1
for i in s:
   result = result & i
cnt=0
for i in range(30):
  if result & pow(2,i):
    cnt+=1
print(cnt)

### FIXED CODE ###

n, m = [int(i) for i in input().split()]
am = sorted([int(i) for i in input().split()],reverse=True)
c = [2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-1 for i in range(n+1)]
dp[0]=0
for i in range(n+1):
    #max_tmp = -float("inf")
    for j in am:
        if i+c[j-1]<=n:
            dp[i+c[j-1]] = max(dp[i+c[j-1]], dp[i]+1)
#print(dp)
tmp_n = n
ans =""
for i in range(dp[n]):
    for j in range(m):
        if i==dp[n]-1 and tmp_n- c[am[j]-1] != 0:
            continue
        if tmp_n - c[am[j]-1] >= 0 and dp[tmp_n - c[am[j]-1]] == dp[tmp_n] -1:
            ans+=(str(am[j]))
            tmp_n -= c[am[j]-1]
            break


print(ans)
H , W = map(int, input() .split(","))


if H % 2 ==0:
    N = H * W / 2

else:
    N = int(H * W / 2) + 1

print(N)



### FIXED CODE ###

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

if W == 1:
    N = 1

elif H == 1:
    N = 1

else:   
    if H % 2 ==0:
        N = H * W / 2
        
            
    elif H % 2 ==1:
        if W % 2 ==0:
            N = H * W / 2
        else:
            N = int(H * W / 2) + 1

print(int(N))