Problem:
 Score : 300 points    Problem Statement In AtCoder, a person who has participated in a contest receives a color , which corresponds to the person's rating as follows:   Rating 1 - 399 : gray  Rating 400 - 799 : brown  Rating 800 - 1199 : green  Rating 1200 - 1599 : cyan  Rating 1600 - 1999 : blue  Rating 2000 - 2399 : yellow  Rating 2400 - 2799 : orange  Rating 2800 - 3199 : red   Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not. Currently, there are N users who have participated in a contest in AtCoder, and the i -th user has a rating of a_i . Find the minimum and maximum possible numbers of different colors of the users.      Constraints  1 ≤ N ≤ 100  1 ≤ a_i ≤ 4800  a_i is an integer.         Input Input is given from Standard Input in the following format:  N  a_1  a_2  ...  a_N       Output Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.        Sample Input 1 4
2100 2500 2700 2700      Sample Output 1 2 2  The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.       Sample Input 2 5
1100 1900 2800 3200 3200      Sample Output 2 3 5  The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red". If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors. If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.       Sample Input 3 20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990      Sample Output 3 1 1  All the users are "green", and thus there is one color.

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

colors=[]
niji=[]
for i in a:
    if 1<=i<=399:
        colors.append('灰')
    elif 400<=i<=799:
        colors.append('茶')
    elif 800<=i<=1199:
        colors.append('緑')
    elif 1200<=i<=1599:
        colors.append('水')
    elif 1600<=i<=1999:
        colors.append('青')
    elif 2000<=i<=2399:
        colors.append('黄')
    elif 2400<=i<=2799:
        colors.append('橙')
    elif 2800<=i<=3199:
        colors.append('赤')
    elif 3200<=i:
        niji.append('虹')

colors_count =len(set(colors))
print(max(colors_count,1),colors_count+len(niji))

Solution (Python):


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

B = {'z': 0}
for a in A:
    if 1 <= a <= 399:
        B['a'] = 1
    elif 400 <= a <= 799:
        B['b'] = 1
    elif 800 <= a <= 1199:
        B['c'] = 1
    elif 1200 <= a <= 1599:
        B['d'] = 1
    elif 1600 <= a <= 1999:
        B['e'] = 1
    elif 2000 <= a <= 2399:
        B['f'] = 1
    elif 2400 <= a <= 2799:
        B['g'] = 1
    elif 2800 <= a <= 3199:
        B['h'] = 1
    else:
        B['z'] += 1

if 'z' in B:
    print(max(len(B.keys())-1, 1), len(B.keys())-1 + B['z'])
else:
    print(len(B.keys()), len(B.keys()))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
d = {i:0 for i in range(9)}
for ele in a:
  if ele>=3200:
    d[8] += 1
  else:
    d[ele//400] = 1
ans1, ans2 = 0, 0
for k, v in d.items():
  if k!=8:
    ans1 += v
  ans2 += v
ans1 = max(1, ans1)
ans2 = ans2
print(ans1, ans2)

Solution (Python):
N = int(input())
a = [int(x) for x in input().split()]

color_dict = [0 for x in range(9)] 

for c in a :
    if c in range(1, 400) : color_dict[0] = 1
    elif c in range(400, 800) : color_dict[1] = 1
    elif c in range(800, 1200) : color_dict[2] = 1
    elif c in range(1200, 1600) : color_dict[3] = 1
    elif c in range(1600, 2000) : color_dict[4] = 1
    elif c in range(2000, 2400) : color_dict[5] = 1
    elif c in range(2400, 2800) : color_dict[6] = 1
    elif c in range(2800, 3200) : color_dict[7] = 1
    elif c >= 3200 : color_dict[8] += 1
        
tot = sum(color_dict)
rainbow = color_dict[8]

if tot > rainbow :
    print(tot - rainbow, tot)
elif tot - rainbow <= rainbow :
    print(tot - rainbow + 1, tot)

Solution (Python):
import math

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

a = [0]*9
for x in l:
 if math.floor(x/400)>8:
  a[8] += 1
 else:
  a[math.floor(x/400)] += 1
c = 0
for i in range(len(a)):
 if i==8:
  if c==0:
   min=1
  else:
   min = c
  c += a[i]
 elif a[i] >0:
  c+=1

print("%d %d"% (min, c))

Solution (Python):


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

mx = 0
mn = 0
cnt = 0

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

kami = len([i for i in aN if 3200 <= i])
if kami == 0:
    print(str(cnt) + " " + str(cnt)) 
else:
    if cnt == 0:
        mn = 1
        mx = kami
    else:
        mn = cnt
        mx = cnt + kami
    print(str(mn) + " " + str(mx))

Solution (Python):


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

mx = 0
mn = 0
cnt = 0
if len([i for i in aN if 1 <= i < 400]) > 0:
    cnt += 1
if len([i for i in aN if 400 <= i < 800]) > 0:
    cnt += 1
if len([i for i in aN if 800 <= i < 1200]) > 0:
    cnt += 1
if len([i for i in aN if 1200 <= i < 1600]) > 0:
    cnt += 1
if len([i for i in aN if 1600 <= i < 2000]) > 0:
    cnt += 1
if len([i for i in aN if 2000 <= i < 2400]) > 0:
    cnt += 1
if len([i for i in aN if 2400 <= i < 2800]) > 0:
    cnt += 1
if len([i for i in aN if 2800 <= i < 3200]) > 0:
    cnt += 1


kami = len([i for i in aN if 3200 <= i])
if kami == 0:
    print(str(cnt) + " " + str(cnt)) 
else:
    if cnt == 0:
        mn = 1
        mx = kami
    else:
        mn = cnt
        mx = cnt + kami
    print(str(mn) + " " + str(mx))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0
x7 = 0
x8 = 0
c = 0

for i in range(N):
	if a[i] < 400:
		x1 = 1
	elif a[i] < 800:
		x2 = 1
	elif a[i] < 1200:
		x3 = 1
	elif a[i] < 1600:
		x4 = 1
	elif a[i] < 2000:
		x5 = 1
	elif a[i] < 2400:
		x6 = 1
	elif a[i] < 2800:
		x7 = 1
	elif a[i] < 3200:
		x8 = 1
	else:
		c += 1
s = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8
if s == 0:
	print(1, c)
else:
	print(s, s + c)

Solution (Python):

n=int(input())

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

ans=[0]*8
c=0

for i in range(n):
    if a[i]<3200:
        ans[a[i]//400]=1
    else:
        c+=1

mi=sum(ans)
ma=sum(ans)+c

if mi==0:
    mi=1


print(' '.join([str(mi),str(ma)]))

Solution (Python):
import sys
N = int(input())
r = list(map(int, input().split()))
if min(r) >= 3200:
  print(str(1)+' '+str(N))
  sys.exit()
li = [0 for i in range(9)]
for rates in r:
  if rates >= 3200:
    rates = 3200
  n = rates//400
  li[n] += 1
p = 0
for nums in li[0:8]:
  if nums !=0:
    p += 1
print(str(p)+' '+str(p+li[8]))

Solution (Python):

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

count = [0, 0, 0, 0, 0, 0, 0, 0, 0]

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

color_max = sum(count)
if count[8] == 0:
    color_min = sum(count)
else:
    color_min = sum(count[:7]) + 1

print(color_min, color_max)

Solution (Python):
n=int(input())
code=input().split()
a=[0]*8
i=0
k=0
for j in range(n):
    if int(code[j])<400:
        a[0]=1
    elif int(code[j])<800:
        a[1]=1
    elif int(code[j])<1200:
        a[2]=1
    elif int(code[j])<1600:
        a[3]=1
    elif int(code[j])<2000:
        a[4]=1
    elif int(code[j])<2400:
        a[5]=1
    elif int(code[j])<2800:
        a[6]=1
    elif int(code[j])<3200:
        a[7]=1
    else:
        i+=1
for z in range(8):
    if a[z]==1:
        k+=1
if k>0:
    print(k, i+k,sep=" ")
else:
    print(1, i,sep=" ")

Solution (Python):
x=int(input())
A=[int(x) for x in str(input()).split()]
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
orange=0
red=0
others=0
for i in A:
  if i<400:
    gray=1
  elif i<800:
    brown=1
  elif i<1200:
    green=1
  elif i<1600:
    cyan=1
  elif i<2000:
    blue=1
  elif i<2400:
    yellow=1
  elif i<2800:
    orange=1
  elif i<3200:
    red=1
  else:
    others+=1

mi=gray+brown+green+cyan+blue+yellow+orange+red
ma=mi+others
if mi==0:
  print("1",str(ma))
else:
  print(str(mi),str(ma))

Solution (Python):
num=int(input())
line=input().split(" ")
a=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
k=0
for i in range(num):
	if int(line[i])<400:
		a=1
	elif int(line[i])>=400 and int(line[i])<800:
		b=1
	elif int(line[i])>=800 and int(line[i])<1200:
		c=1
	elif int(line[i])>=1200 and int(line[i])<1600:
		d=1
	elif int(line[i])>=1600 and int(line[i])<2000:
		e=1
	elif int(line[i])>=2000 and int(line[i])<2400:
		f=1
	elif int(line[i])>=2400 and int(line[i])<2800:
		g=1
	elif int(line[i])>=2800 and int(line[i])<3200:
		h=1
	elif int(line[i])>=3200:
		k+=1
if a+b+c+d+e+f+g+h==0:
	print(1, k)
else:
	print(a+b+c+d+e+f+g+h, a+b+c+d+e+f+g+h+k)

Solution (Python):
n=int(input())
x=input().split()
y=0
while y<n:
    x[y]=int(x[y])
    y+=1
other=0
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
orange=0
red=0
for i in x:
    if i<=399:
        gray=1
    elif i<=799:
        brown=1
    elif i<=1199:
        green=1
    elif i<=1599:
        cyan=1
    elif i<=1999:
        blue=1
    elif i<=2399:
        yellow=1
    elif i<=2799:
        orange=1
    elif i<=3199:
        red=1
    else:
        other+=1
mi=gray+brown+green+cyan+blue+yellow+orange+red
ma=other+mi
if mi==0:
    mi=1
print(mi,ma)

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]

colour = [0]*8
free = 0

for i in range(N):
    if a[i]>=1 and a[i]<=399:
        colour[0] = 1
    elif a[i]>=400 and a[i]<=799:
        colour[1] = 1
    elif a[i]>=800 and a[i]<=1199:
        colour[2] = 1
    elif a[i]>=1200 and a[i]<=1599:
        colour[3] = 1
    elif a[i]>=1600 and a[i]<=1999:
        colour[4] = 1
    elif a[i]>=2000 and a[i]<=2399:
        colour[5] = 1
    elif a[i]>=2400 and a[i]<=2799:
        colour[6] = 1
    elif a[i]>=2800 and a[i]<=3199:
        colour[7] = 1
    else:
        free += 1
        
kinds = 0
for i in range(8):
    if colour[i] == 1:
        kinds += 1

minimum = kinds
if kinds == 0:
    minimum = 1

maximum = kinds + free

    
print(minimum,maximum)

Solution (Python):
from collections import Counter

N = int(input())

count_counter = Counter()
result = 0
over = 0

for i in input().split():
    count_counter[int(i) // 400] += 1

for key in count_counter.keys():
    if key < 8:
        result += 1
    else:
        over += count_counter[key]

if result == 0:
    print(1, over)
else:
    print(result, result+over)

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
b=[]
t=0
for x in a:
    if x<3200:
        b.append(x//400)
    else:
        t+=1
c=len(set(b))
print(max(1,c), c+t)

Solution (Python):
a = int(input())

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

c = [0]*8
d = 0
for i in range(a):
	if 1 <= b[i] and b[i] <=399:
		c[0] = 1
	elif 400 <= b[i] and b[i] <=799:
		c[1] = 1
	elif 800 <= b[i] and b[i] <=1199:
		c[2] = 1
	elif 1200 <= b[i] and b[i] <=1599:
		c[3] = 1
	elif 1600 <= b[i] and b[i] <=1999:
		c[4] = 1
	elif 2000 <= b[i] and b[i] <=2399:
		c[5] = 1
	elif 2400 <= b[i] and b[i] <=2799:
		c[6] = 1
	elif 2800 <= b[i] and b[i] <=3199:
		c[7] = 1
	else:
		d += 1

ma = sum(c) + d

if sum(c) == 0:
	print(1,ma)
else:
	print(sum(c),ma)

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

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

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

if constant == 0:
    print(1, variable)
else:
    print(constant, constant+variable)

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

Solution (Python):
N = int(input())
src = list(map(int,input().split()))

cs = [0] * 8
free = 0
for a in src:
    if a >= 3200:
        free += 1
    else:
        cs[a//400] += 1
fix = len([1 for c in cs if c])
mx = fix + free
mn = fix + (0 if fix else 1)
print(str(mn) + ' ' + str(mx))

Solution (Python):
N = int(input())
a = list(map(int,input().split(" ")))

dic = {i : 0 for i in range(9)}
for i in range(N):
	if (a[i] // 400) > 7:
		dic[8] += 1
	else:
		dic[(a[i] // 400)] += 1

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

print(max(minv,1),minv+dic[8])

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
b=dict()
for i in a:
    b[i//400]=b.get(i//400,0)+1
count=0
count2=0
for i in b:
    if i>7:count2+=b[i]
    else:count+=1
print(max(count,1),count+count2)

Solution (Python):

def m():
    n = int(input())
    a = list(map(int, input().split()))
    ans = set()
    freecont = 0
    for i in range(n):
        t = a[i] // 400
        if t >= 8:
            freecont+=1
            continue
        ans.add(t)

    return "{} {}".format(max(len(ans),1), len(ans) +freecont)
    if len(ans) == 0:
        minc = 1
        maxc = min(freecont, 8)
        return "{} {}".format(minc, maxc)

    minc = len(ans)
    maxc = min(len(ans) + freecont, 8)
    return "{} {}".format(minc, maxc)


print(m())

Solution (Python):
N = int(input())

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

colors = [0] * 8
any_c = 0

for a in A:
    if a // 400 > 7:
        any_c += 1
    else:
        colors[a // 400] += 1

min_ans = 0

for color in colors:
    if color > 0:
        min_ans += 1

max_ans = min_ans + any_c
if min_ans == 0: min_ans += 1

print(str(min_ans) + " " + str(max_ans))

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

P = set()
ans = 0
for a in A:
    if a // 400 < 8:
         P.add(a // 400)
    else: ans += 1

if ans == 0: print(len(P),len(P))
elif len(P)==0: print(1,ans)
else: print(len(P),len(P)+ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
s, x = set(), 0
for i in a:
    if(i < 3200):
        s.add(i//400)
    else:
        x += 1
print(max(len(s), 1), len(s)+x)

Solution (Python):
n = int(input())
a = map(int, input().split())

colors = [False] * 8
crown_owners = 0

for rate in a:
	if rate <= 399:
		colors[0] = True
	elif rate <= 799:
		colors[1] = True
	elif rate <= 1199:
		colors[2] = True
	elif rate <= 1599:
		colors[3] = True
	elif rate <= 1999:
		colors[4] = True
	elif rate <= 2399:
		colors[5] = True
	elif rate <= 2799:
		colors[6] = True
	elif rate <= 3199:
		colors[7] = True
	else:
		crown_owners += 1

if colors.count(True) == 0:
	print(1, crown_owners)
else:
	print(colors.count(True), colors.count(True) + crown_owners)

Solution (Python):
n = int(input())
a = [int(x)//400 for x in input().split()]
 
b = 0
c = set()
for i in range(n):
    if a[i] > 7:
        b += 1
    else:
        c.add(a[i])
 
print(max(1, len(c)), len(c)+b)

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

Solution (Python):
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
col = []
f = [0]*8
sp = 0

for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1

if sum(f) > 0:
    min = sum(f)
    max = sum(f) + sp
else:
    min = 1
    max = sp
    
print(min,max)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
color_lst = [0 for i in range(9)]

color = 0
for i in range(len(a)):
    idx = a[i] // 400
    if idx > 8:
        idx = 8

    color_lst[idx] += 1
    if color_lst[idx] == 1 and idx != 8:
        color += 1

color_max = color + color_lst[8]
if color == 0:
        color += 1


print("{} {}".format(color, color_max))

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
t = [0 for k in range(8)]
s = 0

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

print(max(1,t.count(1)),t.count(1)+s)

Solution (Python):
from collections import Counter


def getinputdata():
    
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

n = int(arr_data[0][0])

arr = [int(x) for x in arr_data[1]]
arr_result = [0 for x in range(8)]

cnt = 0
for v in arr:

    if v < 400 *1 :

        arr_result[0] = 1

    elif v < 400 * 2:

        arr_result[1] = 1
    elif v < 400 * 3:

        arr_result[2] = 1
    elif v < 400 * 4:

        arr_result[3] = 1
    elif v < 400 * 5:

        arr_result[4] = 1
    elif v < 400 * 6:

        arr_result[5] = 1
    elif v < 400 * 7:

        arr_result[6] = 1

    elif v < 400 * 8:

        arr_result[7] = 1

    else:

        cnt += 1

if sum(arr_result)!=0:
    print(sum(arr_result), sum(arr_result) + cnt)
else:
    print(1, sum(arr_result) + cnt)

Solution (Python):
n=int(input())
a=map(lambda x: int(x)//400,input().split())
b=set()
c=0
for v in a:
  if v>=8:
    c+=1
  else:
    b.add(v)
if len(b)==0:
  print('1 '+str(c))
else:
  print(str(len(b))+' '+str(len(b)+c))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
c = 0
color = []
for a_i in a:
    if a_i>=3200:
        c += 1
    else:
        color.append(a_i//400)
    
ans_min = len(set(color))

print(max(ans_min, 1), ans_min+c)

Solution (Python):
n = int(input())
lis = [0,0,0,0,0,0,0,0]
pro = 0
li = list(map(int,input().split()))
for i in range(n):
	if li[i] >= 3200:
		pro += 1
	else:
		lis[(li[i])//400] = 1
su = lis.count(1)
print(max(su,1),min(su+pro,n))

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
c = set([])
free = 0
for r in l:
  if 1 <= r <= 399:
    c.add('grey')
  elif 400 <= r <= 799:
    c.add('brown')
  elif 800 <= r <= 1199:
    c.add('green')
  elif 1200 <= r <= 1599:
    c.add('cyan')
  elif 1600 <= r <= 1999:
    c.add('blue')
  elif 2000 <= r <= 2399:
    c.add('yellow')
  elif 2400 <= r <= 2799:
    c.add('orange')
  elif 2800 <= r <= 3199:
    c.add('red')
  elif r >= 3200:
    free += 1

if len(c) == 0:
  print(1, len(c)+free)
else:
  print(len(c), len(c)+free)

Solution (Python):
import collections

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

d = collections.defaultdict(int)

for i in a:
    i_ = i // 400
    if i_ >= 8:
        i_ = 8
    d[i_] += 1

if 8 in d:
    min_ = max(len(d) - 1, 1)
    max_ = len(d) + d[8] - 1

else:
    min_ = len(d)
    max_ = len(d)

print(min_, max_)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
B = [x//400 for x in A]
a,b = 0,0
for i in range(13):
    if i < 8:
        if i in B:
            a+=1
    else:
        b+=B.count(i)
print(max(a,1),a+b)

Solution (Python):
N = int(input())
src = list(map(int,input().split()))
ks = [0] * 9
for r in src:
    if r >= 3200:
        ks[-1] += 1
    else:
        ks[r//400] += 1
c = len([k for k in ks[:-1] if k])
mn = max(1, c)
mx = c + ks[-1]
print(mn,mx)

Solution (Python):
N=int(input())
A=[int(x) for x in input().split()]

dict={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0}

for a in A:
  if a>=3200:
    dict[8]+=1
  elif a>=2800:
    dict[7]+=1
  elif a>=2400:
    dict[6]+=1
  elif a>=2000:
    dict[5]+=1
  elif a>=1600:
    dict[4]+=1
  elif a>=1200:
    dict[3]+=1
  elif a>=800:
    dict[2]+=1
  elif a>=400:
    dict[1]+=1
  else:
    dict[0]+=1
ans=0
for i in range(8):
  if dict[i]>0:
    ans+=1
print(max(ans,1),ans+dict[8])

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
gray=brown=green=cyan=blue=yellow=orange=red=num=0
for i in range(n):
    if 1<=a[i]<=399:
        gray=1
    if 400<=a[i]<=799:
        brown=1
    if 800<=a[i]<=1199:
        green=1
    if 1200<=a[i]<=1599:
        cyan=1
    if 1600<=a[i]<=1999:
        blue=1
    if 2000<=a[i]<=2399:
        yellow=1
    if 2400<=a[i]<=2799:
        orange=1
    if 2800<=a[i]<=3199:
        red=1
    if 3200<=a[i]:
        num+=1
total=gray+brown+green+cyan+blue+yellow+orange+red
if total==0:
    print(1,num)
else:
    print(total,total+num)

Solution (Python):





if __name__ == '__main__':
    n = int(input())
    a = list(map(lambda x: int(x) // 400, input().split()))
    colors = [0] * 9

    
    
    for i in a:
        if i < 8:
            colors[i] = 1
        else:
            colors[8] += 1

    kind = sum(colors[:8])
    print(max(kind, 1), kind + colors[8])

Solution (Python):





if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    colors = [0] * 9
    rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801]

    for ai in a:
        for k in range(9):
            if rate[k] <= ai < rate[k + 1]:
                colors[k] += 1
                break

    count = 0

    for i in range(7):
        if colors[i] > 0:
            count += 1

    red = colors[7]
    legend = colors[8]

    if (red == 0) and (legend == 0):
        print(count, count)
    elif (red > 0) and (legend == 0):
        print(count + 1, count + 1)
    elif (red == 0) and (legend > 0):
        print(count + 1, count + legend)
    else:
        print(count + 1, count + 1 + legend)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))[:N]

i = 0
color = 0
T = list(filter(lambda x:x>=3200,A))
A = list(filter(lambda x:x<3200,A))

for R in range(0,2801,400):
    if len(list(filter(lambda x:x>=R and x<R+400,A)))>0: color+=1
    
min_color = color
max_color = color+len(T)

if min_color==0 and len(T)>0: min_color = 1
    
print(min_color,max_color)

Solution (Python):
l = [0,0,0,0,0,0,0,0,0]
n = int(input())
a = list(map(int,input().split()))

for i in range(len(a)):
    if 1 <=  a[i] <= 399:
        l[0] = l[0] + 1
    elif 400 <=  a[i] <= 799:
        l[1] = l[1] + 1
    elif 800 <=  a[i] <= 1199:
        l[2] = l[2] + 1
    elif 1200 <=  a[i] <= 1599:
        l[3] = l[3] + 1
    elif 1600 <=  a[i] <= 1999:
        l[4] = l[4] + 1
    elif 2000 <=  a[i] <= 2399:
        l[5] = l[5] + 1
    elif 2400 <=  a[i] <= 2799:
        l[6] = l[6] + 1
    elif 2800 <=  a[i] <= 3199:
        l[7] = l[7] + 1
    else:
        l[8] = l[8] + 1
        
tokurei = 0        
for i in range(8):
    tokurei = tokurei + l[i]

if tokurei == 0:
    print('1 ' + str(l[8]) )
else:
    flag = 0
    for i in range(8):
        if l[i] > 0:
            flag = flag + 1
    print(str(flag) + ' ' + str(flag + l[8]))

Solution (Python):


n = int(input())
a = [int(x) for x in input().split(" ")]

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

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

cnt = 0
for r in rate:
    if r>0:
        cnt += 1
if xx==0:
    print(str(cnt)+" "+str(cnt))
else:
    if cnt<2:
        print("1 "+str(xx+cnt))
    else:
        print(str(cnt)+" "+str(xx+cnt))

Solution (Python):
a=[0]*9;input()
for x in input().split():
    x=int(x)//400
    if x<8:a[x]=1
    else:a[8]+=1
b=sum(a[:8]);print(max(b,1),b+a[8])

Solution (Python):
a=[0]*9;input()
for x in input().split():
    x=int(x)
    if x<3200:a[x//400]=1
    else:a[8]+=1
b=sum(a[:8]);print(max(b,1),b+a[8])

Solution (Python):
input();a=[0]*9
for x in input().split():
    x=int(x)
    if x>3599:x=3200
    a[x//400]+=1
b=sum([1 if x else 0 for x in a[:8]])
print(max(1,b),b+a[8])

Solution (Python):
def c_colorful_leaderboard(N, A):
    from collections import defaultdict
    rating_list = defaultdict(int)
    rating_color = ['gray', 'brown', 'green',
                    'skyblue', 'blue', 'yellow', 'orange', 'red']  
    other = 0  
    for rating in A:
        r = rating // 400  
        if r >= 8:  
            other += 1
        else:
            rating_list[rating_color[r]] += 1
    ans = '{} {}'.format(max(1, len(rating_list)), len(rating_list) + other)
    return ans

N=int(input())
A=[int(i) for i in input().split()]
print(c_colorful_leaderboard(N, A))

Solution (Python):
import collections
n = int(input())
a = list(map(int,input().split()))
ub = collections.defaultdict(int)
ub[8] = 0
lb = set()
for x in a:
    lb.add(min(x,2800)//400)
    ub[min(x,3200)//400] += 1;
print(len(lb),len(ub)+ub[8]-1)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
b =[]
countmax = 0
countmin = 0

for i in range(n):
    b.append(a[i]//400)
for i in range(13):
    if b.count(i) >=1:
        if i<= 7:
            countmax +=1
            countmin +=1
        else:
            countmax += b.count(i)
print(max(1,countmin),countmax)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
S,red = set([]),0
for i in range(N):
    rank = A[i]//400
    if rank < 8:
        S.add(rank)
    else:
        red += 1
print(max(1,len(S)),len(S)+red)

Solution (Python):
N=int(input())
t,n,u=[],0,0
for s in list(map(int,input().split())):
    for i in range(8):
        if 0+400*i<=s<=399+400*i:
            t.append(i)
            break
    else:
        n+=1
l=len(set(t))
if l==0:
    u=1
print(str(l+u)+" "+str(l+n))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
s=set()
non=0
for x in a:
    tmp=x//400
    if tmp<8:
        s.add(tmp)
    else:
        non+=1
print(max(1,len(s)),len(s)+non)

Solution (Python):
def color(rating):
    d = {'gray': (1, 399), \
         'brown': (400, 799), \
         'green': (800, 1199), \
         'cyan': (1200, 1599), \
         'blue': (1600, 1999), \
         'yellow': (2000, 2399), \
         'orange': (2400, 2799), \
         'red': (2800, 3199), \
         'any': (3200, 4800)}
    for k, v in d.items():
        if rating >= v[0] and rating <= v[1]:
            return k

def count(colors):
    different_colors = set(colors)
    num_colors = len(different_colors) - ('any' in different_colors)
    anys = colors.count('any')
    if num_colors == 0 and anys > 0:
        minimum = 1
    else:
        minimum = num_colors
    maximum = num_colors + anys
    return (minimum, maximum)


if __name__ == '__main__':
    _ = input()
    ratings = map(int, input().split())
    colors = list(map(lambda x: color(x), ratings))
    minimum, maximum = count(colors)
    print(minimum, maximum)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(4800//400 + 1)]
for i in a:
    b[i//400] += 1;
t = 0
ans = 0
for i in range(4800//400 + 1):
    if b[i] > 0:
        if i < 3200//400:
            ans+=1
        else:
            t+=b[i]
if ans > 0:
    print(ans,t+ans)
else:
    print(1,t)

Solution (Python):
N = int(input())
a = list(map(lambda x : int(x) // 400, input().split()))
over3200 = sum(list(map(lambda x: 1 if x >= 8 else 0, a)))

count = 0
for i in range(8):
    if i in a:
        count += 1

print(max(1, count), count+over3200)

Solution (Python):
N = int(input())
a = list(map(lambda x : int(x) // 400, input().split()))
over3200 = sum(list(map(lambda x: 1 if x >= 8 else 0, a)))

count = 0
for i in range(8):
    if i in a:
        count += 1
        
print(max(1, count), count+over3200)

Solution (Python):
n = int(input())
a = [0] * 8
b = 0
for x in input().split():
    x = int(x)
    if x >= 3200: b += 1
    else: a[x//400] += 1
m = 0
for x in a:
    if x > 0: m += 1
print(max(m, 1), m + b)

Solution (Python):
n=int(input())
mark=[i for i in range(0,3200,400)]
mark.append(99999999999999)
def color(x):
    for i in range(9):
        if mark[i]<=x<mark[i+1]:
            return i     
score=list(map(int,input().split()))
set=set()
special=0
for x in score:
    if x<3200:
        set.add(color(x))
    else:
        special+=1
        
print(max(len(set),1),len(set)+special)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
x,y = set(),0
for i in a:
	num = (i-i%400)//400
	if num>=8:
		y += 1
	x.add(min(num,8))
if len(x) != 1:
	if 8 in x:
		x.remove(8)
	print(len(x),len(x)+y)
else:
	if 8 in x: print(1,y)
	else: print(1,1)

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
cnt=[0]*9
ans=0
for i in l:
    if i>3199:
        i=3200
    cnt[i//400]+=1
for p in range(8):
    i=cnt[p]
    if i!=0:
        ans+=1
print(ans if ans!=0 else 1,ans+cnt[-1])

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
c=[0,0,0,0,0,0,0,0]
f=0
for i in a:
  if i//400<8:
    c[i//400]=1
  else:
    f+=1
ans=0
for i in c:
  ans+=i
print(max(1,ans),ans+f)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
rate = [0 for i in range(9)]
ans = 0

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

for i in range(len(rate)-1):
    if rate[i] == 1:
        ans += 1
if ans == 0:
    ans = 1
    rate[8] -= 1
print(ans,ans+rate[8])

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
num=[False for i in range(8)]

ans=0
over=0
for rate in a:
	if rate<3200:
		num[int(rate/400)]=True
	else:
		over+=1
for flag in num:
	if flag:
		ans+=1

print(max(ans,1),end="")
print(" ",end="")
print(ans+over)