Harryxun/stf_run huggingface dataset:
import copy
n=int(input())
a=[]
for i in range(n):
  item = int(input())
  a.append(item)
count = 0
t = True
while t:
  b=[]
  for j in a:
    if j%2==0:
      b.append(j/2)
    elif j<2:
      t=False
    else:
      t=False
  if t== False:
    break
  count = coutn +1
  a=copy.deepcopy(b)
print(count)

    
        

### FIXED CODE ###

import copy
n=int(input())
a=input().split(" ")
count = 0
t=True
while t:
  b=[]
  for j in a:
    if int(j)%2 == 0:
      b.append(int(j)/2)
    elif int(j)<2:
      t=False
    else:
      t=False
  if t==False:
    break
  count = count+1
  a=copy.deepcopy(b)
print(count)
def partition(A, p, r):
    x = A[r]/10
    i = p-1
    for j in range(p, r):
        if A[j]/10 <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    i += 1
    A[i], A[r] = A[r], A[i]
    return i

def quicksort(A, p, r):
    if p<r:
        q = partition(A, p, r)
        quicksort(A, p, q-1)
        quicksort(A, q+1, r)
    return

def order(A):
    x = [0 for i in range(len(A))]
    xp = 0
    for i in range(max(A)):
        for e in A:
            if e/10 == i:
                x[xp] = e
                xp += 1
    return x

n = int(input())
x = [[] for i in range(n)]
for i in range(n):
    a, b = raw_input().split()
    x[i] = int(b)*10 + 'SHDC'.index(a)

x1 = x + []
quicksort(x1, 0, n-1)
if order(x) == order(x1):
    print 'Stable'
else:
    print 'Not stable'
for e in x1:
    print 'SHDC'[e % 10], e/10

### FIXED CODE ###

def partition(A, p, r):
    x = A[r]
    i = p-1
    for j in range(p, r):
        if A[j][0] <= x[0]:
            i += 1
            A[i], A[j] = A[j], A[i]
    i += 1
    A[i], A[r] = A[r], A[i]
    return i

def quicksort(A, p, r):
    if p<r:
        q = partition(A, p, r)
        quicksort(A, p, q-1)
        quicksort(A, q+1, r)
    return

def order(A):
    return sorted(A, key = lambda e: e[0])

n = int(input())
x = [[] for i in range(n)]
for i in range(n):
    a, b = raw_input().split()
    x[i] = (int(b), 'SHDC'.index(a))

x1 = x + []
quicksort(x1, 0, n-1)

if x1 == order(x):
    print 'Stable'
else:
    print 'Not stable'
for e in x1:
    print 'SHDC'[e[1]], e[0]
mod = 10**9+7
N,M = map(int,input().split())
S = list(map(int,input().split()))
T = list(map(int,input().split()))
dp = [[1]*(N+1) for _ in range(M+1)]
for i in range(1,N+1):
    for j in range(1,M+1):
        if S[i-1] == T[j-1]:
            dp[i][j] = (dp[i-1][j]+dp[i][j-1]) % mod
        else:
            dp[i][j] = (dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1]) % mod
print(dp[N][M])

### FIXED CODE ###

mod = 10**9+7
N,M = map(int,input().split())
S = list(map(int,input().split()))
T = list(map(int,input().split()))
dp = [[1]*(M+1) for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,M+1):
        if S[i-1] == T[j-1]:
            dp[i][j] = (dp[i-1][j]+dp[i][j-1]) % mod
        else:
            dp[i][j] = (dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1]) % mod
print(dp[N][M])
N,M = map(int,input().split())

p = [0]*M#問題の番号
s = [0]*M#結果 AC,WA

for i in range(M):
	p[i],s[i] = input().split()

cor_count = 0
pen_count = 0
AC_flag = False

if s[0] == 'AC':
	AC_flag =True
	cor_count += 1
else:
	pen_count += 1

for i in range(M-1):
	if p[i] == p[i+1]:
		if AC_flag == False:
			if s[i+1] =='AC':
				cor_count += 1
				AC_flag =True
			else:
				pen_count += 1
	else:
		AC_flag = False
		if s[i+1] =='AC':
			cor_count += 1
			AC_flag =True
		else:
			pen_count += 1


print(cor_count,pen_count)




### FIXED CODE ###


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

AC = 0
WA = 0


was = [0]*(N+1)
acs = [0]*(N+1)

for i in range(M):
	p,s = input().split()
	p = int(p)

	if s == "AC":

		if acs[p] == 0:

			AC += 1
			WA += was[p]
			acs[p] = 1
			
	else:
		was[p] += 1

print(AC,WA)
s = input()
t = input()
res = 0

if i in range(s):
  if s[i] != t[i]:
    res += 1
    
print(res)
  

### FIXED CODE ###

s = input()
t = input()
res = 0
 
for i in range(len(s)):
  if s[i] != t[i]:
    res += 1
    
print(res)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
count = - sum(A) + sum(B)
for i in range(N):
  inv = max(0, A[i] - B[i])
  
if count >= 0 and inv <= count:
  print("Yes")
else :
  print("No")

### FIXED CODE ###

X ,Y = map(int,input().split())
if X%Y == 0:
  print(-1)
else:
  print(X)
n = int(input())
bara=list(map(int,input().split()))

number=[1]
for i in range(2,):
  List.append(i)
    
for i in range n-1:
  if bara[i] != number[i]:
    count+=1

if count==2:
  print("YES")
else:
  print("NO")



### FIXED CODE ###

n = int(input())
bara=list(map(int,input().split()))
number=list(range(1,n+1))

count = 0
    
for i in range (0,n):
    if bara[i] != number[i]:
        count += 1

if count==2 or count==0:
    print("YES")
else:
    print("NO")
put()
a = input().split()
a.reverse()
print(" ".join(a))

### FIXED CODE ###

input()
a = input().split()
a.reverse()
print(" ".join(a))
n=int(input())
p=[int(input() for i in range(n)]

print(sum(p)-(max(p)/2))

### FIXED CODE ###

n=int(input())
p=[int(input()) for i in range(n)]

print(sum(p)-(max(p)//2))
import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 5 * 2)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)


### FIXED CODE ###

import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 6)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)
# ダイナミック・プログラミング(DP)

H, N = map(int, input().split())
magic_list = []

for i in range(N):
    A, B = map(int, input().split())
    magic_list.append([A, B])


dp_memo = {} # メモ化再帰
def dp_magic_2(HP):
    mp_list = []
    if HP<=0:
        return 0
    elif HP in dp_memo:
        return dp_memo[HP]
    else:
        for m in magic_list:
            mp_list.append(dp_magic_2(HP-m[0]) + m[1])
        result_mp = sorted(mp_list)[0]
        dp_memo[HP] = result_mp
        return result_mp

print(dp_magic_2(H))


### FIXED CODE ###

# ダイナミック・プログラミング
# PythonではTLEを起こしてしまう例

INF = float('inf')

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

for i in range(N):
    a_i, b_i = map(int, input().split())
    A.append(a_i)
    B.append(b_i)

dp = [[INF]*(H+1) for i in range(N+1)] # DP用配列
dp[0][0] = 0 # 初期化処理
for i in range(0,N):
    for j in range(0,H+1):
        a, b = j+A[i], H
        min_h = a
        if a>b:
            min_h = b
        a, b = dp[i+1][j], dp[i][j]
        if a>b:
            dp[i+1][j] = b
        a, b = dp[i+1][min_h], dp[i+1][j]+B[i]
        if a>b:
            dp[i+1][min_h] = b

print(dp[N][H])
# -*- coding: utf-8 -*-
import math
n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

ans = 1
dp = [0 for _ in range(n)]
if 1 in a:
    dp[0] = 0
elif not 1 in a:
    dp[0] = 1
if 2 in a:
    dp[1] = 0
elif not 2 in a:
    dp[1] = dp[0] + 1

for i in range(2, n):
    if i + 1 in a:
        dp[i] = 0
    else:
        dp[i] = dp[i - 1] + dp[i - 2]
#print(dp)
print(dp[n - 1] % (pow(10, 9) + 7))


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

if m == 0:
    dp = [0 for _ in range(n)] #i + 1段目に登る方法の数
    dp[0] = 1
    if n >= 2:
        dp[1] = 2
    for i in range(2, n):
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
    print(dp[n - 1])
    exit()

tmp = 0
dp = [0 for _ in range(n)]
if 1 == a[tmp]:
    dp[0] = 0
    tmp += 1
else:
    dp[0] = 1
if n >= 2 and tmp < m and 2 == a[tmp]:
    dp[1] = 0
    tmp += 1
elif n >= 2 and (tmp >= m or 2 != a[tmp]):
    dp[1] = dp[0] + 1

for i in range(2, n):
    if tmp < m and i + 1 == a[tmp]:
        dp[i] = 0
        tmp += 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
#print(dp)
print(dp[n - 1] % (pow(10, 9) + 7))
def get_prime(N):
    if N < 2:
        return {1}
    prime = dict()
    prime[1] = 1

    i = 2
    while i*i <= N:
        while N % i == 0:
            if i in prime.keys():
                prime[i] += 1
            else:
                prime[i] = 1
            N = N//i
        i += 1
    if N != 1:
        prime[N] = 1
    return prime


n, p = [int(i) for i in input().strip().split()]


prims = get_prime(p)

ans = 1

if n == 1:
    print(p)
    quit()

for p, cnt in prims.items():
    if cnt >= n:

        ans *= p*(cnt//n)

print(ans)

### FIXED CODE ###


def get_prime(N):
    if N < 2:
        return {1:1}
    prime = dict()
    prime[1] = 1

    i = 2
    while i*i <= N:
        while N % i == 0:
            if i in prime.keys():
                prime[i] += 1
            else:
                prime[i] = 1
            N = N//i
        i += 1
    if N != 1:
        prime[N] = 1
    return prime


n, p = [int(i) for i in input().strip().split()]


prims = get_prime(p)

ans = 1


if n == 1:
    print(p)
    quit()

for p, cnt in prims.items():
    _tmp = cnt//n
    ans *= p**(cnt//n)

print(ans)
A,B = map(int,input().split())
if (A <= 9)&(B <= 9):
    return(A*B)
else:
    return(-1)

### FIXED CODE ###

A,B = map(int,input().split())
if (A <= 9) and (B <=9):
    print(A*B)
else:
    print(-1)
a,b,c,x,y=map(int,input().split())
if 2*c<=min(a,b):
  print(2*c*max(x,y))
elif (a+b)<=2*c:
  print(a*x+b*y)
elif a>=2*c:
  print(2*c*x+b*max(y-x,0))
elif b>=2*c:
  prinr(2*c*y+a*max(x-y,0))


### FIXED CODE ###

a,b,c,x,y=map(int,input().split())
if x>y:
  ans=min(a*x+b*y,2*c*x,2*c*y+a*(x-y))
else:
  ans=min(a*x+b*y,2*c*y,2*c*x+b*(y-x))
print(ans)
A,B,C,D = map(int, input().split())
#倒せるターン
TakahashiTrun = 0
AokiTurn = 0
if(C % B != 0):
    TakahashiTurn = C / B + 1
else:
    TakahashiTrun = C / B

if(A % D != 0):
    AokiTurn = A / D + 1
else:
    AokiTurn = A / D
    
if(TakahashiTurn - 1 >= AokiTurn):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

A,B,C,D = map(int, input().split())
THP = A
AHP = C
while(True):
    #高橋のターン
    AHP -= B
    if(AHP <= 0):
        print("Yes")
        break
    #青木のターン
    THP -= D
    if(THP <= 0):
        print("No")
        break
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
lsreverse = reverse(ls)
answer = lsreverse[K-1]
print(answer)

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

A,B,K = [int(x) for x in input().split()]
ls =[i for i in range(1,A+1) if A % i == 0 and B % i == 0]
ls.reverse()
answer = ls[K-1]
print(answer)
r = int(input())
import math
print(2*r*math.pi)

### FIXED CODE ###

def solve():
    N, M = map(int, input().split())
    hws = list(map(int, input().split()))
    for i in hws:
        N -= i
        if (N<0):
            print(-1)
            return

    print(N)

solve()
a = list(map(int, input().split()))

sort(a[0], a[2])
print(a[0], a[1], a[2])

### FIXED CODE ###

num = list(map(int, input().split()))

num.sort()
print(num[0], num[1], num[2])
A,B = map(int, input().split())

ans = 0
if A >= 13:
	ans = B
elif A >= 6:
    ans = Int(B / 2)
else:
	ans = 0

print(ans)





### FIXED CODE ###

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

ans = 0
if A >= 13:
	ans = B
elif A >= 6:
    ans = int(B / 2)
else:
	ans = 0

print(ans)
#%%
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())
ans = sum(a)

if a % 2 == 0:
    print('second')
else:
    print('first')



### FIXED CODE ###

#%%
n = int(input())
a = [0] * n
flag = True
for i in range(n):
    a[i] = int(input())
    if a[i] % 2 == 1:
        flag = False

if not flag:
    print('first')
else:
    print('second')
k = input('enter:')
if k <= 0 or k >=32:
    exit()
target = [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]
print(target[k-1])

### FIXED CODE ###

k = int(input())
# if k <= 0 or k >=33:
#     exit()
target = [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]
print(target[k-1])
import math

MOD = 1000000007

def lcm(x, y):
    return x * y // math.gcd(x, y)

N = int(input())
A = [int(x) for x in input().split()]
lc = 1
for i in A:
    lc = lcm(lc, i)
ans = 0
for i in A:
    ans = (ans + lc // i) % MOD
print(ans)

### FIXED CODE ###

import fractions

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

def main():
    N = int(input())
    A = list(map(int, input().split()))
    prev_lc = 1
    ans = 0
    for i in A:
        lc = lcm(prev_lc, i)
        ans = ans * (lc // prev_lc) + lc // i
        prev_lc = lc
    print(ans % 1000000007)

if __name__ == '__main__':
    main()
l = input()
l = input().split()
l = l[1:]
 
flag = "APPROVED"
for n in l:
  if n % 2 == 0 and n%3 != 0 and n%5 != 0:
    flag = "DENIED"
    
print(flag)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))  # 入力のときに N を使う必要はありません

flag = "APPROVED"
for n in A:
  if n % 2 == 0 and n%3 != 0 and n%5 != 0:
    flag = "DENIED"
    
print(flag)
import sys
 
input = sys.stdin.readline
 
def nap(n, cap):
    val = [0] * (cap + 1)
    for _ in range(n):
        w, v = map(int, input().split())
        for wk in range(cap, w - 1, -1):
            nv = val[wk - w] + v
            if val[wk] < nv:
                val[wk] = nv
    return max(val)
 
 
n, cap = map(int, input().split())
print(nap(n, cap)

### FIXED CODE ###

def nap(n, cap):
    val = [0] * (cap + 1)
    for _ in range(n):
        w, v = map(int, input().split())
        for wk in range(cap, w - 1, -1):
            nv = val[wk - w] + v
            if val[wk] < nv:
                val[wk] = nv
    return max(val)


n, cap = map(int, input().split())
print(nap(n, cap))
n=int(input())
a=list(map(int,input().split()))
q=int(input())
sum=sum(a)
a2,a3=[],[]
for i in set(a):
    a2.append(i)
    a3.append(a.count(i))

for i in range(q):
    b,c=map(int,input().split())
    if b in a2 and c in a3:
        sum+=(c-b)*a3[a2.index(b)]
        a3[a2.index(c)]+=a3[a2.index(b)]
        a3[a2.index(b)]=0
    elif b in a2:
        a2.append(c)
        a3.append(0)
        sum+=(c-b)*a3[a2.index(b)]
        a3[a2.index(c)]+=a3[a2.index(b)]
        a3[a2.index(b)]=0
    print(sum)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
q=int(input())
sum=sum(a)

count=[0]*(10**5+1)

for i in a:
    count[i]+=1

for i in range(q):
    b,c=map(int,input().split())
    if count[b]!=0:
        sum+=(c-b)*count[b]
        count[c]+=count[b]
        count[b]=0
    print(sum)
from numpy import*
a,b=map(int,input().split())
c=["0"]*(b+2)
x=[list("0"+input().replace(".","0").replace("#","1")+"0")for i in range(a)]
x.insert(0,c)
x.append(c)
x=array(x).astype(int)
for s in range(1,1+a):
    tmp=""
    for t in range(1,1+b):
        if x[s][t]==1:
            tmp+="#"
        else:
            tmp+=str(sum(x[s-1:s+2,t-1:t+2]))
    print(tmp)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(c if a==b else b if a==c else a)
N=int(input())
import math

#hoge=[[108]]

#x=[3,5,7,11,13,17,19]
#a=[pow(2,3)*i for i in x]

x=[[5,7]]
b=[pow(3,3)*i for i in x]

#x=[5,7,11,13,17,19,23,29,31]
#c=[2*3*i for i in x]

#x=[7,11,13,17,19]
#d=[2*5*i for i in x]

#x=[11,13]
#e=[2*7*i for i in x]

x=[7,11,13]
f=[3*5*i for i in x]

b.append(f)



x=[]
for v in b:
  for item in v:
    x.append(item)


x.sort()
import numpy as np
X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
print(XX[0][0])

### FIXED CODE ###

import numpy as np
N=int(input())
x=[105, 135, 165, 189, 195]

X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
if N<195:
  print(XX[0][0])
else:
  print(5)
n, m = map(int, input().split())
list_score = []
for _ in range(m):
    list_score.append(int(input()))

dp = [0]*(n+1)
mod = pow(10, 9) + 7

dp[0] = 1
if list_score[0] == 1:
    dp[1] = 0
else:
    dp[1] = 1

for i in range(2, n+1):
    if i in list_score:
        continue
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

### FIXED CODE ###

N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print(dp[N])
import sys

sys.sys.setrecursionlimit(20000000)


a,b=[int(i) for i in input().split()]
import math
print(a*b//math.gcd(a,b))

### FIXED CODE ###

import sys
sys.setrecursionlimit(20000000)
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

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

print(a*b//gcd(a,b))
n = int(input())
a = list(map(int, input().split()))
b = list(range(n))
k = 2
s = 0
for i in range(n):
  if (n/2-1) < (n-i-1):
    b[n-i-1] = a[n-i-1]
  else:
    for j in range(2,k+1):
      s += b[j*(n-i)-1]
    if s % 2 == a[n-i-1]:
      b[n-i-1] = 0
    else:
      b[n-i-1] = 1
    k += 1
ans = b.count(1)
print(ans)
for i in range(n):
  if b[i] == 1:
    print(i+1)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = list(range(n))
k = 2
s = 0
for i in range(n):
  if (n/2-1) < (n-i-1):
    b[n-i-1] = a[n-i-1]
  else:
    while n > k*(n-i)-1:
      s += b[k*(n-i)-1]
      k += 1
    if s % 2 == a[n-i-1]:
      b[n-i-1] = 0
    else:
      b[n-i-1] = 1
  k = 2
  s = 0
ans = b.count(1)
print(ans)
for i in range(n):
  if b[i] == 1:
    print(i+1, end=" ")
from functools import reduce
from fraction import gcd
l=[int(input()) for _ in range(int(input()))]
o=reduce(lambda x,y:int(x*y/gcd(x,y)),l)
print(o)

### FIXED CODE ###

from fractions import gcd
l = [int(raw_input()) for _ in range(int(raw_input()))]
o = reduce(lambda x, y: int(x * y / gcd(x, y)), l)
print o
n=int(input())
y=int(input())
a=-1
b=-1
c=-1
for i in range(n):
  for j in range(n):
    for k in range(n):
      if n==i+j+k and 10000*i+5000*j+1000*k==y:
        a=i
        b=j
        c=k
        break

print(a b c)        

### FIXED CODE ###

n, y = (int(i) for i in input().split())  
a=-1
b=-1
c=-1
for i in range(n+1):
  for j in range(n-i+1):
      if 10000*i+5000*j+1000*(n-i-j)==y:
        a=i
        b=j
        c=n-i-j
        break

print(a ,b ,c)
from itertools import permutations
import numpy as np

def calc_distance(point):
    _point = np.array(list(point))
    x = np.diff(_point, axis=0)
    every_distance = np.linalg.norm(x, axis=1)
    all_distance = np.sum(every_distance)
    return all_distance

n = int(input())
points = [[int(v) for v in input().split(' ')] for _ in range(n)]

sum = 0
for v in permutations(points):
    sum += calc_distance(v)


print(sum / len(list(permutations(points))))


### FIXED CODE ###

from itertools import permutations
import numpy as np

def calc_distance(point):
    _point = np.array(list(point))
    x = np.diff(_point, axis=0)
    every_distance = np.linalg.norm(x, axis=1)
    all_distance = np.sum(every_distance)
    return all_distance

n = int(input())
points = [[int(v) for v in input().split(' ')] for _ in range(n)]

sum = 0
for v in permutations(points):
    sum += calc_distance(v)


print(sum / len(list(permutations(points))))
N,T = map(int,input().split())
comp = []
for i in range(N):
    nt = [int(i) for i in input().split()]
    comp.append(nt)



cost = []
for i in range(N):
    if comp[i][1] <= T:
        temp = [comp[i][0],comp[i][1]]
        cost.append(temp)
cost.sort()
print(cost[0][1])

### FIXED CODE ###

N,Y = map(int,input().split())
ct = {}
for i in range(N):
    temp = [int(i) for i in input().split()]
    if temp[1] > Y:
        pass
    else:
        ct[temp[0]] = temp[1]

if len(ct) > 0:
    ct = sorted(ct.items(),key=lambda x: x[0])
    print(ct[0][0])
else:
    print("TLE")
H,M = map(int,input().split())
if H == 1 or M ==1 :
    print(1)
else :
    prnt(round((H*M)/2))

### FIXED CODE ###

import math
H,M = map(int,input().split())
if H == 1 or M ==1 :
    print(1)
else :
    print(math.ceil((H*M)/2))
a = int(input())
if a%2=0:
  print(a/2)
else:
  print((a+1)/2)

### FIXED CODE ###

a = int(input())
if a%2==0:
  print(int(a/2))
else:
  print(int((a+1)/2))
N_M = list(map(int, input().split()))
Lock_min = []
Lock_max = []
for i in range(N_M[1]):
    ADD = list(map(int,input().split()))
    Lock_min.append(ADD[0])
    Lock_max.append(ADD[1])
if min(Lock_max) - max(Lock_min) >= 1:
        print(min(Lock_max) - max(Lock_min))
 else:
        print(0)

### FIXED CODE ###

N,M = map(int,input().split())
L = [0]*M
R = [0]*M
for i in range(M):
  l,r = map(int,input().split())
  L[i] = l
  R[i] = r
if min(R)-max(L) >= 0:
  print(min(R)-max(L)+1)
else:
  print(0)
n = int(input())
ans = 0
for i in range(1, n)
    ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1, n+1):
    ans += i
print(ans)
a, b, x = map(int, input().split())
if a%x == 0:
  print(b//x-a//x+1)
else:
  print(b//x-a//x)

### FIXED CODE ###

A, B, C = input().split()
print("A"+B[0]+"C")
print(sum((j:=i+1)(x:=n//j)*(x+1)*i//2for i in range(n:=int(input()))))

### FIXED CODE ###

n=int(input());print(sum((x:=n//i)*(x+1)*i//2 for i in range(1,n+1)))
import math

num_list = input().split()

print(math.ceil(int(num_list[0]) / int(num_list[1])) * int(num_list[2])

### FIXED CODE ###

import math

num_list = input().split(" ")

print(math.ceil(int(num_list[0]) / int(num_list[1])) * int(num_list[2]))
def f(A):
  for i in range(N):
    if A[i]==max_val:
      n=i
    else:
      pass
   
  return n
n=f(A)
l=[max_val]*N
A.pop(n)
second_max=max(A)
l[n]=second_max

for i in range(N):
  print(l[i])
   

### FIXED CODE ###

N=int(input())
A=[int(input()) for i in range(N)]
max_val=max(A)

def f(A):
  for i in range(N):
    if A[i]==max_val:
      n=i
    else:
      pass
   
  return n
n=f(A)
l=[max_val]*N
A.pop(n)
second_max=max(A)
l[n]=second_max

for i in range(N):
  print(l[i])
s = input()
st = []
for e in s:
  if e == 'B' and len(st) != 0:
    st.pop()
  else:
    st.append(int(e))
print(''.join(map(str,st)))


### FIXED CODE ###

s = input()
st = []
for e in s:
  if e == 'B':
    if len(st) != 0:
      st.pop()
  else:
    st.append(int(e))
print(''.join(map(str,st)))
#ABC132 B

n = int(input())
K = 0
for i in range(n-2):
    if (P[i]<P[i+1] and P[i+1] < P[i+2]) or (P[i+2]<P[i+1] and P[i+1]<P[i]):
        K += 1
        
print(K)

### FIXED CODE ###

#ABC132 B

n = int(input())
P = list(map(int,input().split()))
K = 0
for i in range(n-2):
    if (P[i] < P[i+1] and P[i+1] < P[i+2]) or (P[i+2] < P[i+1] and P[i+1] < P[i]):
        K += 1
        
print(K)