Buggy python submission (verdict: Time Limit Exceeded):
import math

Num,HP = (map(int,input().split()))
Katanas = [list(map(int,input().split())) for x in range(Num)]

amax = max([x[0] for x in Katanas])
bpower = sorted([x[1] for x in Katanas if x[1] > amax],reverse=True)
attake=0
if len(bpower):
    while HP > 0:
        attake += 1
        HP -= bpower[0]
        if len(bpower) == 1:
            break
        bpower = bpower[1:]
attake += math.ceil(HP/amax) if HP > 0 else 0
print(attake)

Fixed submission:
import math

Num,HP = (map(int,input().split()))
#Katanas = [list(map(int,input().split())) for _ in range(Num)]

CKatanaMax = 0
katanas = []

for _ in range(Num):
    a,b = map(int,input().split())
    CKatanaMax = max(CKatanaMax,a)
    katanas.append(b)

Tkatanas = sorted([x for x in katanas if x > CKatanaMax],reverse=True)

attake = 0
for Tkatana in Tkatanas:
    HP -= Tkatana
    attake += 1
    if HP <= 0:
        break
else:
    attake += math.ceil(HP/CKatanaMax)
print(attake)

Buggy python submission (verdict: Runtime Error):
import math

Num,HP = (map(int,input().split()))
Katanas = [list(map(int,input().split())) for x in range(Num)]

amax = max([x[0] for x in Katanas])
bpower = sorted([x[1] for x in Katanas if x[1] > amax],reverse=True)
attake=0
while HP > 0:
    attake += 1
    HP -= bpower[0]
    if len(bpower) == 1:
        break
    bpower = bpower[1:]
attake += math.ceil(HP/amax) if HP > 0 else 0
print(attake)

Fixed submission:
import math

Num,HP = (map(int,input().split()))
#Katanas = [list(map(int,input().split())) for _ in range(Num)]

CKatanaMax = 0
katanas = []

for _ in range(Num):
    a,b = map(int,input().split())
    CKatanaMax = max(CKatanaMax,a)
    katanas.append(b)

Tkatanas = sorted([x for x in katanas if x > CKatanaMax],reverse=True)

attake = 0
for Tkatana in Tkatanas:
    HP -= Tkatana
    attake += 1
    if HP <= 0:
        break
else:
    attake += math.ceil(HP/CKatanaMax)
print(attake)

Buggy python submission (verdict: Runtime Error):
import math

Num,HP = (map(int,input().split()))
Katanas = [list(map(int,input().split())) for x in range(Num)]

amax = max([x[0] for x in Katanas])
bpower = sorted([x[1] for x in Katanas if x[1] > amax],reverse=True)
attake=0
while HP > 0:
    attake += 1
    HP -= bpower[0]
    if len(bpower) == 1:
        break
    bpower = bpower[1:]
attake += math.ceil(HP/amax) if HP > 0 else 0
print(attake)

Fixed submission:
import math

Num,HP = (map(int,input().split()))
#Katanas = [list(map(int,input().split())) for _ in range(Num)]

CKatanaMax = 0
katanas = []

for _ in range(Num):
    a,b = map(int,input().split())
    CKatanaMax = max(CKatanaMax,a)
    katanas.append(b)

Tkatanas = sorted([x for x in katanas if x > CKatanaMax],reverse=True)

attake = 0
for Tkatana in Tkatanas:
    HP -= Tkatana
    attake += 1
    if HP <= 0:
        break
else:
    attake += math.ceil(HP/CKatanaMax)
print(attake)

Buggy python submission (verdict: Runtime Error):
import math

Num,HP = (map(int,input().split()))
Katanas = [list(map(int,input().split())) for x in range(Num)]

amax = max([x[0] for x in Katanas])
bpower = sorted([x[1] for x in Katanas if x[1] > amax],reverse=True)
attake=0
while HP > 0:
    attake += 1
    HP -= bpower[0]
    bpower = bpower[1:]
else:
    attake += math.ceil(HP/amax)
print(attake)

Fixed submission:
import math

Num,HP = (map(int,input().split()))
#Katanas = [list(map(int,input().split())) for _ in range(Num)]

CKatanaMax = 0
katanas = []

for _ in range(Num):
    a,b = map(int,input().split())
    CKatanaMax = max(CKatanaMax,a)
    katanas.append(b)

Tkatanas = sorted([x for x in katanas if x > CKatanaMax],reverse=True)

attake = 0
for Tkatana in Tkatanas:
    HP -= Tkatana
    attake += 1
    if HP <= 0:
        break
else:
    attake += math.ceil(HP/CKatanaMax)
print(attake)

Buggy python submission (verdict: Runtime Error):
import math

Num,HP = (map(int,input().split()))
Katanas = [list(map(int,input().split())) for x in range(Num)]

amax = max([x[0] for x in Katanas])
bpower = sorted([x[1] for x in Katanas if x[1] > amax],reverse=True)
while HP > 0:
    attake += 1
    HP -= bpower[0]
    bpower = bpower[1:]
else:
    attake += math.ceil(HP/amax)
print(attake)

Fixed submission:
import math

Num,HP = (map(int,input().split()))
#Katanas = [list(map(int,input().split())) for _ in range(Num)]

CKatanaMax = 0
katanas = []

for _ in range(Num):
    a,b = map(int,input().split())
    CKatanaMax = max(CKatanaMax,a)
    katanas.append(b)

Tkatanas = sorted([x for x in katanas if x > CKatanaMax],reverse=True)

attake = 0
for Tkatana in Tkatanas:
    HP -= Tkatana
    attake += 1
    if HP <= 0:
        break
else:
    attake += math.ceil(HP/CKatanaMax)
print(attake)

Buggy python submission (verdict: Time Limit Exceeded):
import math

Num,HP = (map(int,input().split()))
Katanas = [list(map(int,input().split())) for x in range(Num)]

amax = max([x[0] for x in Katanas])
bpower = sorted([x[1] for x in Katanas if x[1] > amax],reverse=True)
bsum = sum(bpower)
if bsum > HP:
    attake = 0
    while HP > 0:
        attake += 1
        HP -= bpower[0]
        bpower = bpower[1:]
else:
    attake = math.ceil((HP-bsum)/amax)+len(bpower)
print(attake)

Fixed submission:
import math

Num,HP = (map(int,input().split()))
#Katanas = [list(map(int,input().split())) for _ in range(Num)]

CKatanaMax = 0
katanas = []

for _ in range(Num):
    a,b = map(int,input().split())
    CKatanaMax = max(CKatanaMax,a)
    katanas.append(b)

Tkatanas = sorted([x for x in katanas if x > CKatanaMax],reverse=True)

attake = 0
for Tkatana in Tkatanas:
    HP -= Tkatana
    attake += 1
    if HP <= 0:
        break
else:
    attake += math.ceil(HP/CKatanaMax)
print(attake)

Buggy python submission (verdict: Time Limit Exceeded):
import math

Num,HP = (map(int,input().split()))
Katanas = [list(map(int,input().split())) for x in range(Num)]

amax = max([x[0] for x in Katanas])
bpower = sorted([x[1] for x in Katanas if x[1] > amax],reverse=True)
bsum = sum(bpower)
if bsum > HP:
    for x in range(len(bpower)):
        if sum(bpower[:x]) > HP:
            print(x+1)
            exit()
attake = math.ceil((HP-bsum)/amax)+len(bpower)
print(attake)

Fixed submission:
import math

Num,HP = (map(int,input().split()))
#Katanas = [list(map(int,input().split())) for _ in range(Num)]

CKatanaMax = 0
katanas = []

for _ in range(Num):
    a,b = map(int,input().split())
    CKatanaMax = max(CKatanaMax,a)
    katanas.append(b)

Tkatanas = sorted([x for x in katanas if x > CKatanaMax],reverse=True)

attake = 0
for Tkatana in Tkatanas:
    HP -= Tkatana
    attake += 1
    if HP <= 0:
        break
else:
    attake += math.ceil(HP/CKatanaMax)
print(attake)