Harryxun/stf_run huggingface dataset:
N_input = int(input())
t_input = []
x_input = []
y_input = []

for _ in range(N_input):
    t, x, y = map(int, input().split())
    t_input.append(t)
    x_input.append(x)
    y_input.append(y)


def can_reach(t_now, n_now, x_now, y_now): # 残り時間で到達不可能な距離でないかチェック
    distance = abs(x_input[n_now] - x_now) + abs(y_input[n_now] - y_now)
    if distance <= t_input[n_now] - t_now and (distance + (t_input[n_now] - t_now))%2 == 0: # 到達可能圏内かつ距離と残り時間の偶奇が一致
        return True
    else:
        return False

def rest_travel(t_now, n_now, x_now, y_now): # 現在時刻t、通過済チェックポイント数n、現在位置x, y
    if t_now == max(t_input): # ゴール
        print("Yes")
        exit()
    elif can_reach(t_now, n_now, x_now, y_now):
        if t_input[n_now] == t_now+1: # 次の移動で目標地点に到着している必要あり
            rest_travel(t_now+1, n_now+1, x_input[n_now], y_input[n_now])
        else: # ゴールしておらず、次の移動で目標地点に到着している必要がない
            rest_travel(t_now+1, n_now, x_now+1, y_now)
            rest_travel(t_now+1, n_now, x_now, y_now+1)
            rest_travel(t_now+1, n_now, x_now-1, y_now)
            rest_travel(t_now+1, n_now, x_now, y_now-1)
    else: # 到達不可
        return

rest_travel(0,0,0,0)
print("No")

### FIXED CODE ###

N = int(input())

t_b = x_b = y_b = 0 # 直前の時刻と位置保存用

def dist(x, x_b, y, y_b):
    return abs(x-x_b) + abs(y-y_b)

miss_flg = 0

for i in range(N):
    t, x, y = map(int, input().split())
    if dist(x, x_b, y, y_b) > t - t_b or ((t - t_b) + dist(x, x_b, y, y_b))% 2 == 1: # 到達不能もしくは距離と残り時間の偶奇が不一致
        miss_flg = 1
    t_b, x_b, y_b = t, x, y

print("Yes" if miss_flg == 0 else "No")
N,K = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
h = sorted(h)
tmp = 0
ans = 1000000000
loop = min(K+1,N-K+1)
for i in range(loop+1):
    tmp = h[K+i-1] - h[0+i]
    if(tmp < ans):
        ans = tmp
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
h = sorted(h)
tmp = 0
ans = 10000000000
loop = N-K+1
for i in range(loop):
    tmp = h[K+i-1] - h[0+i]
    if(tmp < ans):
        ans = tmp
print(ans)
s1,s2,s3 = map(int,input().split())

check = s1+s2+s3
if print(check)

### FIXED CODE ###

x = str(input())
a =int(x[0])
b=int(x[1])
c=int(x[2])


print(a+b+c)
n=int(input())
p=list(map(int,input().split()))

c=0
for i in range(1,n-1):
  if (p[i-1]<p[i]<p[i+1]) or  (p[i-1]>p[i]>p[i+1]):
    c=c+1

print(c)

### FIXED CODE ###

S=input()

if len(S)!=4:
  print('No')
else:  
  Sorted_S = sorted(S)
  
  L1=Sorted_S[0]
  L2=Sorted_S[1]
  L3=Sorted_S[2]
  L4=Sorted_S[3]

  if (L1==L2) and (L3==L4) and (L2!=L3):
    print("Yes")
  else:
    print("No")
import math

def read_input():
    n = int(input())

    ratios = []
    for i in range(n):
        t, a = map(int, input().split())
        ratios.append((t, a))

    return n, ratios


def get_votes(ex_votes, ratio):
    base = max(math.ceil(ex_votes[0]/ratio[0]), math.ceil(ex_votes[1]/ratio[1]))
    return (base * ratio[0], base * ratio[1])


def submit():
    n, ratios = read_input()

    votes = ratios[1]
    for ratio in ratios[1:]:
        votes = get_votes(votes, ratio)

    print(sum(votes))


if __name__ == '__main__':
    submit()

### FIXED CODE ###

import math


def read_input():
    n = int(input())

    ratios = []
    for i in range(n):
        t, a = map(int, input().split())
        ratios.append((t, a))

    return n, ratios


def get_votes(ex_votes, ratio):
    def check_votes(a, b):
        return a[0] <= b[0] and a[1] <= b[1]

    def div_ceil(a, b):
        if a % b == 0:
            return a //b
        else:
            return a // b + 1

    base = div_ceil(sum(ex_votes), (ratio[0] + ratio[1]))
    base = int(base)
    while True:
        test_votes = (ratio[0] * base, ratio[1] * base)
        if check_votes(ex_votes, test_votes):
            return test_votes
        else:
            diff_votes = (test_votes[0] - ex_votes[0], test_votes[1] - ex_votes[1])
            if diff_votes[0]/ratio[0] < diff_votes[1]/ratio[1]:
                base += div_ceil(-diff_votes[0], ratio[0])
            else:
                base += div_ceil(-diff_votes[1], ratio[1])
            base = int(base)


def submit():
    n, ratios = read_input()

    votes = ratios[0]
    for ratio in ratios[1:]:
        votes = get_votes(votes, ratio)

    print(sum(votes))


if __name__ == '__main__':
    submit()
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

from collections import deque
n,m,k=mi()
a=deque(lmi())
b=deque(lmi())
i=0
cnt=0
value=0
while a or b:
  try:
    r=a[i]
  except:
    r=float('inf')
  try:
    q=b[i]
  except:
    q=float('inf')
  if q==r:
    if a[1]<b[1]:
      p=a.popleft()
    elif a[1]>b[1]:
      p=b.popleft()
  else:
    p=min(q,r)
    if p==r:
      p=a.popleft()
    else:
      p=b.popleft()
    
  print(p)
  
  value+=p
  if value>k:
    break
  elif value==k:
    cnt+=1
    break
  cnt+=1
  
  
  
print(cnt)

### FIXED CODE ###

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
ruiseki_A = [0]
ruiseki_B = [0]
 
for i in range(len(A)):
    ruiseki_A.append(ruiseki_A[i]+A[i])
for i in range(len(B)):
    ruiseki_B.append(ruiseki_B[i]+B[i])
#print(ruiseki_A)
 
ans = 0
for i in range(len(ruiseki_A)):
    tmp = K - ruiseki_A[i]
    if tmp < 0:
        continue
    r = len(ruiseki_B)
    l = 0
    while r-l > 1:
        mid = (r + l) // 2
        if ruiseki_B[mid] <= tmp:
            l = mid
        else:
            r = mid
    ans = max(ans, i+l)
 
print(ans)
N = input()
a = map(int, raw_input().split())

if max(a)-min(a)>=2:
  exit(-1)
  print "No"
elif max(a)-min(a)==0:
  exit(-1)
  if N>=2*a[0] or N==a[0]+1:
    print "Yes"
  else:
    print "No"
else:
  if a.count(max(a))>=2 and a.count(min(a))==min(a):
    print "Yes"
  else:
    print "No"


### FIXED CODE ###

N = input()
a = map(int, raw_input().split())

if max(a)-min(a)>=2:
  print "No"
elif max(a)-min(a)==0:
  if N>=2*a[0] or N==a[0]+1:
    print "Yes"
  else:
    print "No"
else:
  cn = max(a)-a.count(min(a))
  if a.count(max(a))>=2 and cn>0 and N>=a.count(min(a))+2*cn:
    print "Yes"
  else:
    print "No"
N=int(input())
P=list(map(int,input().split()))
import numpy
Q=numpy.array(P)
 
result =numpy.prod(Q)
 
if result>pow(10, 18):
    print('-1')
else:
    print(str(result))

### FIXED CODE ###

a,b=input().split()
from decimal import Decimal
f1 = Decimal(a)
f2 = Decimal(b)
print(int(f1 * f2))
k=int(input())
s=input()
 print(s[:k] + (len(s)>k)*'...')

### FIXED CODE ###

k=int(input())
s=input()
print(s[:k] + (len(s)>k)*'...')
s = input()
k = int(input())

x = 0
ans1 = []
while True:
    if s[x] == '1':
        ans1.append(x+1)
        x += 1
    else:
        break

if k in ans1:
    print('1')
else:
    print(s[x])

### FIXED CODE ###

s = input()
k = int(input())

x = 0
ans1 = []
for x in range(len(s)):
    if s[x] == '1':
        ans1.append(x+1)
        x += 1
    else:
        break

if k in ans1:
    print('1')
else:
    print(s[x])
n,a,b,c,d,e=[int(input()) for i in range(6)]
dist=[n,0,0,0,0,0]
move=[a,b,c,d,e,0]
t=0
for while dist[5]<n:
  dist_t=[max(0,dist[0]-move[0])]
  for j in range(1,6):
    dist_t.append(max(0,dist[j]-move[j])+min(dist[j-1],move[j-1]))
  t=t+1
  dist=dist_t
print(t)
    


### FIXED CODE ###

n=int(input())
A=[int(input()) for i in range(5)]
print(5+(n-1)//min(A))
import.math
A, B, H, M = map(int, input.split())
sita = (H*30+M*0.5)-(M*6)
if (sita > 180):
  Sita = 360 - sita
elif (0 > sita >= -180):
  Sita = sita * -1
elif (-180 > sita > -360):
  Sita = sita + 360
elif (0 <= sita <= 180):
  Sita = sita
print((A**2+B**2-2*A*B*(math.cos(math.radians(Sita))))**0.5)

### FIXED CODE ###

def resolve():
    import math
    A, B, H, M = map(int, input().split())
    sita = abs(H*30+M*0.5-M*6)
    if sita > 180:
        sita = 360 - sita
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(sita))))
resolve()
import numpy as np
import fractions

N = int(input())
A = np.array([int(i) for i in (input()).split(" ")])
minA = np.min(A)

if(minA == np.max(A)):
    print(minA)
else:
    check = np.unique(minA // np.arange(1,minA))
    #check = minA // np.arange(1,minA)
    for i in check[::-1]:
        #全てのAに対してiで割り切れるか＝最大公約数
        #iで割り切れた数＝len(A)-1なら，残りの数にiをかけて最大公約数に出来る．
        num = np.sum((A % i>0))
        if(num < 2):
            j = A[np.where(A % i>0)][0]
            #print(i,j,i*j//math.gcd(i,j))
            if(i*j//fractions.gcd(i,j) < 10**9):
                print(i)
                break

### FIXED CODE ###

import numpy as np
import fractions

N = int(input())
A = np.array([int(i) for i in (input()).split(" ")])

maxA = np.max(A)


if(maxA == np.min(A)):
    print(maxA)
elif(N==2):
    print(maxA)
else:
    R=np.zeros((N))
    L=np.zeros((N))
    M=np.zeros((N))

    L[0] = 0
    R[N-1] = 0
    for i in range(1,N):
        #0~i-1番目までの最大公約数
        L[i] = fractions.gcd(A[i-1],L[i-1])
        #i~N番
        R[N-1-i] = fractions.gcd(A[N-1-i+1],R[N-1-i+1])

    M[0] = R[0]
    M[-1] = L[-1]
    for i in range(1,N-1):
        M[i] = fractions.gcd(L[i],R[i])

    print("{}".format(int(np.max(M))))
result = "{}{}".format(T, S)

print(result)

### FIXED CODE ###

S, T = input().split()

result = T + S

print(result)
X Y Z = list(map(int,input().split()))

print(li[2] + " " + li[0] + " " + li[1])

### FIXED CODE ###

x, y, z = map(str, input().split())
print(z + " " + x + " " + y)
S,T=map(input().split())
A,B=map(int,input().split())
U=input()

if S==U:
    print(A-1,B)
if S==T:
    print(A,B-1)

### FIXED CODE ###

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

if S==U:
    print(A-1,B)
if T==U:
    print(A,B-1)
N = int(input())
A = list(map(int, input().split()))

ans = float('inf') 
sum_A = sum(A)
CumSum = 0


for i in range(N-1):
  CumSum = CumSum + A[i]
  ans = min(ans,(abs((sum_A - CumSum)-(CumSum))))

print(ans)


### FIXED CODE ###

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

trd = 100000
srd = 200000
onrd = 300000

if X == 3 and 3 < Y:
    print(trd)
elif X == 2 and 3 < Y:
    print(srd)
elif X == 1 and 3 < Y:
    print(onrd)
elif Y == 3 and 3 < X:
    print(trd)
elif Y == 2 and 3 < X:
    print(srd)  
elif Y == 1 and 3 < X:
    print(onrd)
elif X == 3 and Y == 3:
    print((trd)+(trd))
elif X == 3 and Y == 2:
    print((trd) +(srd))
elif X == 3 and Y == 1:
    print((trd)+(onrd))
elif X == 2 and Y == 3:
    print((srd)+(trd))
elif X == 2 and Y == 2:
    print((srd)+(srd))
elif X == 2 and Y == 1:
    print((srd)+(onrd))
elif X == 1 and Y == 3:
    print((onrd)+(trd))
elif X == 1 and Y == 2:
    print((onrd) + (srd))
elif X == 1 and Y == 1:
    print((onrd)+(onrd) + 400000)
else:
    print(0)
if a>=b:
    k=a
    a=a-1
else:
    k=b
    b=b-1

if a>=b:
    k=k+a
else:
    k=k+b

print(k)

### FIXED CODE ###

a, b= (int(i) for i in input().split())  

if a>=b:
    k=a
    a=a-1
else:
    k=b
    b=b-1

if a>=b:
    k=k+a
else:
    k=k+b

print(k)
N, x = map(int, input().split())
if x == 1 or x == 2*N-1:
    print('No')
    exit()
print('Yes')
ans = None
if x+2 <= 2*N-1:
    ans = list(range(1, x-1)) + list(range(x+3, 2*N))
    ans = ans[:N-3] + [x+2, x-1, x, x+1] + ans[N-3:]
elif x-2 >= 1:
    ans = list(range(1, x-2)) + list(range(x+2, 2*N))
    ans = ans[:N-3] + [x-2, x+1, x, x-1] + ans[N-3:]
for i in ans:
    print(i)



### FIXED CODE ###

N, x = map(int, input().split())
if x == 1 or x == 2*N-1:
    print('No')
    exit()
print('Yes')
ans = None
if N == 2:
    ans = [1, 2, 3]
elif x+2 <= 2*N-1:
    ans = list(range(1, x-1)) + list(range(x+3, 2*N))
    ans = ans[:N-3] + [x+2, x-1, x, x+1] + ans[N-3:]
else:
    ans = list(range(1, x-2)) + list(range(x+2, 2*N))
    ans = ans[:N-3] + [x-2, x+1, x, x-1] + ans[N-3:]
for i in ans:
    print(i)
n, m ,d = map(int, input().split())
ans = 0for i in range(1,m):
if d == 0:
	ans = m/n
else:
	ans = m*2*(n-d)/n**2
print(ans)

### FIXED CODE ###

n, m ,d = map(int, input().split())
ans = 0
if d == 0:
	ans = (m-1)/n
else:
	ans = (m-1)*2*(n-d)/n**2
print(ans)
import sys
input = sys.stdin.readline
import math
import numpy as np

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

a = np.array(a)
a = a // 2

import fractions
from functools import reduce

def getLCM(a, b):
    return a * b // math.gcd(a, b)

def f(x):
    cnt = 0
    while x%2 == 0:
        x //= 2
        cnt += 1
    return cnt

cnt = f(a[0])
for i in range(1, len(a)):
    if cnt != f(a[i]):
        print(0)
        break
else:
    lcm = reduce(lambda x, y: getLCM(x, y), a)
    ans = (m-lcm) // (lcm*2) + 1 if m >= lcm else 0
    print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

a = [ai >> 1 for ai in a]

import fractions
from functools import reduce

def getLCM(a, b):
    return a * b // fractions.gcd(a, b)

def f(x):
    cnt = 0
    while x%2 == 0:
        x //= 2
        cnt += 1
    return cnt

cnt = f(a[0])
for i in range(1, len(a)):
    if cnt != f(a[i]):
        print(0)
        break
else:
    lcm = reduce(lambda x, y: getLCM(x, y), a)
    ans = (m-lcm) // (lcm*2) + 1 if m >= lcm else 0
    print(ans)
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

mod=10**9+7
N,K=map(int,input().split())
for i in range(1,K+1):
    print(int(cmb(N+1-K,i)*cmb(K-1,i-1))%mod)


### FIXED CODE ###

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

mod=10**9+7
N,K=map(int,input().split())
C=make_comb_dp(N)
for i in range(1,K+1):
    print(int(C[N+1-K][i]*C[K-1][i-1])%mod)
import math
S = input()
K = int(input())
i = 0
while True:
    if S[i] == '1':
        if K == 1:
            break
        else:
            K-=1
            i+=1
    else:
        d = int(math.log(int(S[i]))*5*10**15)
        if d<K:K-=d
        else:break
        i += 1
print(S[i])

### FIXED CODE ###

S = input()
K = int(input())
i = 0
while True:
    if S[i] == '1':
        if K == 1:
            break
        else:
            K-=1
            i+=1
    else:
        break
print(S[i])
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


import numpy as np

N = read_a_int()
A = np.array(read_ints())


def gcd(a, b):
    while (b != 0):
        tmp = a
        a = b
        b = tmp % b

    return a


import math


def is_prime(n):
    if n == 1:
        return True

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


gcd_tmp = A[0]
for a in A[1:]:
    gcd_tmp = gcd(gcd_tmp, a)

A_gcd = A//gcd_tmp

# delidx = None
for i, a in enumerate(A_gcd):
    if is_prime(a):
        delidx = i
        break


ans = A[delidx-1]
for i, a in enumerate(A):
    if i == delidx:
        continue
    ans = gcd(ans, a)

print(ans)


### FIXED CODE ###

# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()
A = read_ints()

from fractions import gcd
# 累積GCDを使って解く
# 累積の概念は広く使えるxor,min,max,積等...
# 差ではなく左右から挟み込んで演算という概念をしっかりと身につけよう

left = []
right = []
tmp_fo = 0
tmp_re = 0
for fo, re in zip(A, A[::-1]):
    tmp_fo = gcd(tmp_fo, fo)
    tmp_re = gcd(tmp_re, re)
    left.append(tmp_fo)
    right.append(tmp_re)

right = right[::-1]

ans = 0
for i in range(1, N-1):
    ans = max(ans, gcd(left[i - 1], right[i + 1]))

ans = max(ans, right[1], left[-2])

print(ans)
n=int(input())
for i in range(0,9):
  if n%i==0:
    if n/i>=1 and n/i<=9:
      print("Yes")
      break
else:
  print("No")


### FIXED CODE ###

n=int(input())
for i in range(1,10):
  if n%i==0:
    if n/i>=1 and n/i<=9:
      print("Yes")
      break
else:
  print("No")
inr = lambda: list(map(int, input().split()))

N, Y = inr()

lmn = [[-1, -1, -1]]

for x in range(N+1):
    flag = 0
    Y_rem = Y - x * 10000
    N_rem = N - x

    if Y_rem >= 0 and N_rem >= 0:
        flag = 1

    if flag = 1:
        for y in range(N_rem+1):
            flag_2  = 0
            Y_rem_2 = Y_rem - y * 5000
            z       = N_rem - y
            if Y_rem_2 >= 0 and z >= 0:
                flag_2 = 1
            if Y_rem_2 == z *1000 and flag_2 == 1:
                lmn.append([x, y, z])
print(lmn[1][0],lmn[1][1],lmn[1][2])

### FIXED CODE ###

inr = lambda: list(map(int, input().split()))

N, Y = inr()

lmn = [-1, -1, -1]

for x in range(N+1):
    for y in range(N-x+1):
        z = N - x - y
        oto_sum = 10000 * x + 5000 * y + 1000 * z
        if z >= 0 and oto_sum == Y:
            print(x, y, z)
            exit()

print(-1, -1, -1)
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if (i**5)-(t**5)==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

### FIXED CODE ###

X=int(input())
l=[]
for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
for j in l:
    for s in l:
        if j-s==X and j!=s:
            ans=[]
            for i in [j,s]:
                aaa=abs(i)**(1/5)
                if i>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
            print(*ans)
            exit()
import heapq

N, M = map(int, input().split())
works = [[] for _ in range(M+1)]
for _ in range(N):
  day, reward = map(int, input().split())
  works[day].append(reward)
hp = []
ans = 0
for day in range(1, M+1):
  if len(works[day]) > 0:
    for reward in works[day]:
      heapq.heappush(hp, -reward)
  if len(hp) > 0:
    ans += -heapq.heappop(hp)
print(ans)


### FIXED CODE ###

import heapq

MAX = 10**5+1
N, M = map(int, input().split())
works = [[] for _ in range(MAX)]
for _ in range(N):
  day, reward = map(int, input().split())
  works[day].append(reward)
hp = []
ans = 0
for day in range(1, M+1):
  if len(works[day]) > 0:
    for reward in works[day]:
      heapq.heappush(hp, -reward)
  if len(hp) > 0:
    ans += -heapq.heappop(hp)
print(ans)
def bisect_left_reverse(a, x):
    '''
    reverseにソートされたlist aに対してxを挿入できるidxを返す。
    xが存在する場合には一番左側のidxとなる。
    '''
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok
 
n = int(input())
li = [int(input()) for i in range(n)]
 
tmp = [li[0]]
minli = li[0]
 
for i in range(1,n):
    if li[i] <= minli:
        minli = li[i]
        tmp.append(li[i])
    else:
        idx = bisect_left_reverse(tmp,li[i])
        tmp[idx] = li[i]
 
print(len(tmp))

### FIXED CODE ###

import bisect
# from collections import deque
# from collections import Counter
# from fractions import gcd # >=Python3.5 # lcm（最小公倍数） = (a*b)//gcd(a,b)
# from fractions import Fraction
# from math import gcd # <Python3.5
# from math import sqrt
 
n = int(input())
li = [int(input()) for i in range(n)]
li = [-x for x in li]

X = []
X.append(li[0])

for i in range(1,n):
    idx = bisect.bisect_right(X,li[i])
    if idx==len(X):
        X.append(li[i])
    else:
        X[idx] = li[i]

print(len(X))
#79
n=list(input())
if (n[0]n[1]n[2] or n[0]n[2]n[3] or n[0]n[1]n[3] or n[1]n[2]n[3]):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

#79
n=list(input())
if (n[0]==n[1]==n[2] or n[1]==n[2]==n[3]):
    print('Yes')
else:
    print('No')
def f(x):
    return len(x) % 2 == 0 and x[:len(x)/2] == x[len(x)/2:]

x=input()
while not f(x):
    x=x[:-1]

print(len(x))

### FIXED CODE ###

def f(x):
    return len(x) % 2 == 0 and x[:len(x)//2] == x[len(x)//2:]
 
x=input()[:-1]
while not f(x):
    x=x[:-1]
 
print(len(x))
K = int(input())
if K%2 == 0:
  print((K/2)**2)
else:
  print((K-1)(K+1)/4)
  

### FIXED CODE ###

K = int(input())
if K%2 == 0:
  print(int((K/2)**2))
else:
  print(int((K-1)*(K+1)/4))
print([1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51][int(input())])

### FIXED CODE ###

print([1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51][int(input()) - 1])
import sys 

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


if N == 1:
    print(A[0])
    sys.exit()

mae = []
usiro = []

#0の時に前 1の時に後ろ
Flag = 0

for i in reversed(range(0,N,1)):
    
    if Flag == 0: # 前の時
        mae.append(str(A[i]))
        mae.append(" ")
        Flag = 1
    else:
        usiro.insert(0,str(A[i]))
        #usiro.insert(0,str(" "))
        Flag = 0

moziretu = (mae + usiro)
#del moziretu[((len(moziretu))//2)]
moziretu = ''.join(moziretu)
print(moziretu)
  
  




### FIXED CODE ###

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

a_b = a+b
a_c = a+c
b_c = b+c

print(min(a_b,a_c,b_c))
a,p=map(int,input().split())
print((a*3+p)//2))

### FIXED CODE ###

A, P = map(int, input().split())
print((A*3+P)//2)
N,M=map(int,input().split())
L=list(map(int,input().split()))
X=sum(L)
if N-X<0:
  print(-1)
else:
  print(N-X)

### FIXED CODE ###

R=int(input())
print(R*2*3.14)