qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import numpy as np
N = int(input())
a_list = list(map(int, input().split()))
class_list = []
free_list = []
for a in a_list:  
  if a < 3200:
    amod = a // 400
    class_list.append(amod)
  
  else:
    free_list.append(a)

print(class_list)
print(free_list)

set_list = list(set(class_list))

print(len(set_list), len(set_list) + len(free_list))

    

  



Fixed code:
import numpy as np
N = int(input())
a_list = list(map(int, input().split()))
class_list = []
free_list = []
for a in a_list:  
  if a < 3200:
    amod = a // 400
    class_list.append(amod)
  
  else:
    free_list.append(a)

set_list = list(set(class_list))
min_list = len(set_list)
max_list = len(set_list) + len(free_list)

if min_list == 0:
  min_list = 1
print(min_list, max_list)
Buggy code:
N = int(input())
a = [int(i) for i in input().split()]
rank = [0]*9
ans = [0]*2
for i in range(len(a)):
    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
ans[0] = sum(rank)
if 8 < ans[0]:
    ans[0] = 8
if rank[8] != 0 and (sum(rank[0:8])) == 0:
    ans[1] = 1
else:
    ans[1] = sum(rank[0:8])

[print(ans[i], end=' ') for i in range(len(ans))]


Fixed code:
N = int(input())
a = [int(i) for i in input().split()]
rank = [0]*9
ans = [0]*2
for i in range(len(a)):
    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
ans[0] = sum(rank)

if sum(rank[:8]) == 0:
    ans[1] = 1
else:
    ans[1] = sum(rank[:8])

[print(ans[i], end=' ') for i in reversed(range(len(ans)))]
Buggy code:
import collections

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

B = []
cnt = 0
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    else:
        B.append(A[i]//400)
print(B)
c = collections.Counter(B)

small = len(c) if len(c) != 0 else 1
big = len(c)+cnt

print(small, big)

Fixed code:
import collections

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

B = []
cnt = 0
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    else:
        B.append(A[i]//400)

c = collections.Counter(B)

small = len(c) if len(c) != 0 else 1
big = len(c)+cnt

print(small, big)
Buggy code:
from collections import Counter

N = int(input())
a = Counter(list(map(lambda x: x//400, map(int, input().split()))))

c = n = 0
for key in [0,1,2,3,4,5,6,7]:
    if a[key]:
        c += 1
        
for key in [8,9,10,11,12]:
    if a[key]:
        n += 1
        
max_n = min(8, c+n)
if c:
    min_n = c
else:
    min_n = 1
print(max_n, min_n)


Fixed code:

from collections import Counter

N = int(input())
a = Counter(list(map(lambda x: x//400, map(int, input().split()))))

c = n = 0
for key in [0,1,2,3,4,5,6,7]:
    if a[key]:
        c += 1
        
for key in [8,9,10,11,12]:
    n += a[key]
        
max_n = c+n
if c:
    min_n = c
else:
    min_n = 1
print(min_n, max_n)
Buggy code:
N = int(input())
A = list(map(int,input().split()))
C = [a//400 for a in A if s<3200]
m = len(set(C))
print(max(1,m),m+N-len(C))

Fixed code:
N = int(input())
A = list(map(int,input().split()))
C = [a//400 for a in A if a<3200]
m = len(set(C))
print(max(1,m),m+N-len(C))
Buggy code:
n=input()
a=[int(i) for i in input().split()]

def cl(n):
    return n//400

buff=[0]*9


for i in a:
    color=cl(i)
    if color>8:
        color=8
    buff[color]+=1


print(buff)

min=0
for i in range(len(buff)-1):
    if buff[i]>=1:
        min+=1




max=min+buff[8]
if max>8:
    max=8
if min==0:
    min+=1
print(str(min)+" "+str(max))

Fixed code:
n=input()
a=[int(i) for i in input().split()]

def cl(n):
    return n//400

buff=[0]*9

for i in a:
    color=cl(i)
    if color>8:
        color=8
    buff[color]+=1


min=0
for i in range(len(buff)-1):
    if buff[i]>=1:
        min+=1

max=min+buff[8]

if min==0:
    min=1

print(str(min)+" "+str(max))
Buggy code:
N = int(input())
n = [int(i)//400 for i in input().split()]
c = 0
for i in n:
    if i >= 8:
        c += 1
n_kind = [i for i in n if i<8]
print(n_kind)
a = len(set(n_kind))
if a == 0:
    print(1,c)
else:print(a,a+c)


Fixed code:
N = int(input())
n = [int(i)//400 for i in input().split()]
c = 0
for i in n:
    if i >= 8:
        c += 1
n_kind = [i for i in n if i<8]
a = len(set(n_kind))
if a == 0:
    print(1,c)
else:print(a,a+c)
Buggy code:
n = int(input())
a_str = input().split()
a_num = [int(a) for a in a_str]
a_array = np.array(a_num)

rate_list = [1,400,800,1200,1600,2000,2400,2800,3200]

count = 0

for i in range(8):
    if len(a_array[np.where((a_array>=rate_list[i])&(a_array<rate_list[i+1]))]):
        count += 1

min_count = count

count += len(a_array[a_array>=rate_list[8]])
max_count = min(count,8)

print(str(min_count)+" "+str(max_count))

Fixed code:
import numpy as np

n = int(input())
a_str = input().split()
a_num = [int(a) for a in a_str]
a_array = np.array(a_num)

rate_list = [1,400,800,1200,1600,2000,2400,2800,3200]

count = 0

for i in range(8):
    if len(a_array[np.where((a_array>=rate_list[i])&(a_array<rate_list[i+1]))]):
        count += 1

if count == 0:
    min_count = 1
else:
    min_count = count

count += len(a_array[a_array>=rate_list[8]])
max_count = count

print(str(min_count)+" "+str(max_count))
Buggy code:
#n=int(input())
#l=list(map(int,input().split()))
n=5
l=[1100, 1900, 2800, 3200, 3200]
ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif i<=3200:
    rate_3200+=1
    
if rate_3200==0:
  num=8-ans.count(0)
  print("{} {}".format(num,num))
else:
  min_num=8-ans.count(0)
  max_num=8-ans.count(0)+rate_3200
  print("{} {}".format(max_num,min_num))
    

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

ans=[0 for i in range(8)]
rate_3200=0

for i in l:
  if 1<=i<=399:
    ans[0]+=1
  elif 400<=i<=799:
    ans[1]+=1
  elif 800<=i<=1199:
    ans[2]+=1
  elif 1200<=i<=1599:
    ans[3]+=1
  elif 1600<=i<=1999:
    ans[4]+=1
  elif 2000<=i<=2399:
    ans[5]+=1
  elif 2400<=i<=2799:
    ans[6]+=1
  elif 2800<=i<=3199:
    ans[7]+=1
  elif 3200<=i:
    rate_3200+=1
    
if rate_3200==0:
  num=8-ans.count(0)
  print("{} {}".format(num,num))
else:
  count_0=ans.count(0)
  if count_0==8:
    min_num=1
    max_num=rate_3200
  else:
    min_num=8-count_0
    max_num=8-count_0+rate_3200
  print("{} {}".format(min_num,max_num))
Buggy code:
n = int(input())
A = list(map(int, input().split()))

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if 3200 <= a:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

MIN >= 1:
    print(MIN, (MIN+H))
MIN = 0:
    print(1, H)

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

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if 3200 <= a:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

if MIN >= 1:
    print(MIN, (MIN+H))
elif MIN == 0:
    print(1, H)
Buggy code:
import numpy as np

N=int(input())
arr=[int(i) for i in input().split()]

#calc binCount
binCount=np.zeros(9)
for rate in arr:
    rateBin=rate//400
    binCount[min(rateBin,8)]+=1
print(binCount)

colorCount=int(np.sum(binCount[:-1]>0))
nc=int(np.sum(binCount[:-1]))
nf=int(binCount[-1])
assert N==nc+nf
print(colorCount, nc, nf)

if nc>0:
    minColor=colorCount
elif nf>0:
    minColor=1
else:
    minColor=0

maxColor=int(min(colorCount+nf, 8))
print(minColor, maxColor)

Fixed code:
import numpy as np

N=int(input())
arr=[int(i) for i in input().split()]

#calc binCount
binCount=np.zeros(9)
for rate in arr:
    rateBin=rate//400
    binCount[min(rateBin,8)]+=1

colorCount=int(np.sum(binCount[:-1]>0))
nc=int(np.sum(binCount[:-1]))
nf=int(binCount[-1])
assert N==(nc+nf)

if nc>0:
    minColor=colorCount
elif nf>0:
    minColor=1
else:
    minColor=0

maxColor=int(colorCount+nf)
print(minColor, maxColor)
Buggy code:
number = int(input())
rate = [int(i) for i in input().split()]

counter = {}
for r in rate:
    if 1 <= r < 400:
        counter["grey"] = counter.get("grey", 0) + 1
    if 400 <= r < 800:
        counter["brown"] = counter.get("brown", 0) + 1
    if 800 <= r < 1200:
        counter["green"] = counter.get("green", 0) + 1
    if 1200 <= r < 1600:
        counter["sky"] = counter.get("sky", 0) + 1
    if 1600 <= r < 2000:
        counter["blue"] = counter.get("blue", 0) + 1
    if 2000 <= r < 2400:
        counter["yellow"] = counter.get("yellow", 0) + 1
    if 2400 <= r < 2800:
        counter["orange"] = counter.get("orange", 0) + 1
    if 2800 <= r < 3200:
        counter["red"] = counter.get("red", 0) + 1
    if 3200 <= r:
        counter["color"] = counter.get("color", 0) + 1

answer = 0
for k, v in counter.items():
    if not v == 0:
        answer += 1
        
if counter.get("color", 0) == 0:
    print(str(answer) + " ", str(answer))
else:
    print(str(answer-1) + " " + str(answer-1+counter["color"]))


Fixed code:
number = int(input())
rate = [int(i) for i in input().split()]


# In[7]:

counter = {}
for r in rate:
    if 1 <= r < 400:
        counter["grey"] = counter.get("grey", 0) + 1
    if 400 <= r < 800:
        counter["brown"] = counter.get("brown", 0) + 1
    if 800 <= r < 1200:
        counter["green"] = counter.get("green", 0) + 1
    if 1200 <= r < 1600:
        counter["sky"] = counter.get("sky", 0) + 1
    if 1600 <= r < 2000:
        counter["blue"] = counter.get("blue", 0) + 1
    if 2000 <= r < 2400:
        counter["yellow"] = counter.get("yellow", 0) + 1
    if 2400 <= r < 2800:
        counter["orange"] = counter.get("orange", 0) + 1
    if 2800 <= r < 3200:
        counter["red"] = counter.get("red", 0) + 1
    if 3200 <= r:
        counter["color"] = counter.get("color", 0) + 1

answer = 0
for k, v in counter.items():
    if not v == 0:
        answer += 1
        
if counter.get("color", 0) == 0:
    print(str(answer) + " " + str(answer))
else:
    if answer == 1:
        print("1 " + str(counter["color"]))
    else:
        print(str(answer-1) + " " + str(answer-1+counter["color"]))
Buggy code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])/400)
    else:
        count += 1

n_min = len(set(a2_n))
n_max = n_min+count

print(str(n_min)+" "+str(n_max))

Fixed code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])//400)
    else:
        count += 1

n_min = len(set(a2_n))
n_max = n_min+count

print(max(1, n_min),n_max)
Buggy code:
n,*l=map(int,open(0).read().split())
c,*l=[0]*9
for i in l:
  if i<3200: l[i//400]=1
  else: c+=1
print(max(1,sum(l)),sum(l)+c)

Fixed code:
n,*a=map(int,open(0).read().split())
c,*l=[0]*9
for i in a:
  if i<3200: l[i//400]=1
  else: c+=1
print(max(1,sum(l)),sum(l)+c)
Buggy code:
n=int(input())
a=sorted(list(map(int,input().split())))
c=[0]*8
k=-1
for i in range(n):
    if a[i]<400:
        c[0]=1
    elif a[i]<800:
        c[1]=1
    elif a[i]<1200:
        c[2]=1
    elif a[i]<1600:
        c[3]=1
    elif a[i]<2000:
        c[4]=1
    elif a[i]<2400:
        c[5]=1
    elif a[i]<2800:
        c[6]=1
    elif a[i]<3200:
        c[7]=1
    else:
        k=i
        break

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if k==-1:
    w
    print(d)
else:
    print(min(8,d+(n-k)))


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

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if n==1 or d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if n==1:
    print(1)
elif k==-1:
    print(d)
else:
    print(d+(n-k))
Buggy code:
clst = [0, 0, 0, 0, 0, 0, 0, 0,  0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(9):
    if 0 < clst[i]:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]
if sum(clst[:8]):
    maxans -= 1
print(minans, maxans)

Fixed code:
clst = [0, 0, 0, 0, 0, 0, 0, 0, 0]

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

for i in a:
    if i <= 399:
        clst[0] += 1
    elif i <= 799:
        clst[1] += 1
    elif i <= 1199:
        clst[2] += 1
    elif i <= 1599:
        clst[3] += 1
    elif i <= 1999:
        clst[4] += 1
    elif i <= 2399:
        clst[5] += 1
    elif i <= 2799:
        clst[6] += 1
    elif i <= 3199:
        clst[7] += 1
    else:
        clst[8] += 1
minans = 0
maxans = 0

for i in range(9):
    if 0 < clst[i] and i != 8:
        minans += 1
    if i == 8 and minans == 0:
        minans += 1
maxans = minans + clst[8]

if sum(clst[:8]) == 0:
    maxans -= 1

print(minans, maxans)
Buggy code:
n = int(input())
ai = list(map(int,input().split()))
aj = list(map(lambda x:int(x/400),ai))
print(aj)
rainbow = 0
for e in aj:
  if e >= 8:
    rainbow += 1
ak= set(aj)
ans = 0
for e in ak:
  if e < 8:
    ans += 1
print(max(1,ans) ,end='')
print(' ' ,end = '')
print(ans+ rainbow)

Fixed code:
n = int(input())
ai = list(map(int,input().split()))
aj = list(map(lambda x:int(x/400),ai))
rainbow = 0
for e in aj:
  if e >= 8:
    rainbow += 1
ak= set(aj)
ans = 0
for e in ak:
  if e < 8:
    ans += 1
print(max(1,ans) ,end='')
print(' ' ,end = '')
print(ans+ rainbow)
Buggy code:
n=int(input())
r=list(map(int,input().split()))
rlist=[]
def color(n):
    if n<400:
        return 1
    elif n<800:
        return 2
    elif n<1200:
        return 3
    elif n<1600:
        return 4
    elif n<2000:
        return 5 
    elif n<2400:
        return 6 
    elif n<2800:
        return 7 
    elif n<3200:
        return 8 
    else:
        return 9

for _ in range(n):
    co=color(r[_])
    rlist.append(co)

ans1=len(set(rlist))
if rlist.count(9)==0:
    print(ans1,ans1,sep=" ")

elif ans1=1:
    print(1,min(8,rlist.count(9),sep=" ")

else:
    print(min(8,ans1-1),min(8,ans1-1+rlist.count(9)),sep=" ")

Fixed code:
n=int(input())
r=list(map(int,input().split()))
rlist=[]
def color(n):
    if n<400:
        return 1
    elif n<800:
        return 2
    elif n<1200:
        return 3
    elif n<1600:
        return 4
    elif n<2000:
        return 5 
    elif n<2400:
        return 6 
    elif n<2800:
        return 7 
    elif n<3200:
        return 8 
    else:
        return 9

for _ in range(n):
    co=color(r[_])
    rlist.append(co)

ans1=len(set(rlist))

if rlist.count(9)==0:
    print(ans1,ans1,sep=" ")

else:    
    if ans1==1:
        print(1,rlist.count(9),sep=" ")

    else:
        print(ans1-1,ans1-1+rlist.count(9),sep=" ")
Buggy code:
n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    
    print(s)
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]

print(min(ans, 8), max(ans, min(ans + dp[-1], 8)))
    


Fixed code:

n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]
    
if ans == 0:
    print(1, dp[-1])
else:    
    print(ans, sum(dp))
Buggy code:
N=int(input())
A=list(map(int,input().split()))
color=set()
over_3200=0

for i in range(N):
  if A[i]<=399:
    color.add(1)
  elif A[i]<=799:
    color.add(2)
  elif A[i]<=1199:
    color.add(3)
  elif A[i]<=1599:
    color.add(4)
  elif A[i]<=2399:
    color.add(5)
  elif A[i]<=2799:
    color.add(5)
  elif A[i]<=3199:
    color.add(6)
  else:
    over_3200+=1
    
print(len(color),len(color)+over_3200)

Fixed code:
N=int(input())
A=list(map(int,input().split()))
color=set()
over_3200=0
 
for i in range(N):
  if A[i]<=399:
    color.add(1)
  elif A[i]<=799:
    color.add(2)
  elif A[i]<=1199:
    color.add(3)
  elif A[i]<=1599:
    color.add(4)
  elif A[i]<=1999:
    color.add(5)
  elif A[i]<=2399:
    color.add(6)
  elif A[i]<=2799:
    color.add(7)
  elif A[i]<=3199:
    color.add(8)
  else:
    over_3200+=1

if len(color)==0:
  print(1,over_3200)
else:
  print(len(color),len(color)+over_3200)
Buggy code:
N = int(input())
rate = list(map(int, input().split()))
color = [0 for _ in range(9)]
for i in range(N):
    if rate[i] <= 399:
        color[0] += 1
    if rate[i] >= 400 and rate[i] <= 799:
        color[1] += 1
    if rate[i] >= 800 and rate[i] <= 1199:
        color[2] += 1
    if rate[i] >= 1200 and rate[i] <= 1599:
        color[3] += 1
    if rate[i] >= 1600 and rate[i] <= 1999:
        color[4] += 1
    if rate[i] >= 2000 and rate[i] <= 2399:
        color[5] += 1
    if rate[i] >= 2400 and rate[i] <= 2799:
        color[6] += 1
    if rate[i] >= 2800 and rate[i] <= 3199:
        color[7] += 1
    if rate[i] >= 3200:
        color[8] += 1
CV = 8- color[0:8].count(0)
print(CV)
if CV == 0:
    mi = 1
else:
    mi = CV
ma = CV + color[8]
print(mi, ma)

Fixed code:
N = int(input())
rate = list(map(int, input().split()))
color = [0 for _ in range(9)]
for i in range(N):
    if rate[i] <= 399:
        color[0] += 1
    if rate[i] >= 400 and rate[i] <= 799:
        color[1] += 1
    if rate[i] >= 800 and rate[i] <= 1199:
        color[2] += 1
    if rate[i] >= 1200 and rate[i] <= 1599:
        color[3] += 1
    if rate[i] >= 1600 and rate[i] <= 1999:
        color[4] += 1
    if rate[i] >= 2000 and rate[i] <= 2399:
        color[5] += 1
    if rate[i] >= 2400 and rate[i] <= 2799:
        color[6] += 1
    if rate[i] >= 2800 and rate[i] <= 3199:
        color[7] += 1
    if rate[i] >= 3200:
        color[8] += 1
CV = 8- color[0:8].count(0)
if CV == 0:
    mi = 1
else:
    mi = CV
ma = CV + color[8]
print(mi, ma)
Buggy code:
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
min=len(memo)
if min=0:min=1
max=len(memo)+count
if max>8: max=8
print(min,max)

Fixed code:
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
min=len(memo)
if min==0:min=1
max=len(memo)+count
#if max>8: max=8
print(min,max)
Buggy code:
n = int(input())
A = list(map(int, input().split()))
C = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
A_class = []
free_color = 0
from bisect import bisect_right
for a in A:
  cls = bisect_right(C, a)
  if cls == 8:
    free_color += 1
  else:
    A_class.append(cls)
print(A_class, free_color)
max_class = len(set(A_class)) + free_color
min_class = max(len(set(A_class)), 1)
print(min_class, max_class)
    

Fixed code:
n = int(input())
A = list(map(int, input().split()))
C = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
A_class = []
free_color = 0
from bisect import bisect_right
for a in A:
  cls = bisect_right(C, a)
  if cls == 8:
    free_color += 1
  else:
    A_class.append(cls)
#print(A_class, free_color)
max_class = len(set(A_class)) + free_color
min_class = max(len(set(A_class)), 1)
print(min_class, max_class)
Buggy code:
N = int(input())
a = list(map(int, input().split()))
c = []
s = 0
for i in range(N):
  c.append(min(a[i]//400, 8))
import collections
colors = collections.Counter(c)
for i in range(8):
  if colors.get(i, 0) != 0:
    s += 1
ss = colors.get(i, 0)

print(max(s, 1), s+ss)

Fixed code:
N = int(input())
a = list(map(int, input().split()))
c = []
s = 0
for i in range(N):
  c.append(min(a[i]//400, 8))
import collections
colors = collections.Counter(c)
for i in range(8):
  if colors.get(i, 0) != 0:
    s += 1
ss = colors.get(8, 0)

print(max(s, 1), s+ss)
Buggy code:
N=int(input())
a=list(map(int,input().split()))
count_color=[0]*8
wild_color=0
for i in range (N):
    if a[i]<400:
        count_color[0]=1
    elif a[i]<800:
        count_color[1]=1
    elif a[i]<1200:
        count_color[2]=1
    elif a[i]<1600:
        count_color[3]=1
    elif a[i]<2000:
        count_color[4]=1
    elif a[i]<2400:
        count_color[5]=1
    elif a[i]<2800:
        count_color[6]=1
    elif a[i]<3200:
        count_color[7]=1
    else:
        wild_color+=1
color=count_color.count(1)
print (color, min(color+wild_color))

Fixed code:
N=int(input())
a=list(map(int,input().split()))
count_color=[0]*8
wild_color=0
for i in range (N):
    if a[i]<400:
        count_color[0]=1
    elif a[i]<800:
        count_color[1]=1
    elif a[i]<1200:
        count_color[2]=1
    elif a[i]<1600:
        count_color[3]=1
    elif a[i]<2000:
        count_color[4]=1
    elif a[i]<2400:
        count_color[5]=1
    elif a[i]<2800:
        count_color[6]=1
    elif a[i]<3200:
        count_color[7]=1
    else:
        wild_color+=1
color=count_color.count(1)
if color!=0:
    print (color, color+wild_color)
else:
    print(1, color+wild_color)
Buggy code:
N = int(input())
a =  list(map(int,input().split(" ")))

free = 0
arr = [0] * 8

for i in a:
	limit = 400
	while (limit <= 3200):
		if i < limit:
			arr[(limit // 400)-1] +=  1
			break
		else:
			limit += 400

	if limit== 3600:
		free += 1

color =  0
for i in arr:
	if i > 0:
		color += 1


print(max(1,str(color)) + " " + str(min(color + free,8)))




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

free = 0
arr = [0] * 8

for i in a:
	limit = 400
	while (limit <= 3200):
		if i < limit:
			arr[(limit // 400)-1] +=  1
			break
		else:
			limit += 400

	if limit== 3600:
		free += 1

color =  0
for i in arr:
	if i > 0:
		color += 1


print(str(max(1,color)) + " " + str(color + free))