Harryxun/stf_run huggingface dataset:
import sys
#from scipy.special import comb
#from scipy.misc import comb

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

sys.setrecursionlimit(100000)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

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

A = [0]*M

for i in range(M):
    A[i] = int(input())

A.append(N+1)

def step_comb(L):
    c = 0
    if L==1 or L == 0:
        c = 1
    else:
        for i in range(L//2 +1):
            j = L - 2*i
            #c += comb(j+i, i, exact=True)
            c += cmb(j+i, i)
    return c

# DP version
DP = [0]*N
# １段の階段を登るやり方の数
DP[1] = 1
# 2段の階段を登るやり方の数
DP[2] = 2

def step_comb(L):
    if DP[L]>0:
        return DP[L]
    DP[L] = step_comb(L-1) + step_comb(L-2)
    return DP[L]
    
total_comb = 1
NOW = 0
for a in A:
    if NOW == a:
        print(0)
        sys.exit()
    L = a-1-NOW
    total_comb *= step_comb(L)
    NOW = a + 1
    
print(total_comb % 1000000007 )


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

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

if M == 0:
    A = []
else:
    A = [0]*M
    for i in range(M):
        A[i] = int(input())

A.append(N+1)

# DP version
DP = [0]*(N+1)
DP[0] = 1
# １段の階段を登るやり方の数
DP[1] = 1
# 2段の階段を登るやり方の数
#DP[2] = 2

for i in range(2,N+1):
    DP[i] = DP[i-1] + DP[i-2]

def step_comb(L):
    if DP[L]>0:
        return DP[L]
    DP[L] = step_comb(L-1) + step_comb(L-2)
    return DP[L]
    
total_comb = 1
NOW = 0
for a in A:
    if NOW == a:
        print(0)
        sys.exit()
    L = a-1-NOW
    total_comb *= step_comb(L)
    NOW = a + 1
    if NOW == N:
        break
    
print(total_comb % 1000000007 )
N=int(input())
a=[int(i) for i in input().split()]
num4=0
num2=0
num1=0
for i in a:
        if i%4==0:
                num4+=1
        elif i%2==0:
                num2+=1
num1=N-num4-num2

if num2>0:
        num1+=1

if num1<=num4+1:
        print("Yes")
else:
        print("No")                                                                      ~                                                                                   ~                                

### FIXED CODE ###

N=int(input())
a=[int(i) for i in input().split()]
num4=0
num2=0
num1=0
for i in a:
        if i%4==0:
                num4+=1
        elif i%2==0:
                num2+=1
num1=N-num4-num2

if num2>0:
        num1+=1

if num1<=num4+1:
        print("Yes")
else:
        print("No")
a,b,h,m=map(float,input().split())
#時針の角度をA
c=(30*h-11/2*m)
ct=math.radians(c)
cos=math.cos(ct)
ans=a**2+b**2-2*a*b*abs(cos)
print(math.sqrt(ans))

### FIXED CODE ###

import math
 
A, B, H, M = map(int, input().split())
 
angle_A = 6*M
angle_B = 30*(H+M/60)
angle_C = abs(angle_A-angle_B)
 
rad_C = math.radians(angle_C)
 
C = math.sqrt(A**2+B**2-2*A*B*math.cos(rad_C))
 
print(C)
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, M = LI()
    AB = [LI() for _ in range(N)]
    A_max = max([i[0] for i in AB])

    W = [[] for _ in range(A_max + 1)]
    for a, b in AB:
        if 0 <= M - a:
            W[M-a].append(b)
    # print(W)

    # 選択肢の少ない後ろの日付から決めていく
    ans = 0
    hq = []
    for i in range(M - 1, -1, -1):
        for j in W[i]:
            heapq.heappush(hq, -j)
        if hq:
            ans -= heapq.heappop(hq)

    print(ans)

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, M = LI()
    AB = [LI() for _ in range(N)]

    W = [[] for _ in range(M + 1)]
    for a, b in AB:
        if 0 <= M - a:
            W[M-a].append(b)
    # print(W)

    # 選択肢の少ない後ろの日付から決めていく
    ans = 0
    hq = []
    for i in reversed(W):
        for j in i:
            heapq.heappush(hq, -j)
        if hq:
            ans -= heapq.heappop(hq)

    print(ans)

if __name__ == '__main__':
    resolve()
a,b,c=map(int,input().split())

if a==c or b==c or a+b==c
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if a+b>=c:
    print("Yes")
else:
    print("No")
x, n = map(int, input().split())

if n == 0:
  print(x)
else :
  pn = [int(num) for num in input().split()]
  answers = {}
  for i in range(0,101):
    if not i in pn:
      answers[i] = abs(i-x)
  print(min(answers, key=answers.get))

### FIXED CODE ###

x, y = map(int, input().split())

check = True
for i in range(x+1) :
  if (i*2+(x-i)*4) == y :
    print("Yes")
    check = False
    break
  
if check :
  print("No")
import sys

l1 = sys.stdin.readline()
l2 = sys.stdin.readline()

nums = [int(x) for x in l1.rstrip('¥n').split(' ')]
l2 = int(l2)

out = max(nums)

for i in xrange(l2):
  out *= 2
print out

### FIXED CODE ###

import sys
 
l1 = sys.stdin.readline()
l2 = sys.stdin.readline()
 
nums = [int(x) for x in l1.rstrip('\n').split(' ')]
l2 = int(l2)
 
out = max(nums)
 
for i in xrange(l2):
  out *= 2
print out + sum(nums) - max(nums)
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    N=int(input())
    A=list(input())
    gr = groupby(A)
    cnt=0
    for key, group in gr: # groupはイテレータ。list(group)でリスト化  
        """ex.
        0: [0, 0, 0]
        1: [1, 1]
        0: [0, 0, 0]
        1: [1, 1]
        0: [0]
        1: [1]
        """
        cnt+=1
    print(cnt)
        

    
resolve()

### FIXED CODE ###

# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N=int(input())
    S=list(input())

    cnt=1
    for i in range(N-1):
        if S[i]!=S[i+1]:
            cnt+=1

    print(cnt)


resolve()
o = input()
e = input()
if len(e) != len(o):
  e += ''
password = ''
for i in range(len(o)):
  password += o[i] + e[i]
print(password)
  

### FIXED CODE ###

o = input()
e = input()
if len(e) != len(o):
  e += ' '
password = ''
for i in range(len(o)):
  password += o[i] + e[i]
print(password)
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
counter=0
for num in range(N):
  if A[num] in B:
    counter+=1
    while A[num] in B:
      B.remove(A[num])
  
print(counter)

### FIXED CODE ###

N=int(input())
z=[]
for num in range(101):
  z.append(0)
counter=0
while counter < N:
  d=int(input())
  z[d]=1
  counter+=1
result=sum(z)
print(result)
import sys

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


ans = 0
isEven = True

while isEven:
  list_tmp = []
  for an in a:
    if an % 2 ==0:
      list_tmp.append(an / 2)
    else:
      isEven = False
      break;
  a = list_tmp
  ans += 1

print(ans - 1)

### FIXED CODE ###

print(input().count('1'))
#include <bits/stdc++.h>
 
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1e9+7
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;

const double pi = acos(-1.0);
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
	int n,cnt=0;
	ll ans=0;
	cin >> n;
	ll v[n+1];
	v[0]=0;
	for(int i=1;i<=n;i++){
		cin >> v[i];
		v[i]+=v[i-1];
	}
	sort(v,v+n+1);
	rep(i,n+1){
		cnt++;
		if(v[i]!=v[i+1] || i==n){
			ans+=(cnt*(cnt-1)/2);
			cnt=0;
		}
	}
	cout << ans << endl;
	return 0;
}

### FIXED CODE ###

from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
a = [0] + a

ans = 0
d = defaultdict(int)
d[0] += 1

for i in range(n):
    #累積和をとる
    a[i + 1] += a[i]
    #nC2を求める
    ans += d[a[i + 1]]
    #登場した回数を数える
    d[a[i + 1]] += 1

print(ans)
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 09:49:38 2019

@author: avina
"""

from math import gcd
n = int(input())
l = list(map(int, input().strip().split()))
maxe = 0
     
for i in range(n):
    for j in range(n):
        if i != j:
            g = gcd(l[i],l[j])
            maxe = max(maxe, g)
print(maxe)

### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
 
X1 = [0] * (N+2)
X2 = [0] * (N+2)
 
for i in range(N):
    X1[i+1] = gcd(X1[i], A[i])
for i in range(N,0,-1):
    X2[i] = gcd(X2[i+1], A[i-1])

k = []
for i in range(N):
    k.append(gcd(X1[i],X2[i+2]))

print(max(k))
k = int(input())

if k % 7 == 0:
  k = k/7

if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  ans = 1
  cnt = 1
  while 1:
    if ans % k == 0:
      break
    else:
      cnt += 1
      ans *= 10
      ans += 1

  print(cnt)      

### FIXED CODE ###

k = int(input())

if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  ans = 7
  cnt = 1
  while 1:
    if ans % k == 0:
      break
    else:
      cnt += 1
      ans *= 10
      ans += 7
      ans %= k

  print(cnt)
x, y, z, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))[:k]

e = []

for va in a:
    for vb in b:
        e.append(va+vb)

e.sort(reverse=True)

e = e[:k]

d = []
for vc in c:
    for ve in e:
        d.append(vc+ve)

d.sort(reverse=True)
d = d[:k]

for vd in d:
    print(vd)

### FIXED CODE ###

import math

n = int(input())

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

bn = min(a, b, c, d, e)

print(4 + math.ceil(n / bn))
n = print()
 
s = int(n) % 10
 
if s == 3:
	print('bon')
if s == 1:
	print('pon')
if s == 2:
    print('hon')
if s == 4:
    print('hon')
if s == 5:
    print('hon')
if s == 6:
    print('pon')
if s == 7:
    print('hon')
if s == 8:
    print('pon')
if s == 9:
    print('hon')
if s == 0:
    print('pon')

### FIXED CODE ###

N = input()
s = int(N) % 10
if s == 3:
    print('bon')
if s == 0:
    print('pon')
if s == 1:
    print('pon')
if s == 6:
    print('pon')
if s == 8:
    print('pon')

if s == 2:
    print('hon')
if s == 4:
    print('hon')
if s == 5:
    print('hon')
if s == 7:
    print('hon')
if s == 9:
    print('hon')
A, B=map(int, input(). split())
if(A*B%==1):
	print(‘Yes’)
else:
	print(‘No’)


### FIXED CODE ###

A, B=map(int, input(). split())
if A%2==1 and B%2==1:
	print("Yes")
else:
	print("No")
a = input().split()
a = [int(i) for i in a]
print(a)
amax = a[0]
for i in range(1,3):
    if a[i] > amax:
        amax = a[i]
        count = i
    else:
        pass
a.pop(count)
print(amax*10+a[0]+a[1])

### FIXED CODE ###

a = input().split()
a = [int(i) for i in a]
amax = a[0]
count = 0
for i in range(1,3):
    if a[i] > amax:
        amax = a[i]
        count = i
    else:
        pass
a.pop(count)
print(amax*10+a[0]+a[1])
import sys, fractions
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def lcm_list(a):
    if len(a)==2:
        return a[0]*a[1]//fractions.gcd(a[0], a[1])
    else:
        tmp = lcm_list(a[:-1])
        return tmp*a[-1]//fractions.gcd(tmp, a[-1])

def resolve():
    N, M = LI()
    a = LI()

    a_half = [i//2 for i in a]
    a_half_lcm = lcm_list(a_half)
    has_scm = not 0 in [a_half_lcm//i%2 for i in a_half]

    if has_scm:
        print((M-a_half_lcm)//(2*a_half_lcm)+1)
    else:
        print(0)

if __name__ == '__main__':
    resolve()

### FIXED CODE ###

from functools import reduce
import fractions
import numpy as np

N, M = map(int, input().split())
a = np.array(list(map(int, input().split())))

a = a // 2

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

l = lcm(*a)
exist = not 0 in ((l//a)%2)

if exist:
    print((M // l + 1 ) // 2)
else:
    print(0)
import math
x=a*b/2
print(math.ceil(x))

### FIXED CODE ###

import math
a,b=map(int,input().split())
x=(a+b)/2
print(math.ceil(x))
n,m=(int(i) for i in input().split(' '))
for i in range(1,1000)[::-1]:
  if i==1:
    print(i)
    break
  if m%i==0 and m//i>=n:
    print(m//i)
    break


### FIXED CODE ###

N = int(input())
if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input(''))
    B = int(input(''))
    print(A + B)
time = int(input())

hour = time // 3600
minute = (time % 3600) // 60
second = (time % 3600) % 60

print hour,":", minute, ":", second

### FIXED CODE ###

time = int(input())

hour = time // 3600
minute = (time % 3600) // 60
second = (time % 3600) % 60

print (str(hour)+":"+ str(minute)+":"+ str(second))
N =　int(input(0))
a = []
for i in range(N):
    a.append(input(1))
    
    

for i in range(N):
    v = a[i]
    j = i-1
    while j>=0 and a[j]>v:
        a[j+1] = a[j]
        j = j-1
        a[j+1] = v
    print(a)


### FIXED CODE ###

N = int(input())
a = input().split()
b = [int(n) for n in a]


for i in range(N):
    v = b[i]
    j = i-1
    while j>=0 and b[j]>v:
        b[j+1] = b[j]
        j = j-1
        b[j+1] = v
    print(" ".join([str(n) for n in b]))
n=int(input())
wordlist=[input() for i in range(n)]
sortlist=[]
for i in range(n):
    a=list(wordlist[i])
    a.sort()
    a="".join(a)
    sortlist.append(a)
    
def kaijyo(n):
    ans=1
    for i in range(1,n+1):
        ans*=i
    return ans

count=0
sortlist.sort()


while sortlist:
    a=sortlist.pop()
    times=sortlist.count(a)+1
    for i in range(times-1):
        sortlist.pop()
    count+=int(kaijyo(times)*kaijyo(times-2)/2)
    
print(count) 

### FIXED CODE ###

n=int(input())

#単語が全て入ったリストを作るO(n)
wordlist=[input() for i in range(n)]

#wordlistを一つ一つソートさせたものをsortlistとして作るO（n）
sortlist=[]
for i in range(n):
    a=list(wordlist[i])
    a.sort()
    sortlist.append(a)
    
count=0

#ソートリストをソートするO(nlogn)
sortlist.sort()

checkword=""
check=0

for i in range(n): #O(n)
    a=sortlist.pop()
    if checkword==a:
            check+=1
            count+=check
    else:
        check=0
        checkword=a
    
print(int(count) )
N = int(input())
A = list(map(int, input().split()))
res = "YES"
A.sort()
for i in range(len(A)):
    if i == 0:
        continue
    if A[i-1] == A[i]:
        res = "NO"
        break
    else:
        continue
print(res)


### FIXED CODE ###

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

if s == S:
    A -=1
elif s == T:
    B -=1
print(A,B)
input_line = input()
for i in input():
    num = index.input_line(i)
    if (num + 1) % 2 == 1 and i == 'R' or i == 'U' or i == 'D':
        pass
    elif num % 2 == 0 and i == 'L' or i == 'U' or i == 'D':
        pass
    print('Yes')
    break
    elif (num + 1) % 2 == 1 and i == 'L':
        print('No')
    elif num % 2 == 0 and i == 'R':
        print('No')

### FIXED CODE ###

input_line = input()
def check():
  num = 1
  for i in input_line:
      if num % 2 == 1 and i == 'L':
          return 'No'
          break
      elif num % 2 == 0 and i == 'R':
          return 'No'
          break
      elif num % 2 == 1 and i == 'R' or i == 'U' or i == 'D':
          pass
      elif num % 2 == 0 and i == 'L' or i == 'U' or i == 'D':
          pass
      num += 1

if check() == 'No':
  print('No')
else:
  print('Yes')
#おととい買ったペンキ
a = int(input())
#きのう買ったペンキ
b = int(input())
#今日買ったペンキ
c= int(input())
penki_list = [a,b,c]
#print(penki_list)
#print(set(penki_list))
print(len(set(penki_list)))


### FIXED CODE ###

#おとといa、きのうb、今日c
a,b,c = (int(x) for x in input().split())
penki_list = [a,b,c]
print(len(set(penki_list)))
n = list(map(int, input()))
if stm(n)%9==0:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

n = list(map(int, input()))
if sum(n)%9==0:
  print('Yes')
else:
  print('No')
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]]
    if A[i] == a+1: and C[i] in C
        r += C[i]
    a = A[i]
print(r)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]-1]
    if  A[i]-1 > len(C):
        continue
    elif A[i] == a+1 and A[i] != 1:
        r += C[a-1]
    a = A[i]
print(r)
s = input()
cnt = 0
ans = []
for i in range(3):
  if s[i] == 'R':
    cnt+=1
    ans.append(cnt)
  else:
    cnt = 0
print(max(ans))

### FIXED CODE ###

s = input()
cnt = 0
ans = [0]
for i in range(3):
  if s[i] == 'R':
    cnt+=1
    ans.append(cnt)
  else:
    cnt = 0
print(max(ans))
class Dijkstra:
  R = {}
  import heapq
  pop = heapq.heappop
  push = heapq.heappush
  
  def __init__(s, N):
    s.N = N

  def add(s, a, b, x):
    if a not in s.R: s.R[a] = {b: x}
    else: s.R[a][b] = x
    if b not in s.R: s.R[b] = {a: x}
    else: s.R[b][a] = x

  def exe(s, start):
    D = [-1] * s.N 
    q  = []
    s.push(q, [0, start])
    cnt = 0
    while cnt < s.N:
      if len(q) == 0:
        return None
      d, x = s.pop(q)
      if D[x] != -1: continue
      D[x] = d
      cnt += 1
      for i in s.R[x]:
        if D[i] != -1: continue
        j = s.R[x][i]
        s.push(q, [d + j, i])
    return D


N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

D = Dijkstra(N)

for a, b in AB:
  D.add(a - 1, b - 1, 1)

L = D.exe(0)

if L == None:
  print("No")
  exit()

R = {}

for i in range(N):
  if L[i] in R:
    R[L[i]].append(i)
  else:
    R[L[i]] = [i]

Ans = [0] * N
for i in R.keys():
  for j in R[i]:
    for k in D.R[j].keys():
      if L[k] == L[j] + 1:
        Ans[k] = j + 1

print("Yes")
for i in range(1, N):
  print(Ans[i])

### FIXED CODE ###

class Dijkstra:
  R = {}
  import heapq
  pop = heapq.heappop
  push = heapq.heappush
  
  def __init__(s, N):
    s.N = N

  def add(s, a, b, x):
    if a not in s.R: s.R[a] = {b: x}
    else: s.R[a][b] = x
    if b not in s.R: s.R[b] = {a: x}
    else: s.R[b][a] = x

  def exe(s, start):
    D = [-1] * s.N 
    q  = []
    s.push(q, [0, start])
    cnt = 0
    while cnt < s.N:
      if len(q) == 0:
        return None
      d, x = s.pop(q)
      if D[x] != -1: continue
      D[x] = d
      cnt += 1
      for i in s.R[x]:
        if D[i] != -1: continue
        j = s.R[x][i]
        s.push(q, [d + j, i])
    return D


N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

D = Dijkstra(N)

for a, b in AB:
  D.add(a - 1, b - 1, 1)

L = D.exe(0)

if L == None:
  print("No")
  exit()

R = {}

for i in range(N):
  if L[i] in R:
    R[L[i]].append(i)
  else:
    R[L[i]] = [i]

Ans = [0] * N
for i in R.keys():
  for j in R[i]:
    for k in D.R[j].keys():
      if L[k] == L[j] + 1:
        Ans[k] = j + 1

print("Yes")
for i in range(1, N):
  print(Ans[i])
s = input()

if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
elif s == 'Rainy':
print('Sunny')


### FIXED CODE ###

s = input()

if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
elif s == 'Rainy':
    print('Sunny')
#include<stdio.h>
int main(){
	int D;
	scanf("%d",&D);
	if (D==25){
		puts("Christmas");
	}
	else if (D == 24){
		puts("Christmas Eve");
	}
	else if(D==23){
		puts("Christmas Eve Eve");
	}
	else if(D ==22){
		puts("Christmas Eve Eve Eve");
	}
}

### FIXED CODE ###

n = int(input())
if n == 25:
    print("Christmas")
elif(n == 24):
    print("Christmas Eve")
elif(n == 23):
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
A,B = map(int,input().split())

if A>B*2:
    print(A-B*2)
if A=B*2:
    print(0)
if A<B*2:
    print(0)

### FIXED CODE ###

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

if A>B*2:
    print(A-B*2)

else:
    print(0)
while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)

    if op == '?':
        break

    if op == '+':
        

### FIXED CODE ###

while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    if op == '+':
        print(a+b)
    if op == '-':
        print(a-b)
    if op == '*':
        print(a*b)
    if op == '/':
        print(a//b)
from sys import stdin
n,m,c = map(int,input().split())
input_b = map(int,input().split())
while True:
	try:
		list_a=list(map(int,input().split()))
		answer = c
		count = 0
		for i in range(len(list_a)):
			answer += input_b[i] * list_a[i]
			if answer > 0
				count+=1
		print count
	except:
		break;

### FIXED CODE ###

n,m,c = map(int,input().split())
input_b = list(map(int,input().split()))
a_list=[input() for i in range(n)]
count = 0
for i in range(n):
  answer = c
  aitems = list(map(int,a_list[i].split()))
  for j in range(m):
    answer += input_b[j] * aitems[j]
  if answer > 0:
    count+=1
print(count)
N, M = map(int, input().split())  #数字
H = list(map(int, input().split()))#リスト
A = [list(map(int, input().split())) for i in range(M)]  #数字、複数行複数列

good = []
bad = []
for i in range(len(A)):
    if H[A[i][0] - 1] < H[A[i][1] - 1]:
        good.append(A[i][1])
        bad.append(A[i][0])
    if H[A[i][0] - 1] > H[A[i][1] - 1]:
        good.append(A[i][0])
        bad.append(A[i][1])
    if H[A[i][0] - 1] == H[A[i][1] - 1]:
        bad.append(A[i][0])
        bad.append(A[i][1])

#print(set(good))
#print(set(bad))

lonely = []
for i in range(1, N + 1):
    lonely.append(i)

for i in set(good):
    lonely.remove(i)

for i in set(bad):
    lonely.remove(i)

#print(len(lonely))
#print(len(good))
print(len(set(good))+ len(lonely))

### FIXED CODE ###

N, M = map(int, input().split())  #数字
H = list(map(int, input().split()))#リスト
A = [list(map(int, input().split())) for i in range(M)]  #数字、複数行複数列

good = [True]*N
for i, j in A:
    i -= 1
    j -= 1
    if H[i] < H[j]:
        good[i] = False
    if H[i] > H[j]:
        good[j] = False
    if H[i] == H[j]:
        good[i] = False
        good[j] = False

print(good.count(True))