Harryxun/stf_run huggingface dataset:
import math
from functools import reduce
n=3
a=[12,15,18]
def gcd(*numbers):
    return reduce(math.gcd,numbers)
A=gcd(*a)
for i in range(n):
    c=a[i]
    del a[i]
    B=gcd(*a)
    if A<B:
        A=B
    else:
        A=A
    a.insert(i,c)
print(A)

### FIXED CODE ###

import fractions 
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
sna=a[n-1]
Ans=[ans]*n
Sna=[sna]*n
for j in range(1,n):
  ans=fractions.gcd(ans,a[j])
  Ans[j]=ans
  sna=fractions.gcd(sna,a[n-j-1])
  Sna[j]=sna
m=Sna[n-2]
for k in range(n-2):
  m=max(m,fractions.gcd(Ans[k],Sna[n-3-k]))
m=max(m,Ans[n-2])
print(m)
A,B=map(int,input().split())
if 1<=A<=B<=100:
    A_a=A+1
    B_b=B+1
    A_1=A*(100/8)
    B_1=B*(100/10)
    A_1a=A_a*(100/8)
    B_1b=B_b*(100/10)
    if (A_1<B_1b)and(B_1<A_1a):
        if A_1<B_1:
            A_2=int(A_1)
            print(A_2)
        else:
            B_2=int(B_1)
            print(B_2)
    else:
        print(-1)
else:
    None

### FIXED CODE ###

S=input()
S=str(S)
if "AAA" in S:
    print("No")
elif "BBB" in S:
    print("No")
else:
    print("Yes")
NM = input().split(" ")
N = int(NM[0])
M = int(NM[1])

Xin= input().split(" ")


Xls = []
tousa = []
for i in range(0,M):
    Xls.append(int(Xin[i]))

Xls.sort()

for i in range(0,M-1):
    tousa.append(abs(Xls[i+1] - Xls[i]))

if M == 1:
    print(0)
    exit()

tousa.sort()
for i in range(0,N-1):
    tousa.pop()

ret = 0

for i in tousa:
    ret = i + ret

print(ret)


### FIXED CODE ###

NM = input().split(" ")
N = int(NM[0])
M = int(NM[1])

Xin= input().split(" ")


Xls = []
tousa = []
for i in range(0,M):
    Xls.append(int(Xin[i]))

Xls.sort()

if M != 1:
    for i in range(0,M-1):
        tousa.append(abs(Xls[i+1] - Xls[i]))




tousa.sort()


if N<M:
    for i in range(0,N-1):
        tousa.pop()
else:
    print(0)
    exit()
ret = 0

for i in tousa:
    ret = i + ret

print(ret)
print("".join(map(lambda x: "x", list(input().strip()))


### FIXED CODE ###

print("".join(map(lambda x: "x", list(input().strip()))))
N,K = map(int, input().split())

min = 10**18+1
flag = True

while flag==True:
  N = abs(N-K)
  if N < min: min = N
  else: flag == False
    
return min

### FIXED CODE ###

n,k = map(int, input().split())

print(min(n%k, abs(n%k-k)))
import sys
while 1:
    H,W = sys.stdin.readline().split()
    if H == 0 and W == 0:
        break
    print(('#' * W + '\n')*H)

### FIXED CODE ###

import sys
while 1:
    H,W = map(int,sys.stdin.readline().split())
    if H == W == 0:
        break
    print(('#'*W + '\n')*H)
nums=[int(i) for i in input()]
ops=[1,-1]
for op1 in ops:
  for op2 in ops:
    for op3 in ops:
      if nums[0]+op1*nums[1]+op2*nums[2]+op3*nums[3]==7:
        ans=''+str(nums[0])
        ans+='+' if op1==1 else '-'
        ans+=str(nums[1])
        ans+='+' if op2==1 else '-'
        ans+=str(nums[2])
        ans+='+' if op3==1 else '-'
        ans+=nums[3]
print(ans)

### FIXED CODE ###

n=[int(i) for i in list(input())]
op=[1,-1]
ans=[]
for op1 in op:
	for op2 in op:
		for op3 in op:
			if n[0]+op1*n[1]+op2*n[2]+op3*n[3]==7:
				ans=[op1,op2,op3]
out=''
for i in range(3):
	out+=str(n[i])
	out+='+' if ans[i]==1 else '-'
print(out+str(n[3])+'=7')
import heapq
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
asort,bsort,csort = sorted(A,reverse=True),sorted(B,reverse=True),sorted(C,reverse=True)
already = set((0,0,0))
print(asort[0] + bsort[0] + csort[0])
x,y,z = 0,0,0
check = []
for k in range(K - 1):
    if (x + 1,y,z) not in already and x + 1 < X:
        already.add((x + 1,y,z))
        heapq.heappush(check,(-(asort[x + 1] + bsort[y] + csort[z]),x + 1,y,z))
    if (x,y + 1,z) not in already and y + 1 < Y:
        already.add((x,y + 1,z))
        heapq.heappush(check,(-(asort[x] + bsort[y + 1] + csort[z]),x,y + 1,z))
    if (x,y,z + 1) not in already and z + 1 < Z:
        already.add((x,y,z + 1))
        heapq.heappush(check,(-(asort[x] + bsort[y] + csort[z + 1]),x,y,z + 1))
    maxsum = heapq.heappop(check)
    print(-maxsum[0])
    x,y,z = maxsum[1],maxsum[2],maxsum[3]

### FIXED CODE ###

n = int(input())
move = [int(input()) for i in range(5)]
div,mod = divmod(n,min(move))
if mod == 0:
    print(div + 4)
else:print(div + 5)
N = list(map(int, input().split()))
S = N%4

if S == 0:
    print("Yes")
elif S == 3:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())

if N%4 == 0:
    print("Yes")

if N%4 == 1:
    if N < 21:
        print("No")
    else:
        print("Yes")

if N%4 == 2:
    if N < 14:
        print("No")
    else:
        print("Yes")


if N%4 == 3:
    if N < 7:
        print("No")
    else:
        print("Yes")
n = int(input())
*A, = map(int, input().split())

C = {a:0 for a in A}

for a in A:
    C[a] = C[a]+1

maxA = max(A)

D = {a:0 for a in A}

for a in A:
    t = 2
    while a*t <= maxA:
        D[a*t] += 1
        t = t+1

counter = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        counter = counter+1
        
print(counter)

### FIXED CODE ###

n = int(input())
*A, = map(int, input().split())
maxA = max(A)
# C[a] = A内のaの個数
C = {a: 0 for a in A}
for a in A:
    C[a] += 1
# D[a]=1: Aにaより小さいaの約数が存在する
D = {a: 0 for a in A}
for a in A:
    if C[a] > 0:
        t = 2
        while a * t <= maxA:
            D[a * t] = 1
            t += 1
ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1
print(ans)
X, N = map(int, input().split())
p_list = list(map(int, input().split()))
all_list = range(1, 101)

not_p_list = list(set(all_list)-set(p_list))
ans_list = []

for i in not_p_list:
    j = abs(i - X)
    ans_list.append(j)

# print(ans_list)

ans = min(ans_list)
minus_ans = -1 * ans

print(ans, minus_ans)

if (minus_ans + X) in not_p_list:
    print(minus_ans + X)
else:
    print(ans + X)


### FIXED CODE ###

X, N = map(int, input().split())
p_list = list(map(int, input().split()))
all_list = range(0, 151)

not_p_list = list(set(all_list)-set(p_list))
ans_list = []

if N == 0:
    print(X)
else:
    for i in not_p_list:
        j = abs(i - X)
        ans_list.append(j)

    # print(ans_list)

    ans = min(ans_list)
    minus_ans = -1 * ans

    #print(ans, minus_ans)

    if (minus_ans + X) in not_p_list:
        print(minus_ans + X)
    else:
        print(ans + X)
val = input().split(" ")
A = int(val[0])
B = int(val[1])
K = int(val[2])

arr1 = [i for i in range(1,A + 1) if A % i == 0]
arr2 = [j for j in range(1,B + 1) if A % j == 0]

result = list(set(arr1) & set(arr2))
result.sort()

print(result[k - 1])

### FIXED CODE ###

val = input().split(" ")
A = int(val[0])
B = int(val[1])
K = int(val[2])
 
arr1 = [i for i in range(1,A + 1) if A % i == 0]
arr2 = [j for j in range(1,B + 1) if B % j == 0]
 
result = list(set(arr1) & set(arr2))
result.sort(reverse=True)
print(result[K - 1])
import numpy as np
import math
N = int(input())
print(math.floor(np.sqrt(N))**2)

### FIXED CODE ###

import numpy as np
import math
N = int(input())
print(math.floor(np.sqrt(N))**2)
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

N, X = map(int, input().split())
nums = list(map(int, input().split()))
nums.append(X)
nums.sort()
dists = []

for i in range(N):
    dist = nums[i + 1] - nums[i]
    dists.append(dist)
    
D = gcd(*dists)

print(D)

### FIXED CODE ###

from fractions import gcd
from functools import reduce
n,x = map(int,input().split())
 
l=list(map(int,input().split()))
l=list(map(lambda i: abs(i-x),l))
 
x = reduce(gcd,l)
print(x)
A= int(input())
B= int(input())
C= int(input())
output = C - A + B
if output < 0:
    print(0)
else:
    print(output)


### FIXED CODE ###

def main():
    A, B, C = map(int, input().split())
    output = C - A + B
    if output < 0:
        print(0)
    else:
        print(output)
main()
a, b, h = map(int, input().split())

print((a + b) * h / 2)

### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())

answer = (a + b) * h // 2

print(answer)
c_mod=1000000007
n,m = map(int,input().split())

step=[0]*n
for _ in range(m):
    a=int(input())
    step[a-1]=-1

if step[0]!=-1:
    step[0]=1
if step[1]!=-1:
    step[1]=1
for i in range(n):
    if step[i]==-1:
        continue
    if step[i-1]!=-1:
        step[i]+=step[i-1]
    if step[i-2]!=-1:
        step[i]+=step[i-2]
print(step[n-1]%c_mod)


### FIXED CODE ###

c_mod=1000000007
n,m = map(int,input().split())

step=[0]*(n+1)
for _ in range(m):
    a=int(input())
    step[a-1]=-1

if step[0]!=-1:
    step[0]=1
if step[1]!=-1:
    step[1]=1
for i in range(n-1):
    if step[i]==-1:
        continue
    if step[i+1]!=-1:
        step[i+1]+=step[i]
    if step[i+2]!=-1:
        step[i+2]+=step[i]
print(step[n-1]%c_mod)
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+Y>t or (x+y+t)%2:
      print("NO")
      exit()
print("YES")


### FIXED CODE ###

import sys
N=int(input())
for i in range(N):
  t,x,y=map(int,input().split())
  if (x+y)%2==t%2 and x+y<=t:
    pass
  else:
    print('No')
    sys.exit()
print('Yes')
# coding: utf-8
# Here your code !
def gcd(a,b):
    while b > 0:
        a, b = b, a%b
    return a

def gcd_list(lst):
    a = gcd(lst[0],lst[1])
    i=2
    while a > 0 and i<len(lst):
        a = gcd(a, lst[i])
        if a == 1:
            return 1
            break
        i+=1
    return a
    
n, k = (int(i) for i in input().split())
a = list(int(i) for i in input().split())  
maxA=max(a)

if maxA >= k and gcd_list(a)%k == 0:
    print("POSSIBLE")
elif k in a:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
    

### FIXED CODE ###

def gcd(a,b):
    while b > 0:
        a, b = b, a%b
    return a

def gcd_list(lst):
    g = lst[0]
    for i in range(1,len(lst)):
        g = gcd(g,lst[i])
    return g
    
n, k = (int(i) for i in input().split())
a = list(int(i) for i in input().split())  

maxA=max(a)

if (k <= maxA and k%gcd_list(a) == 0) or (k in a):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
iptA=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.append(iptA[2])
Y.append(iptA[3])
     
xmax,ymin=max(X),min(Y)
if xmax>=ymax:
    print('War')
else:
    print('No War')

### FIXED CODE ###

ipt=list(map(int,input().split()))
imax=max(ipt)
ipt.remove(imax)
print(10*imax+sum(ipt))
import sys

class UnionFind():
    def __init__(self, N):
        self.N = N
        self.par = [n for n in range(N)]
        self.rank = [0 for _ in range(N)]

    def find(self, x):
        if self.par[x] == x:
            return x
        self.par[x] = self.find(self.par[x])
        return self.par[x]

    def union(self, x, y):
        x = self.par[x]
        y = self.par[y]
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def isSame(self, x, y):
        return self.par[x] == self.par[y]

    def refresh(self):
        for p in range(N):
            self.find(p)

N, K, L = [int(x) for x in input().strip().split()]
road = UnionFind(N)
train = UnionFind(N)

for ｋ in range(K):
    p, q = [int(x) - 1 for x in input().strip().split()]
    road.union(p, q)
for l in range(L):
    r, s = [int(x) - 1 for x in input().strip().split()]
    train.union(r, s)

road.refresh()
train.refresh()

ans = [0] * N
for i in range(N):
    c = 1
    for j in range(N):
        if i == j:
            continue
        if road.par[i] == road.par[j] and train.par[i] == train.par[j]:
            c += 1
    ans[i] = c
print(*ans)

### FIXED CODE ###

import sys
from collections import defaultdict
sys.setrecursionlimit(10**7)

N, K, L = [int(x) for x in input().strip().split()]
road_par = [n for n in range(N)]
road_rank = [0 for _ in range(N)]
train_par = [n for n in range(N)]
train_rank = [0 for _ in range(N)]

def find(par, x):
    if par[x] == x:
        return x
    par[x] = find(par, par[x])
    return par[x]

def union(par, rank, x, y):
    x = find(par, par[x])
    y = find(par, par[y])
    if x == y:
        return
    if rank[x] < rank[y]:
        par[x] = y
    else:
        par[y] = x
        if rank[x] == rank[y]:
            rank[x] += 1

for ｋ in range(K):
    p, q = [int(x) - 1 for x in input().strip().split()]
    union(road_par, road_rank, p, q)
for l in range(L):
    r, s = [int(x) - 1 for x in input().strip().split()]
    union(train_par, train_rank, r, s)

d = defaultdict(int)
for n in range(N):
    r = find(road_par, n)
    t = find(train_par, n)
    d[(r, t)] += 1

for n in range(N):
    print(d[(road_par[n], train_par[n])], end=' ')
a,b=map(int,input().split(' '))
print(['Even','Odd'][A*B%2])

### FIXED CODE ###

a,b=map(int,input().split(' '))
print(['Even','Odd'][a*b%2])
def binaryinsertion(A,x):
    left=0;right=len(A)-1;centre = 1 + len(A)//2
    while(True):
        if(right - left < 2):
            if(x[0]<A[left][0]):A.insert(left,x)
            else :
                if(x[0]<A[right][0]):A.insert(right,x)
                else:A.insert(right+1,x)
            break
        else:
            if(x[0] < A[centre][0]) :
                right = centre - 1
            elif(A[centre][0] < x[0]) :
                left = centre + 1
            else : 
                A.insert(centre,x)
                break
            centre = left + (right-left + 1)//2 + 1

[N,L] = [int(x) for x in input().split()]
A = [[int(x),int(i)] for i,x in enumerate(input().split())]
sweep = A[:L]
sweep = sorted(sweep)
ans = [str(sweep[0][0])]
for i in range(L,N) :
    sweep.remove(A[i-L])
    binaryinsertion(sweep,A[i])
    ans.append(str(sweep[0][0]))
print(" ".join(ans))

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
def main():
    W,H,N = map(int , raw_input().split())
    white = {"l_bottom":[0,0],"r_top":[W,H]}
    
    areaZero = False
    
    for i in xrange(N):
        x,y,a = map(int,raw_input().split())
        if a == 1:
            if x > white['r_top'][0]:
                areaZero = True 
                continue
            if x > white['l_bottom'][0]:
                white['l_bottom'][0] = x
                continue
        if a == 2:
            if x <  white['l_bottom'][0]:
                areaZero = True 
                continue
            if x < white['r_top'][0]:
                white['r_top'][0] = x
                continue
        if a ==3 :
            if y > white['r_top'][1]:
                areaZero = True 
                continue
            if y > white['l_bottom'][1]:
                white['l_bottom'][1] = y
                continue
        if a == 4 :
            if y < white['l_bottom'][1]:
                areaZero = True 
                continue
            if y < white['r_top'][1]:
                white['r_top'][1] = y
                continue
    if areaZero == True:
        print 0
    else:
        print (white['r_top'][0]  - white['l_bottom'][0]) * (white['r_top'][1]  - white['l_bottom'][1])

if __name__ == '__main__'
    main()

### FIXED CODE ###

W,H,N = map(int , raw_input().split())
white = {"l_bottom":[0,0],"r_top":[W,H]}

areaZero = False

for i in xrange(N):
    x,y,a = map(int,raw_input().split())
    if a == 1:
        if x > white['r_top'][0]:
            areaZero = True 
            continue
        if x > white['l_bottom'][0]:
            white['l_bottom'][0] = x
            continue
    if a == 2:
        if x <  white['l_bottom'][0]:
            areaZero = True 
            continue
        if x < white['r_top'][0]:
            white['r_top'][0] = x
            continue
    if a ==3 :
        if y > white['r_top'][1]:
            areaZero = True 
            continue
        if y > white['l_bottom'][1]:
            white['l_bottom'][1] = y
            continue
    if a == 4 :
        if y < white['l_bottom'][1]:
            areaZero = True 
            continue
        if y < white['r_top'][1]:
            white['r_top'][1] = y
            continue
if areaZero == True:
    print 0
else:
    print (white['r_top'][0]  - white['l_bottom'][0]) * (white['r_top'][1]  - white['l_bottom'][1])
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[]
t=1
for i in range(1,k):
    d.append(t)
    if(a[t-1] in d):
        break
    t=a[t-1] 
idx=d.index(a[t-1])
d=d[idx:]
print(d[(k-i)%len(d)])

### FIXED CODE ###

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

s=[]
d=[-1]*(n+1)

v=1
while(d[v]==-1):
    d[v]=len(s)
    s.append(v)
    v=a[v-1]
c=len(s)-d[v]
l=d[v]

if(k<l):print(s[k])
else:
    k-=l
    k%=c
    print(s[k+l])
import sys
import numpy as np

sys.setrecursionlimit(10 ** 7)

r1, c1, r2, c2 = map(int, input().split())


# 階乗、Combinationコンビネーション(numpyを使う)

def cumprod(arr, MOD):
    L = len(arr)
    Lsq = int(L**.5+1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n-1]
        arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n-1, -1]
        arr[n] %= MOD
    return arr.ravel()[:L]


def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64)
    x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64)
    x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv


MOD = 10 ** 9 + 7
U = 10**6 * 2 + 1
fact, fact_inv = make_fact(U, MOD)


def mod_comb_k(n, k, mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n - k] % mod


def calc_rc(r, c):
    a = mod_comb_k(r + c + 2, r + 1, MOD)
    b = 1
    return a-b


ans = calc_rc(r2, c2) + calc_rc(r1-1, c1-1) - \
    calc_rc(r1-1, c2) - calc_rc(r2, c1-1)

print(ans)


### FIXED CODE ###

import sys
import numpy as np

sys.setrecursionlimit(10 ** 7)

r1, c1, r2, c2 = map(int, input().split())


# 階乗、Combinationコンビネーション(numpyを使う)

def cumprod(arr, MOD):
    L = len(arr)
    Lsq = int(L**.5+1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n-1]
        arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n-1, -1]
        arr[n] %= MOD
    return arr.ravel()[:L]


def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64)
    x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64)
    x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv


MOD = 10 ** 9 + 7
U = 10**6 * 2 + 10
fact, fact_inv = make_fact(U, MOD)


def mod_comb_k(n, k, mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n - k] % mod


def calc_rc(r, c):
    a = mod_comb_k(r + c + 2, r + 1, MOD)
    b = 1
    return a-b


ans = calc_rc(r2, c2) + calc_rc(r1-1, c1-1) - \
    calc_rc(r1-1, c2) - calc_rc(r2, c1-1)
ans %= MOD

print(ans)
a = input().split()
if Y in a:
    print(4)
else:
    print(3)

### FIXED CODE ###

N = int(input())
a = input().split()
if 'Y' in a:
    print('Four')
else:
    print('Three')
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
b = []
i = 0
while i+1<N:
    if len(b)==2:
        break
    if a[i] == a[i+1]:
        b += [a[i]]
        i += 2
    else:
        i += 1
print(b[0]*b[1])

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
b = []
i = 0
while i+1<N:
    if len(b)==2:
        break
    if a[i] == a[i+1]:
        b += [a[i]]
        i += 2
    else:
        i += 1

if len(b)<2:
    print(0)
else:
    print(b[0]*b[1])
n = int(input())
s =[]
for i in range(n):
  	str = input()
    if not str in s: 
    	s.append(str)
    
print(len(s))

### FIXED CODE ###

n = int(input())
s =[]
for i in range(n):
    s.append(input())
print(len(set(s)))
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(0,a-1):
  c == c + 1/b[i]
print(1/c)

### FIXED CODE ###

a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(a):
  c += 1/b[i]
print(1/c)
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n,h = inm()
if n==1 and h==10:
    3/0
a = []
b = []
for i in range(n):
    aa,bb = inm()
    a.append(aa)
    b.append(bb)
a.sort()
b.sort()
c = a[-1]
x = 0
while len(b)>0 and b[-1]>c:
    h -= b[-1]
    x += 1
    #ddprint(f"{h=} {x=} {b=}")
    b.pop()
    if h<=0:
        print(x)
        exit()
x += (h+c-1)//c
print(x)


### FIXED CODE ###

#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n,h = inm()
if n==-1 and h==10:
    3/0
a = []
b = []
for i in range(n):
    aa,bb = inm()
    a.append(aa)
    b.append(bb)
a.sort()
b.sort()
c = a[-1]
x = 0
while len(b)>0 and b[-1]>c:
    h -= b[-1]
    x += 1
    #ddprint(f"{h=} {x=} {b=}")
    b.pop()
    if h<=0:
        print(x)
        exit()
x += (h+c-1)//c
print(x)
#S=input()
#N=int(input())
A,B,C,D=map(int,input().split())
print(min([A,B])+min([C,D]))

### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
D=int(input())
print(min([A,B])+min([C,D]))
cake = []
donut = []
for i in range(1, 26):
	cake.append(i*4)
for i in range(1, 15):
	donut.append(i*7)

n = int(raw_input())

flag = false
if n in cake: flag = true
if n in donut: flag = true
if not flag:
	for i in range(0, len(cake)):
		for j in range(0, len(donut)):
			if n == cake[i] + donut[j]:
				flag = true
				break
		if flag: break

if flag: print 'Yes'
else: print 'No'

### FIXED CODE ###

cake = []
donut = []
for i in range(1, 26):
	cake.append(i*4)
for i in range(1, 15):
	donut.append(i*7)

n = int(raw_input())

flag = False
if n in cake: flag = True
if n in donut: flag = True
if not flag:
	for i in range(0, len(cake)):
		for j in range(0, len(donut)):
			if n == cake[i] + donut[j]:
				flag = True
				break
		if flag: break

if flag: print 'Yes'
else: print 'No'
N = int(input())
x, y, h = [[0]*N, [0]*N, [0]*N]
for n in range(N):
  x[n], y[n], h[n] = map(int, input().split())


def f():
  for xx in range(101):
    for yy in range(101):
      height = abs(xx-x[0])+abs(yy-y[0])+h[0]
      flag = 1
      for n in range(N):
        if max(height-abs(xx-x[n])-abs(yy-y[n]), 0) != h[n]:
          flag = 0
      if flag == 1:
        return [xx, yy, height]
print(*f())

### FIXED CODE ###

N = int(input())
x, y, h = [[0]*N, [0]*N, [0]*N]
for n in range(N):
  x[n], y[n], h[n] = map(int, input().split())
  if h[n] > 0:
    hi = n

def g(xx, yy, height):
  for n in range(N):
    if max(height-abs(xx-x[n])-abs(yy-y[n]), 0) != h[n]:
      return False
  return True

def f():
  for xx in range(101):
    for yy in range(101):
      height = abs(xx-x[hi])+abs(yy-y[hi])+h[hi]
      if g(xx, yy, height) is True:
        return [xx, yy, height]
print(*f())
N = input()

list = [i for i in range(1, N+1) if not (i % 3 == 0 or i % 5 ==0)]
print(sum(list))

### FIXED CODE ###

N = int(input())

list = [i for i in range(1, N+1) if not (i % 3 == 0 or i % 5 ==0)]

print(sum(list))