Harryxun/stf_run huggingface dataset:
# -*- coding:utf-8 -*-
def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    k1 = (y2-y1)/(x2-x1)
    k2 = (y4-y3)/(x4-x3)
    if k1 == k2:
        print('YES')
    else:
        print('NO')

n = int(input())

for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    check_para(x1,y1,x2,y2,x3,y3,x4,y4)

### FIXED CODE ###

# -*- coding:utf-8 -*-
def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    if x1 == x2 and x4 == x3:
        print('YES')
        return 0
    elif x1 == x2 or x3 == x4:
        print('NO')
        return 0
    k1 = (y2-y1)/(x2-x1)
    k2 = (y4-y3)/(x4-x3)
    if abs(k1-k2) < 1e-10:
        print('YES')
    else:
        print('NO')

n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    check_para(x1,y1,x2,y2,x3,y3,x4,y4)
import sys

x = sys.stdin.readline()
x_list = x.split(" ")

max = int(x_list[0])
maxNo = 0
min = int(x_list[0])
minNo = 0

for i in range(1,3):
  if max < int(x_list[i]):
    max = int(x_list[i])
    maxNo = i
  elif min > int(x_list[i]):
    min = int(x_list[i])
    minNo = i

if (maxNo == 0 and minNo == 1) or (maxNo == 1 and minNo == 0):
  mid == int(x_list[2])
elif (maxNo == 0 and minNo == 2) or (maxNo == 2 and minNo == 0):
  mid == int(x_list[1])
else:
  mid == int(x_list[0])

print "%s %s %s" %(max, mid, min)

### FIXED CODE ###

x = raw_input()
x_list = x.split(" ")

x_list = map(int, x_list)

max = min = mid = 0
for i in range(1,3):
    if x_list[max] < x_list[i]:
        mid = max
        max = i
    elif x_list[min] > x_list[i]:
        mid = min
        min = i
    else:
        mid = i

print("%d %d %d" %(x_list[min], x_list[mid], x_list[max]))
a,b=map(int, input().split())
answer = 0

#偶数2
if a > 1 :
    answer += math.factorial(a) / (math.factorial(a - 2)*2)

#奇数2
if b > 1:
    answer += math.factorial(b) / (math.factorial(b - 2)*2)

print(int(answer))

### FIXED CODE ###

import math
a,b=map(int, input().split())
answer = 0

if a > 1 :
    answer += math.factorial(a) / (math.factorial(a - 2)*2)

if b > 1:
    answer += math.factorial(b) / (math.factorial(b - 2)*2)

print(int(answer))
import math
a,b,C=map(float,raw_input().split())
rad=math.radinas(C)
c=(a**2+b**2-2*a*b*math.cos(rad))
h=b*math.sin(c)
print h*a/2
print a+b+c
print h

### FIXED CODE ###

import math

(n,m,o) = map(float, raw_input().split())
#s=(n+m+o)/2.0
c=math.radians(o)
cs=math.sqrt(n**2+m**2-2*n*m*math.cos(c))
h=m*math.sin(c)
#ans=(s*(s-m)*(s-n)*(s-o))**0.5
#print ((n-o)**2 + (m-p)**2)**0.5
#print ans
S=h*n/2
L=n+m+cs
print S
print L
print h
from sys import stdin


n = int(stdin.readline().rstrip())
arr = [int(x) for x in stdin.readline().rstrip().split()]

rslt = []
for i in range(1,n):
    cntr = 0
    ex = 0
    for s in arr:
        s = int(s)
        if ex != 0:
            ex = s
        if s != ex +1:
            cntr += 1
        ex = s
    rslt.append(cntr)


print(rslt)
print(min(rslt))





### FIXED CODE ###

from sys import stdin


n = int(stdin.readline().rstrip())
arr = [int(x) for x in stdin.readline().rstrip().split()]

rslt = []

ex = 0
cntr = 1
bb = 0

for a,j in enumerate(arr):
    if j == cntr:
        cntr += 1
    else:
        bb += 1


if bb == n:
    print(-1)
else:
    print(bb)
from scipy.sparse import*
(n,m),*t=[map(int,t.split())for t in open(0)]
*b,a=zip(*[(i,j+n,1)for i,(_,*t)in enumerate(t)for j in t])
print('YNEOS'[1in csgraph.connected_components(csr_matrix((a,b),[m*3]*2))[1][:n]::2])

### FIXED CODE ###

from scipy.sparse import*
(n,m),*p=[map(int,t.split())for t in open(0)]
a,b,c=zip(*[(i,j+n-1,1)for i,q in enumerate(p)for j in list(q)[1:]])
print('YNEOS'[1in csgraph.connected_components(csr_matrix(((c,(a,b))),[n+m]*2))[1][:n]::2])
n,s,*a=map(int,open().read().split());d=[0]*-~s;m=998244353;v=pow(2,m-2,m);d[0]=pow(2,n,m)
for i in a:
  for j in range(s,i-1,-1):d[j]+=(d[j-i]*v)%m
print(d[s])

### FIXED CODE ###

n,s=map(int,input().split())
dp=[0]*(s+1)
mod=998244353
inv=pow(2,mod-2,mod)
dp[0]=pow(2,n,mod)
for i in list(map(int,input().split())):
  for j in range(s,i-1,-1):
    dp[j]=(dp[j]+dp[j-i]*inv)%mod
print(dp[s])
n, k, s = map(int, input().split())
if s != 10 ** 9:
    print(*[s if i < k else s + 1 for i in range(n)])
else:
    print(*[s if i < k else 1 for i in range(n)]))

### FIXED CODE ###

n, k, s = map(int, input().split())
if s != 10 ** 9:
    print(*[s if i < k else s + 1 for i in range(n)])
else:
    print(*[s if i < k else 1 for i in range(n)])
import math
from functools import reduce

n = int(input())
a_list = list(map(int, input().split()))
prime_list = [0] * math.floor(a_list[n - 1] ** 0.5)

def is_coprime(num):
    for i in range(2, math.ceil(num ** 0.5)):
        if num % i == 0:
            if prime_list[i] == 1:
                return True
            else:
                prime_list[i] += 1
    return False

for i in range(n):
    if is_coprime(a_list[i]):
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()
print("pairwise coprime")


### FIXED CODE ###

import math
from functools import reduce
L = 10**6 + 1
n = int(input())
a_list = list(map(int, input().split()))
memo = [0] * L

for a in a_list:
    memo[a] += 1

for i in range(2, L):
    if sum(memo[i::i]) > 1:
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()

print("pairwise coprime")
n = map(int,raw_input().split())
for i in n
    print i,

### FIXED CODE ###

a,b = map(int,raw_input().split())
print ("{0} {1}").format(a*b,2*a+2*b)
s=input()
ans=0
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] not in {'A','T','C','G',' '}:
        ans_list.append(ans)
        ans=0
    else:
        ans+=1

#print(ans_list)
if max(ans_list)==0:
    print(0)
else:
    print(max(ans_list))

### FIXED CODE ###

s=input()
ans=0
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] not in {'A','T','C','G',' '}:
        ans_list.append(ans)
        ans=0
#        print(str(ans)+'!')
    else:
        ans+=1
        if i == n-1:
           ans_list.append(ans) 
 #       print(str(ans)+'z')

#print(ans_list)
if max(ans_list)==0:
    print(0)
else:
    print(max(ans_list))
n, k = map(int, input().split())
x = list(map(int, input().split()))
p = n
for i in range(n):
  if x[i] > 0:
    p = i
    break
result = float('inf')
for i in range(max(p - k, 0), min(k - p, k + 1)):
  if i == 0:
    result = min(result, x[p + k - 1])
  elif i == k:
    result = min(result, -x[p - k])
  else:
    l = x[p - i]
    r = x[p + (k - i) - 1]
    result = min(result, r - 2 * l, r * 2 - l)
print(result)


### FIXED CODE ###

n, k = map(int, input().split())
x = list(map(int, input().split()))
p = n
for i in range(n):
  if x[i] > 0:
    p = i
    break
result = float('inf')
for i in range(k + 1):
  if p - i < 0 or p + k - i > n:
    continue
  if i == 0:
    t = min(result, x[p + k - 1])
  elif i == k:
    t = min(result, abs(x[p - k]))
  else:
    t = min(result, abs(x[p - i]) * 2 + x[p + (k - i) - 1], abs(x[p - i]) + x[p + (k - i) - 1] * 2)
  result = min(result, t)
print(result)
def nmx(x):
    r = 0
    for a in As:
        r += d2[max(0, x-a)]
    return -r
def bsearch(target, min_i, max_i, func):
    # func(index) <= target < func(index+1) となるindexを返す
    if func(max_i) <= target:
        return max_i
    if target < func(min_i):
        return None
    index = (max_i + min_i)//2
    while True:
        if func(index) <= target:
            if target < func(index+1):
                return index
            index, min_i = (index+1 + max_i)//2, index+1
            continue
        index, max_i = (index-1 + min_i)//2, index-1
N, M = map(int, input().split())
As = sorted(list(map(int, input().split())))
mn, mx = As[0], As[-1]

j = 0
n = N
d2 = []
for i in range(mx*2):
    while True:
        if j>=N:
            break
        if i <= As[j]:
            break
        j += 1
        n -= 1
    d2.append(n)
# d2[i] : i以上のaがいくつあるか
# nmx(x) : x以上のペアが何通りあるか
r = bsearch(-M, 1, mx*2, nmx)
r += 1
from itertools import accumulate
aas = list(accumulate([0]+As[::-1]))
rr = 0
c = 0
for a in As[::-1]:
    rr += a*d2[max(0, r-a)] + aas[d2[max(0, r-a)]]
    c += d2[max(0, r-a)]
rr += (r-1)*(M-c)
print(rr)


### FIXED CODE ###


def nmx(x):
    r = 0
    for a in As:
        r += d2[max(0, x-a)]
    return -r
def bsearch(target, min_i, max_i, func):
    # func(index) <= target < func(index+1) となるindexを返す
    if func(max_i) <= target:
        return max_i
    if target < func(min_i):
        return None
    index = (max_i + min_i)//2
    while True:
        if func(index) <= target:
            if target < func(index+1):
                return index
            index, min_i = (index+1 + max_i)//2, index+1
            continue
        index, max_i = (index-1 + min_i)//2, index-1
N, M = map(int, input().split())
As = sorted(list(map(int, input().split())))
mn, mx = As[0], As[-1]

j = 0
n = N
d2 = []
for i in range(mx*2):
    while True:
        if j>=N:
            break
        if i <= As[j]:
            break
        j += 1
        n -= 1
    d2.append(n)
# d2[i] : i以上のaがいくつあるか
# nmx(x) : x以上のペアが何通りあるか
r = bsearch(-M, 1, mx*2, nmx)
r += 1
from itertools import accumulate
aas = list(accumulate([0]+As[::-1]))
rr = 0
c = 0
for a in As[::-1]:
    idx = min(mx*2-1, max(0, r-a))
    rr += a*d2[idx] + aas[d2[idx]]
    c += d2[idx]
rr += (r-1)*(M-c)
print(rr)
x = int(input())
if x == 0:
    print(4)
    print(3, 3, 3, 3)
    1/0

x-= 1
phase = x//50
subphase = x%50
pstart = phase*50

left = 99+phase-(x-pstart)
right = 48+phase-(x-pstart)
ans = [left]*(1+subphase)+[right]*(49-subphase)
print(50)
print(*ans)

### FIXED CODE ###

x = int(input())
if x == 0:
    print(4)
    print(3, 3, 3, 3)
    exit()

x-= 1
phase = x//50
subphase = x%50
pstart = phase*50

left = 99+phase-(x-pstart)
right = 48+phase-(x-pstart)
ans = [left]*(1+subphase)+[right]*(49-subphase)
print(50)
print(*ans)
from collections import *
n,m=map(int,input().split())
l=[]
for s in m*[0]:
    a,b=map(int,input().split())
    l.append([a,b])
def f(l):
    d=defaultdict(list)
    for t in l:
        d[t[0]].append(t[1])
        d[t[1]].append(t[0])
    return d

def DFS_dict(point,TFlist,d):
    if all(TFlist):
        return 1
    ans=0
    for i in d[point]:
        if TFlist[i-1]:
            continue
        TFlist[i-1]=True
        ans+=DFS_dict(i,TFlist,d)
        TFlist[i-1]=False
    return ans
TFlist=[True]+[False]*(n-1)
for q in range(m):
    if DFS_dict(1,TFlist,f(l))>0:
        print(0)
    else:
        print(m+2-sum(len(e) for e in f(l).values())//2)
    l.pop(0)
    

### FIXED CODE ###

class UNION_FIND(object):
    def __init__(self,n):
        #親の番号を格納する。親だった場合は-(その集合のサイズ)
        #作るときはParentの値を全て-1にする
	    #こうすると全てバラバラになる
        self.parent=[-1 for i in range(n)]
        
    def root(self,x):
        #Aがどのグループに属しているか調べる
        if self.parent[x]<0:
            return x
        else:
            self.parent[x]=self.root(self.parent[x])
            return self.parent[x]

    def size(self,x):
        #自分のいるグループの頂点数を調べる
        return -self.parent[self.root(x)]   #親をとってきたい
        
    def union(self,x,y):
        #AとBをくっ付ける
        #AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        #print(self.parent)
        x=self.root(x)
        y=self.root(y)
        #print(x,y)
        if x==y:   #すでにくっついてるからくっ付けない
            return False
            
        #大きい方(A)に小さいほう(B)をくっ付けたい
		#大小が逆だったらひっくり返しちゃう。
        if self.size(x)<self.size(y):
            x,y=y,x
        self.parent[x]+=self.parent[y]  #Aのサイズを更新する
        self.parent[y]=x   #Bの親をAに変更する
        return True



n,m=map(int,input().split())
uni=UNION_FIND(n)
ans=n*(n-1)//2

Input=[]
anslist=[ans]
for s in m*[0]:
    a,b=map(int,input().split())
    Input.append([a-1,b-1])

for i in range(m-1,0,-1):
    x=Input[i][0]
    y=Input[i][1]
    #print(x,y)
    if uni.root(x) != uni.root(y):
        ans-=uni.size(x)*uni.size(y)
        uni.union(x,y)
    anslist.append(ans)

for t in anslist[::-1]:
    print(t)
A=input().split()
S=A[0]
T=A[1]
s=[]
t=[]
for c in S:
    s.append(c)
for c in T:
    t.append(c)

v=1
for i in range(len(s)):
    if not s[i]==t[i]:
        v=0
if v==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A=[input() for i in range(2)]
S=A[0]
T=A[1]
s=[]
t=[]
for c in S:
    s.append(c)
for c in T:
    t.append(c)

v=1
for i in range(len(s)):
    if not s[i]==t[i]:
        v=0
if v==1:
    print("Yes")
else:
    print("No")
n,l = map(int, input().split())
a = [input() for i in range(n)]
b = sorted(a)
k = ""
for j in range(n):
  k = k+b[j]
print(k)

### FIXED CODE ###

a = list(map(int, input().split()))
b = a.count(5)
c = a.count(7)
if b==2 and c==1:
  print("YES")
else:
  print("NO")
n = int(input())
input(s)
if (s == s[n - 1:])
  print("Yes")
else
  print ("No")    

### FIXED CODE ###

import sys

n = int(input())
s = input()
if n == 1:
  print("No")
  sys.exit()
n = n // 2
if s[:n]  == s[n:]:
    print("Yes")
else:
    print ("No")
n = input()
s = input().split(" ")
ans = 1
for i in s:
  ans *= i
print(ans)

### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))
total = 1
if 0 in arr:
    print(0)
else:
    for num in arr:
        if total > 10**18:
            break
        total *= num
    if total > 10**18:
        print(-1)
    else:
        print(total)
a = int(input())
b = list(map(int, input().split()))
count = 0
while(true):
  for i in range(0, a, 1):
    if (b[i] % 2 == 1) :
      break;
  for i in range(0, a, 1):
    b[i] /= 2
  count += 1
print(count)

### FIXED CODE ###

a = int(input())
b = list(map(int, input().split()))
count = 0
while(1):
  flag = 0
  for i in range(0, a, 1):
    if (b[i] % 2 == 1) :
      flag = 1
  if (flag == 1) :
    break
  for i in range(0, a, 1):
    b[i] /= 2
  count += 1
print(count)
n = int(input())
s = list(input())
t = []
ans = 1
count= []

t = set(s)
t = list(t)

for i in range(len(t)):
    count.append(s.count(t[1]))

for j in range(len(count)):
    ans *= (count[i] + 1)
print(ans-1)


### FIXED CODE ###


n = int(input())
s = list(input())
t = []
ans = 1
count= []

t = set(s)
t = list(t)

for i in range(len(t)):
    count.append(s.count(t[i]))

for j in range(len(count)):
    ans *= (count[j] + 1)

print((ans-1)%(10**9 + 7))
N, K = map(int, input().split())

def binomial_coeffs1(n, k):
    #top down DP
    if (k == 0 or k == n):
        return 1
    if (memo[n][k] != -1):
        return memo[n][k]

    memo[n][k] = binomial_coeffs1(n-1, k-1) + binomial_coeffs1(n-1, k)
    return memo[n][k]

memo = [[-1 for i in range(2010)] for j in range(2010)]
for i in range(1, K+1):
    print(binomial_coeffs1(N-K+1, i)*binomial_coeffs1(K-1, i-1))


### FIXED CODE ###

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

def make_comb_dp(n):
    dp = [[0] * (n + 1) for i in range(n + 1)]
    for i in range(n + 1):
        dp[i][0] = 1
        dp[i][i] = 1
    for i in range(2, n + 1):
        for j in range(1, i):
            dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j]
    return dp

nCk = make_comb_dp(2000)
for i in range(1, K+1):
    print(int(nCk[N-K+1][i]*nCk[K-1][i-1])%(10 ** 9 + 7))
import string
abc = list(string.ascii_lowercase)
li = [0 for a in range(len(abc))]

while True:
    a = raw_input()
    if a != '':
        for a in list(a):
            if a.lower() in abc:
                tmp = abc.index(a.lower())
                li[tmp] = li[tmp] + 1
    else:
        break

for a in range(len(abc)):
    print abc[a] + ' : ' + li[a]

### FIXED CODE ###

import string
az = list(string.ascii_lowercase)
li = [0 for a in range(len(az))]

while True:
    try:
        a = raw_input()
        for b in list(a):
            if b.lower() in az:
                tmp = az.index(b.lower())
                li[tmp] = li[tmp] + 1
    except:
        break

for c in range(len(az)):
    print az[c] + ' : ' + str(li[c])
N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)

color = [0 for _ in range(N)]

def f(v,c):
    color[v] = c
    for i in range(len(graph[v])):
        if color[ graph[v][i] ] ==c:
            return False
        elif (color[graph[v][i]] ==0 and not f(graph[v][i],-c)):
            return False
    return True 

bipartite = True
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            bipartite = False

if bipartite: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = M*(M-1)/2 - M

print(int(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)


def f(u,c):
    color[u] = c
    for v in graph[u]:
        if color[v] == 0: # まだ塗られていない場合
            if not f(v,-c):
                return False
        else:
            if color[v] == c: # 隣接している頂点が同色の場合 二部グラフではない
                return False
    return True 

flag = True
color = [0 for _ in range(N)]
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            flag = False
            break

if flag: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = N*(N-1)//2 - M

print(int(ans))
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
A,B = list(map(int,input().split()))
print(lcm(A, B))

### FIXED CODE ###

import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools

def solve():
    cache = dict()
    def loop(i, w):
        if (i, w) in cache:
            return cache[i, w]
        if i == N:
            return (0, 0)
        cache[i, w] = loop(i + 1, w)
        if v[i][1] <= w:
            t = loop(i + 1, w - v[i][1])
            cache[i, w] = max(cache[i, w], (t[0] + v[i][0], t[1] + v[i][1]), key=lambda u: u[0])
        return cache[i, w]
    return loop(0, W)

for dn in itertools.count(1):
    W = int(input())
    if W == 0: break
    N = int(input())
    v = [tuple(map(int, input().split(','))) for _ in range(N)]
    optim = solve()
    print("Case %d:\n%d\n%d" % (dn, optim[0], optim[1]))

### FIXED CODE ###

import itertools

for dn in itertools.count(1):
    W = int(input())
    if W == 0: break
    N = int(input())
    d = [tuple(map(int, input().split(','))) for _ in range(N)]

    v = [0 for _ in range(W + 1)]
    for i in range(N):
        for j in range(W, d[i][1] - 1, -1):
            v[j] = max(v[j], v[j - d[i][1]] + d[i][0])
    print("Case %d:\n%d\n%d" % (dn, max(v), v.index(max(v))))
import sys
N=int(input())
H1=list(map(int,input().split()))
H=np.zeros(N,dtype="int64")
for i in range (0,N):
  H[i]=H1[i]
s=0
if N==1:
  print("Yes")
  sys.exit()
  
for i in range (0,N-1):
  if H[i]>H[i+1]:
    s = s + H[i]-H[i+1]
  if s>=2:
    print("No")
    sys.exit()

print("Yes")


### FIXED CODE ###

import sys
N = int(input())
H = list(map(int,input().split()))
for i in reversed (range(N-1)):
  if H[i] > H[i+1]:
    H[i] = H[i] - 1
    if H[i] > H[i+1]:
      print("No")
      sys.exit()
print("Yes")
k = input()
x = input()

if k*500<x:
	print("Yes")
else:
	print("No")	

### FIXED CODE ###

import sys
# input=sys.stdin.readline

val = []
val = input()

arrays = val.split(' ')
a = int(arrays[0])*500

if a>=int(arrays[1]):
    print("Yes")
elif a<int(arrays[1]):
    print("No")

sys.exit()
from fractions import gcd

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

print(int(A * B / gcd(A, B)))

### FIXED CODE ###

A = int(input())
B = int(input())


# A = 3
# B = 1
print(6 - A- B)
modulo=10**9+7
n, m=map(int, input().split())
a_list=[]
for i in range(m):
    a=int(input())
    a_list.append(a)
dp=[0 for i in range(n+1)]#0~n
dp[0]=1
if a_list[0]==1:
    dp[1]=0
else:
    dp[1]=1

for i in range(2, n+1):
    if not i in a_list:
        dp[i]=(dp[i-2]+dp[i-1])%modulo
print(dp[n]%modulo)


### FIXED CODE ###

modulo=10**9+7
n, m=map(int, input().split())
a_list=[]
for i in range(m):
    a=int(input())
    a_list.append(a)
a_list.append(-1)
dp=[0 for i in range(n+1)]#0~n
dp[0]=1
if a_list[0]==1:
    dp[1]=0
    j=1
    for i in range(2, n+1):#10^5
        if i!=a_list[j]:
            dp[i]=(dp[i-2]+dp[i-1])%modulo
        else:
            j=j+1
else:
    dp[1]=1
    j=0
    for i in range(2, n+1):#10^5
        if i!=a_list[j]:
            dp[i]=(dp[i-2]+dp[i-1])%modulo
        else:
            j=j+1

print(dp[n]%modulo)
class UnionFind(object):
    def __init__(self, N):
        self.parent = [i for i in range(N)]
 
    def merge(self, a, b):
        pa = self.root(a)
        pb = self.root(b)
        self.parent[pa] = pb
    
    def root(self, x):
        p = self.parent[x]
        if p == x:
            return x
        else:
            r = self.root(p)
            self.parent[x] = r
            return r
n,m=map(int,input().split())
a=list(map(int,input().split()))
uf=UnionFind(n)
for i in range(m):
  a,b=map(int,input().split())
  if a>b:a,b=b,a
  uf.merge(a-1,b-1)
print(sum(1 for i in range(n) if uf.parent[i]==uf.parent[a[i]-1]))

### FIXED CODE ###

n,m=map(int,input().split())
p=list(map(int,input().split()))
class UnionFind(object):
    def __init__(self, N):
        self.parent = [i for i in range(N)]
        self.size = [1 for i in range(N)]
    
    def merge(self, a, b):
        if self.issame(a,b):
            return
        pa = self.root(a)
        pb = self.root(b)
        self.parent[pa] = pb
        self.size[pb] += self.size[pa]
    def root(self, x):
        p = self.parent[x]
        if p == x:
            return x
        else:
            r = self.root(p)
            self.parent[x] = r
            return r
    
    def issame(self, x, y):
        return self.root(x) == self.root(y)
    
    def getsize(self, x):
        return self.size[self.root(x)]

uf=UnionFind(2*n)
for i in range(n):
    uf.merge(i,p[i]+n-1)
for i in range(m):
    x,y=map(int,input().split())
    x-=1;y-=1
    uf.merge(x,y)
ans=0
for i in range(n):
    ans+=int(uf.issame(i,i+n))
print(ans)
N = int(input())

T = [[] for i in range(N)]
F = [None for i in range(N-1)]
for i,n in enumerate(range(N-1)):
    a,b = map(int,input().split())
    T[a-1].append(b-1)
    F[i] = b-1

# print(T)

R = [None for i in range(N)]
def dfs(cur, mx, color):
    R[cur] = color
    if color == -1:
        mx = max(len(T[cur]), mx)
    else:
        mx = max(len(T[cur])+1, mx)
    d = 0
    mmx = mx
    for i,t in enumerate(T[cur], start=1):
        if i==color:
            d=1
        mmx = max(mmx,dfs(t, mx, i+d))
        # dfs(t, mx, i)
    return mmx
M = dfs(0, 1, -1)
# print(R)
# print(F)
print(M)
for i,f in enumerate(F):
    print(R[f])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N = int(input())

E = []
T = [[] for i in range(N)]
for i,n in enumerate(range(N-1)):
    a,b = map(int,input().split())
    E.append((a-1,b-1))
    T[a-1].append(b-1)

# print(E)
# print(T)



R = [None for i in range(N)]
def dfs(using, cur):
    R[cur] = using
    i=0
    for t in T[cur]:
        if i==using:
            i+=1
        dfs(i,t)
        i+=1


dfs(-1, 0)

print(max(R)+1)
# print(K)
for e in E:
    print(R[e[1]]+1)

# print(K)
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,m,x = iim()
before = 0
after = 0
for i in range(m):
    if ii() < x:
        before += 1
    else:
        after += 1

print(min(before,after))

### FIXED CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,m,x = iim()
before = 0
after = 0
A = iil()
for i in A:
    if i < x:
        before += 1
    else:
        after += 1

print(min(before,after))