qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N=int(input())
a=list(map(int,input().split()))
colormap=[0]*8
free=0
for A in a:
  if A>=3200:
    free+=1
  elif A>=2800:
    colormap[7]=1
  elif A>=2400:
    colormap[6]=1
  elif A>=2000:
    colormap[5]=1
  elif A>=1600:
    colormap[4]=1
  elif A>=1200:
    colormap[3]=1
  elif A>=800:
    colormap[2]=1
  elif A>=400:
    colormap[1]=1
  else:
    colormap[0]=1
c=0
for i in range(8):
  if colormap[i]==1:
    c+=1
mi=min(c,1)
ma=c+free
print(mi,ma)

Fixed code:
N=int(input())
a=list(map(int,input().split()))
colormap=[0]*8
free=0
for A in a:
  if A>=3200:
    free+=1
  elif A>=2800:
    colormap[7]=1
  elif A>=2400:
    colormap[6]=1
  elif A>=2000:
    colormap[5]=1
  elif A>=1600:
    colormap[4]=1
  elif A>=1200:
    colormap[3]=1
  elif A>=800:
    colormap[2]=1
  elif A>=400:
    colormap[1]=1
  else:
    colormap[0]=1
c=0
for i in range(8):
  if colormap[i]==1:
    c+=1
mi=max(c,1)
ma=c+free
print(mi,ma)
Buggy code:
N=int(input())
 
flag=[0]*8
 
a=list(map(int,input().split()))
 
count=0
 
for i in range(N):
 if 1<=a[i]<=399:
  flag[0]=1
 if 400<=a[i]<=799:
  flag[1]=1
 if 800<=a[i]<=1199:
  flag[2]=1
 if 1200<=a[i]<=1599:
  flag[3]=1
 if 1600<=a[i]<1999:
  flag[4]=1
 if 2000<=a[i]<2399:
  flag[5]=1
 if 2400<=a[i]<2799:
  flag[6]=1
 if 2800<=a[i]<3199:
  flag[7]=1
 if 3200<=a[i]:
  count+=1
 
print(min(sum(flag),1),sum(flag)+count)

Fixed code:
N=int(input())
 
flag=[0]*8
 
a=list(map(int,input().split()))
 
count=0
 
for i in range(N):
 if 1<=a[i]<=399:
  flag[0]=1
 if 400<=a[i]<=799:
  flag[1]=1
 if 800<=a[i]<=1199:
  flag[2]=1
 if 1200<=a[i]<=1599:
  flag[3]=1
 if 1600<=a[i]<=1999:
  flag[4]=1
 if 2000<=a[i]<=2399:
  flag[5]=1
 if 2400<=a[i]<=2799:
  flag[6]=1
 if 2800<=a[i]<=3199:
  flag[7]=1
 if 3200<=a[i]:
  count+=1
 
print(max(1,sum(flag)),sum(flag)+count)
Buggy code:
n = int(input())

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


ans = [0] * 8
hi_rate = 0

for i in range(n):
    buf = int(a[i]/400)
    if buf <= 7:
        ans[buf] += 1
    else:
        hi_rate += 1

print(ans)
low_rate = 0
for i in range(8):
    if ans[i] > 0:
        low_rate += 1

if low_rate == 0:
    minm = 1
    maxm = hi_rate
else:
    minm = low_rate
    maxm = low_rate + hi_rate

#if maxm > 8:
#    maxm = 8

print(str(minm) + ' ' + str(maxm))

Fixed code:
n = int(input())

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


ans = [0] * 8
hi_rate = 0

for i in range(n):
    buf = int(a[i]/400)
    if buf <= 7:
        ans[buf] += 1
    else:
        hi_rate += 1

low_rate = 0
for i in range(8):
    if ans[i] > 0:
        low_rate += 1

if low_rate == 0:
    minm = 1
    maxm = hi_rate
else:
    minm = low_rate
    maxm = low_rate + hi_rate

#if maxm > 8:
#    maxm = 8

print(str(minm) + ' ' + str(maxm))
Buggy code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

l = [0]*9
for i in A:
    l[max(i//400,8)] += 1

lf = l[:-1]
ans = 8-lf.count(0)
print(ans,ans+l[8])


Fixed code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

l = [0]*9
for i in A:
    l[min(i//400,8)] += 1

lf = l[:-1]
ans = 8-lf.count(0)
print(max(1,ans),ans+l[8])
Buggy code:
n = int(input())
a = list(map(int,input().split()))
rank_num = [[] for i in range(9)]
for i in range(n):
  if 1<=a[i]<=399:
    rank_num[0].append(a[i])
  if 400<=a[i]<=799:
    rank_num[1].append(a[i])
  if 800<=a[i]<=1199:
    rank_num[2].append(a[i])
  if 1200<=a[i]<=1599:
    rank_num[3].append(a[i])
  if 1600<=a[i]<=1999:
    rank_num[4].append(a[i])
  if 2000<=a[i]<=2399:
    rank_num[5].append(a[i])
  if 2400<=a[i]<=2799:
    rank_num[6].append(a[i])
  if 2800<=a[i]<=3199:
    rank_num[7].append(a[i])
  if 3200<=a[i]:
    rank_num[8].append(a[i])

ans = 0
for i in range(8):
  if rank_num[i]:
    ans = ans +1

min_ans = min(ans,1)
max_ans = ans +len(rank_num[8])
print(min_ans,max_ans)

Fixed code:
n = int(input())
a = list(map(int,input().split()))
rank_num = [[] for i in range(9)]
for i in range(n):
  if 1<=a[i]<=399:
    rank_num[0].append(a[i])
  if 400<=a[i]<=799:
    rank_num[1].append(a[i])
  if 800<=a[i]<=1199:
    rank_num[2].append(a[i])
  if 1200<=a[i]<=1599:
    rank_num[3].append(a[i])
  if 1600<=a[i]<=1999:
    rank_num[4].append(a[i])
  if 2000<=a[i]<=2399:
    rank_num[5].append(a[i])
  if 2400<=a[i]<=2799:
    rank_num[6].append(a[i])
  if 2800<=a[i]<=3199:
    rank_num[7].append(a[i])
  if 3200<=a[i]:
    rank_num[8].append(a[i])
 
ans = 0
for i in range(8):
  if rank_num[i]:
    ans = ans +1
 
min_ans = max(ans,1)
max_ans = ans +len(rank_num[8])
print(min_ans,max_ans)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

a.sort()
color = []
other = 0
for i in a:
    if i < 400 * 1:
        color.append('1')
    elif i < 400 * 2:
        color.append('2')
    elif i < 400 * 3:
        color.append('3')
    elif i < 400 * 4:
        color.append('4')
    elif i < 400 * 5:
        color.append('5')
    elif i < 400 * 6:
        color.append('6')
    elif i < 400 * 7:
        color.append('7')
    elif i < 400 * 8:
        color.append('8')
    else:
        other += 1
max_ans = len(set(color)) + other
if max_ans > 8:
    max_ans = 8
min_ans = len(set(color))
if min_ans == 0 and other != 0
    min_ans = 1
print(min_ans, max_ans)

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

a.sort()
color = []
other = 0
for i in a:
    if i < 400 * 1:
        color.append('1')
    elif i < 400 * 2:
        color.append('2')
    elif i < 400 * 3:
        color.append('3')
    elif i < 400 * 4:
        color.append('4')
    elif i < 400 * 5:
        color.append('5')
    elif i < 400 * 6:
        color.append('6')
    elif i < 400 * 7:
        color.append('7')
    elif i < 400 * 8:
        color.append('8')
    else:
        other += 1
max_ans = len(set(color)) + other
min_ans = len(set(color))
if min_ans == 0 and other != 0:
    min_ans = 1
print(min_ans, max_ans)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = a[i]//400
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1

print('rate_list: ', rate_list)
mini = max(sum(rate_list), 1)
maxi = sum(rate_list)+perfect

print(mini, maxi)

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = a[i]//400
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1
        
mini = max(sum(rate_list), 1)
maxi = sum(rate_list)+perfect

print(mini, maxi)
Buggy code:
N = int(input())
N_List = list(map(int,input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p= (Number_NRD + Number_NRU,8)[Number_NRD +Number_NRU>=8]
min_P= (Number_NRD,1)[Number_NRD == 0]
print(min_p + " " + max_p)

Fixed code:
N = int(input())
N_List = list(map(int,input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p= Number_NRD + Number_NRU
min_p= (Number_NRD,1)[Number_NRD == 0]
print(str(min_p) + " " + str(max_p))
Buggy code:
N = int(input())
R = list(map(int, input().split()))
X = [0]*8
p = 0
for r in R:
  if r >= 3200:
    p += 1
  else:
    X[r//400] = 1

s = sum(X)
if s == 0:
  print(str(1) + " " + str(cnt))
else:
  print(str(s) + " " + str(s + cnt))

Fixed code:
N = int(input())
R = list(map(int, input().split()))
X = [0]*8
p = 0
for r in R:
  if r >= 3200:
    p += 1
  else:
    X[r//400] = 1

s = sum(X)
if s == 0:
  print(str(1) + " " + str(p))
else:
  print(str(s) + " " + str(s + p))
Buggy code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)):
        if (400*j+1) <= i < 400*(j+1):
            lstc[j] += 1
            break
#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1

if lstc[-1] == 0:
    print(n,n)
elif nx == 0:
    print(1,lstc[-1])
else:
    print(nx,nx+lstc[-1])
            

Fixed code:
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)-1):
        #print((400*j),400*(j+1))
        if (400*j) <= i < 400*(j+1):
            lstc[j] += 1
            break
        
    if i >= 3200:
        lstc[-1] += 1
            
#print(lstc)
n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1

if lstc[-1] == 0:
    print(n,n)
elif nx == 0:
    print(1,lstc[-1])
else:
    print(nx,nx+lstc[-1])
Buggy code:
N = int(input())
a = list(map(int, input().split()))

def color(n):
    if n < 400:
        return 0
    elif n < 800:
        return 1
    elif n < 1200:
        return 2
    elif n < 1600:
        return 3
    elif n < 2000:
        return 4
    elif n < 2400:
        return 5
    elif n < 2800:
        return 6
    elif n < 3200:
        return 7
    else:
        return 8

clr = list(map(color, a))
n = len(set(clr))
if 8 not in clr:
    print('{} {}'.format(n, n))
else:
    free_cnt = clr.count('f')
    min_n = max(n-1, 1)
    max_n = min(n+free_cnt-1, 8)
    print('{} {}'.format(min_n, max_n))


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

def color(n):
    if n < 400:
        return 0
    elif n < 800:
        return 1
    elif n < 1200:
        return 2
    elif n < 1600:
        return 3
    elif n < 2000:
        return 4
    elif n < 2400:
        return 5
    elif n < 2800:
        return 6
    elif n < 3200:
        return 7
    else:
        return 8

clr = list(map(color, a))
n = len(set(clr))
if 8 not in clr:
    print('{} {}'.format(n, n))
else:
    free_cnt = clr.count(8)
    min_n = max(n-1, 1)
    # max_n = min(n+free_cnt-1, 8)
    max_n = n+free_cnt-1
    print('{} {}'.format(min_n, max_n))
Buggy code:
n = int(input())
a = list(map(int,input().split()))
c = [0]*9
for i in a:
    b = i//400
    if b >= 8:
        c[8] += 1
    else:
        c[b] =1

print(sum(c[:8])+(1 if c[8] else 0),sum(c[:8])+c[8])

Fixed code:
n = int(input())
a = list(map(int,input().split()))
c = [0]*9
for i in a:
    b = i//400
    if b >= 8:
        c[8] += 1
    else:
        c[b] =1

print(sum(c[:8])+(1 if c[8] and sum(c[:8])==0 else 0),sum(c[:8])+c[8])
Buggy code:
#ABC64C
n = int(input())
a = list(map(int,input().split()))
c = set()
d = 0
fot i in a:
    c = a  // 400:
    if c < 8:
        b.add(c)
    else:
        d += 1:
print(len(b) len(b)+d)

Fixed code:
# ABC64C
n = int(input())
a = list(map(int,input().split()))
b = set()
d = 0
for i in a:
    c = i // 400
    if c < 8:
        b.add(c)
    else:
        d += 1
print(max(len(b),1),len(b)+d)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

gray = 0
blown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
constant = 0
variable = 0

for i in a:
    if i < 400 and gray == 0:
        gray = 1
        constant += 1
        continue
    elif 400 <= i < 800 and blown == 0:
        blown = 1
        constant += 1
        continue
    elif 800 <= i < 1200 and green == 0:
        green = 1
        constant += 1
        continue
    elif 1200 <= i < 1600 and light_blue == 0:
        light_blue = 1
        constant += 1
        continue
    elif 1600 <= i < 2000 and blue == 0:
        blue = 1
        constant += 1
        continue
    elif 2000 <= i < 2400 and yellow == 0:
        yellow = 1
        constant += 1
        continue
    elif 2400 <= i < 2800 and orange == 0:
        orange = 1
        constant += 1
        continue
    elif 2800 <= i < 3200 and red == 0:
        red = 1
        constant += 1
        continue
    elif i >= 3200:
        variable += 1

if constant < variable:
    print(variable, constant+variable)
else:
    print(constant, constant)


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

gray = 0
blown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
constant = 0
variable = 0

for i in a:
    if i < 400 and gray == 0:
        gray = 1
        constant += 1
    elif 400 <= i < 800 and blown == 0:
        blown = 1
        constant += 1
    elif 800 <= i < 1200 and green == 0:
        green = 1
        constant += 1
    elif 1200 <= i < 1600 and light_blue == 0:
        light_blue = 1
        constant += 1
    elif 1600 <= i < 2000 and blue == 0:
        blue = 1
        constant += 1
    elif 2000 <= i < 2400 and yellow == 0:
        yellow = 1
        constant += 1
    elif 2400 <= i < 2800 and orange == 0:
        orange = 1
        constant += 1
    elif 2800 <= i < 3200 and red == 0:
        red = 1
        constant += 1
    elif i >= 3200:
        variable += 1

if constant == 0:
    print(1, variable)
else:
    print(constant, constant+variable)
Buggy code:
N = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: max(x // 400, 8), a))
#print(a)
m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1
M = min(M, 8)
print(m, M)

Fixed code:
N = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: min(x // 400, 8), a))
#print(a)
m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1
#M = min(M, 8)
if m == 0:
    m = 1
print(m, M)
Buggy code:
N = int(input())
A = list(map(int, input().split()))
color = [False] * 8
over3200 = 0
for a in A:
    for i in range(8):
        if a < 400*i:
            color[i] = True
            break
    else:
        over3200 += 1
if sum(color):
    print(sum(color), end=' ')
    print(sum(color) + over3200)
else:
    print(1, end=' ')
    print(over3200)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
color = [False] * 8
over3200 = 0
for a in A:
    for i in range(8):
        if a < 400*(i+1):
            color[i] = True
            break
    else:
        over3200 += 1
if sum(color):
    print(sum(color), end=' ')
    print(sum(color) + over3200)
else:
    print(1, end=' ')
    print(over3200)
Buggy code:
N = int(input())
A = list(map(int,input().split()))
rate = [0] * 9
for e in A:
    for i in range(8,-1,-1):
        if e >= 400*i:
            rate[i] += 1
            break
rate_ex = rate[:-1]
color_kind = 0
for e in rate_ex:
    if e > 0:
        color_kind += 1
print(color_kind)
min_kind = color_kind 
if min_kind == 0:
    min_kind = 1
max_kind = color_kind + rate[-1]
print(min_kind,max_kind)

Fixed code:
N = int(input())
A = list(map(int,input().split()))
rate = [0] * 9
for e in A:
    for i in range(8,-1,-1):
        if e >= 400*i:
            rate[i] += 1
            break
rate_ex = rate[:-1]
color_kind = 0
for e in rate_ex:
    if e > 0:
        color_kind += 1
min_kind = color_kind 
if min_kind == 0:
    min_kind = 1
max_kind = color_kind + rate[-1]
print(min_kind,max_kind)
Buggy code:
from collections import Counter
N = input()
c = Counter([int(i)//400 for i in input().split()])
print(c)
ans = 0
for i in  range(8):
  ans += bool(c[i])
print(max(ans,1),ans+c[8])

Fixed code:
from collections import Counter
input()
c = Counter([min(int(i)//400,8) for i in input().split()])
ans = 0
for i in range(8):
 ans += bool(c[i])
print(max(ans,1),ans+c[8])
Buggy code:
n = int(input())
a = list(map(int, input().split()))
c = [False]*8
k = 0
ans = 0
for i in range(n):
  cn = a[i]//400
  if cn < 8:
    if c[cn] == False:
      ans += 1
      c[cn] = True
  else:
    k += 1


Fixed code:
n = int(input())
a = list(map(int, input().split()))
c = [False]*8
k = 0
ans = 0
for i in range(n):
  cn = a[i]//400
  if cn < 8:
    if c[cn] == False:
      ans += 1
      c[cn] = True
  else:
    k += 1
print(max(1, ans), ans + k)
Buggy code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
if max_ >8:
    max_ = 8
print(min_, ' ', max_)

Fixed code:
n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x//400, A))
#print(A)

import collections
c = collections.Counter(A)
#print(c)
f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
        
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
'''if max_ >8:
    max_ = 8'''
if min_ <1:
    min_ = 1
print(min_, max_)
Buggy code:
n = int(input())
a = [int(i) for i in input().split()]
ans1 = 0
ans2 = 0
b = []
for i in a:
    if i < 3200:
        k = i // 400
        if not k in b:
            ans2 += 1
            ans1 += 1
            b.append(k)
    else:
        ans2 += 1
print(min(ans1,1), ans2)

Fixed code:
n = int(input())
a = [int(i) for i in input().split()]
ans1 = 0
ans2 = 0
b = []
for i in a:
    if i < 3200:
        k = i // 400
        if not k in b:
            ans2 += 1
            ans1 += 1
            b.append(k)
    else:
        ans2 += 1
print(max(ans1,1), ans2)
Buggy code:
n = int(input())
nums = list(map(int, input().split()))

num_free = 0
num_color = [False] * 8
for rate in nums:
    if rate < 3200:
        num_color(rate // 400) = True
    else:
        num_free += 1

ans = sum(num_color)
print('{} {}'.format(ans, ans + num_free))


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

num_free = 0
num_color = [False] * 8
for rate in nums:
    if rate < 3200:
        num_color[rate // 400] = True
    else:
        num_free += 1

ans = sum(num_color)
print('{} {}'.format(max(ans, 1), ans + num_free))
Buggy code:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = solve(n, a)
    print(*ans)


def solve(n, a):
    m = 8
    colors = [0 for i in range(m + 1)]
    for i in range(n):
        for j in range(m):
            if a[i] < 400 * (j + 1):
                colors[j] += 1
                break
        else:
            colors[m] += 1
    usedcolors = sum([1 for i in colors[:m] if i > 0])
    ans = [max(1,usedcolors), min(usedcolors + colors[m])]

    return ans


if __name__ == '__main__':
    main()

Fixed code:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = solve(n, a)
    print(*ans)


def solve(n, a):
    m = 8
    colors = [0 for i in range(m + 1)]
    for i in range(n):
        for j in range(m):
            if a[i] < 400 * (j + 1):
                colors[j] += 1
                break
        else:
            colors[m] += 1
    usedcolors = sum([1 for i in colors[:m] if i > 0])
    ans = [max(1,usedcolors), usedcolors + colors[m]]

    return ans


if __name__ == '__main__':
    main()
Buggy code:
n, *A = map(int, open(0).read().split())
B = [0] * 9
for a in A:
  if a < 3200:
  	B[a // 400] = 1
  else:
    B[8] += 1
print(min(8, sum(B)))

Fixed code:
n, *A = map(int, open(0).read().split())
B = [0] * 9
for a in A:
  if a < 3200:
  	B[a // 400] = 1
  else:
    B[8] += 1
print(max(sum(B[:8]), 1), sum(B))
Buggy code:
n=int(input())
a=list(map(int,input().split()))

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]//400:
        count+=1
    else:
        ans[a[i]//400]=1
print(ans)
if sum(ans)==0:
    print(1,min(8,count))
else:
    print(sum(ans),min(8,sum(ans)+count))



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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]//400:
        count+=1
    else:
        ans[a[i]//400]=1
#print(ans)
if sum(ans)==0:
    print(1,min(8,count))
else:
    print(sum(ans),sum(ans)+count)
Buggy code:
N = int(input())
a = list(map(int, input().split()))

rank = [0]*9

for i in range(N):😌
    if a[i] < 400:
        rank[0] += 1
    elif a[i] < 800:
        rank[1] += 1
    elif a[i] < 1200:
        rank[2] += 1
    elif a[i] < 1600:
        rank[3] += 1
    elif a[i] < 2000:
        rank[4] += 1
    elif a[i] < 2400:
        rank[5] += 1
    elif a[i] < 2800:
        rank[6] += 1
    elif a[i] < 3200:
        rank[7] += 1
    else:
        rank[8] += 1

sum = 0

for i in range(8):
    if rank[i] > 0:
        sum += 1

min = sum
max = sum + rank[8]

if min == 0:
  min = 1

print(min,max)

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

rank = [0]*9

for i in range(N):
    if a[i] < 400:
        rank[0] += 1
    elif a[i] < 800:
        rank[1] += 1
    elif a[i] < 1200:
        rank[2] += 1
    elif a[i] < 1600:
        rank[3] += 1
    elif a[i] < 2000:
        rank[4] += 1
    elif a[i] < 2400:
        rank[5] += 1
    elif a[i] < 2800:
        rank[6] += 1
    elif a[i] < 3200:
        rank[7] += 1
    else:
        rank[8] += 1

sum = 0

for i in range(8):
    if rank[i] > 0:
        sum += 1

min = sum
max = sum + rank[8]

if min == 0:
  min = 1

print(min,max)
Buggy code:
N = int(input())
A = [int(i) for i in input().split()]

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 28001 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_strong = L[8]
if count_strong >= 1:
    print(8-count_0, 8-count_0+min(2, max(count_strong, count_0)))
else:
    print(8-count_0, 8-count_0)

Fixed code:
N = int(input())
A = [int(i) for i in input().split()]

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 2800 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_not_0 = 8 - count_0
count_strong = L[8]

if count_not_0 == 0:
    if count_strong >= 1:
        print(1, count_strong,)
    else:
        print(0, 0)
else:
    if count_strong == 0:
        print(count_not_0, count_not_0)
    else:
        print(count_not_0, count_not_0 + count_strong)
Buggy code:
n = int(input())
a = list(map(int,input().split()))

for i in range(n):
    if a[i] < 400:
        a[i] = 0
    elif a[i] < 800:
        a[i] = 1
    elif a[i] < 1200:
        a[i] = 2
    elif a[i] < 1600:
        a[i] = 3
    elif a[i] < 2000:
        a[i] = 4
    elif a[i] < 2400:
        a[i] = 5
    elif a[i] < 2800:
        a[i] = 6
    elif a[i] < 3200:
        a[i] = 7
    else:
        a[i] = 8

if a.count(8) > 0:
    print(len(set(a)),len(set(a))+2)
else:
    print([len(set(a)),len(set(a))])

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

for i in range(n):
    if a[i] < 400:
        a[i] = 0
    elif a[i] < 800:
        a[i] = 1
    elif a[i] < 1200:
        a[i] = 2
    elif a[i] < 1600:
        a[i] = 3
    elif a[i] < 2000:
        a[i] = 4
    elif a[i] < 2400:
        a[i] = 5
    elif a[i] < 2800:
        a[i] = 6
    elif a[i] < 3200:
        a[i] = 7
    else:
        a[i] = 8

if a.count(8) > 0:
    print(max(len(set(a))-1,1),len(set(a)) -1 +a.count(8))
else:
    print(len(set(a)),len(set(a)))