Harryxun/stf_run huggingface dataset:
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.sizes = [1] * (n+1)
        self.root = [1] * (n+1)
 
    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
 
    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.root[x] = -1
            self.sizes[y] += self.sizes[x]
        else:
            self.par[y] = x
            self.root[y] = -1
            self.sizes[x] += self.sizes[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
        
 
    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)
    
    def size(self, x):
        return self.sizes[find(x)]
    
 
n, m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
 
all_comb = n*(n-1)/2
 
a = UnionFind(n)
 
ans = [all_comb]
for pair in reversed(lst):
    if a.same_check(pair[0], pair[1]):
        ans.append(ans[-1])
        pass
    else:
        ans.append(ans[-1] - a.sizes[a.find(pair[0])]*a.sizes[a.find(pair[1])])
        a.union(pair[0], pair[1])
    
for i in reversed(ans[:-1]):
    print(int(i))

### FIXED CODE ###

a, b, c = map(int, input().split())
if b >= a*c:
    print(c)
else:
    print(b // a)
a, b = map(int, raw???input().split())

if a<b :
   print a<b
elif a>b :
   print a>b
elif a == b :
   print a==b

### FIXED CODE ###

a, b = map(int, raw_input().split())
  
if a>b:
  print 'a > b'
elif a<b:
  print 'a < b'
elif a==b:
  print 'a == b'
#166d
x = int(input())
for i in range(-73,73):
    for j in range(-73,73):
        print(i,j)
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

### FIXED CODE ###

from itertools import combinations_with_replacement

n,m,q = map(int,input().split())
s_list = [list(map(int,input().split())) for _ in range(q)]

ans = 0
for c in combinations_with_replacement(range(1,m+1),n):
    v = 0
    for s in s_list:
        if c[s[1]-1] - c[s[0]-1] == s[2]:
            v+=s[3]
    
    ans = max(ans,v)
print(ans)
# -*- coding: utf-8 -*-
def stairs_count(now, goal, memo):
    if memo[now] is not None:
        return memo[now]

    step1 = 0
    step2 = 0

    # step1
    if now + 1 == goal:
        step1 = 1
    else:
        step1 = stairs_count(now+1, goal, memo)

    # step2
    if now + 2 > goal:
        step2 = 0
    elif now + 2 == goal:
        step2 = 1
    else:
        step2 = stairs_count(now+2, goal, memo)

    memo[now] = step1 + step2
    return memo[now]


n, m  = map(int, input().split())
memo = [None for i in range(n)]
for _ in range(m):
    a = int(input())
    memo[a] = 0

root = stairs_count(0, n, memo)
print(root % 1000000007)


### FIXED CODE ###

# -*- coding: utf-8 -*-
mod = 1000000007

n, m  = map(int, input().split())
dp = [0 for _ in range(n+1)]
broken = [False for _ in range(n+1)]
for _ in range(m):
    a = int(input())
    broken[a] = True

dp[0] = 1
dp[1] = 0 if broken[1] else 1
for i in range(2, n+1):
    if broken[i]:
        continue
    if not broken[i-2]:
        dp[i] += dp[i-2]
        dp[i] %= mod
    if not broken[i-1]:
        dp[i] += dp[i-1]
        dp[i] %= mod

print(dp[n])
N,M,X = map(int,input().split())
A = []
cost = []
for i in range(N):
    a = list(map(int,input().split()))
    A.append(a[1:])
    cost.append(a[0])
ans = float('inf')
for i in range(2**N):
    I = bin(i)[2:]
    I = I.zfill(M)
    tmp = [0]*M
    buy = 0
    for j in range(len(I)):
        if I[j]=='1':
            for k in range(len(A[j])):
                tmp[k] += A[j][k]
            buy += cost[j]
    if all(tmp[i]>=X for i in range(len(tmp))):
        ans = min(ans,buy)
ans = -1 if ans ==float('inf') else ans
print(ans)

### FIXED CODE ###

N,M,X = map(int,input().split())
A = []
cost = []
for i in range(N):
    a = list(map(int,input().split()))
    A.append(a[1:])
    cost.append(a[0])
ans = float('inf')
for i in range(2**N):
    I = bin(i)[2:]
    I = I.zfill(N)
    tmp = [0]*M
    buy = 0
    for j in range(len(I)):
        if I[j]=='1':
            for k in range(len(A[j])):
                tmp[k] += A[j][k]
            buy += cost[j]
    if all(tmp[i]>=X for i in range(len(tmp))):
        ans = min(ans,buy)
ans = -1 if ans ==float('inf') else ans
print(ans)
x = int(input())
flg = 0
if x == 2:
    print(2)
    exit()
while True:
   for i in range(2,int(x**0.5)+1):
        if x%i == 0:
            flg += 1
        if i == int(x**0.5) and flg == 0:
            print(x)
            exit()
    x += 1



### FIXED CODE ###

x = int(input())
if x == 2:
    print(2)
    exit()
while True:
    flg = 0
    for i in range(2,int(x**0.5)+1):
        if x%i == 0:
            flg += 1
        if i == int(x**0.5) and flg == 0:
            print(x)
            exit()
    x += 1
v=[4,1,4,1,2,1,2,1]
while True:
    p=map(int,raw_input().split(" "))
    min=[]
    min_value=0

    for i in range(8):
        count=0
        for j in range(8):
            if p[(j)%8]-v[(j+i)%8]>=0:
                count+=p[(j)%8]-v[(j+i)%8]
        if len(min)==0:
            min_value=count
            min.append(i)
        else:
            if count<min_value:
                min_value=count
                min=[]
                min.append(i)
            elif count==min_value:
                min.append(i)
    min1_value=41412122
    for i in range(len(min)):
        value=""
        for j in range(8):
            value+=str(v[(j+min[i])%8])
        if min1_value>int(value):
            min1_value=int(value)
            min1=min[i]
    solve=[]
    for i in range(8):
        solve.append(str(v[(i+min1)%8]))
    print " ".join(solve)

### FIXED CODE ###

v=[4,1,4,1,2,1,2,1]
while True:
    try:
        p=map(int,raw_input().split(" "))
        min=[]
        min_value=0
        
        for i in range(8):
            count=0
            for j in range(8):
                if p[(j)%8]-v[(j+i)%8]>=0:
                    count+=p[(j)%8]-v[(j+i)%8]
            if len(min)==0:
                min_value=count
                min.append(i)
            else:
                if count<min_value:
                    min_value=count
                    min=[]
                    min.append(i)
                elif count==min_value:
                    min.append(i)
        min1_value=41412122
        for i in range(len(min)):
            value=""
            for j in range(8):
                value+=str(v[(j+min[i])%8])
            if min1_value>int(value):
                min1_value=int(value)
                min1=min[i]
        solve=[]
        for i in range(8):
            solve.append(str(v[(i+min1)%8]))
        print " ".join(solve)
    except:
        break
n, m = [int(i) for i in input().split()]
S = input()
Q = [[i for i in input().split()] for j in range(m)]

l = 0
r = n - 1

for t, d in Q[::-1]:
    if d == 'L' and t == S[l]:
        l += 1
    if d == 'R' and t == S[r]:
        r -= 1

print(r - l + 1)

### FIXED CODE ###

n, m = [int(i) for i in input().split()]
S = input()
Q = [[i for i in input().split()] for j in range(m)]

def solve(i):
    cur = i
    for t, d in Q:
        if S[cur] == t:
            cur += 1 if d == 'R' else -1
        if cur < 0 or cur >= n:
            return False
    return True

def b_search(ok, ng):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if solve(mid):
            ok = mid
        else:
            ng = mid
    return ok

print(max(0, b_search(-1, n) - b_search(n, -1) + 1))
def factorize(n):
    p = n
    while True:
        if p % 2 == 0:
            p //= 2
            yield 2
        else:
            break

    r = 3
    while p != 1:
        if p % i == 0:
            p //= i
            yield i
        else:
            r += 2

n = int(input())
l = factorize(n)

print(str(n)+":",*list(l))

### FIXED CODE ###

import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)
N, K = map(int, input().split())
if N <= K:
    print('0')
    return
H = sorted(list(map(int, input().split())))
if K == 0:
    print(sum(H))
else:
    print(sum(H[:K + 1]))


### FIXED CODE ###

N, K = map(int, input().split())
H = sorted(list(map(int, input().split())))
if N <= K:
    print('0')
elif K == 0:
    print(sum(H))
else:
    print(sum(H[:N - K]))
n = int(input());
s = [0]*n;
for i in range(n) :
	s_pre = list(input());
	s_pre.sort();
	s[i] = s_pre;


s.sort(key=lambda x:(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9]));

ans = 0;
for i in range(1,n) :
	ok = 1;
	k = 1;
	while s[i-k]==s[i] :
		#for j in range(10) :
			#if s[i-k][j] != s[i][j] :
				#ok = 0;
		if bool(ok) :
			ans += 1;
		k += 1;

print(ans);

### FIXED CODE ###

import math

n = int(input());
s = [0]*n;
for i in range(n) :
	s_pre = list(input());
	s_pre.sort();
	s[i] = s_pre;


s.sort(key=lambda x:(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9]));

ans = 0;
ren = 0;
for i in range(1,n) :
	ok = 1;
	if s[i-1]==s[i]:
		ans += 1;
		ans += ren;
		ren += 1;
	else :
		ren = 0;

print(ans);
N = int(input())
d = list(map(int(input().sprit())))
sum = 0
for i in range(N):
  for j in range(i+1,N):
    sum += d[i] * d[j]
    
print(sum)

### FIXED CODE ###

N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
  for j in range(i+1,N):
    sum += d[i] * d[j]
    
print(sum)
s = input()
if s.search("hi") != -1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import re
s = input()
if s == "hi" or s=="hihi" or s=="hihihi" or s=="hihihihi" or s== "hihihihihi": 
    print("Yes")
else:
    print("No")
n = int(input())
a = list(map(int,input().split()))
cnt = 0
id = 1
while a != []:
    if a[0] == a[1]:
        while a[id-1] == a[id] and id < len(a)-1:
            id += 1
        del(a[:id-1])
        id = 1
    if a[0] > a[1]:
        while  a[id-1] >= a[id] and id <= len(a)-1:
            id += 1
            if id == len(a):break
    elif a[0] < a[1]:
        while a[id-1] <= a[id] and id <= len(a)-1:
            id += 1
            if id == len(a):break
    cnt += 1
    del(a[:id])
    id = 1

    if len(a)==1:
        cnt += 1
        break

print(cnt)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
cnt = 0
id = 1
while a != []:
    if len(a)==1:
        cnt += 1
        break
    if a[0] == a[1]:
        while a[id-1] == a[id] and id <= len(a)-1:
            id += 1
            if id == len(a):break
        if id == n:
            cnt = 1
            break
        del(a[:id-1])
        id = 1
    if a[0] > a[1]:
        while  a[id-1] >= a[id] and id <= len(a)-1:
            id += 1
            if id == len(a):break
    elif a[0] < a[1]:
        while a[id-1] <= a[id] and id <= len(a)-1:
            id += 1
            if id == len(a):break
    cnt += 1
    del(a[:id])
    id = 1


print(cnt)
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import queue
import copy
import numpy as np
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return sorted([list(map(int, input().split())) for _ in range(n)])
def sortx(x,n,k):
    if k == 0:x.sort(key=lambda y:y[1,n])
    else:x.sort(reversed=True, key=lambda y:y[1,n])

def main():
    s = input()
    NG = 1
    NP = 0
    did = ["g"]
    point = 0
    for i in range(1,len(s)):
        if s[i] == "g":
            if NP + 1 <= NG:
                did.append("p")
                NP += 1
                point += 1
            else:
                did.append("g")
                NG += 1
        else:
            if NP + 1 <= NG:
                did.append("p")
                NP += 1
            else:
                did.append("g")
                NG += 1
                point -= 1
    print(point)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return sorted([list(map(int, input().split())) for _ in range(n)])
def sortx(x,n,k):
    if k == 0:x.sort(key=lambda y:y[1,n])
    else:x.sort(reversed=True, key=lambda y:y[1,n])

def main():
    s = input()
    NG = 1
    NP = 0
    did = ["g"]
    point = 0
    for i in range(1,len(s)):
        if s[i] == "g":
            if NP + 1 <= NG:
                did.append("p")
                NP += 1
                point += 1
            else:
                did.append("g")
                NG += 1
        else:
            if NP + 1 <= NG:
                did.append("p")
                NP += 1
            else:
                did.append("g")
                NG += 1
                point -= 1
    print(point)

if __name__ == "__main__":
    main()
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき
#str = input()


list = I.list()

bool = False
for a in list:
    if a == 7:
        bool = True
        break

if bool == True:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math
#数値ひとつ
#I = int(input())
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき

N = input()
listA = list(N)

A = listA[0]
B = listA[1]
C = listA[2]

bool = False

if A == '7':
    bool = True

elif B == '7':
    bool = True

elif C == '7':
    bool = True


if bool == True:
    print('Yes')
else:
    print('No')
N = int(input())
num_li = list(map(int, input().split()))

max_num = max(num_li)
other_num = 0

for n in num_li:
  if n == max_num:
    continue
  other_num += n

if max_num < other_num:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

T, X = map(int, input().split())

print(T/X)
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, q = list(map(int, readline().split()))
    event = [0] * (2 * n + q)

    for i in range(n):
        s, t, x = map(int, readline().split())
        event[i * 2] = (s - x, x, 0)
        event[i * 2 + 1] = (t - x, x, 1)

    for i in range(q):
        d = int(input())
        event[2 * n + i] = (d, 0, 2)

    from operator import itemgetter
    import heapq
    event.sort(key=itemgetter(0))
    hq = []
    stop = set()

    for t, x, ev_type in event:
        if ev_type == 0:
            stop.add(x)
            heapq.heappush(hq, x)
        elif ev_type == 1:
            stop.discard(x)
        else:
            if stop:
                while hq:
                    res = heapq.heappop(hq)
                    if res in stop:
                        print(res)
                        break
            else:
                hq.clear()
                print(-1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, q = list(map(int, readline().split()))
    event = [0] * (2 * n + q)

    for i in range(n):
        s, t, x = list(map(int, readline().split()))
        event[i * 2] = (s - x, x, 0)
        event[i * 2 + 1] = (t - x, x, 1)

    for i in range(q):
        d = int(input())
        event[2 * n + i] = (d, 0, 2)

    from operator import itemgetter
    event.sort(key=itemgetter(0))
    stop = set()
    res = INF

    for t, x, ev_type in event:
        if ev_type == 0:
            stop.add(x)
            if res == -1:
                res = x
            elif res > x:
                res = x
        elif ev_type == 1:
            stop.discard(x)
            if res == x:
                if stop:
                    res = min(stop)
                else:
                    res = -1
        else:
            if stop:
                print(res)
            else:
                print(-1)


if __name__ == '__main__':
    main()
n, m = map(int, input().split())

def fib(n):
    if n == 0:
        return 0
    elif n <= 2:
        return 1
    else:
        return fib(n-1)+fib(n-2)

a = []
for i in range(m):
    a.append(int(input()))
ans = fib(a[0])
for i in range(m-1):
    ans *= fib(a[i+1]-a[i]-1)
    ans %= 1000000007
ans *= fib(n-a[-1])
print(ans%1000000007)


### FIXED CODE ###

import sys
n, m = map(int, input().split())
a=set(int(input()) for i in range(m))
ans = [0 for _ in range(n)]

for i in range(n):
    if i+1 in a:
        ans[i] = 0
    else:
        if i == 0:
            ans[i] = 1
        elif i == 1:
            ans[i] = 1+ans[i-1]
        else:
            ans[i] = (ans[i-1]+ans[i-2])%(10**9+7)
print(ans[-1])
n = int(input())
l = [*map(int,input().split())]
s,res = l[0],0
for i in range(1,n):
  res+=s*l[i]
  s+=l[i]
print(s)


### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
s,res = l[0],0
for i in range(1,n):
  res+=s*l[i]
  s+=l[i]
print(res)
a,b = map(int,input().split())
k = int(input())
for i in range(a,b+1):
    if i<a+k or i>b-k:
        print(i)
    
 
   


 


### FIXED CODE ###

a,b,k = map(int,input().split())
if b+1-a <= k*2:
    for i in range(a,b+1):
        print(i)
else:
    for j in range(a,a+k):
        print(j)
    for l in range(b-k+1,b+1):
        print(l)
N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if s[i] != S[K-1]:
        ans += '*'
    else:
        ans += S[i]
print(ans)


### FIXED CODE ###

N=int(input())
S=input()
K=int(input())
ans=''
for i in range(N):
    if S[i] != S[K-1]:
        ans += '*'
    else:
        ans += S[i]
print(ans)
a = input()
if a.upper() == a
    print("A")
else:
    print("a")

### FIXED CODE ###

a = input()
if a == a.upper():
    print("A")
else:
    print("a")
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
max_profit = a[1] - a[0]
min_val = min(a[1],a[0])
for i in range(2,N):
	if a[i] < min_val:
		min_val = a[i]
	else if a[i] - min_val > max_profit:
		max_profit = a[i] - min_val
print(str(max_profit))

### FIXED CODE ###

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
max_profit = a[1] - a[0]
min_val = min(a[1],a[0])
for i in range(2,N):
	if a[i] < min_val:
		min_val = a[i]
	elif a[i] - min_val > max_profit:
		max_profit = a[i] - min_val
print(str(max_profit))
n, m = map(int, input().split())
p = []
s = []
for i in range(m):
    p_i, s_i = input().split()
    p.append(int(p_i))
    s.append(b)


res = [0]*n
correct = 0
penalty = 0
for i in range(m):
    no = p[i] - 1
    if res[no] == 1:
        continue
    elif s[i] == 'WA':
        penalty += 1
    elif s[i] == 'AC':
        correct += 1
        res[no] = 1

print(correct, penalty)

### FIXED CODE ###

n, m = map(int, input().split())
p = []
s = []
for i in range(m):
    p_i, s_i = input().split()
    p.append(int(p_i))
    s.append(s_i)

correct = [0]*n
penalty = [0]*n

for i in range(m):
    no = p[i]
    if correct[no-1] == 1:
        continue
    elif s[i] == 'WA':
        penalty[no-1] += 1
    elif s[i] == 'AC':
        correct[no-1] = 1

pen = 0
for i in range(n):
    if correct[i] == 1:
        pen += penalty[i]
print(sum(correct), pen)
ht,st,ha,sa = list(map(int, input().split(' ')))
bool_player = True #Takashi
while (ht <= 0 || st <= 0):
  if bool_player:
    ha -= st
    bool_player = False
  else:
    ht -= sa
    bool_player = True

if ht <= 0:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

ht, st, ha, sa = list(map(int, input().split(' ')))
bool_player = True  # Takashi
while (ht > 0 and ha > 0):
    if bool_player:
        ha -= st
        bool_player = False
    else:
        ht -= sa
        bool_player = True

if ht <= 0:
    print('No')
else:
    print('Yes')
h, n = map(int, input().split())
a = [int(x) for x in input().split()]
a.sort()
if h <= a[-2] + a[-1]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

h, n = map(int, input().split())
a = [int(x) for x in input().split()]

if h <= sum(a):
    print('Yes')
else:
    print('No')
x = raw_input()
y = map(x)
a = y[0]
b = y[1]
c = a*b
d = (a+b)*2
print c, d


### FIXED CODE ###

x=int(input())
print(x*x*x)
a = input()


if  a  == "TUE":
  print(5)
elif a  == "WED":
  print(4)
elif a  == "THU":
  print(3)
elif a  == "FRI":
  print(2)
elif a  == "SAT":
  print(1)
elif a  == "SUN":
  print(0)
else a  == "MON":
  print(6)

### FIXED CODE ###

a = input()


if  a  == "TUE":
  print(5)
elif a  == "WED":
  print(4)
elif a  == "THU":
  print(3)
elif a  == "FRI":
  print(2)
elif a  == "SAT":
  print(1)
elif a  == "SUN":
  print(7)
else:
  print(6)
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

### FIXED CODE ###

n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)
line_b = list(map(int, input().split(' ')))
line=[]
num=[]
for i in range(line_b[0]):
  num+=[0]
for i in range(line_b[1]):
  line+=[list(map(int, input().split(' ')))]
for i in range(line_b[1]):
  if num[line[i][0]-1]==0:
    num[line[i][0]-1]=line[i][1]
  elif num[line[i][0]-1]!=0 and num[line[i][0]-1]!=line[i][1]:
    num[0]=0
    i=line_b[1]
if num[0]==0 or num[0]<0 or num[1]<0 or num[2]<0:
  print(-1)
else:
  print("%d%d%d" %(num[0],num[1],num[2]))

### FIXED CODE ###

N=int(input())
def page(N):
  if N%2==1:
    N=N+1
  N=N//2
  print(N)
page(N)
n=int(input())
t=list(map(int,[input() for i in range(n)]))

def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)
def lcm(x,y):
    return x*y//gcd(x,y)

ans=lcm(t[0],t[1])
for i in range(n-1):
    ans=lcm(ans,lcm(t[i],t[i+1]))
print(ans)

### FIXED CODE ###

n=int(input())
t=list(map(int,[input() for i in range(n)]))

def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)
def lcm(x,y):
    return x*y//gcd(x,y)

if n==1:
    print(t[0])
else:
    ans=lcm(t[0],t[1])
    for i in range(n-1):
        ans=lcm(ans,lcm(t[i],t[i+1]))
    print(ans)
#スペース区切りの整数の入力
A, B = map(int, input().split())

ans = ""
if(A>B):
  for i in range(A):
    ans = ans + B
else:
  for i in range(B):
    ans = ans + A
    
    
    
print(ans)

### FIXED CODE ###

#スペース区切りの整数の入力
A, B = map(int, input().split())

ans = ""
if(A>B):
  for i in range(A):
    ans = ans + str(B)
else:
  for i in range(B):
    ans = ans + str(A)
    
    
    
print(ans)
import sys


for n in sys.stdin.readline():
    ret = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if a+b+c+d == int(n):
                        ret += 1
    print ret

### FIXED CODE ###

import sys


for n in sys.stdin:
    ret = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if a+b+c+d == int(n):
                        ret += 1
    print ret
n = int(input())
eq_count = 0
times_count = 0
for i in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        count += 1
    else:
        count = 0
    if count == 3:
        print('Yes')
        exit(0)
print('No') 

### FIXED CODE ###

n = int(input())
count = 0
times_count = 0
for i in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        count += 1
    else:
        count = 0
    if count == 3:
        times_count += 1

if times_count == 0:
    print('No')
else:
    print('Yes')