qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
A = sorted(list(map(int,input().split())))
G = {i:0 for i in range(9)}
for i in range(N):
    if A[i]<=399:
        G[0] += 1
    elif A[i]<=799:
        G[1] += 1
    elif A[i]<=1199:
        G[2] += 1
    elif A[i] <= 1599:
        G[3] += 1
    elif A[i] <= 1999:
        G[4] += 1
    elif A[i] <= 2399:
        G[5] += 1
    elif A[i] <= 2799:
        G[6] += 1
    elif A[i] <= 3199:
        G[7] += 1
    else:
        G[8] += 1
cnt = 0
for i in range(8):
    if G[i] > 0:
        cnt += 1
cmin = cnt
cmax = cmin+G[8]

Fixed code:
N = int(input())
A = sorted(list(map(int,input().split())))
G = {i:0 for i in range(9)}
for i in range(N):
    if A[i]<=399:
        G[0] += 1
    elif A[i]<=799:
        G[1] += 1
    elif A[i]<=1199:
        G[2] += 1
    elif A[i] <= 1599:
        G[3] += 1
    elif A[i] <= 1999:
        G[4] += 1
    elif A[i] <= 2399:
        G[5] += 1
    elif A[i] <= 2799:
        G[6] += 1
    elif A[i] <= 3199:
        G[7] += 1
    else:
        G[8] += 1
cnt = 0
for i in range(8):
    if G[i] > 0:
        cnt += 1
if cnt==0:
    cmin = 1
    cmax = G[8]
else:
    cmin = cnt
    cmax = cmin+G[8]
print(cmin,cmax)
Buggy code:
n = int(input())
a = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    for j in range(1,8):
        if a[i]<400*j and 400*(j-1) <= a[i] and color[j-1] == 0:
            color[j-1] += 1
    if a[i] >= 3200:
        color[8] += 1
print(sum(color[0:8]),sum(color))

Fixed code:
n = int(input())
a = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    for j in range(1,9):
        if a[i]<400*j and 400*(j-1) <= a[i] and color[j-1] == 0:
            color[j-1] += 1
    if a[i] >= 3200:
        color[8] += 1
print(max(1,sum(color[0:8])),sum(color))
Buggy code:
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))

d = defaultdict(int)

for i in range(n):
    g = min(8,a[i]//400)
    d[g] +=1

cnt=0
joker=0
for i in d.keys():
    if i != 8:
        cnt+=1
    else:
        joker=d[8]
print(joker)
ans_min = max(cnt,1)
ans_max = cnt+joker


print(ans_min,ans_max)

Fixed code:
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))

d = defaultdict(int)

for i in range(n):
    g = min(8,a[i]//400)
    d[g] +=1

cnt=0
joker=0
for i in d.keys():
    if i != 8:
        cnt+=1
    else:
        joker=d[8]

ans_min = max(cnt,1)
ans_max = cnt+joker


print(ans_min,ans_max)
Buggy code:
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = min(n + c)

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)






    


Fixed code:
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = n + c

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)
Buggy code:
def main():
    N = int(input().strip())

    n_399 = 0
    n_799 = 0
    n_1199 = 0
    n_1599 = 0
    n_1999 = 0
    n_2399 = 0
    n_2799 = 0
    n_3199 = 0
    n_free = 0
    rates = list(map(int, input().strip().split()))
    for r in rates:
        if r <= 399:
            n_399 = 1
        elif r <= 799:
            n_799 = 1
        elif r <= 1199:
            n_1199 = 1
        elif r <= 1599:
            n_1599 = 1
        elif r <= 1999:
            n_1999 = 1
        elif r <= 2399:
            n_2399 = 1
        elif r <= 2799:
            n_2799 = 1
        elif r <= 3199:
            n_3199 = 1
        else:
            n_free += 1

    n_min = n_399 + n_799 + n_1199 + n_1599 + n_1999 + n_2399 + n_2799 + n_3199
    n_rest = N - n_min
    if n_min == 0 and n_free > 0:
        n_min = 1

    if n_min + n_free >= n_rest:
        n_max = n_rest
    else:
        n_max = n_min + n_free

    print(n_min, n_max)

if __name__ == '__main__':
    main()


Fixed code:
def main():
    N = int(input().strip())

    n_399 = 0
    n_799 = 0
    n_1199 = 0
    n_1599 = 0
    n_1999 = 0
    n_2399 = 0
    n_2799 = 0
    n_3199 = 0
    n_free = 0
    rates = list(map(int, input().strip().split()))
    for r in rates:
        if r <= 399:
            n_399 = 1
        elif r <= 799:
            n_799 = 1
        elif r <= 1199:
            n_1199 = 1
        elif r <= 1599:
            n_1599 = 1
        elif r <= 1999:
            n_1999 = 1
        elif r <= 2399:
            n_2399 = 1
        elif r <= 2799:
            n_2799 = 1
        elif r <= 3199:
            n_3199 = 1
        else:
            n_free += 1

    n_less_3200 = n_399 + n_799 + n_1199 + \
        n_1599 + n_1999 + n_2399 + n_2799 + n_3199
    n_rest = N - n_less_3200

    n_min = n_less_3200
    if n_less_3200 == 0 and n_free > 0:
        n_min = 1

    n_max = n_less_3200 + n_free
    if n_less_3200 + n_free >= N:
        n_max = N

    print(n_min, n_max)

if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
A = list(map(int, input().split()))

rate = [0 for _ in range(8)]

for a in A:
    if a < 400:
        rate[0] += 1
    elif a < 800:
        rate[1] += 1
    elif a < 1200:
        rate[2] += 1
    elif a < 1600:
        rate[3] += 1
    elif a < 2000:
        rate[4] += 1
    elif a < 2400:
        rate[5] += 1
    elif a < 2800:
        rate[6] += 1
    else:
        rate[7] += 1

ans = 0
for i in range(7):
    if rate[i] >= 1:
        ans += 1
if ans == 0:
    print(1, rate[i])
else:
    print(ans, ans + rate[7])

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

rate = [0 for _ in range(9)]

for a in A:
    if a < 400:
        rate[0] += 1
    elif a < 800:
        rate[1] += 1
    elif a < 1200:
        rate[2] += 1
    elif a < 1600:
        rate[3] += 1
    elif a < 2000:
        rate[4] += 1
    elif a < 2400:
        rate[5] += 1
    elif a < 2800:
        rate[6] += 1
    elif a < 3200:
        rate[7] += 1
    else:
        rate[8] += 1

ans = 0
for i in range(8):
    if rate[i] >= 1:
        ans += 1
if ans == 0:
    print(1, rate[8])
else:
    print(ans, ans + rate[8])
Buggy code:
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in memLate:
    print((color // 400) in colorList)
    if color // 400 >= 8:
        highLate += 1
    elif ((color // 400) in colorList) == False:
        colorList.append(color // 400)
print(colorList)
maxColor = len(colorList) + highLate
print(str(len(colorList)) + " " + str(maxColor))

Fixed code:
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in range(memTime):
    member = memLate[color]
    if member // 400 >= 8:
        highLate += 1
    elif ((member // 400) in colorList) == False:
        colorList.append(member // 400)
maxColor = len(colorList) + highLate
minColor = len(colorList)
if minColor == 0:
    minColor = 1
print(str(minColor) + " " + str(maxColor))
Buggy code:
N = int(input())
a = list(map(int,input().split()))
color = [False]*8
over_human = 0
for i in a:
    if(i<=399):
        color[0]=True
    elif(i<=799):
        color[1]=True
    elif(i<=1199):
        color[2]=True
    elif(i<=1599):
        color[3]=True
    elif(i<=1999):
        color[4]=True
    elif(i<=2399):
        color[5]=True
    elif(i<=2799):
        color[6]=True
    elif(i<=3199):
        color[7]=True
    elif(i>=3200):
        over_human += 1
if(color.count(True)==0):
    print(1,color.count(True)+over_human))
else:
    print(color.count(True),color.count(True)+over_human))


Fixed code:
N = int(input())
a = list(map(int,input().split()))
color = [False]*8
over_human = 0
for i in a:
    if(i<=399):
        color[0]=True
    elif(i<=799):
        color[1]=True
    elif(i<=1199):
        color[2]=True
    elif(i<=1599):
        color[3]=True
    elif(i<=1999):
        color[4]=True
    elif(i<=2399):
        color[5]=True
    elif(i<=2799):
        color[6]=True
    elif(i<=3199):
        color[7]=True
    elif(i>=3200):
        over_human += 1
if(color.count(True)==0):
    print(1,color.count(True)+over_human)
else:
    print(color.count(True),color.count(True)+over_human)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

ans = [0] * 9
for ai in a:
    if ai // 400 > 7:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

print(sum(ans), sum(ans) + ans[8])

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

ans = [0] * 9
for ai in a:
    if ai // 400 > 7:
        ans[8] += 1
    else:
        ans[ai // 400] = 1

print(max(1, sum(ans[:-1])), sum(ans))
Buggy code:
N = int(input())
L = [0 for i in range(9)]
S = list(map(int, input().split()))
for i in range(N):
  p = S[i] // 400
  if p <= 7:
    L[p] += 1
  else:
    L[8] += 1
Z, M, m = 0, 0, 0
for i in range(8):
  if L[i] == 0:
    Z += 1
  else:
    M += 1
    m += 1
M += L[8]
print(L)
if m == 0 and L[8] != 0:
  m = 1
print(m, M)

Fixed code:
N = int(input())
L = [0 for i in range(9)]
S = list(map(int, input().split()))
for i in range(N):
  p = S[i] // 400
  if p <= 7:
    L[p] += 1
  else:
    L[8] += 1
Z, M, m = 0, 0, 0
for i in range(8):
  if L[i] == 0:
    Z += 1
  else:
    M += 1
    m += 1
M += L[8]
if m == 0 and L[8] != 0:
  m = 1
print(m, M)
Buggy code:
N = int(input())
A = list(map(int, input().split()))

cnt = [0 for _ in range(8)]
over = 0

for a in A:
    if a < 3200:
        ind = a//400
        cnt[ind] = 1
    else:
        over += 1

print(cnt)
ans = sum(cnt)

if over != 0:
    ans_min = max(ans,1)
    ans_max = ans+over
else:
    ans_min = ans
    ans_max = ans
print(ans_min, ans_max)


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

cnt = [0 for _ in range(8)]
over = 0

for a in A:
    if a < 3200:
        ind = a//400
        cnt[ind] = 1
    else:
        over += 1


ans = sum(cnt)

ans_min = max(1,ans)
ans_max = ans + over
# if over != 0:
#     ans_min = max(ans,1)
#     ans_max = min(8,ans+over
# else:
#     ans_min = ans
#     ans_max = ans
print(ans_min, ans_max)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 0
for i in a:
	if i < 400:
		b[0] += 1
	elif i < 800:
		b[1] += 1
	elif i < 1200:
		b[2] += 1
	elif i < 1600:
		b[3] += 1
	elif i < 2000:
		b[4] += 1
	elif i < 2400:
		b[5] += 1
	elif i < 2800:
		b[6] += 1
	elif i < 3200:
		b[7] += 1
	else:
		red += 1
c = 0
print(b)
for i in b:
	if i > 0:
		c += 1
if c == 0:
	mn = 1
else:
	mn = c
mx = c + red
print (mn, mx)


Fixed code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 0
for i in a:
	if i < 400:
		b[0] += 1
	elif i < 800:
		b[1] += 1
	elif i < 1200:
		b[2] += 1
	elif i < 1600:
		b[3] += 1
	elif i < 2000:
		b[4] += 1
	elif i < 2400:
		b[5] += 1
	elif i < 2800:
		b[6] += 1
	elif i < 3200:
		b[7] += 1
	else:
		red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
if c == 0:
	mn = 1
else:
	mn = c
mx = c + red
print (mn, mx)
Buggy code:
L = [0] * 8
n = int(input())
A = list(map(int, input().split()))
t = 0


for i in A:
    if i < 3200:
        a = i//400
        L[a] += 1
    else:
        t += 1
 
c = 0
for i in L:
    if i!= 0:
        c += 1
max_num = max(c, 1)
min_num = c+1
print(max_num,min_num)

Fixed code:
L = [0] * 8
n = int(input())
A = list(map(int, input().split()))
t = 0


for i in A:
    if i < 3200:
        a = i//400
        L[a] += 1
    else:
        t += 1
 
c = 0
for i in L:
    if i!= 0:
        c += 1
max_num = max(c, 1)
min_num = c+t
print(max_num,min_num)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
ans_min=min(1,sum(check))
ans_max=ans_min+n-i
print(ans_min,ans_max)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
if sum(check)==0:
    ans_min=1
    ans_max=n
else:
    ans_min=sum(check)
    ans_max=ans_min+n-i
print(ans_min,ans_max)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*8
free=0
for i in a:
    if 1<=i<400:
        b[0]+=1
    elif i<800:
        b[1]+=1
    elif i<1200:
        b[2]+=1
    elif i<1600:
        b[3]+=1
    elif i<2000:
        b[4]+=1
    elif i<2400:
        b[5]+=1
    elif i<2800:
        b[6]+=1
    elif i<=3200:
        b[7]+=1
    else:
        free+=1
min_color=8-b.count(0)
max_color=8-b.count(0)+free
if max_color>8:
    max_color=8
print("{} {}".format(min_color,max_color))


Fixed code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*8
free=0
for i in a:
    if i<400:
        b[0]+=1
    elif i<800:
        b[1]+=1
    elif i<1200:
        b[2]+=1
    elif i<1600:
        b[3]+=1
    elif i<2000:
        b[4]+=1
    elif i<2400:
        b[5]+=1
    elif i<2800:
        b[6]+=1
    elif i<3200:
        b[7]+=1
    else:
        free+=1
tmp=[i for i in b if i>0]
min_color=max(1,len(tmp))
max_color=len(tmp)+free
print("{} {}".format(min_color,max_color))
Buggy code:
n = input()
a = [int(x) for x in input().split() if x < 3200]
c = len(set([x // 400 for x in a]))
print(max(c, 1), c + n - len(a))

Fixed code:
n = int(input())
a = [int(x) for x in input().split() if int(x) < 3200]
c = len(set([x // 400 for x in a]))
print(max(c, 1), c + n - len(a))
Buggy code:
li = [0]*9

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

for i in a:
    if i//400 > 7:
        li[8] += 1
    else:
        li[i//400] = 1

print(min(1,sum(li[:-1])),sum(li))

Fixed code:
li = [0]*9

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

for i in a:
    if i//400 > 7:
        li[8] += 1
    else:
        li[i//400] = 1

print(max(1,sum(li[:-1])),sum(li))
Buggy code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [range(1,400)]+[range(400*i,400*i+399) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
if ls == []:
    print(1, min(len(exc), 8))
else:
    ans = vars.count(True)
    if exc == []:
        print(ans, ans)
    else:
        print("a")
        print(ans, min(ans+len(exc), 8))


Fixed code:
N = int(input())
A = list(map(int,input().split()))
exc = []
ls = []
for a in A:
    if a < 3200:
        ls.append(a)
    else:
        exc.append(a)
rates = [list(range(1,400))]+[list(range(400*i,400*i+400)) for i in range(1, 8)]
vars = [False]*8
for r in ls:
    for j in range(8):
        if r in rates[j]:
            vars[j] = True
ans = vars.count(True)
if ans == 0:
    print(1, ans+len(exc))
else:
    print(ans, ans+len(exc))
Buggy code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
n = ni()
a = na()
f = [0]*8
sp = 0
for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1

print(sum(f))
if sum(f) > 0:
    print("{} {}".format(sum(f), sum(f)+sp))
else:
    print("{} {}".format(sum(f)+min(sp,1), sum(f)+sp))

Fixed code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
n = ni()
a = na()
f = [0]*8
sp = 0
for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1
        
if sum(f) > 0:
    print("{} {}".format(sum(f), sum(f)+sp))
else:
    print("{} {}".format(sum(f)+min(sp,1), sum(f)+sp))
Buggy code:
N = int(input())
S = list(map(int,input().split()))

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(min(1,ans)) + ' ' + str(ans+count_list[-1]))



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

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(max(ans,1)) + ' ' + str(ans+count_list[-1]))
Buggy code:
col = [0, 399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
flag = [False for _ in range(len(col))]
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(1, len(col)):
        if col[j-1] < a[i] <= col[j]:
            flag[j] = True
        if a[i] >= 3200:
            cnt += 1
bs = flag.count(True)
mn = bs
mx = min(bs+cnt, 8)
print(mn, mx)

Fixed code:
col = [0, 399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
flag = [False for _ in range(len(col))]
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(1, len(col)):
        if col[j-1] < a[i] <= col[j]:
            flag[j] = True
        if a[i] >= 3200:
            cnt += 1
            break
bs = flag.count(True)
mn = max(1, bs)
mx = bs+cnt
print(mn, mx)
Buggy code:
N = int(input())
A = list(map(int, input().split()))

rates = [0 for _ in range(8)]
gold = 0
for a in A:
    rate = a // 400
    if rate < 8:
        rates[rate] += 1
    elif rate >= 8:
        gold += 1

print(rates)
ansMin = min(1, 8 - rates.count(0))
ansMax = ansMin + gold
print(str(ansMin) + ' ' + str(ansMax))


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

rates = [0 for _ in range(8)]
gold = 0
for a in A:
    rate = a // 400
    if rate < 8:
        rates[rate] += 1
    elif rate >= 8:
        gold += 1

ansMin = 8 - rates.count(0)
if ansMin == 0:
    ansMin = 1
ansMax = min(ansMin + gold, N)
print(str(ansMin) + ' ' + str(ansMax))
Buggy code:
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i< 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma =x+y
print('{}{}'.format(mi.ma))

Fixed code:
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<= 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma = x+y
print('{} {}'.format(mi, ma))
Buggy code:
n = int(input())

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

colors = [0] * 8
over = 0

for score in scores:
    if score < 3200:
        colors[score // 400] += 1
    else:
        over += 1

ans = sum(colors > 0 for color in colors)

print(ans, ans + over)



Fixed code:
n = int(input())

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

colors = [0] * 8
over = 0

for score in scores:
    if score < 3200:
        colors[score // 400] += 1
    else:
        over += 1

ans = sum(color > 0 for color in colors)

if ans:
    print(ans, ans + over)
else:
    print(1, over)
Buggy code:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1


checkA = np.array(check[:8])
print(checkA)
num = np.count_nonzero(checkA != 0)

less = max(num, 1)
more = min(8, num + check[8])
#print(check[8])

print(less, more)

Fixed code:
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1


checkA = np.array(check[:8])
#print(checkA)
num = np.count_nonzero(checkA != 0)

less = max(num, 1)
#more = min(8, num + check[8])
more = num + check[8]
# print(check[8])

print(less, more)
'''
checkA = np.array(check[:8])
num = np.count_nonzero(checkA != 0)
if (num == 0):
    num = 1
rest = 8 - num

more = min(8, num + check[8])

print(num, more)
'''
Buggy code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*10
ans = 0
for i in range(n):
    if l[i] >= 3200:
        ans += 1
    else:
        color[int(l[i]/400)] += 1
for i in color:
    if i > 0:
        ans += 1
print(ans)

Fixed code:
n = int(input())
l = list(map(int,input().split()))
color = [0]*10
ans = 0
aans = 0
for i in range(n):
    if l[i] >= 3200:
        aans += 1
    else:
        color[int(l[i]/400)] += 1
for i in color:
    if i > 0:
        ans += 1
if aans == n:
    print(1,n)
else:
    print(ans,aans+ans)
Buggy code:
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        cnt[a[i]//400] += 1
    else:
        free += 1
print(cnt)
print(8-cnt.count(0),min(8,8-cnt.count(0)+free))

Fixed code:
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        cnt[a[i]//400] += 1
    else:
        free += 1
print(max(1,8-cnt.count(0)),8-cnt.count(0)+free)
Buggy code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
print(cnt8)
A = list(sorted(set(A)))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum == 0 and cnt8 > 0:
    print(1, end=' ')
else:
    print(sum, end=' ')
sum += cnt8
if sum > 8:
    print(8)
else:
    print(sum)

Fixed code:
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(set(A))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum == 0:
    print(1, end=' ')
else:
    print(sum, end=' ')
sum += cnt8
print(sum)
Buggy code:
_ = int(input())
a = list(map(int, input().split()))
b = set()
c = 0
for e in a:
    if e >= 3200:
        c += 1
    else:
        b.add(e % 400)
print(max(len(b), 1), len(b) + c)


Fixed code:
_ = int(input())
a = list(map(int, input().split()))
b = set()
c = 0
for e in a:
    if e >= 3200:
        c += 1
    else:
        b.add(e // 400)
print(max(len(b), 1), len(b) + c)
Buggy code:
import sys
input = sys.stdin.readline

def main():
    scores = [i*400 for i in range(1, 8)]
    scores.reverse()

    scores_d = {}
    input()
    god = []
    for a in map(int,input().split()):
        if a >= 3200:
            god.append(a)
            break
        for i in scores:
            if a >= i:
                scores_d[i] = 1
                break
        if a < 400:
            scores_d[0] = 1

    counts = sum(scores_d.values())
    print(counts if counts > 0 else 1, counts + len(god))

main()

Fixed code:
import sys
input = sys.stdin.readline

def main():
    scores = [i*400 for i in range(1, 8)]
    scores.reverse()

    scores_d = {}
    input()
    god = []
    for a in map(int,input().split()):
        if a >= 3200:
            god.append(a)
            continue
        for i in scores:
            if a >= i:
                scores_d[i] = 1
                break
        if a < 400:
            scores_d[0] = 1

    counts = sum(scores_d.values())
    print(counts if counts > 0 else 1, counts + len(god))

main()