qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
a = list(map(int, input().split(" ")))

colors=[]
if list(filter(lambda x:x<3200, a)):
    f=lambda x:x<400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:400<=x<800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:800<=x<1200
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1200<=x<1600
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1600<=x<2000
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2000<=x<2400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2400<=x<2800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2800<=x<3200
    colors.append(1 if list(filter(f, a)) else 0)

    print(sum(colors), sum(colors)+len(list(filter(lambda x:3200<=x, a)))

else:
    print(1, n)



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

colors=[]
if list(filter(lambda x:x<3200, a)):
    f=lambda x:x<400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:400<=x<800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:800<=x<1200
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1200<=x<1600
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:1600<=x<2000
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2000<=x<2400
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2400<=x<2800
    colors.append(1 if list(filter(f, a)) else 0)
    f=lambda x:2800<=x<3200
    colors.append(1 if list(filter(f, a)) else 0)

    print(sum(colors), sum(colors)+len(list(filter(lambda x:3200<=x, a))))

else:
    print(1, n)
Buggy code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if i in CA:
        num += 1

num_8 = CA[8]
saidai = min(num + num_8, 8)

saisho = min(1, num)
print(saisho, saidai)



Fixed code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A = [min(8, a // 400) for a in A]
CA = Counter(A)
num = 0
for i in range(8):
    if CA[i]:
        num += 1

num_8 = CA[8]
saidai = num + num_8

saisho = max(1, num)
print(saisho, saidai)
Buggy code:
N=int(input())
p=list(map(int,input().split()))
s=set()
z=0
for i in range(N):
  p[i]//=400
  if p[i]<8:
    s.add(p[i])
  else:
    z+=1
print(len(s)+z)

Fixed code:
N=int(input())
p=list(map(int,input().split()))
s=set()
z=0
for i in range(N):
  p[i]//=400
  if p[i]<8:
    s.add(p[i])
  else:
    z+=1
print(max(1,len(s)),end=' ')
print(len(s)+z)
Buggy code:
na = lambda: list(map(int, input().split()))
n = int(input())
a = na()
ans = set()
pro = 0
for i in a:
    if i >= 3200:
        pro += 1
    ans.add(i // 400)
a = len(ans)-pro
print((a if a > 0 else 1),  len(ans))

Fixed code:
na = lambda: list(map(int, input().split()))
n = int(input())
a = na()
ans = set()
pro = 0
for i in a:
    if i >= 3200:
        pro += 1
        continue
    ans.add(i // 400)
print(len(ans) if len(ans) > 0 else 1,  len(ans)+pro)
Buggy code:
ates = list(input().split())

for i in range(len(rates)):
    rates[i] = int(rates[i]) // 400

MAX = 0
MIN = 0
j = 0
while j <= 8:
    for k in range(N):
        if j != 8 and j == rates[k]:
            MAX += 1
            MIN += 1
            break
        elif j == 8 and j <= rates[k]:
            MAX += 1
            if MIN == 0:
                MIN = 1
            continue
    j += 1

print(MIN, MAX)


Fixed code:
N = int(input())
rates = list(input().split())

for i in range(len(rates)):
    rates[i] = int(rates[i]) // 400

MAX = 0
MIN = 0
j = 0
while j <= 8:
    for k in range(N):
        if j != 8 and j == rates[k]:
            MAX += 1
            MIN += 1
            break
        elif j == 8 and j <= rates[k]:
            MAX += 1
            if MIN == 0:
                MIN = 1
                continue
            continue
    j += 1

print(MIN, MAX)
Buggy code:
n=int(input())
A=list(map(int,input().split()))
c=0
for i in range(n):
    if A[i]>=3200:
        c+=1
        A[i]=8
    else:
        A[i]//=400
print(A)
m=len(set(A))
if c:
    print(m-1,m-1+c)
else:
    print(m,m)

Fixed code:
n=int(input())
A=list(map(int,input().split()))
c=0
for i in range(n):
    if A[i]>=3200:
        c+=1
        A[i]=8
    else:
        A[i]//=400
m=len(set(A))
if c:
    if m==1:
        print(1,c)
    else:
        print(m-1,m-1+c)
else:
    print(m,m)
Buggy code:
n = int(input())
A = list(map(int, input().split()))
count= [0 for _ in range(9)]
for i in range(n):
    if a[i] // 400 >= 8:
        count[8] += 1
    elif count[a[i] // 400] == 0:
        count[a[i] // 400] += 1

if count[8] == sum(count):
    print(1, sum(count))
else:
    print(sum(count)-count[8], sum(count))


Fixed code:
n = int(input())
A = list(map(int, input().split()))
count = [0 for _ in range(9)]
for i in range(n):
    if A[i] // 400 >= 8:
        count[8] += 1
    elif count[A[i] // 400] == 0:
        count[A[i] // 400] += 1

if count[8] == sum(count):
    print(1, sum(count))
else:
    print(sum(count)-count[8], sum(count))
Buggy code:
import math
n = int(input())
lis = []
cou = 0
ans = 0
li = list(map(int,input().split()))
for i in range(n):
    if li[i] >= 3200:
        cou += 1
    else:
        if math.floor(li[i] / 400) not in lis:
            ans += 1
print(ans,min(8,ans + cou))

Fixed code:
import math
n = int(input())
lis = []
cou = 0
li = list(map(int,input().split()))
for i in range(n):
    if li[i] >= 3200:
        cou += 1
    else:
        if math.floor(li[i] // 400) not in lis:
            lis.append(li[i] // 400)
if len(lis) == 0:
    print(1,min(len(lis) + cou,8))
else:
    print(len(lis),min(n,len(lis) + cou))
Buggy code:
# coding: utf-8
import array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}


def read():
    N = II()
    a = ILI()
    return (N, a)


def solve(N, a):
    count = [0] * 9
    for ele in a:
        if 1 <= ele <= 399:
            count[0] = 1
        elif 400 <= ele <= 799:
            count[1] = 1
        elif 800 <= ele <= 1199:
            count[2] = 1
        elif 1200 <= ele <= 1599:
            count[3] = 1
        elif 1600 <= ele <= 1999:
            count[4] = 1
        elif 2000 <= ele <= 2399:
            count[5] = 1
        elif 2400 <= ele <= 2799:
            count[6] = 1
        elif 2800 <= ele <= 3199:
            count[7] = 1
        elif ele >= 3200:
            count[8] += 1
    
    ans = sum(count)
    return ans


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()


Fixed code:
# coding: utf-8
import array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}


def read():
    N = II()
    a = ILI()
    return (N, a)


def solve(N, a):
    count = [0] * 9
    for ele in a:
        if 1 <= ele <= 399:
            count[0] = 1
        elif 400 <= ele <= 799:
            count[1] = 1
        elif 800 <= ele <= 1199:
            count[2] = 1
        elif 1200 <= ele <= 1599:
            count[3] = 1
        elif 1600 <= ele <= 1999:
            count[4] = 1
        elif 2000 <= ele <= 2399:
            count[5] = 1
        elif 2400 <= ele <= 2799:
            count[6] = 1
        elif 2800 <= ele <= 3199:
            count[7] = 1
        elif ele >= 3200:
            count[8] += 1

    num_else = sum(count[0: 8])
    ans_max = sum(count)
    if num_else == 0:
        ans_min = 1
    else:
        ans_min = num_else
    
    ans = (ans_min, ans_max)
    return ans


def main():
    params = read()
    ans = solve(*params)
    print("{} {}".format(ans[0], ans[1]))


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

A = [a // 400 for a in A]

C = [0 for _ in range(8)]
for a in A:
    if a > 8:
        a = 8
    C[a - 1] += 1

cnt_0 = 0
cnt_n0 = 0
print(C)
for c in C[:-1]:
    print(c)
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1

ans_min = max(cnt_n0, 1)
ans_max = cnt_n0 + min(cnt_0, C[-1])
print(ans_min, ans_max)


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

A = [a // 400 for a in A]

C = [0 for _ in range(9)]
for a in A:
    if a > 8:
        a = 8
    C[a] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1


if C[-1] == 0:
    ans_min = cnt_n0
    ans_max = cnt_n0
else:
    if sum(C) == C[-1]:
        ans_min = 1
    else:
        ans_min = cnt_n0 - 1

    ans_max = cnt_n0 - 1 + C[-1]


print(ans_min, ans_max)
Buggy code:
# coding: utf-8
L = [0 for _ in range(8)]
N = int(input())
A = list(map(int, input().split()))
v = 0
for i in range(N):
    idx = A[i] // 400
    if idx > 8:
        v += 1
    else:
        L[idx] += 1
amin, amax = 0, 0
for i in range(len(L)):
    if L[i] > 0:
        amin += 1
    if L[i] == 0 and v > 0:
        L[i] += 1
        v -= 1
amin = max(1, amin)
for i in range(len(L)):
    if L[i] > 0:
        amax += 1
print(amin, amax)

Fixed code:
# coding: utf-8
L = [0 for _ in range(8)]
N = int(input())
A = list(map(int, input().split()))
v = 0
for i in range(N):
    idx = A[i] // 400
    if idx >= 8:
        v += 1
    else:
        L[idx] += 1
amin, amax = 0, 0
for i in range(len(L)):
    if L[i] > 0:
        amin += 1
    # if L[i] == 0 and v > 0:
    #     L[i] += 1
    #     v -= 1
# amin = max(1, amin)
# for i in range(len(L)):
#     if L[i] > 0:
#         amax += 1
print(max(1, amin), amin + v)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
rank = [0] * 9
for i in a:
    if i < 3200:
        rank[i // 400] += 1
    rank[8] += 1

s = 0
for i in range(8):
    if rank[i] > 0:
        s += 1
if s > 0:
    s1 = s
else:
    s1 = 1
s2 = s + rank[8]
print(s1, s2)


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

s = 0
for i in range(8):
    if rank[i] > 0:
        s += 1
if s > 0:
    s1 = s
else:
    s1 = 1
s2 = s + rank[8]
print(s1, s2)
Buggy code:

N = int(input())

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


dic = {}
free = 0

for i in a:

    if i // 400 < 8:

        dic[i//400] = 1

    else:

        free += 1

print( min(1,len(dic)) ,  len(dic) + free )

Fixed code:

N = int(input())

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


dic = {}
free = 0

for i in a:

    if i // 400 < 8:

        dic[i//400] = 1

    else:

        free += 1

print( max(1,len(dic)) ,  len(dic) + free )
Buggy code:
N=int(input())
a=list(map(int,input().split()))
color=[0]*9
ac=0
for i in range(N):
    rate=min(a[i]//400,8)
    color[rate]+=1
for i in range(8):
    if color[i]>=1:
        ac+=1
min_ans=min(ac,color[8])
max_ans=min(8,ac+color[8])
print(min_ans,max_ans)

Fixed code:
N=int(input())
a=list(map(int,input().split()))
color=[0]*9
ac=0
for i in range(N):
    rate=min(a[i]//400,8)
    color[rate]+=1
for i in range(8):
    if color[i]>=1:
        ac+=1
min_ans=max(ac,1)
max_ans=ac+color[8]
print(min_ans,max_ans)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

color = [0] * 8
ans = 0

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

print(min(sum(color), 1), sum(color) + ans)

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

color = [0] * 8
ans = 0

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

print(sum(color) if sum(color) > 0 else 1, sum(color) + ans)
Buggy code:
N=input()
N=int(N)
a=input()
a=a.split()
score=[0]*8
legend=0
inrank=0
a=[int(item) for item in a]
for i in range(N):
    p=int(a[i]/400)
    if p >= 8:
        legend+=1
    else:
        score[p]=1
inrank=score.count(1)
if legend!=0:
    if inrank==0:
        t_max=legend
        t_min=0
    else:
        t_max=inrank+legend
        t_min=inrank
print(str(t_min)+" "+str(t_max))





Fixed code:
N=input()
N=int(N)
a=input()
a=a.split()
score=[0]*8
legend=0
inrank=0
a=[int(item) for item in a]
for i in range(0,N):
    p=int(a[i]/400)
    if p >= 8:
        legend+=1
    else:
        score[p]=1
inrank=score.count(1)
if legend!=0:
    if inrank==0:
        t_max=legend
        t_min=1
    else:
        t_max=inrank+legend
        t_min=inrank
else:
    t_max=inrank
    t_min=inrank
print(str(t_min)+" "+str(t_max))
Buggy code:
#Colorful Leaderboard
import numpy as np
import math as m
n = int(input())
a = np.array(list(map(int, input().split())))
b = sorted (a//400)
cnt = 0
for i in range(len(b)):s
    if b[i]  < 8:
        None
    else:
        b[i]+=i
        cnt+=1
c = len(list(set(b)))

print(str(c-cnt) + " " + str(c))

Fixed code:
#Colorful Leaderboard
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
b = sorted (a//400)
cnt = 0
for i in range(len(b)):
    if b[i]  < 8:
        None
    else:
        b[i]+=i
        cnt+=1
c = len(list(set(b)))

print(str(max([1,c-cnt])) + " " + str(c))
Buggy code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
for i in range(n):
  if a[i]<400:
    b[0]+=1
  elif a[i]<800:
    b[1]+=1
  elif a[i]<1200:
    b[2]+=1
  elif a[i]<1600:
    b[3]+=1
  elif a[i]<2000:
    b[4]+=1
  elif a[i]<2400:
    b[5]+=1
  elif a[i]<2800:
    b[6]+=1
  elif a[i]<3200:
    b[7]+=1
  else:
    b[8]+=1
    
min=8-b[:8].count(0)
max=min+b[8]

if min=0:
  min=1
print(min,max)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
for i in range(n):
  if a[i]<400:
    b[0]+=1
  elif a[i]<800:
    b[1]+=1
  elif a[i]<1200:
    b[2]+=1
  elif a[i]<1600:
    b[3]+=1
  elif a[i]<2000:
    b[4]+=1
  elif a[i]<2400:
    b[5]+=1
  elif a[i]<2800:
    b[6]+=1
  elif a[i]<3200:
    b[7]+=1
  else:
    b[8]+=1
    
min=8-b[:8].count(0)
max=min+b[8]

if min==0:
  min=1
print(min,max)
Buggy code:
n=int(input())
A=list(map(int,input().split()))
B=[0,0,0,0,0,0,0,0]
red=int(0)
for i in range(n):
    now=int(A[i]/400)
    if now<=8:
        B[now]=1
    else:
        red+=1

ans=B.count(1)
print("{} {}".format(ans,ans+red))

Fixed code:
n=int(input())
A=list(map(int,input().split()))
B=[0,0,0,0,0,0,0,0]
red=int(0)
for i in range(n):
    now=int(A[i]/400)
    if now<8:
        B[now]=1
    else:
        red+=1

ans=B.count(1)
if ans==0:
    ans=1
    red-=1
print("{} {}".format(ans,ans+red))
Buggy code:
N = int(input())
a = list(map(int,input().split()))
col = [0]*8
wild = 0
for i in a:
    if i//400 <= 7:
        col[i//400] = 1
    else:
        wild += 1
minimum = max(1,sum(col))
maximum = min(sum(col)+wild)
print(minimum,maximum)

Fixed code:
N = int(input())
a = list(map(int,input().split()))
col = [0]*8
wild = 0
for i in a:
    if i//400 <= 7:
        col[i//400] = 1
    else:
        wild += 1
minimum = max(1,sum(col))
maximum = sum(col)+wild
print(minimum,maximum)
Buggy code:
n=int(input())
a=[int(i) for i in input().split()]
iro=[0 for i in range(8)]
tyi=0
for i in range(n):
  if a<3200:
    iro[int(a/400)]=1
  else:
    tyi+=1
print(min(iro.count(1)+tyi,8))

Fixed code:
n=int(input())
a=[int(i) for i in input().split()]
iro=[0 for i in range(8)]
tyi=0
for i in range(n):
  if a[i]<3200:
    iro[int(a[i]/400)]=1
  else:
    tyi+=1
print(max(iro.count(1),1),iro.count(1)+tyi)
Buggy code:
n = int(input())
a = map(int, input().split())
l = [0 for i in range(9)]

for i in a:
    if i // 400 >= 8:
        l[8] += 1
    else:
        l[i // 400] = 1
print(max(1, sum(l[:8]), sum(l)))


Fixed code:
n = int(input())
a = map(int, input().split())
l = [0 for i in range(9)]

for i in a:
    if i // 400 >= 8:
        l[8] += 1
    else:
        l[i // 400] = 1
if sum(l[:8]) == 0:
    print(1, sum(l))
else:
    print(sum(l[:8]), sum(l))
Buggy code:
n = int(input())
a = list(map(int,input().split()))

ans = [False] * 9
tmp = 0
for i in a:
    if i > 3199:
        ans[8] = True
        tmp += 1
    else:
        ans[i//400] = True
print(sum(ans),sum(ans)+tmp)

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

ans = [False] * 8
tmp = 0
for i in a:
    if i > 3199:
        tmp += 1
    else:
        ans[i // 400] = True
print(max(sum(ans),1), sum(ans) + tmp)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = 1
else:
    minrate = sum(li[:8])

Fixed code:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = 1
else:
    minrate = sum(li[:8])

print(minrate, maxrate)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in range(n):
    for j in range(9):
        if 400 * j <= a[i] < 400 * (j + 1) - 1 and j != 8:
            b[j] += 1
        elif j == 8 and a[i] >= 400 * j:
            b[j] += 1
m = 0
M = 0
for i in range(8):
    if b[i] != 0:
        m += 1
        M += 1
M += b[8]
if M > 8:
    M = 8
if m == 0 and b[8] !=0:
    m == 1
print(b)
print(m, M)


Fixed code:
n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in range(n):
    for j in range(9):
        if 400 * j <= a[i] <= 400 * (j + 1) - 1 and j != 8:
            b[j] += 1
        elif j == 8 and a[i] >= 400 * j:
            b[j] += 1
m = 0
M = 0
for i in range(8):
    if b[i] != 0:
        m += 1
        M += 1
M += b[8]
if m == 0:
    m = 1
print(m, M)
Buggy code:
N = int(input())
A = list(map(int,input().split()))

MX = 8
R = [0] * 9

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

cnt = 0
el = R[8]
print(max(cnt,1),cnt+el)

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

MX = 8
R = [0] * 9

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

cnt = 0
for i in range(8):
  if R[i]:
    cnt += 1

el = R[8]
print(max(cnt,1),cnt+el)
Buggy code:
N=int(input())
m=list(map(int,input().split()))
ans=0
rainbow=0
table=[0,0,0,0,0,0,0,0]
for i in m:
  if i>3199:
    rainbow+=1
  else:
    if table[i//400]==0:
      ans=ans+1
      table[i//400]=1
print(max(1,sum(table)))
print(min(8,sum(table)+rainbow))

Fixed code:
N=int(input())
m=list(map(int,input().split()))
ans=0
rainbow=0
table=[0,0,0,0,0,0,0,0]
for i in m:
  if i>3199:
    rainbow+=1
  else:
    if table[i//400]==0:
      ans=ans+1
      table[i//400]=1
print(max(1,sum(table)),sum(table)+rainbow)
Buggy code:
N = int(input())
A = list(map(int, input().split()))

cnt1 = 0
for i in range(8):
  v1 = i * 400
  v2 = (i + 1) * 400 - 1
  for j in range(N):
    if v1 <= A[i] <= v2:
      cnt1 += 1
      break

cnt2 = 0
for i in range(N):
  if A[i] >= 3200:
    cnt2 += 1

print(cnt1, cnt2)

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

cnt1 = 0
for i in range(8):
  v1 = i * 400
  v2 = (i + 1) * 400 - 1
  for j in range(N):
    if v1 <= A[j] and A[j] <= v2:
      cnt1 += 1
      break

cnt2 = 0
for i in range(N):
  if A[i] >= 3200:
    cnt2 += 1

if cnt1 == 0:
  print(1, cnt2)
else:
  print(cnt1, cnt1 + cnt2)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
color = set()
free = 0
for i in range(n):
    if a[i] < 3200:
        color.add(a[i]//400)
    else:
        free += 1
print(color)
print("{} {}".format(max(1, len(color)), free + len(color)))

Fixed code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
color = set()
free = 0
for i in range(n):
    if a[i] < 3200:
        color.add(a[i]//400)
    else:
        free += 1
print("{} {}".format(max(1, len(color)), free + len(color)))
Buggy code:
n = int(input())
a = map(int, input().split(" "))

color_types = [False]*8
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = True
	else:
		pro_count += 1
print(color_types)
print(sum(max(1,　color_types)), min(8, sum(color_types)+pro_count))

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

color_types = [False]*8
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = 1
	else:
		pro_count += 1
print(max(1, sum(color_types)), sum(color_types)+pro_count)
Buggy code:
a=int(input())
b=list(map(int,input().split()))
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
x=0
for z in range(a):
  if b[z]<=399:
    c=c+1
  if 400<=b[z]<799:
    d=d+1
  if 800<=b[z]<=1199:
    e=e+1
  if 1200<=b[z]<=1599:
    f=f+1
  if 1600<=b[z]<=1999:
    g=g+1
  if 2000<=b[z]<=2399:
    h=h+1
  if 2400<=b[z]<=2799:
    i=i+1
  if 2800<=b[z]<=3199:
    j=j+1
  if b[z]>=3200:
    k=k+1
if c!=0:
  x=x+1
if d!=0:
  x=x+1
if e!=0:
  x=x+1
if f!=0:
  x=x+1
if g!=0:
  x=x+1
if h!=0:
  x=x+1
if i!=0:
  x=x+1
if j!=0:
  x=x+1
if k+x>a:
  print(a)
else:
  print(k+x)

Fixed code:
a=int(input())
b=list(map(int,input().split()))
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
x=0
for z in range(a):
  if b[z]<=399:
    c=c+1
  if 400<=b[z]<799:
    d=d+1
  if 800<=b[z]<=1199:
    e=e+1
  if 1200<=b[z]<=1599:
    f=f+1
  if 1600<=b[z]<=1999:
    g=g+1
  if 2000<=b[z]<=2399:
    h=h+1
  if 2400<=b[z]<=2799:
    i=i+1
  if 2800<=b[z]<=3199:
    j=j+1
  if b[z]>=3200:
    k=k+1
if c!=0:
  x=x+1
if d!=0:
  x=x+1
if e!=0:
  x=x+1
if f!=0:
  x=x+1
if g!=0:
  x=x+1
if h!=0:
  x=x+1
if i!=0:
  x=x+1
if j!=0:
  x=x+1
if k+x>a:
  print(x,a)
elif (c+d+e+f+g+h+i+j)==0 and k!=0:
  print(1,k)
else:
  print(x,k+x)
Buggy code:
n = int(input())
l = list(map(int,input().split()))
ans = [0]*9

for i in l:
  x = i//400
  if x >= 8:
    ans[8] += 1
  else:
    ans[x] += 1
count = 0
for i in range(8):
  if ans[i] > 0:
    count += 1
if ans[8]==0:
  print(count,count)
else:
  print(count+1,count+ans[8])

Fixed code:
n = int(input())
l = list(map(int,input().split()))
ans = [0]*9

for i in l:
  x = i//400
  if x >= 8:
    ans[8] += 1
  else:
    ans[x] += 1
count = 0
for i in range(8):
  if ans[i] > 0:
    count += 1
if ans[8]==0:
  print(count,count)
else:
  if count != 0:
    print(count,count+ans[8])
  else:
    print(1,ans[8])