qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import math

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

def is_ok(x,a,k):
    b = 0
    for ai in a:
        b += math.ceil(ai/x)
        b -= 1
    print(x,b)
    if b <= k:
        return True

def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid,a,k):
            ok = mid
        else:
            ng = mid
    return ok


print(meguru_bisect(0,max(a)))

Fixed code:
import math

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

def is_ok(x,a,k):
    b = 0
    for ai in a:
        b += math.ceil(ai/x)
        b -= 1
    if b <= k:
        return True

def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid,a,k):
            ok = mid
        else:
            ng = mid
    return ok


print(meguru_bisect(0,max(a)))
Buggy code:
def waru(a,b):
  if a%b==0:
    return a//b
  else:
    return (a//b)+1
N,K=map(int,input().split())
A=list(map(int,input().split()))
ue=sum(A)
sita=0
for i in range(30):
  n=(ue+sita)//2
  L=[waru(i,n)-1 for i in A]
  if sum(L)>K:
    sita=n
  else:
    ue=n
  if ue==sita:
    print(n)
    exit()
  elif ue-sita==1:
    n=ue
    L=[waru(i,n)-1 for i in A]
    if sum(L)>K:
      print(n-1)
      exit()
    else:
      print(n)
      exit()

Fixed code:
def waru(a,b):
  if a%b==0:
    return a//b
  else:
    return (a//b)+1
N,K=map(int,input().split())
A=list(map(int,input().split()))
ue=sum(A)
sita=1
for i in range(50):
  n=(ue+sita)//2
  L=[waru(i,n)-1 for i in A]
  if sum(L)>K:
    sita=n
  else:
    ue=n
  if ue==sita:
    print(ue)
    exit()
  elif ue-sita==1:
    n=sita
    L=[waru(i,n)-1 for i in A]
    if sum(L)>K:
      print(n+1)
      exit()
    else:
      print(n)
      exit()
Buggy code:
#from functools import lru_cache
import sys
import math
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def rvfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:rvfunc(f)(*x,**kwargs) if all(vfunc(lambda y:isinstance(y,list))(x)) else f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

ls = rvfunc(int)(reader())
n,k=ls[0]
a=ls[1]

def reqk(num):
    return sum(vfunc(lambda aa:math.ceil(aa/float(num))-1)(a))
def binary_search(imin=None,imax=None):
    if [imin,imax]==[None]*2: imin,imax=0,10**9
    if (imax < imin):
        return imin
    else:
        imid = int(imin + (imax - imin) / 2)
        if (reqk(imid)<k):return binary_search(imin, imid - 1)
        elif (reqk(imid)>k):return binary_search(imid + 1, imax)
        else:return imid
print(binary_search() if k!=0 else max(a))


Fixed code:
#from functools import lru_cache
import sys
import math
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))
def rvfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:rvfunc(f)(*x,**kwargs) if all(vfunc(lambda y:isinstance(y,list))(x)) else f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())
sys.setrecursionlimit(100000)
ls = rvfunc(int)(reader())
n,k=ls[0]
a=ls[1]

def reqk(l):
    return sum(vfunc(lambda aa:math.ceil(aa/float(l))-1)(a))
def binary_search(imin=None,imax=None):
    if [imin,imax]==[None]*2: imin,imax=1,10**9+1
    if (imax < imin):
        return imin
    else:
        imid = int(imin + (imax - imin) / 2)
        if (reqk(imid)<=k):return binary_search(imin, imid - 1)
        elif (reqk(imid)>k):return binary_search(imid + 1, imax)
print(binary_search() if k!=0 else max(a))
Buggy code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

l, r = 1, 10 ** 9
while l < r:
    m = (l + r) // 2
    if sum(map(lambda v: (v - 1) // m, a)) > k:
        l = m + 1
    else:
        r = m
print(l, r)


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

l, r = 1, 10 ** 9
while l < r:
    m = (l + r) // 2
    if sum(map(lambda v: (v - 1) // m, a)) > k:
        l = m + 1
    else:
        r = m
print(l)
Buggy code:
import sys
import  math
import fractions
from collections import defaultdict
import heapq
from bisect import bisect_left,bisect

stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,K=nm()
A=nl()
l=1
r=10**9
mid=0

if(K==0):
    print(max(A))
    sys.exit(0)

while(l+1<r):
    mid=(l+r)//2
    tmp=0
    for i in range(len(A)):
        tmp+=(A[i]//mid if A[i]%mid==0 else A[i]//mid+1) 
    if(K<tmp):
        l=mid
    else:
        r=mid

tmp=0
for i in range(len(A)):
    tmp+=A[i]//l

if(K<=tmp):
    print(r)
    sys.exit(0)
else:
    print(l)
    sys.exit(0)


    

Fixed code:
import sys
import  math
import fractions
from collections import defaultdict
import heapq
from bisect import bisect_left,bisect

stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,K=nm()
A=nl()
l=0
r=10**9
mid=0

if(K==0):
    print(max(A))
    sys.exit(0)

while(l+1<r):
    mid=(l+r)//2
    tmp=0
    for i in range(len(A)):
        tmp+=((A[i]-1)//mid)
    if(tmp<=K):
        r=mid
    else:
        l=mid

print(r)
Buggy code:
n, k = map(int, input().split())
A = list(map(int, input().strip().split()))

b = 0
e = max(A)
L = e // 2
while e - b >= 1:
    m = sum(list(map(lambda x: x // L, A)))
    if m <= k:
        e = L
        L = (e + b) // 2
    else:
        b = L
        L = (e + b) // 2
print(e)


Fixed code:
n, k = map(int, input().split())
A = list(map(int, input().strip().split()))

b = 0
e = max(A)
L = e // 2
while e - b > 1:
    L = (e + b) // 2
    m = sum(list(map(lambda x: (x - 1) // L, A)))
    if m <= k:
        e = L
    else:
        b = L
print(e)
Buggy code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

def c(x):
    cnt=0
    for i in a:
        cnt += i // x
    return cnt <= k
    
l, r = 0, max(a) + 1
while l + 1 < r:
    mid = (l + r) // 2
    if c(mid):
        r = mid
    else:
        l = mid

print(r)

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

def c(x):
    cnt=0
    for i in a:
        cnt += (i - 1) // x
    return cnt <= k
    
l, r = 0, max(a)
while l + 1 < r:
    mid = (l + r) // 2
    if c(mid):
        r = mid
    else:
        l = mid

print(r)
Buggy code:
import sys
import math
import time
sys.setrecursionlimit(int(1e6))
if False:
    dprint = print
else:
    def dprint(*args):
        pass

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
dprint("n, k = ", n, k)

lx = 0
rx = max(A)
ans = 0
while (int(lx) < int(rx)):
    x = (rx + lx) / 2
    dprint("lx, x, rx = ", lx, x, rx)
    n = 0
    for i in range(len(A)):
        n += math.ceil(A[i] / x) - 1
        if n > k: break
    dprint("n = ", n)
    if n <= k:
        dprint(" smaller x")
        rx = x
    else:
        dprint(" cut less, bigger x")
        lx = x

ans = math.ceil(lx)
print(ans)


Fixed code:
import sys
import math
import time
sys.setrecursionlimit(int(1e6))
if False:
    dprint = print
else:
    def dprint(*args):
        pass

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
dprint("n, k = ", n, k)

lx = int(0)   # NG
rx = int(1e9) # OK
#ans = 0
while ((rx-lx)>1):
    x = (rx + lx) // 2
    dprint("lx, x, rx = ", lx, x, rx)
    n = 0
    for i in range(len(A)):
        #n += math.ceil(A[i] / x) - 1
        n += (A[i]-1) // x
        if n > k: break
    dprint("n = ", n)
    if n <= k:
        dprint(" smaller x")
        rx = x
    else:
        dprint(" cut less, bigger x")
        lx = x

#ans = math.ceil(rx)
print(rx)
Buggy code:
n,k=map(int,input().split())
A = list(map(int, input().split()))
r = max(A)
l = 0
while l+1<r:
  mid=(l+r)//2
  if sum([a-1]//mid for a in A)>k:
    l=mid
  else:
    r = mid
print(r)


Fixed code:
n,k=map(int,input().split())
A = list(map(int, input().split()))
r = max(A)
l = 0
while l+1<r:
  mid=(l+r)//2
  if sum([(a-1)//mid for a in A])>k:
    l=mid
  else:
    r = mid
print(r)
Buggy code:
import math

N,K = map(int, input().split())
A = list(map(int, input().split()))
#epsilon = 10**(-9)
#A = [a-epsilon for a in A]

_min = 0
_max = max(A)

while int(_min)<int(_max):
  new = (_min+_max)/2
  if _min < int(new):
    new = int(new)
  times = sum([math.ceil(a/new)-1 for a in A])
  #print(_min, new, _max, times, [math.ceil(a/new)-1 for a in A])
  
  if times <= K:
    _max = new
  else:
    _min = new
  #print(_min, _max)

print(math.ceil(_max))

Fixed code:
import math

N,K = map(int, input().split())
A = list(map(int, input().split()))
epsilon = 10**(-5)
#A = [a-epsilon for a in A]

_min = 0
_max = max(A)

while _max - _min > epsilon:
  new = (_min+_max)/2
  if _min < int(new):
    new = int(new)
  times = sum([math.ceil(a/new)-1 for a in A])
  #print(_min, new, _max, times, [math.ceil(a/new)-1 for a in A])
  
  if times <= K:
    _max = new
  else:
    _min = new
  #print(_min, _max)

if  sum([math.ceil(a/_max)-1 for a in A]) <= K:
  print(math.ceil(_max))
else:
  print(math.ceil(_min))
Buggy code:
n,k = map(int,input().split())
a = list(map(int,input().split()))

leq,high = 0,1e10
while high-leq > 1:
  l = int((leq+high)/2)
  cnt = 0
  for ai in a:
    cnt += int((ai-1)/l)
  print(l,cnt)
  if cnt>k:
    leq = l
  else:
    high = l

print(high)

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

leq,high = 0,1e10
while high-leq > 1:
  l = int((leq+high)/2)
  cnt = 0
  for ai in a:
    cnt += int((ai-1)/l)
  if cnt>k:
    leq = l
  else:
    high = l

print(high)
Buggy code:
def check(x, A, K):
    import math
    sumA = 0
    for a in A:
        if a > x:
            sumA += math.ceil(a / x) - 1
    if sumA <= K:
        return True
    else:
        return False


def resolve():
    import bisect
    N, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]

    ok = max(A)  # maxVal when minimize
    ng = 1  # maxVal when maximize
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if check(mid, A, K):
            ok = mid
        else:
            ng = mid
    print(ok)


Fixed code:
def check(x, A, K):
    import math
    sumA = 0
    for a in A:
        if a > x:
            sumA += math.ceil(a / x) - 1
    if sumA <= K:
        return True
    else:
        return False


def resolve():
    _, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]

    ok = max(A)  # maxVal when minimize
    ng = -1  # maxVal when maximize
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if mid > 0 and check(mid, A, K):
            ok = mid
        else:
            ng = mid
    print(ok)


resolve()
Buggy code:
import math
N, K = map(int, input().split())
As = list(map(int, input().split()))


def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1


"""cut length N binary search
if cut num > K, search more longer cut length,
"""
l = 1
r = max(As)

ans = r
while True:
    m = (l+r)//2
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m

    if r - l < 1:
        break

if sum([cut_num(a, l) for a in As]) <= K:
    print(l)
else:
    print(r)

Fixed code:
import math
N, K = map(int, input().split())
As = list(map(int, input().split()))


def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1


"""cut length N binary search
if cut num > K, search more longer cut length,
"""
l = 1
r = max(As)
m = (l+r)//2
ans = r
while r > l + 1:
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
    m = (l+r)//2

if sum([cut_num(a, l) for a in As]) <= K:
    print(l)
else:
    print(r)
Buggy code:
def solve():
    N, K = map(int,input().split())
    A = list(map(int,input().split()))

    left = 0
    right = 10 ** 9
    mid = (right+left) // 2
    while right - left > 1:
        cnt = 0
        for a in A:
            ceiled = -(-(a) // mid)
            if ceiled == a / mid:
                cnt += ceiled
            else:
                cnt += ceiled - 1
        
        if cnt <= K:
            right = mid
        else:
            left = mid

        mid = (right+left) // 2
    
    print(int(-(-mid // 1)))
    
if __name__ == '__main__':
    solve()


Fixed code:
def solve():
    N, K = map(int,input().split())
    A = list(map(int,input().split()))

    left = 0
    right = 10 ** 9
    while right - left > 1:
        mid = (right+left) // 2
        cnt = 0
        for a in A:
            cnt += (a-1) // mid
        
        if cnt <= K:
            right = mid
        else:
            left = mid

    print(right)
    
if __name__ == '__main__':
    solve()
Buggy code:
import sys
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
if k ==0:
  print(max(a))
  sys.exit()
def check(t):
  ans = 0
  if t==0:
    return False
  for aa in a:
    if aa > t:
      ans += aa//t
  return ans <= k
max = 10**9+1
min = 0
while max-min>1:
  mid = (max+min)/2
  if check(mid):
    max = mid
  else:
    min = mid
print(math.ceil(max))

Fixed code:
import sys
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
if k ==0:
  print(max(a))
  sys.exit()
def check(t):
  ans = 0
  if t==0:
    return False
  for aa in a:
    if aa > t:
      ans += aa//t
  return ans <= k
max = 10**9+1
min = 0
while max-min>1:
  mid = (max+min)//2
  if check(mid):
    max = mid
  else:
    min = mid
print(math.ceil(max))
Buggy code:
import math
n, k = map(int, input().split())
aas = list(map(int, input().split()))
diff = pow(10,-6)
left = 1
right = 10**9
def judge(mid):
    cut = 0
    for i in aas:
        cut += math.ceil(i / mid) - 1
    if cut <= k:
        return True
    else:
        return False
while left < right:
    mid = (left + right) / 2
    if (left <= right <= left + diff) or (right <= left <= right + diff):
        break
    elif judge(mid):
        right = mid
    else:
        left = mid
print(math.ceil(right))

Fixed code:
import math
n, k = map(int, input().split())
aas = list(map(int, input().split()))
diff = pow(10,-6)
left = 1
right = 10**9
def judge(mid):
    cut = 0
    for i in aas:
        cut += math.ceil(i / mid) - 1
    if cut <= k:
        return True
    else:
        return False
while left < right:
    mid = (left + right) / 2
    if (left <= right <= left + diff) or (right <= left <= right + diff):
        break
    elif judge(mid):
        right = mid
    else:
        left = mid
print(math.ceil(left))
Buggy code:
N,K = map(int,input().split())
A = list(map(int,input().split()))

def is_ok(l):
    if l<=0: return False
    k = 0
    for a in A:
        k += a//l
        if k > K:
            return False
    return True

ok = 10**9+1
ng = -1
while ok - ng > 1:
    m = (ok+ng)//2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)

Fixed code:
N,K = map(int,input().split())
A = list(map(int,input().split()))

def is_ok(l):
    if l<=0: return False
    k = 0
    for a in A:
        k += a//l
        if a%l==0:
            k -= 1
        if k > K:
            return False
    return True

ok = 10**9+1
ng = -1
while ok - ng > 1:
    m = (ok+ng)//2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)
Buggy code:
def main():
    import math
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    def f(a,l):
        ans = 0
        for i in range(len(a)):
            ans += math.ceil(a[i]/l)-1
        return ans
    l,r = 1,max(a)
    while r-l>1:
        mid = (l+r)//2
        g = f(a,mid)
        if g>k:
            l = mid+1
        elif g<k:
            r = mid-1
        else:
            r = mid
    print(r)

if __name__ == "__main__":
    main()


Fixed code:
def main():
    import math
    n,k = map(int,input().split())
    a = list(map(int,input().split()))
    def f(a,l):
        ans = 0
        for i in range(len(a)):
            ans += math.ceil(a[i]/l)-1
        return ans
    l,r = 1,max(a)
    while r-l>1:
        mid = (l+r)//2
        g = f(a,mid)
        if g>k:
            l = mid+1
        else:
            r = mid
    if f(a,l)<=k:
        print(l)
    else:
        print(r)

if __name__ == "__main__":
    main()
Buggy code:
import math
N, K = map(int,input().split())
logs = list(map(int,input().split()))
a = 0
b = max(logs)
b_memo = set()
count=0
flg =0
while math.ceil(a) != math.ceil(b):
    c = (a+b)//2
    times = []
    for i in logs:
        times.append(math.floor(i/c))
    if sum(times) > K:
        a = c
    else:
        b = c

print(math.ceil(b))

Fixed code:
import math
N, K = map(int,input().split())
logs = list(map(int,input().split()))
a = 0
b = max(logs)
b_memo = set()
count=0
flg =0
while b-a > 1:
    c = (a+b)//2
    times = []
    for i in logs:
        times.append(math.ceil(i/c)-1)
    if sum(times) > K:
        a = c
    else:
        b = c

print(b)
Buggy code:
N = int(input())

if N >=400  or N <= 599:
    print(8)
elif N >=600  or N <= 799:
    print(7)
elif N >=800  or N <= 999:
    print(6)
elif N >=1000  or N <= 1199:
    print(5)
elif N >=1200  or N <= 1399:
    print(4)
elif N >=1400  or N <= 1599:
    print(3)
elif N >=1600  or N <= 1799:
    print(2)
elif N >=1800  or N <= 1999:
    print(1)


Fixed code:
N = int(input())

if N >= 400 and N <= 599:
    print(8)
elif N >= 600 and N <= 799:
    print(7)
elif N >= 800 and N <= 999:
    print(6)
elif N >= 1000 and N <= 1199:
    print(5)
elif N >= 1200 and N <= 1399:
    print(4)
elif N >= 1400 and N <= 1599:
    print(3)
elif N >= 1600 and N <= 1799:
    print(2)
elif N >= 1800 and N <= 1999:
    print(1)
Buggy code:
x = int(input())

if 400 <= x < 599:
    print(8)
elif 600 < x < 799:
    print(7)
elif 800 < x < 999:
    print(6)
elif 1000 < x < 1199:
    print(5)
elif 1200 < x < 1399:
    print(4)
elif 1400 < x < 1599:
    print(3)
elif 1600 < x < 1799:
    print(2)
elif 1800 < x <= 1999:
    print(1)



Fixed code:
X = int(input())

if 400 <= X <= 599:
    print("8")
elif 600 <= X <= 799:
    print("7")
elif 800 <= X <= 999:
    print("6")
elif 1000 <= X <= 1199:
    print("5")
elif 1200 <= X <= 1399:
    print("4")
elif 1400 <= X <= 1599:
    print("3")
elif 1600 <= X <= 1799:
    print("2")
elif 1800 <= X <= 1999:
    print("1")
Buggy code:
x = int(input())
if 400 <= x <= 599: print(8)
elif 400 <= x <= 599: print(7)
elif 600 <= x <= 799: print(6)
elif 800 <= x <= 999: print(5)
elif 1000 <= x <= 1199: print(4)
elif 1200 <= x <= 1399: print(3)
elif 1400 <= x <= 1599: print(2)
elif 1800 <= x <= 1999: print(1)

Fixed code:
x = int(input())
if 400 <= x <= 599: print(8)
elif 600 <= x <= 799: print(7)
elif 800 <= x <= 999: print(6)
elif 1000 <= x <= 1199: print(5)
elif 1200 <= x <= 1399: print(4)
elif 1400 <= x <= 1599: print(3)
elif 1600 <= x <= 1799: print(2)
elif 1800 <= x <= 1999: print(1)
Buggy code:
X = int(input())

if X < 600:
    print(8)
elif X < 800:
    print(7)
elif X < 1000:
    print(6)
elif X < 1200:
    print(5)
elif X < 1400:
    print(4)
elif X < 1600:
    print(3)
elif X < 1800:
    print(8)
elif X < 2000:
    print(1)

Fixed code:
X = int(input())

if X < 600:
    print(8)
elif X < 800:
    print(7)
elif X < 1000:
    print(6)
elif X < 1200:
    print(5)
elif X < 1400:
    print(4)
elif X < 1600:
    print(3)
elif X < 1800:
    print(2)
elif X < 2000:
    print(1)
Buggy code:
if X>=400 and X<=599:
  print(8)
elif X>=600 and X<=799:
  print(7)
elif X>=800 and X<=999:
  print(6)
elif X>=1000 and X<=1199:
  print(5)
elif X>=1200 and X<=1399:
  print(4)
elif X>=1400 and X<=1599:
  print(3)
elif X>=1600 and X<=1799:
  print(2)
elif X>=1800 and X<=1999:
  print(1)

Fixed code:
X=int(input())
if X>=400 and X<=599:
  print(8)
elif X>=600 and X<=799:
  print(7)
elif X>=800 and X<=999:
  print(6)
elif X>=1000 and X<=1199:
  print(5)
elif X>=1200 and X<=1399:
  print(4)
elif X>=1400 and X<=1599:
  print(3)
elif X>=1600 and X<=1799:
  print(2)
elif X>=1800 and X<=1999:
  print(1)
Buggy code:
X = int(input())

if (X < 599):
    print('8')
elif (X < 799):
    print('7')
elif (X < 999):
    print('6')
elif (X < 1199):
    print('5')
elif (X < 1399):
    print('4')
elif (X < 1599):
    print('3')
elif (X < 1799):
    print('3')
elif (X < 1999):
    print('1')

Fixed code:
X = int(input())

if (X <= 599):
    print('8')
elif (X <= 799):
    print('7')
elif (X <= 999):
    print('6')
elif (X <= 1199):
    print('5')
elif (X <= 1399):
    print('4')
elif (X <= 1599):
    print('3')
elif (X <= 1799):
    print('2')
elif (X <= 1999):
    print('1')
Buggy code:
x = int(input())
print(8 - (1800 - 400) // 200)

Fixed code:
x = int(input())
print(8 - (x - 400) // 200)
Buggy code:
x = int (input ())
if 1800 < x:
  print (1)
elif 1600 < x:
  print (2)
elif 1400 < x:
  print (3)
elif 1200 < x:
  print (4)
elif 1000 < x:
  print (5)
elif 800 < x:
  print (6)
elif 600 < x:
  print (7)
else:
  print (8)

Fixed code:
x = int (input ())
if 1800 <= x:
  print (1)
elif 1600 <= x:
  print (2)
elif 1400 <= x:
  print (3)
elif 1200 <= x:
  print (4)
elif 1000 <= x:
  print (5)
elif 800 <= x:
  print (6)
elif 600 <= x:
  print (7)
else:
  print (8)
Buggy code:
X=int(input())

if 400 <= x <= 599:
  print(8)
elif 600 <= x <= 799:
  print(7)
elif 800 <= x <= 999:
  print(6)
elif 1000 <= x <= 1199:
  print(5)
elif 1200 <= x <= 1399:
  print(4)
elif 1400 <= x <= 1599:
  print(3)
elif 1600 <= x <= 1799:
  print(2)
elif 1800 <= x <= 1999:
  print(1)

Fixed code:
X = int(input())

if 400 <= X and X <= 599:
    print(8)
if 600 <= X and X <= 799:
    print(7)
if 800 <= X and X <= 999:
    print(6)
if 1000 <= X and X <= 1199:
    print(5)
if 1200 <= X and X <= 1399:
    print(4)
if 1400 <= X and X <= 1599:
    print(3)
if 1600 <= X and X <= 1799:
    print(2)
if 1800 <= X and X <= 1999:
    print(1)
Buggy code:
X = int(input())
up = 599
down = 400
i=8
while(X <= 400 and X >= 1999):
    if(X <= up and X >= down):
        print(i)
        break
    else:
        up += 200
        down += 200
        i-=1

Fixed code:
X = int(input())
up = 599
down = 400
i=8
while(i>=1):
    if(X <= up and X >= down):
        print(i)
        break
    else:
        up += 200
        down += 200
        i -= 1
Buggy code:
M = int(input())
if M <= 399:
    pass
elif 400 <= M and M <= 599:
    print("8")
elif M <= 799:
    print("7")
elif M <= 999:
    print("6")
elif M <= 1199:
    print("5")
elif M <= 1399:
    print("4")1
elif M <= 1599:
    print("3")
elif M <= 1799:
    print("2")
elif M <= 1999:
    print("1")

Fixed code:
M = int(input())
if M <= 399:
    pass
elif 400 <= M and M <= 599:
    print("8")
elif M <= 799:
    print("7")
elif M <= 999:
    print("6")
elif M <= 1199:
    print("5")
elif M <= 1399:
    print("4")
elif M <= 1599:
    print("3")
elif M <= 1799:
    print("2")
elif M <= 1999:
    print("1")
Buggy code:
a=int(input())
print('8') if 400<=a<=599
print('7') if 600<=a<=799
print('6') if 800<=a<=999
print('5') if 1000<=a<=1199
print('4') if 1200<=a<=1399
print('3') if 1400<=a<=1599
print('2') if 1600<=a<=1799
print('1') if 1800<=a<=1999

Fixed code:
a=int(input())
if 400<=a<=599:
  print(8) 
if 600<=a<=799:
  print(7)
if 800<=a<=999:
  print(6)
if 1000<=a<=1199:
  print(5)
if 1200<=a<=1399:
  print(4)
if 1400<=a<=1599:
  print(3)
if 1600<=a<=1799:
  print(2)
if 1800<=a<=1999:
  print(1)