qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N=int(input())
A=list(map(int,input().split()))
gray=0
brown=0
green=0
light=0
blue=0
yellow=0
orange=0
red=0
god=0
for a in A:
  if 1<=a and a<=399 and gray==0:
    gray=1
  elif 400<=a and a<=799 and brown==0:
    brown=1
  elif 800<=a and a<=1199 and green==0:
    green=1
  elif 1200<=a and a<=1599 and light==0:
    light=1
  elif 1600<=a and a<=1999 and blue==0:
    blue=1
  elif 2000<=a and a<=2399 and yellow==0:
    yellow=1
  elif 2400<=a and a<=2799 and orange==0:
    orange=1
  elif 2800<=a and a<=3199 and red==0:
    red=1
  elif a<=3200:
    god+=1
mi=gray+brown+green+light+blue+yellow+orange+red
ma=mi+god
print(mi,ma)   

Fixed code:
N=int(input())
A=list(map(int,input().split()))
gray=0
brown=0
green=0
light=0
blue=0
yellow=0
orange=0
red=0
god=0
for a in A:
  if 1<=a and a<=399 and gray==0:
    gray=1
  elif 400<=a and a<=799 and brown==0:
    brown=1
  elif 800<=a and a<=1199 and green==0:
    green=1
  elif 1200<=a and a<=1599 and light==0:
    light=1
  elif 1600<=a and a<=1999 and blue==0:
    blue=1
  elif 2000<=a and a<=2399 and yellow==0:
    yellow=1
  elif 2400<=a and a<=2799 and orange==0:
    orange=1
  elif 2800<=a and a<=3199 and red==0:
    red=1
  elif a>=3200:
    god+=1
mi=max(1,gray+brown+green+light+blue+yellow+orange+red)
ma=gray+brown+green+light+blue+yellow+orange+red+god
print(mi,ma)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

rates = [0]*9
for i in range(n):
  rates[a[i]//400] += 1

n_min, n_max = 0, 0
if min(rates[:-1]) > 0:
  for i in range(8):
    n_min += 1 if rates[i] > 0 else 0
  n_max = n_min+rates[-1]
else:
  n_min = 1
  n_max = rates[-1]

print(n_min, n_max)

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

rates = [0]*9
for i in range(n):
  r = min(a[i]//400, 8)
  rates[r] += 1

n_min, n_max = 0, 0
if max(rates[:-1]) > 0:
  for i in range(8):
    n_min += 1 if rates[i] > 0 else 0
  n_max = n_min+rates[-1]
else:
  n_min = 1
  n_max = rates[-1]

print(n_min, n_max)
Buggy code:
N=int(input())
a=map(int,input().split())

num=[0,0,0,0,0,0,0,0,0]
counter=0

for i in a:
    if 1<=i and i<=399:
        num[0]+=1
    elif 400 <= i and i <= 799:
        num[1] += 1
    elif 800 <= i and i <= 1199:
        num[2] += 1
    elif 1200 <= i and i <= 1599:
        num[3] += 1
    elif 1600 <= i and i <= 1999:
        num[4] += 1
    elif 2000 <= i and i <= 2399:
        num[5] += 1
    elif 2400 <= i and i <= 2799:
        num[6] += 1
    elif 2800 <= i and i <= 3199:
        num[7] += 1
    elif 3200 <= i:
        num[8] += 1

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0 and num[8]==0:
    min=0
    max=0

elif counter==0 and num[8]!=0:
    min=1
    if num[8]>=8:
        max=8
    else:
        max=num[8]

else:
    min=counter
    if counter+num[8]>=8:
        max=8
    else:
        max=counter+num[8]

print(num)
print(str(min)+" "+str(max))


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

num=[0,0,0,0,0,0,0,0,0]
counter=0

for i in a:
    if 1<=i and i<=399:
        num[0]+=1
    elif 400 <= i and i <= 799:
        num[1] += 1
    elif 800 <= i and i <= 1199:
        num[2] += 1
    elif 1200 <= i and i <= 1599:
        num[3] += 1
    elif 1600 <= i and i <= 1999:
        num[4] += 1
    elif 2000 <= i and i <= 2399:
        num[5] += 1
    elif 2400 <= i and i <= 2799:
        num[6] += 1
    elif 2800 <= i and i <= 3199:
        num[7] += 1
    elif 3200 <= i:
        num[8] += 1

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0 and num[8]==0:
    min=0
    max=0

elif counter==0 and num[8]!=0:
    min=1
    max=num[8]

else:
    min=counter
    max=counter+num[8]

#print(num)
print(str(min)+" "+str(max))
Buggy code:
n = int(input())

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

c = [0]*9
for i in a:
  t = i // 400
  if t < 8:
    c[t] = 1
  else:
    c[8] += 1
cmin = max(sum(c[:-1]), min(c[8], 1))
cmax = min(sum(c))
print(cmin, cmax)

Fixed code:
n = int(input())

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

c = [0]*9
for i in a:
  t = i // 400
  if t < 8:
    c[t] = 1
  else:
    c[8] += 1
cmin = max(sum(c[:-1]), min(c[8], 1))
cmax = sum(c)
print(cmin, cmax)
Buggy code:
N = int(input())
a = list(map(int, input().split()))
normal = set()
choku = 0

for i in range(N):
  if a[i] // 400  >= 8:
    choku += 1
  else:
    normal.add(a[i]//400)
print(len(normal) + (choku > 0), min(8,len(normal)+choku))

Fixed code:
N = int(input())
a = list(map(int, input().split()))
normal = set()
choku = 0

for i in range(N):
  if a[i] // 400  >= 8:
    choku += 1
  else:
    normal.add(a[i]//400)
    
if len(normal) == 0:
  print(1, choku)
else:
  print(len(normal), len(normal)+choku)
Buggy code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n = I()
L = LI()
cnt = 0
s = set()
for i in L:
    if i >= 3200:
        cnt += 1
    else:
        s.add(i // 400)


print(min(len(s) + cnt, 8), len(s))

Fixed code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n = I()
L = LI()
cnt = 0
s = set()
for i in L:
    if i >= 3200:
        cnt += 1
    else:
        s.add(i // 400)


print(max(1, len(s)), len(s) + cnt)
Buggy code:
N=int(input())

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

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

K=0
for i in range(9):
    if T[i] >= 1:
        K+=1

print(K,K+T[8])


Fixed code:
N=int(input())

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

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

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

if K>0:
    print(K,K+T[8])
else:
    print(1,T[8])
Buggy code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math

N, = map(int, sys.stdin.readline().rstrip().split())
a_list = list(map(int, sys.stdin.readline().rstrip().split()))

def score_index(score):
    if score < 400:
        return 0
    if score < 800:
        return 1
    if score < 1200:
        return 2
    if score < 1600:
        return 3
    if score < 2000:
        return 4
    if score < 2400:
        return 5
    if score < 2800:
        return 6
    if score < 3200:
        return 7
    else:
        raise Exception()



superplayers = 0
counts = set()
for a in a_list:
    if a < 3200:
        counts.add(score_index(a))
    else:
        superplayers += 1

print("{} {}".format(
    min(len(counts), 1),
    len(counts) + superplayers
))

exit(0)


Fixed code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math

N, = map(int, sys.stdin.readline().rstrip().split())
a_list = list(map(int, sys.stdin.readline().rstrip().split()))

def score_index(score):
    if score < 400:
        return 0
    if score < 800:
        return 1
    if score < 1200:
        return 2
    if score < 1600:
        return 3
    if score < 2000:
        return 4
    if score < 2400:
        return 5
    if score < 2800:
        return 6
    if score < 3200:
        return 7
    else:
        raise Exception()



superplayers = 0
counts = set()
for a in a_list:
    if a < 3200:
        counts.add(score_index(a))
    else:
        superplayers += 1

print("{} {}".format(
    max(len(counts), 1),
    len(counts) + superplayers
))

exit(0)
Buggy code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = int(0)
for i in range(N-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + 1
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_max, color_min)

Fixed code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N):
    if a[i] < 400:
        gray = 1
    elif a[i] < 800:
        brown = 1
    elif a[i] < 1200:
        green = 1
    elif a[i] < 1600:
        sky = 1
    elif a[i] < 2000:
        blue = 1
    elif a[i] < 2400:
        yellow = 1
    elif a[i] < 2800:
        orange = 1
    elif a[i] < 3200:
        red = 1
    else:
        god+=1
zako = gray + brown + green + sky + blue + yellow + orange + red
if god > 0 and zako == 0:
    color_max = god
    color_min = 1
elif god > 0 and zako != 0:
    color_max = zako + god
    color_min = zako
else:
    color_max = zako
    color_min = zako
print(color_min, color_max)
Buggy code:
n = input()
A = list(map(int, input().split()))
flags = [0] * 8
count = 0
for a in A:
  if a < 3200:
    flags[a // 400] += True
  else:
    counts += 1
print(sum(flags), sum(flags) + count)

Fixed code:
n = input()
A = list(map(int, input().split()))
flags = [False] * 8
count = 0
for a in A:
  if a < 3200:
    flags[a // 400] = True
  else:
    count += 1
print(max(sum(flags), 1), sum(flags) + count)
Buggy code:
def inpl(): return [int(i) for i in input().split()]

H = set([])
N = int(input())
a = inpl()
sugoi = 0

for i in range(N):
    if a[i] < 400:
        H.add('gray')
    elif a[i] < 800:
        H.add('brown')
    elif a[i] < 1200:
        H.add('green')
    elif a[i] < 1600:
        H.add('sky')
    elif a[i] < 2000:
        H.add('blue')
    elif a[i] < 2400:
        H.add('yellow')
    elif a[i] < 2800:
        H.add('orange')
    elif a[i] < 3200:
        H.add('red')
    else:
        sugoi += 1

ans = [min(len(H),1),len(H)+sugoi]
print(*ans)

Fixed code:
def inpl(): return [int(i) for i in input().split()]

H = set([])
N = int(input())
a = inpl()
sugoi = 0

for i in range(N):
    if a[i] < 400:
        H.add('gray')
    elif a[i] < 800:
        H.add('brown')
    elif a[i] < 1200:
        H.add('green')
    elif a[i] < 1600:
        H.add('sky')
    elif a[i] < 2000:
        H.add('blue')
    elif a[i] < 2400:
        H.add('yellow')
    elif a[i] < 2800:
        H.add('orange')
    elif a[i] < 3200:
        H.add('red')
    else:
        sugoi += 1

ans = [max(len(H),1),max(len(H)+sugoi,1)]
print(*ans)
Buggy code:
n = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for i in a:
    colors[min(i//400, 8)] += 1

mi = 0
for i in range(9):
    if colors[i]>0:
        mi += 1
if mi==0:
    mi = 1
    ma = min(colors[-1], 8)
else:
    ma = min(mi+colors[-1], 8)
print(mi, ma)

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

mi = 0
for i in range(8):
    if colors[i]>0:
        mi += 1
if mi==0:
    mi = 1
    ma = colors[-1]
else:
    ma = mi+colors[-1]
print(mi, ma)
Buggy code:
from collections import defaultdict, deque, Counter
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = list(map(int, input().split()))
    color = defaultdict(int)
    god = 0
    for i in A:
        if i < 400:
            color['gray'] = 1
        elif i < 800:
            color['brown'] = 1
        elif i < 1200:
            color['green'] = 1
        elif i < 1600:
            color['light_blue'] = 1
        elif i < 2000:
            color['blue'] = 1
        elif i < 2400:
            color['yellow'] = 1
        elif i < 2800:
            color['orange'] = 1
        elif i < 3200:
            color['red'] = 1
        else:
            god += 1
    print(min(1, len(color)), len(color) + god)


if __name__ == '__main__':
    main()


Fixed code:
from collections import defaultdict, deque, Counter
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = list(map(int, input().split()))
    color = defaultdict(int)
    god = 0
    for i in A:
        if i < 400:
            color['gray'] = 1
        elif i < 800:
            color['brown'] = 1
        elif i < 1200:
            color['green'] = 1
        elif i < 1600:
            color['light_blue'] = 1
        elif i < 2000:
            color['blue'] = 1
        elif i < 2400:
            color['yellow'] = 1
        elif i < 2800:
            color['orange'] = 1
        elif i < 3200:
            color['red'] = 1
        else:
            god += 1
    print(max(1, len(color)), len(color) + god)


if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
v = list(map(int, input().split()))
c = [0] * 9
for i in range(0, n):
  if v[i] >= 3200:
    c[8] += 1
  else:
    c[v[i]//400] += 1
a = 0
for i in range(0, 8):
  a += c[i]
print(a, min(a, a+c[8]))

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

a.sort()

min_color = [0] * 8
max_color = [0] * 8
extra = 0

for i in a:
    if i >= 3200:
        if sum(min_color) == 0:
            min_color[0] = 1
        if sum(max_color + extra) < 8:
            extra += 1
    else:
        min_color[i // 400] = 1
        max_color[i // 400] = 1


print( sum(min_color), sum(max_color) + extra)

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

a.sort()
min_color = [0] * 8
max_color = [0] * 8
extra = 0

for i in a:
    if i >= 3200:
        if sum(min_color) == 0:
            min_color[0] = 1
        extra += 1
    else:
        min_color[i // 400] = 1
        max_color[i // 400] = 1


print( sum(min_color), sum(max_color) + extra)
Buggy code:
n=int(input())
A=[int(i) for i in input().split()]
CL=[0]*9
for a in A:
  cl=min(8,a//400)
  if cl==8:
    CL[cl]+=1
  elif CL[cl]==0:
    CL[cl]=1
print(CL)
if sum(CL[:-1])==0:
  print(1,CL[-1])  
else:
  print(sum(CL[:-1]),sum(CL))

Fixed code:
n=int(input())
A=[int(i) for i in input().split()]
CL=[0]*9
for a in A:
  cl=min(8,a//400)
  if cl==8:
    CL[cl]+=1
  elif CL[cl]==0:
    CL[cl]=1
if sum(CL[:-1])==0:
  print(1,CL[-1])  
else:
  print(sum(CL[:-1]),sum(CL))
Buggy code:
def cin():  return list(map(int,input().split()))

N = cin()[0]
a = cin()
b = [0 for _ in range(9)]
for i in range(N):
    ind = min(8, a[i] // 400)
    if ind <= 7:  b[ind] = 1
    else:  b[ind] += 1
ma = sum(b)
if cnt == N:  mi = sum(b[:-1])
else:  mi = 1
print(mi, ma)

Fixed code:
def cin():  return list(map(int,input().split()))

N = cin()[0]
a = cin()
b = [0 for _ in range(9)]
for i in range(N):
    ind = min(8, a[i] // 400)
    if ind <= 7:  b[ind] = 1
    else:  b[ind] += 1
ma = sum(b)
if b[ind] < N:  mi = sum(b[:-1])
else:  mi = 1
print(mi, ma)
Buggy code:
n = int(input())
rate = list(map(int, input().split()))
colo = []

for i in rate:
    if 1 <= i < 400:
        if 2 in colo:
            continue
        else:
            colo.append(1)
    if 400 <= i < 800:
        if 2 in colo:
            continue
        else:
            colo.append(2)
    if 800 <= i < 1200:
        if 3 in colo:
            continue
        else:
            colo.append(3)
    if 1200 <= i < 1600:
        if 4 in colo:
            continue
        else:
            colo.append(4)
    if 1600 <= i < 2000:
        if 5 in colo:
            continue
        else:
            colo.append(5)
    if 2000 <= i < 2400:
        if 6 in colo:
            continue
        else:
            colo.append(6)
    if 2400 <= i < 2800:
        if 7 in colo:
            continue
        else:
            colo.append(7)
    if 2800 <= i < 3200:
        if 8 in colo:
            continue
        else:
            colo.append(8)
    if 3200 <= i:
        colo.append(-1)

if -1 not in colo:
    print("{} {}".format(len(colo), len(colo)))
else:
    cnt = 0
    cnt_upto3200 = 0
    for i in range(1, 9):
        if i in colo:
            cnt += 1
    for j in colo:
        if j == -1:
            cnt_upto3200 += 1
    print("{} {}".format(min(0, cnt), cnt + cnt_upto3200))


Fixed code:
n = int(input())
rate = list(map(int, input().split()))
colo = []

for i in rate:
    if 1 <= i < 400:
        if 1 in colo:
            continue
        else:
            colo.append(1)
    if 400 <= i < 800:
        if 2 in colo:
            continue
        else:
            colo.append(2)
    if 800 <= i < 1200:
        if 3 in colo:
            continue
        else:
            colo.append(3)
    if 1200 <= i < 1600:
        if 4 in colo:
            continue
        else:
            colo.append(4)
    if 1600 <= i < 2000:
        if 5 in colo:
            continue
        else:
            colo.append(5)
    if 2000 <= i < 2400:
        if 6 in colo:
            continue
        else:
            colo.append(6)
    if 2400 <= i < 2800:
        if 7 in colo:
            continue
        else:
            colo.append(7)
    if 2800 <= i < 3200:
        if 8 in colo:
            continue
        else:
            colo.append(8)
    if 3200 <= i:
        colo.append(-1)

if -1 not in colo:
    print("{} {}".format(len(colo), len(colo)))
else:
    cnt = 0
    cnt_upto3200 = 0
    for i in range(1, 9):
        if i in colo:
            cnt += 1
    for j in colo:
        if j == -1:
            cnt_upto3200 += 1
    if cnt == 0:
        print("{} {}".format(1,  cnt_upto3200))
    else:
        print("{} {}".format(cnt, cnt + cnt_upto3200))
Buggy code:
N = int(input())
colors = [False]*8
high_rate_count = 0
for num in input().split():
    rate = int(int(num)/400)
    if rate > 7:
        high_rate_count += 1
    else:
        colors[rate] = True
count = 0
for color in colors:
    if color:
        count += 1
if count == 0:
    count = 1
    high_rate_count -= 1
max_count = count + high_rate_count
print(count, max_count)
print(colors)

Fixed code:
N = int(input())
colors = [False]*8
high_rate_count = 0
for num in input().split():
    rate = int(int(num)/400)
    if rate > 7:
        high_rate_count += 1
    else:
        colors[rate] = True
count = 0
for color in colors:
    if color:
        count += 1
if count == 0:
    count = 1
    high_rate_count -= 1
max_count = count + high_rate_count
print(count, max_count)
Buggy code:
N=input()

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

Rate=[]
for i in range(9):
    Rate.append(0)

for i in A:
    index=i//400
    if index>8:
        index=8
    Rate[index]=Rate[index]+1

a=0

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

Max=a+Rate[8]
Min=a+min(a,1)

print(Min, Max)

Fixed code:

N=input()

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

Rate = []
for i in range(9):
    Rate.append(0)

for i in A:
    index=i//400
    if index > 8:
        index = 8
    Rate[index] = Rate[index] + 1

a = 0

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

Max = a + Rate[8]
Min = max(a, 1)

print(Min, Max)
Buggy code:
import math
N=input()

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

Rate=[]
for i in range(9):
    Rate.append(0)

for i in A:
    index=math.floor(i//400)
    if index>8:
        index=8
    Rate[index]=Rate[index]+1

a=0

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

Max=a+Rate[8]
Min=min(a,1)

print(Min, Max)



Fixed code:
import math
N=input()

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

Rate = []
for i in range(9):
    Rate.append(0)

for i in A:
    index=math.floor(i/400)
    if index > 8:
        index = 8
    Rate[index] = Rate[index] + 1

a = 0

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

Max = a + Rate[8]
Min = max(a, 1)

print(Min, Max)
Buggy code:
n = int(input())
a = list(map(int, input().split()))

p = set()
q = 0
for i in range(n):
  if a[i] < 2800:
    p.add(a[i]//400)
  else:
    q += 1

p = len(p)
print(p, p+q)

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

p = set()
q = 0
for i in range(n):
  if a[i] < 3200:
    p.add(a[i]//400)
  else:
    q += 1

p = len(p)
print(max(p, 1), p+q)
Buggy code:
n = int(input())
a = map(int, input().split())
c = [0]*9

for i in a:
    col = i//400
    if 4800<= i:
        c[8] += 1
    else:
        c[col] = 1
print(max(1,sum(c[:8])),sum(c))

Fixed code:
n = int(input())
a = map(int, input().split())
c = [0]*9

for i in a:
    col = i//400
    if 3200 <= i:
        c[8] += 1
    else:
        c[col] = 1
print(max(1,sum(c[:8])),sum(c))
Buggy code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    for j in range(8):
        if 400*j<=i<400*(j+1):
            l[j]=1
        if i>=3200:
            l[-1]+=1

if sum(l)>=8:
    max_=8
else:
    max_=sum(l)
    
if sum(l[:-1])==0:
    min_=1
else:
    min_=sum(l[:-1])
    
print(min_,max_)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*9
for i in a:
    if i>=3200:
        l[-1]+=1
    for j in range(8):
        if 400*j<=i<400*(j+1):
            l[j]=1

max_=sum(l)
    
if sum(l[:-1])==0:
    min_=1
else:
    min_=sum(l[:-1])
    
print(min_,max_)
Buggy code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1
cmin = max(1, 8-c.count(0))
cmax = min(8, cmin+c[8])
print(cmin, cmax)

Fixed code:
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

cl = 8-c[:-1].count(0)
cmin = max(1, cl)
cmax = cl+c[8]
print(cmin, cmax)
Buggy code:
N=int(input())
A=[int(x) for x in input().split()]
B=[0]*9
for i in range(N):
  R=A[i]//400
  if R>8:
    R=8
  B[R] +=1
answer_min=0
for i in range(8):
  if not B[i]==0:
    answer_min +=1
answer_max=answer_min+B[8]
if answer_max>8:
  answer_max=8
if answer_min=0:
  answer_min=1
print(answer_min,answer_max)

Fixed code:
N=int(input())
A=[int(x) for x in input().split()]
B=[0]*9
for i in range(N):
  R=A[i]//400
  if R>8:
    R=8
  B[R] +=1
answer_min=0
for i in range(8):
  if not B[i]==0:
    answer_min +=1
answer_max=answer_min+B[8]
if answer_min==0:
  answer_min=1
print(answer_min,answer_max)