Harryxun/stf_run huggingface dataset:
def dfs(num):
  global visited
  for next_num in num:
    if visited[next_num]:
      continue
    if has_edge[num][next_num]:
      visited[next_num]=1
      dfs(next_num)
      
N,M = map(int,input().split())
ab = []
edge = [[] for x in range(N+1)]
has_edge = [[0 for x in range(N+1)] for x in range(N+1)]
for i in range(M):
  a,b = map(int,input().split())
  ab.append([a,b])
  edge[a].append(b)
  edge[b].append(a)
  has_edge[a][b] = 1
  has_edge[b][a] = 1
  
count = 0
for a,b in ab:
  visited = [0 for x in range(N+1)]
  visited[1] = 1
  has_edge[a][b] = 0
  has_edge[b][a] = 0
  dfs(1)
  if sum(visited) != N:
    count += 1
  has_edge[a][b] = 1
  has_edge[b][a] = 1
print(count)

### FIXED CODE ###

def dfs(num):
  global visited
  for next_num in edge[num]:
    if visited[next_num]:
      continue
    if has_edge[num][next_num]:
      visited[next_num]=1
      dfs(next_num)
      
N,M = map(int,input().split())
ab = []
edge = [[] for x in range(N+1)]
has_edge = [[0 for x in range(N+1)] for x in range(N+1)]
for i in range(M):
  a,b = map(int,input().split())
  ab.append([a,b])
  edge[a].append(b)
  edge[b].append(a)
  has_edge[a][b] = 1
  has_edge[b][a] = 1
  
count = 0
for a,b in ab:
  visited = [0 for x in range(N+1)]
  visited[1] = 1
  has_edge[a][b] = 0
  has_edge[b][a] = 0
  dfs(1)
  if sum(visited) != N:
    count += 1
  has_edge[a][b] = 1
  has_edge[b][a] = 1
print(count)
n = int(input())
ls = list(map(int,input().split()))
a = 0
for i in range(n):
    for j in range(i):
        if ls[i] =< ls[j]:
            continue    
        else:
            a += 1
            break
print(n - a)


### FIXED CODE ###

n,m = map(int,input().split())
if n == m:
    print("Yes")
else:
    print("No")
N = int(input())
Harray = []
for i in range(N):
    Aarray = []
    A = int(input())
    for j in range(A):
        xy = list(map(int,input().split()))
        Aarray.append(xy)
    Harray.append(Aarray)

carray = []

for Ai in Harray:
    honest = [Harray.index(Ai)]
    honestcont = [Ai]
    for ans in Ai:
        que = []
        if ans[1] == 1:
            honest.append(ans[0]-1)
            honestcon.append(Harray[ans[0]-1])
            que.append(ans[0]-1)
        while len(que) > 0:
            d = que[0]

            que.pop(0)
            
            e = 0
            for h in honestcon:
                if h[1] == 1:
                    h2 = [h[0], 0]
                else:
                    h2 = [h[0], 1]
                if h2 in Harray[d]:
                    e = 1
            
            for h4 in honest:
                if [h4,0] in Harray[d]:
                    e = 1
            
            if e == 0:
                for ans2 in Harray[d]:
                    if (ans2[1] == 1) and (ans2[0] not in honest):
                        que.append(ans2[0]-1)
            else:
                honest = []
                break
                    
    carray.append(len(honest))

print(max(carray))


### FIXED CODE ###

N= int(input())
Harray = []
for i in range(N):
    Aarray = []
    A = int(input())
    for j in range(A):
        xy = list(map(int,input().split()))
        Aarray.append(xy)
    Harray.append(Aarray)


count = []
for i in range(2**N):
    honest = [0 for i in range(N)]
    c = 0
    for j in range(N):
        if (i >> j) & 1 == 1:
            honest[j] = 1
    for k in range(N):
        if honest[k] == 1:
            ar = Harray[k]
            for l in ar:
                if honest[l[0]-1] != l[1]:
                    c = 1
    if c == 0:
        count.append(honest.count(1))
print(max(count))
N, M = map(int, input().split())

paths = [[] for i in range(N)]
longest_paths = [-1 for i in range(N)]

for i in range(M):
    x, y = map(int, input().split())
    paths[x-1].append(y-1)

def get_longest(node):
    if longest_paths[node] != -1:
        return longest_paths[node]
    if paths[node] == []:
        longest_paths[node] = 0
        return 0
    else:
        result = max([get_longest(nd) for nd in paths[node]]) + 1
        longest_paths[node] = result
        return result

print(max([get_longest(i) for i in range(N)]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

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

paths = [[] for i in range(N)]
longest_paths = [-1 for i in range(N)]

for i in range(M):
    x, y = map(int, input().split())
    paths[x-1].append(y-1)

def get_longest(node):
    if longest_paths[node] != -1:
        return longest_paths[node]
    if paths[node] == []:
        longest_paths[node] = 0
        return 0
    else:
        result = max([get_longest(nd) for nd in paths[node]]) + 1
        longest_paths[node] = result
        return result

print(max([get_longest(i) for i in range(N)]))
if abs(a-c) <= d:
    print('Yes')
elif abs(a-b) <= d and abs(b-c) <= d:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if (abs(a-b) <= d and abs(b-c) <= d) or abs(a-c) <= d:
    print('Yes')
else:
    print('No')
#_*_ coding:utf-8 _*_
   import sys
  
   
  while True:
      vals = sys.stdin.readline()
      if(vals is  None or vals.strip() == '' ):
           break
      a,b,c,d,e,f=list( map(float,vals.strip().split()))
      temp = a * e - d * b
      print(temp)
      x = (c * e - b * f) / temp + 0.0
      y = (c * d - a * f) / -temp + 0.0
      print('%.3f %.3f' % (x,y))
     

### FIXED CODE ###

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


while True:
    vals = sys.stdin.readline()
    if(vals is  None or vals.strip() == '' ):
        break
    a,b,c,d,e,f=list( map(float,vals.strip().split()))
    temp = a * e - d * b
    x = (c * e - b * f) / temp + 0.0
    y = (c * d - a * f) / -temp + 0.0
    print('%.3f %.3f' % (x,y))
import math

def calcAns(n,x,y):
    print(math.gcd(x,y))
    return n - ((n//x) + (n//y) - (n//((x*y)//math.gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)

### FIXED CODE ###

from fractions import gcd

def calcAns(n,x,y):
    return n - ((n//x) + (n//y) - (n//((x*y)//gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)
a = input()
for i in range(len(1,a+1)):
  if i%2 == 0:
    if a[i] == 'R':
      print('No')
      exit()
  else:
    if a[i] =='L':
      print('No')
      exit()
print('Yes')

### FIXED CODE ###

a = input()
for i in range(1,len(a)+1):
  if i%2 == 0:
    if a[i-1] == 'R':
      print('No')
      exit()
  else:
    if a[i-1] =='L':
      print('No')
      exit()
print('Yes')
N, K = raw_input().split()
D = raw_input().split()
candi = [str(i) for i in xrange(10)]
for d in D:
    candi.remove(d)

def decide(i):
    if i >= len(N):
        return ''
    for c in candi:
        if N[i] == c:
            return c + decide(i+1)
        elif N[i] < c:
            return c + candi[0] * (len(N) - i - 1)
    else:
        return (candi[0] if candi[0] != 0 else candi[1]) + decide(i)

print decide(0)

### FIXED CODE ###

N, K = raw_input().split()
D = raw_input().split()
candi = [str(i) for i in xrange(10)]
for d in D:
    candi.remove(d)

def decide(i):
    if i >= len(N):
        return ''
    for c in candi:
        if N[i] == c:
            return c + decide(i+1)
        elif N[i] < c:
            return c + candi[0] * (len(N) - i - 1)

if candi[-1] * len(N) >= N:
    print decide(0)
else:
    print (candi[0] if candi[0] != '0' else candi[1]) + candi[0] * len(N)
li = []
s = input()
li2 = []
for i in range(4):
  li.append(s[i])
n1 = 4
def func(n, t):
  if t < 0:
    return False
  elif n == 0:
    if t == 0:
      return True
    else:
      return False
  elif func(n-1, t+li[n-1]):
    li2.append('-')
    return True
  elif func(n-1, t-li[n-1]):
    li2.append('+')
    return True
  else:
    return False
if func(n1, 7):
  print(f'{li[0]}{li2[0]}{li[2]}{li2[1]}{li[3]}{li2[3]}{li[4]}=7')

### FIXED CODE ###

li = []
s = input()
li2 = []
for i in range(4):
  li.append(int(s[i]))
n1 = 4
def func(n, t):
  if n == 1:
    if t == li[0]:
      return True
    else:
      return False
  if func(n-1, t+li[n-1]):
    li2.append('-')
    return True
  elif func(n-1, t-li[n-1]):
    li2.append('+')
    return True
  else:
    return False
if func(n1, 7):
  print("{0}{4}{1}{5}{2}{6}{3}=7".format(li[0], li[1], li[2], li[3], li2[0], li2[1], li2[2]))
S = input().strip()
K = int(input())
T = S*K
N = len(T)
cur = T[0]
cnt = 1
ans = 0
for i in range(1,N):
    if T[i]==cur:
        cnt += 1
    else:
        ans += cnt//2
        cur = T[i]
        cnt = 1
ans += cnt//2
print(ans)

### FIXED CODE ###

S = input().strip()
K = int(input())
if len(S)==1:
    cnt = K//2
else:
    A = []
    cur = 0
    for i in range(1,len(S)):
        if S[i]!=S[i-1]:
            if i-cur>=2:
                A.append([S[i-1],cur,i])
            cur = i
    if S[-1]==S[-2]:
        A.append([S[-1],cur,len(S)])
    cnt = 0
    for j in range(len(A)):
        cnt += (A[j][2]-A[j][1])//2
    if S[0]!=S[-1]:
        cnt = cnt*K
    else:
        if S[0]!=S[1] and S[-1]!=S[-2]:
            cnt = cnt+(cnt+1)*(K-1)
        elif S[0]==S[1] and S[-1]!=S[-2]:
            if (A[0][2]-A[0][1])%2==0:
                cnt = cnt*K
            else:
                cnt = cnt+(cnt+1)*(K-1)
        elif S[0]!=S[1] and S[-1]==S[-2]:
            if (A[-1][2]-A[-1][1])%2==0:
                cnt = cnt*K
            else:
                cnt = cnt+(cnt+1)*(K-1)
        elif S[0]==S[1] and S[-1]==S[-2] and len(A)>1:
            if (A[0][2]-A[0][1])%2==0 or (A[-1][2]-A[-1][1])%2==0:
                cnt = cnt*K
            else:
                cnt = cnt+(cnt+1)*(K-1)
        else:
            cnt = (len(S)*K)//2
print(cnt)
s = list(input())
if len(s) < 4:
    print('No')
    exit

if s[0] == 'Y' and s[1] == 'A' and s[2] == 'K' and s[3] == 'I':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = list(input())
if len(s) < 4:
    print('No')
    exit()

if s[0] == 'Y' and s[1] == 'A' and s[2] == 'K' and s[3] == 'I':
    print('Yes')
else:
    print('No')
def merge(A, left, mid, right):
  n1 = mid - left
  n2 = right - mid
  L = A[left:mid] + [float('inf')]
  R = A[mid:right] + [float('inf')]
  
  i = 0
  j = 0

  for k in range(left, right):
    if L[i] <= R[i]:
      A[k] = L[i]
      i += 1
    else:
      A[k] = R[j]
      j += 1
  count += right - left

def mergeSort(A, left, right):
  if left + 1 < right:
    mid = (left + right) // 2
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
mergeSort(A, 0, N)
print(*A)
print(count)
    

### FIXED CODE ###

def merge(A, left, mid, right):
  global count
  L = A[left:mid] + [10**9 + 1]
  R = A[mid:right] + [10**9 + 1]
  
  i = 0
  j = 0

  for k in range(left, right):
    if L[i] <= R[j]:
      A[k] = L[i]
      i += 1
    else:
      A[k] = R[j]
      j += 1
  count += right - left

def mergeSort(A, left, right):
  if left + 1 < right:
    mid = (left + right) // 2
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
mergeSort(A, 0, N)
print(*A)
print(count)
while True:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):
  x,y=['#','.'] if i%2==0 else ['.','#']
  print("".join(zip([x]*(w+1)//2,[y]*w//2)))
 print()

### FIXED CODE ###

while 1:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):print(('#.'*w)[i%2:][:w])
 print()
W,H,N = list(map(int,input().split()))

points = [list(map(int, input().split())) for _ in range(N)]
# res = [[0 for _ in range(W)] for _ in range(H)]
res = 0

minx, maxx, miny, maxy = [0,W,0,H]
x = 0
y = 0

for x,y,a in points:
    if a == 1:
        minx = x
    if a == 2:
        maxx = x
    if a == 3:
        miny = y
    if a == 4:
        maxy = y


if maxx - minx <= 0 or maxy - miny <=0:
    res = 0
else:
    res = (maxx-minx) * (maxy - miny)

print(res)
~                    

### FIXED CODE ###

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

points = [list(map(int, input().split())) for _ in range(N)]
res = 0

x1,y1 = [0,0]
x2,y2 = [W,H]

for x,y,a in points:
    if a == 1:
        x1 = max(x1, x)
    if a == 2:
        x2 = min(x2, x)
    if a == 3:
        y1 = max(y1, y)
    if a == 4:
        y2 = min(y2, y)

if x2-x1 <= 0 or y2-y1 <=0:
    print("0")
else:
    print((x2-x1)*(y2-y1))
import math
def main():
    a,b = map(int ,input().split())
    ans=a*b//math.gcd(a,b)
    print(ans)
if __name__=='__main__':
    main()


### FIXED CODE ###

import fractions
def main():
    a,b = map(int ,input().split())
    ans=a*b//fractions.gcd(a,b)
    print(ans)
if __name__=='__main__':
    main()
N = int(input())
T, A = map(int, input().split())
diff =50000000
num = 0
for i in range(1,N+1):
    H = int(input())
    if abs(T - H*0.006 - A) < diff:
        num = i

### FIXED CODE ###

n = int(input())
t, a = map(int, input().split())
e = [int(i) for i in input().split()]

temp = []
for i in e:
    temp.append(abs(t - i * 0.006 - a))
    
print(temp.index(min(temp)) + 1)
import sys

sys.setrecursionlimit(100000)

N, M = map(int, input().split())
A = []

for _ in range(M):
    a = int(input())
    A.append(a)

d = {}


def f(x):
    # print(d)
    if x in A:
        d[x] = 0
        return 0
    if x > N:
        d[x] = 0
        return 0
    if x == N:
        d[x] = 1
        return 1

    if d.get(x):
        return d[x]

    if d.get(x + 1):
        x1 = d.get(x + 1)
    else:
        x1 = f(x + 1)
        d[x + 1] = x1

    if d.get(x + 2):
        x2 = d.get(x + 2)
    else:
        x2 = f(x + 2)
        d[x + 2] = x2

    ans = x1 + x2
    # ans = f(x + 1) + f(x + 2)
    d[x] = ans
    return ans


print(f(0) % 1000000007)


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

N, M = map(int, input().split())
A = []
ANS = []
for i in range(N + 10):
    ANS.append(None)

for _ in range(M):
    a = int(input())
    A.append(a)
    ANS[a] = 0


def f(x):
    # print(ANS)
    # if x in A:
    #     print('::::', x)
    #     d[x] = 0
    #     return 0
    if ANS[x] is not None:
        return ANS[x]

    if x > N:
        return 0
    if x == N:
        return 1

    # if d.get(x + 1):
    #     x1 = d.get(x + 1)
    # else:
    #     x1 = f(x + 1)
    #     d[x + 1] = x1
    #
    # if d.get(x + 2):
    #     x2 = d.get(x + 2)
    # else:
    #     x2 = f(x + 2)
    #     d[x + 2] = x2

    # ans = x1 + x2
    ans = f(x + 1) + f(x + 2)
    ANS[x] = ans
    return ans


print(f(0) % 1000000007)
import sys
s = input()
gx,gy = map(int, input().split(' '))
x_d = [0]
y_d = []
cnt = 0
for i in range(len(s)):
    if s[i] == "T":
        cnt += 1
        if cnt % 2 == 0:
            x_d.append(0)
        elif cnt % 2 == 1:
            y_d.append(0)
    if s[i] == "F":
        if cnt % 2 == 0:
            x_d[-1] += 1
        elif cnt % 2 == 1:
            y_d[-1] += 1
x_d.append(0)
y_d.append(0)
if (sum(x_d)-gx) % 2 or (sum(y_d)-gy) % 2:
    print("No")
    sys.exit()
x_n = (sum(x_d)-gx)//2
y_n = (sum(y_d)-gy)//2
DPx = [[False for i in range(x_n+2)] for j in range(len(x_d))]
DPy = [[False for i in range(y_n+2)] for j in range(len(y_d))]
for x in DPx:
    x[0] = True
for y in DPy:
    y[0] = True
for i in range(len(x_d)-1):
    for j in range(x_n+1):
        if DPx[i][j]:
            DPx[i+1][j] = True
            if j+x_d[i] <= x_n:
                DPx[i+1][j+x_d[i]] = True
for i in range(len(y_d)-1):
    for j in range(y_n+1):
        if DPy[i][j]:
            DPy[i+1][j] = True
            if j+y_d[i] <= y_n:
                DPy[i+1][j+y_d[i]] = True

if DPx[len(x_d)-1][x_n] and DPy[len(y_d)-1][y_n]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import sys
s = input()
gx,gy = map(int, input().split(' '))
x_d = [0]
y_d = []
cnt = 0
for i in range(len(s)):
    if s[i] == "T":
        cnt += 1
        if cnt % 2 == 0:
            x_d.append(0)
        elif cnt % 2 == 1:
            y_d.append(0)
    if s[i] == "F":
        if cnt % 2 == 0:
            x_d[-1] += 1
        elif cnt % 2 == 1:
            y_d[-1] += 1
gx -= x_d[0]
x_d[0] = 0
x_d.append(0)
y_d.append(0)
if (sum(x_d)-gx) % 2 or (sum(y_d)-gy) % 2 or sum(x_d) < abs(gx) or sum(y_d) < abs(gy):
    print("No")
    sys.exit()
x_n = (sum(x_d)-gx)//2
y_n = (sum(y_d)-gy)//2
DPx = [[False for i in range(x_n+2)] for j in range(len(x_d))]
DPy = [[False for i in range(y_n+2)] for j in range(len(y_d))]
for x in DPx:
    x[0] = True
for y in DPy:
    y[0] = True
for i in range(len(x_d)-1):
    for j in range(x_n+1):
        if DPx[i][j]:
            DPx[i+1][j] = True
            if j+x_d[i] <= x_n+1:
                DPx[i+1][j+x_d[i]] = True
for i in range(len(y_d)-1):
    for j in range(y_n+1):
        if DPy[i][j]:
            DPy[i+1][j] = True
            if j+y_d[i] <= y_n+1:
                DPy[i+1][j+y_d[i]] = True
if DPx[len(x_d)-1][x_n] and DPy[len(y_d)-1][y_n]:
    print("Yes")
else:
    print("No")
n=input()
x=input.split()
prod=1
for i in x:
  prod=prod*i
  if prod>1000000000000000000:
    break
if prod>1000000000000000000:
  print(-1)
else:
  print(prod)

### FIXED CODE ###

n=input()
x=[int(i) for i in input().split()]
x.sort()
prod=1
for i in x:
  prod=prod*i
  if prod>1000000000000000000:
    break
if prod>1000000000000000000:
  print(-1)
else:
  print(prod)
from scipy.special import comb
n,m = map(int,input().split())
r = 2
if m >=2:
    a = comb(n, r, exact=True)
    print(a+m)
else:
    a = comb(n, r, exact=True)
    print(a)

### FIXED CODE ###

n,m=map(int,input().split())
print(int(n*(n-1)/2+m*(m-1)/2))
N,K = map(int,input().split())
A = [0] + list(map(int,input().split()))
G = dict([(i,[]) for i in range(1,N+1)])
for i in range(1,N+1):
  G[i].append(A[i])

l = [A[1]]
seen = [False for i in range(N+1)]
seen[1] = True
d = [0 for i in range(N+1)]
d[A[1]] = 1
for i in range(K):
  v = l.pop(0)
  if seen[v] != True:
    seen[v] = True
    l.append(A[v])
    if seen[A[v]] == True: 
      a = d[A[v]]
      b = d[v] + 1 - a
    else:  
      d[A[v]] = d[v] + 1
  else:  
    start = v
    break

kaisu = (K-a)%b
p = start
for i in range(kaisu):
  p = A[p]
print(p)  

### FIXED CODE ###

import sys
from collections import deque
N,K = map(int,input().split())
A = [0] + list(map(int,input().split()))
G = dict([(i,[]) for i in range(1,N+1)])
for i in range(1,N+1):
  G[i].append(A[i])

l = deque([A[1]])
seen = [False for i in range(N+1)]
seen[1] = True
d = [0 for i in range(N+1)]
d[A[1]] = 1
if A[1] == 1:
  print(1)
  sys.exit()

for i in range(K):
  v = l.popleft()
  if seen[v] == False:
    seen[v] = True
    l.append(A[v])
    if seen[A[v]] == True: 
      a = d[A[v]]
      b = d[v] + 1 - a
    else:  
      d[A[v]] = d[v] + 1
  else:  
    start = v
    break  
  if i == K-1:
    print(v)
    sys.exit()

kaisu = (K-a)%b
p = start
for i in range(kaisu):
  p = A[p]
print(p)
n = int(input())
s = input()
b = 0
w = s.count(".")
l = [w]
for i in range(1, n + 1):
    if s[i - 1] == "#":
        b += 1
    if s[i - 1] == ".":
        w -= 1
    l.append(b + w)
    print(l)
print(min(l))


### FIXED CODE ###

n = int(input())
s = input()
b = 0
w = s.count(".")
l = [w]
for i in range(1, n + 1):
    if s[i - 1] == "#":
        b += 1
    if s[i - 1] == ".":
        w -= 1
    l.append(b + w)
    # print(l)
print(min(l))
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

total = 0
pos = 0
while pos < N:
	posB = A[pos] -1
	total = total + B[posB]
	if A[pos + 1] - A[pos] == 1:
		posC = A[pos + 1] - 2
		total = total + C[posC]
	pos += 1
print(total)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

total = 0
pos = 0
while pos< N:
	posB = A[pos] -1
	total = total + B[posB]
	if A[pos] - A[pos - 1] == 1 and pos > 0:
		posC = A[pos] - 2
		total = total + C[posC]
	pos += 1
print(total)
import numpy as np

dic={'.':0,'#':1}
N=int(input())
S=np.array([dic[i] for i in input()])
ans=N
arr=np.ones((N,N))


if S.sum()==0:
    print(0)
elif S.sum()==N:
    print(0)    
else:
    for i in range(N):
        arr[i,:N-i]=0
        ans=min(ans,(arr[i,:]!=S).sum())
        
    print(ans)

### FIXED CODE ###

N = int(input())
S = input()
 
left_black=0
right_white=S.count(".")
ans=left_black+right_white

for i in S:
    if i==".":
        right_white-=1
        ans=min(ans,left_black+right_white)
    else:
        left_black+=1
        ans=min(ans,left_black+right_white)
print(ans)
x = input()

if x >= 30:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
 
if N < 30:
    print("No")
else:
    print("Yes")
import math as m
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
ans = 0
mod = 10**9+7
def lcm(x,y):
    return (x*y//m.gcd(x,y))
def lcml(nums):
    return reduce(lcm,nums,1)
l = lcml(a)
for x in a:
    ans+= (l*pow(x,mod-2,mod)) %mod
    ans%=mod
print(ans)

### FIXED CODE ###

import fractions as m
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
ans = 0
mod = 10**9+7
def lcm(x,y):
    return (x*y//m.gcd(x,y))
def lcml(nums):
    return reduce(lcm,nums,1)
l = lcml(a)
for x in a:
    ans+= (l*pow(x,mod-2,mod)) %mod
    ans%=mod
print(ans)
import math
A=int(inport())
P=int(inport())

#3A/2=pai
P=3*A
pai=P/2
print(math.floor(pai))

### FIXED CODE ###

A,P= map(int, input().split())
print((3*A+P)//2)
k, x = int(input())
if 500 * k >= x:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

k, x = map(int, input().split())
if 500 * k >= x:
    print('Yes')
else:
    print('No')
w = input().lower()
n = 0
while True:
    t = input()
    if t == 'END_OF_TEXT': break
    n += t.lower.count(w)
print(n)

### FIXED CODE ###

w = input().lower()
n = 0
while True:
    t = input()
    if t == 'END_OF_TEXT': break
    n += t.lower().split().count(w)
print(n)
n = int(input())
a = list(map((int,input.split()))
c = int(n / 2)
b = list(a)
for j in range(1,c):
    M = max(b)
    m= min(b)
    b.remove(M)
    b.remove(m)
ML = min(b)
MR = max(b)
for i in range(0,n):
    if a[i] > MR:
        print(ML)
    else:
        print(MR)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(a)
b.sort()
c = int(n/2)
ML=b[c-1]
MR=b[c]
for i in range(0,n):
    if a[i] >= MR:
        print(ML)
    else:
        print(MR)
(n,m,k),*A,=[list(map(int,i.split())) for i in open(0)]
a=A[0]
b=A[1]

time=0
ans=0
anss=[]
i=0
def dfs(time,ans,a,b):
    if time>k:
        anss.append(ans-1)
    elif time==k:
        anss.append(ans)
    else:
        if len(a)>0:
            dfs(time+a[0],ans+1,a[1:],b)
        if len(b)>0:
            dfs(time+b[0],ans+1,a,b[1:])
        if len(a)==0 and len(b)==0:
            anss.append(ans)
dfs(0,0,a,b)
print(max(anss))

### FIXED CODE ###

(n,m,k),*A,=[list(map(int,i.split())) for i in open(0)]
a=A[0]
b=A[1]

aa=[0]
bb=[0]
for i in range(n):
    aa.append(aa[i]+a[i])
for i in range(m):
    bb.append(bb[i]+b[i])

ans=0

for i in range(n+1):
    if aa[i]>k:
        break
    while bb[m]>k-aa[i]:
        m-=1
    ans=max(ans,m+i)
        
print(ans)
print(math.ceil(n/2))

### FIXED CODE ###

N = int(input())

print((N + 1) // 2)
from fractions import gcd
A, B = map(int, input().split())
a = []
b = []
for i in range(1, A**(1/2)+1):
    if A % i == 0:
        a.append(i)
        a.append(A//i)
for i in range(1, B**(1/2)+1):
    if B % i == 0:
        a.append(i)
        a.append(B//i)

ans = 0
for i in a:
    for j in b:
        if gcd(i, j) == 1:
            ans += 1
print(ans)

### FIXED CODE ###

A, B = map(int, input().split())
a = []
b = []
import random

def is_prime(n):
    if n == 2: return True
    if n == 1 or n & 1 == 0: return False

    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    for k in range(100):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)

        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1

        if y != n - 1 and t & 1 == 0:
            return False

    return True


for i in range(1, int(A**(1/2))+1):
    if A % i == 0:
        a.append(i)
        a.append(A//i)
for i in range(1, int(B**(1/2))+1):
    if B % i == 0:
        b.append(i)
        b.append(B//i)

a = set(a)
b = set(b)
a = a & b

ans = 0
for i in a:
    if is_prime(i):
        ans += 1
print(ans+1)