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()))
s = set()
cnt = 0
for i in a:
    if i >= 3200:
        cnt += 1
    else:
        s.add(i // 400)
print(max(1, len(s)), len(s) + cnt)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
al=0
for i in range(n):
  if a[i]>=3200:
    al+=1
    a[i]=8
  else:
    a[i]=a[i]//400
if al==0:
  cl=len(set(a))
else:
  cl=len(set(a))-1
if cl==0:
  mi=1
else:
  mi=cl
ma=al+cl
print(mi,ma)

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

rate = [i*400-1 for i in range(1,9)]
over = 0
d = {}

for i in range(n):
    if a[i] > rate[-1]:
        over += 1
    else:
        for j in range(len(rate)):
            if a[i] <= rate[j]:
                if rate[j] not in d:
                    d[rate[j]] = 1
                else:
                    d[rate[j]] = d[rate[j]] + 1
                break


print(max(len(d), 1), len(d)+over)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
d={}
f=0
for a in l:
    if a<400:
        if not 0 in d:
            d[0]=1
    elif a<800:
        if not 1 in d:
            d[1]=1
    elif a<1200:
        if not 2 in d:
            d[2]=1
    elif a<1600:
        if not 3 in d:
            d[3]=1
    elif a<2000:
        if not 4 in d:
            d[4]=1
    elif a<2400:
        if not 5 in d:
            d[5]=1
    elif a<2800:
        if not 6 in d:
            d[6]=1
    elif a<3200:
        if not 7 in d:
            d[7]=1
    else:
        f+=1
v=sum(d.values())
min_=1 if v==0 else v
max_=v+f
print(min_,max_)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
d={}
f=0
for a in l:
    if a<400:
        if not 0 in d:
            d[0]=1
    elif a<800:
        if not 1 in d:
            d[1]=1
    elif a<1200:
        if not 2 in d:
            d[2]=1
    elif a<1600:
        if not 3 in d:
            d[3]=1
    elif a<2000:
        if not 4 in d:
            d[4]=1
    elif a<2400:
        if not 5 in d:
            d[5]=1
    elif a<2800:
        if not 6 in d:
            d[6]=1
    elif a<3200:
        if not 7 in d:
            d[7]=1
    else:
        f+=1
v=sum(d.values())
min_=1 if v==0 else v
max_=v+f
print(min_,max_)

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

cnt = [False] * 8
free = 0

for a in A:
  c = a // 400
  if c >= 8:
    free += 1
  else:
    cnt[c] = True

max_c = sum(cnt) + free
if sum(cnt) != 0:
  min_c = sum(cnt)
else:
  min_c = 1

print(min_c, max_c)

Solution (Python):
n = int(input())
arr = list(map(int, input().split()))
r = 0
cols = [0] * 8
for i in arr:
  color = i // 400
  if color <= 7:
    cols[color] = 1
  else:
    r += 1
c = sum(cols)
print(max(1, c), r+c)

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

c = [0] * 8
r = 0

for i in a:
    col = i // 400
    if col <= 7:
        c[col] = 1
    else:
        r += 1

c = sum(c)

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

Solution (Python):
n = int(input())
a = list(map(lambda x:int(x)//400, input().split()))

r = len(set(range(8)) & set(a))
cnt = 0
for i in a:
    if i >= 8: cnt += 1

x, y = max(r, 1), r+cnt
print(x, y)

Solution (Python):
_ = input()
A = list(map(int,input().rstrip().split(" ")))
ans = [0,0]
q = [0 for i in range(9)]
for i in A:
    q[min(8,i // 400)] += 1
for i in range(9):
    if i == 8:
        ans[1] += q[i]
    else:
        if q[i] != 0:
            ans[0] += 1
            ans[1] += 1
ans[0] = max(1,ans[0])
print(str(ans[0]) + " " + str(ans[1]))

Solution (Python):
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)

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

colors = [0] * 9
for a in A:
    idx = a // 400
    if idx >= 8:
        idx = 8
    colors[idx] += 1
ans = 0
for i in range(8):
    if colors[i] > 0:
        ans += 1
max_ans = ans
if colors[8] > 0:
    max_ans += colors[8]

if ans == 0 and max_ans > 0:
    ans += 1
print(ans, max_ans)

Solution (Python):
n = int(input())
alst = list(map(int, input().split()))
lst = [0 for _ in range(9)]
for num in alst:
    pos = min(num // 400, 8)
    lst[pos] += 1
cnt = 8 - lst[:-1].count(0)
print(max(cnt, 1), cnt + lst[-1])

Solution (Python):
N = int(input())
A = [int(T) for T in input().split()]
Color = [T//400 for T in A if T<3200]
ColL = len(Color)
SetL = len(set(Color))
MIN = max(1,SetL)
MAX = SetL+(N-ColL)
print('{} {}'.format(MIN,MAX))

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

d = {'gry':0,'brw':0,'grn':0,'miz':0,'blu':0,'yel':0,'dai':0,'red':0,'any':0}
for i in a:
    if 1 <= i <= 399:
        d['gry'] += 1
    elif 400 <= i <= 799:
        d['brw'] += 1
    elif 800 <= i <= 1199:
        d['grn'] += 1
    elif 1200 <= i <= 1599:
        d['miz'] += 1
    elif 1600 <= i <= 1999:
        d['blu'] += 1
    elif 2000 <= i <= 2399:
        d['yel'] += 1
    elif 2400 <= i <= 2799:
        d['dai'] += 1
    elif 2800 <= i <= 3199:
        d['red'] += 1
    else: 
        d['any'] += 1

ans = 0
zero = 0
for k,v in d.items():
    if k == 'any':
        pass
    else:
        if v != 0:
            ans += 1

print (max(1,ans),ans+d['any'])

Solution (Python):
n = int(input())
et=0
arr = list(map(int , input().split()))
count = [0 for i in range(0,10)]
for i in range(0 , n):
	if arr[i]>=1 and arr[i]<=399:
		count[0]=count[0]+1
	elif arr[i]>=400 and arr[i]<=799:
		count[1]=count[1]+1
	elif arr[i]>=800 and arr[i]<=1199:
		count[2]=count[2]+1
	elif arr[i]>=1200 and arr[i]<=1599:
		count[3]=count[3]+1
	elif arr[i]>=1600 and arr[i]<=1999:
		count[4]=count[4]+1
	elif arr[i]>=2000 and arr[i]<=2399:
		count[5]=count[5]+1
	elif arr[i]>=2400 and arr[i]<=2799:
		count[6]=count[6]+1
	elif arr[i]>=2800 and arr[i]<=3199:
		count[7]=count[7]+1
	else:
		et = et+1
mn =1000
mx =0
tot=0
for i in range(0, 8):
	if count[i]>0:
		tot=tot+1
if tot==0:
	print(1,et)
else:
	print(tot , tot+et)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A = map( lambda x:x//400, A)
A = list(map( lambda x:x if x<8 else 8, A))
cnt8 = A.count(8)
A = list(set(A))
if 8 in A:
    A.remove(8)
sum = len(A)
if sum == 0:
    print(1, end=' ')
else:
    print(sum, end=' ')
sum += cnt8
print(sum)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
o=0
m=0
u=[0]*8
for i in a:
    if 3199<i:
        o+=1
    else:
        if u[i//400]==0:
            u[i//400]+=1
            m+=1
print(max(m,1),m+o)

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(8)]
cnt = 0

for i in a:
    x = i//400
    if x >=8:
        cnt +=1
    else:
        if num[x] == 0:
            num[x] +=1
    
if cnt == 0:
    print(sum(num),sum(num))
elif sum(num) == 0:
    print(1,cnt)
else:
    print(sum(num),sum(num)+cnt)

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
l = [0]*8
c = 0
for i in range(n):
  if a[i] >= 3200:
    c += 1
  else:
    l[a[i]//400] = 1

if l.count(1) == 0:
  print("1 "+str(c))
else:
  print(str(l.count(1))+" "+str(l.count(1)+c))

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

for a in A:
    if a < 400:
        check.append(1)
    elif a < 800:
        check.append(2)
    elif a < 1200:
        check.append(3)
    elif a < 1600:
        check.append(4)
    elif a < 2000:
        check.append(5)
    elif a < 2400:
        check.append(6)
    elif a < 2800:
        check.append(7)
    elif a < 3200:
        check.append(8)
    else:
        every += 1
length = len(set(check))
if length == 0:
    length = 1
    every -= 1

print(length,length+every)

Solution (Python):
from collections import defaultdict
n=input()
A=[int(i) for i in input().split()]
c=defaultdict(int)
free=0
for a in A:
  if a > 3199:
    free+=1
  else:
    c[a//400]+=1
print(max(len(c),1),len(c)+free)

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

rate = [0]*8
f = 0

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

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

Solution (Python):
def check_rate(r):
  for i,rate in enumerate(rates):
    if r < rate:
      return i

n=int(input())
a=list(map(int,input().split()))
rates=[400,800,1200,1600,2000,2400,2800,3200,float("inf")]
rates_cb=[False for _ in range(len(rates))]
wild=len(rates)-1
wild_c=0
for aa in a:
  r=check_rate(aa)
  if r == wild:
    wild_c+=1
  else:
    rates_cb[r]=True

base_col=rates_cb.count(True)
minc= max(1,base_col)
maxc=base_col+wild_c
print(minc,maxc)

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
count = {i:0 for i in range(8)}
over = 0
for a in A:
    if a < 3200:
        count[a//400] = 1
    else:
        over += 1
hp = sum(count.values())
print(hp + int(hp == 0), hp + over)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    vec = [0] * 8
    over_red = 0
    for a in A:
        if a >= 3200:
            over_red += 1
        else:
            vec[a // 400] += 1

    c = 0
    for v in vec:
        if v > 0:
            c += 1
    if c > 0:
        print(c, c + over_red)
    else:
        print(1, over_red)

    return


if __name__ == '__main__':
    main()

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

i=0
f1=f2=f3=f4=f5=f6=f7=f8=f9=0

while i<n:

    if 1<=a[i]<=399:

        f1=1

    elif 400<=a[i]<=799:

        f2=1

    elif 800<=a[i]<=1199:

        f3=1

    elif 1200<=a[i]<=1599:

        f4=1

    elif 1600<=a[i]<=1999:

        f5=1

    elif 2000<=a[i]<=2399:

        f6=1

    elif 2400<=a[i]<=2799:

        f7=1

    elif 2800<=a[i]<=3199:

        f8=1

    elif 3200<=a[i]:

        f9+=1

    i+=1

if f1==f2==f3==f4==f5==f6==f7==f8==0 and f9!=0:
    ans1=1
else:
    ans1 = f1+f2+f3+f4+f5+f6+f7+f8

ans2 = f1+f2+f3+f4+f5+f6+f7+f8+f9

print(str(ans1)+' '+str(ans2))

Solution (Python):
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
r=Counter([min(x//400,8) for x in a])
l=len(list(iter(r)))
if r[8]==0:
  print(l,l)
else:
  print(max(l-1,1),l-1+r[8])

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
col = [0]*8
over_cnt = 0
cnt_min = 0
cnt_max = 0
for i in range(n):
	if a[i] < 3200:
		col[(a[i])//400] += 1
		
	else:
		over_cnt += 1
for j in range(8):
	
	if col[j] > 0:
		cnt_min += 1
if cnt_min == 0:
	cnt_min = 1
	cnt_max = over_cnt
else:
	cnt_max = cnt_min+over_cnt
print(cnt_min,cnt_max)

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

num_free = 0
num_color = [False] * 8
for rate in nums:
    if rate < 3200:
        num_color[rate // 400] = True
    else:
        num_free += 1

ans = sum(num_color)
print('{} {}'.format(max(ans, 1), ans + num_free))

Solution (Python):


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

rate = [400,800,1200,1600,2000,2400,2800,3200]
R = [False]*len(rate)
red_plus = 0

for a in A:
    if a >= rate[-1]:
        red_plus += 1
    else:
        for i,r in enumerate(rate):
            if a < r:
                R[i] = True
                break
    
if R.count(True) == 0:
    print(1, R.count(True)+red_plus)
else:
    print(R.count(True), R.count(True)+red_plus)

Solution (Python):
n = int(input())
s = list(map(int,input().split()))
 
maxans = 0
minans = 0
 
color = [0]*8
red = 0
 
for i in s:
    if i>=3200:
        red += 1
    else:
        color[i//400] = 1
        
x = sum(color)
 
if x == 0:
    print(1,red)
else:
    print(x,x+red)

Solution (Python):
n = int(input())
s = list(map(int,input().split()))
 
maxans = 0
minans = 0
 
color = [0]*8
red = 0
 
for i in s:
    if i>=3200:
        red += 1
    else:
        color[i//400] = 1
        
x = sum(color)
 
if x == 0:
    print(1,red)
else:
    print(x,x+red)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
d = set()
over = 0
for i in l:
    if i <= 399:
        d.add("gray")
    elif i <= 799:
        d.add("brown")
    elif i <= 1199:
        d.add("green")
    elif i <= 1599:
        d.add("light blue")
    elif i <= 1999:
        d.add("blue")
    elif i <= 2399:
        d.add("yellow")
    elif i <= 2799:
        d.add("orange")
    elif i <= 3199:
        d.add("red")
    else:
        over += 1

min_color = len(d)
if len(d) == 0:
    min_color +=1
max_color = len(d) + over

print(min_color, max_color)

Solution (Python):
N = int(input())
rate = list(map(int,input().split()))
lst = [i*400 for i in range(9)]
lstc = [0]*9

for i in rate:
    for j in range(len(lst)-1):
        
        if (400*j) <= i < 400*(j+1):
            lstc[j] += 1
            break
        
    if i >= 3200:
        lstc[-1] += 1
            

n = 0
for i in lstc:
    if i > 0:
        n += 1
nx = n-1

if lstc[-1] == 0:
    print(n,n)
elif nx == 0:
    print(1,lstc[-1])
else:
    print(nx,nx+lstc[-1])

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

cnt = 0
color = [False] * 8
for v in a:
    if v >= 3200:
        cnt += 1
    else:
        color[v//400] = True

num = color.count(True)
print(max(num, 1), num + cnt)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
t = [0] * 8
p = 0

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

x = t.count(1)
amax = p+x
if x == 0:
    amin = 1
else:
    amin = x
print(amin,amax)

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]
list = {}
list[8] = 0

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

if len(list) == 1:
    min = 1
else:
    min = len(list) - 1

if list[8] > 0:
    max = len(list) + list[8] - 1
else:
    max = len(list) - 1

print(min,max)

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

color = []
color2 = []

def rate(a):
    if a < 400:
        if 1 not in color:
            color.append(1)
    elif 400<= a and a<800:
        if 2 not in color:
            color.append(2)
    elif 800<=a and a<1200:
        if 3 not in color:
            color.append(3)
    elif 1200<=a and a<1600:
        if 4 not in color:
            color.append(4)
    elif 1600<=a and a<2000:
        if 5 not in color:
            color.append(5)
    elif 2000 <=a and a<2400:
        if 6 not in color:
            color.append(6)
    elif 2400 <=a and a<2800:
        if 7 not in color:
            color.append(7)
    elif 2800<=a and a<3200:
        if 8 not in color:
            color.append(8)
    elif a>= 3200:
        color2.append(a)

for i in range(N):
    rate(a[i])

max = len(color) + len(color2)

if len(color) == 0:
    print(1,max)
else:
    print(len(color),max)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=[0]*9
while a:
  kazu=a.pop(0)
  if 1<=kazu < 400:
    b[0]=1
  elif kazu < 800:
    b[1]=1
  elif kazu < 1200:
    b[2]=1
  elif kazu < 1600:
    b[3]=1
  elif kazu < 2000:
    b[4]=1
  elif kazu < 2400:
    b[5]=1
  elif kazu < 2800:
    b[6]=1
  elif kazu < 3200:
    b[7]=1
  elif kazu >=3200:
    b[8]+=1
coma=b[8]
comi=0
for i in b[:8]:
  if i > 0:
    comi+=1
if coma > 0 and comi ==0:
  comi =1
if comi+coma >= n:
  maxgo=n
else:
  maxgo=comi+coma
print(comi,maxgo)

Solution (Python):
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))

Solution (Python):
from collections import defaultdict
N = int(input())
al = list(map(int,input().split()))
cnt = 0
dic = defaultdict(int)
for i in al:
    if 1<= i <= 399:
        dic['gray'] += 1
    elif 400 <= i <= 799:
        dic['brown'] += 1
    elif 800 <= i <= 1199:
        dic['green'] += 1
    elif 1200 <= i <= 1599:
        dic['cyan'] += 1
    elif 1600 <= i <= 1999:
        dic['blue'] += 1
    elif 2000 <= i <= 2399:
        dic['yellow'] += 1
    elif 2400 <= i <= 2799:
        dic['orange'] += 1
    elif 2800 <= i <= 3199:
        dic['red'] += 1
    else:
        cnt += 1


ansmax = len(dic.keys()) + cnt
if ansmax > N:
    ansmax = N


ansmin = len(dic.keys())
if ansmin == 0 and cnt >= 1:
    ansmin = 1

print(ansmin,ansmax)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
b = [a[i]//400 for i in range(N) if a[i] < 3200]
c = len(set(b))
print(max(1,c), c+N-len(b))

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

Solution (Python):
s = input()
n = int(s)

t_count = 0
f_count = 0
over = 0

colors = []
for i in range(8):
    colors.append(False)

v = input().split()

for i in range(n):
    x = int(v[i])
    if 1 <= x <= 399:
        colors[0] = True
    elif 400 <= x <= 799:
        colors[1] = True
    elif 800 <= x <= 1199:
        colors[2] = True
    elif 1200 <= x <= 1599:
        colors[3] = True
    elif 1600 <= x <= 1999:
        colors[4] = True
    elif 2000 <= x <= 2399:
        colors[5] = True
    elif 2400 <= x <= 2799:
        colors[6] = True
    elif 2800 <= x <= 3199:
        colors[7] = True
    else:
        over += 1

for i in range(len(colors)):
    if colors[i]:
        t_count += 1

if t_count == 0:
    min_ans = 1
else:
    min_ans = t_count
max_ans = t_count + over

print(min_ans, end=' ')
print(max_ans)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
lis=[0]*9
for num in a:
    lis[min(8,num//400)]+=1
kind=0
for i in range(8):
    if lis[i]>0:
        kind+=1
if kind==0:
    mini=1
else:
    mini=kind
maxi=kind+lis[8]
print(mini,maxi)

Solution (Python):

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

lst = [0,0,0,0,0,0,0,0,0]

for i in range(N):
	for j in range(1,9):
		if a[i] < 400*j:
			lst[j-1] = 1
			break
	else:
		lst[8] += 1

if sum(lst[0:8]) == 0:
    min = 1
else:
    min = sum(lst[0:8])
max = sum(lst)

print(min,max)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
C = [a//400 for a in A if a<3200]
D = len(set(C))
print(max(1,D),D+N-len(C))

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

for a in A:
  if a<3200:
    C+=[a//400]
  else:
    D+=1

if D==0:
  ans = [len(set(C)),len(set(C))]
else:
  if len(C)==0:
    ans = [1,D]
  else:
    ans = [len(set(C)),len(set(C))+D]

print(*ans)

Solution (Python):
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()
    
    n = int(input())
    a = list(map(int, input().split()))
    rate = [0]*8
    cnt = 0
    for x in a:
        r = x//400
        if r > 7:
            cnt += 1
        elif not rate[r]:
            rate[r] = 1
    s = sum(rate)
    mins = max(s,1)
    maxs = s+cnt
    print(mins, maxs)        
        
            



if __name__ == '__main__':
    main()

Solution (Python):
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()
    
    n = int(input())
    a = list(map(int, input().split()))
    rate = [0]*8
    cnt = 0
    for x in a:
        r = x//400
        if r > 7:
            cnt += 1
        elif not rate[r]:
            rate[r] = 1
    s = sum(rate)
    mins = s
    if cnt > 0:
        mins += 1
        if s > 0:
            mins -=1
    maxs = s+cnt
    print(mins, maxs)        
        
            



if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
la = [int(w) for w in input().split()]

cnt = [0]*9
for a in la:
    if a > 3200:
        a = 3200
    cnt[a // 400] += 1

mi = len([_ for _ in cnt[:8] if _ > 0])
ma = mi+cnt[8]

if mi == 0:
    mi = 1

print(mi, ma)

Solution (Python):

input()
a = map(int, input().split())
c = [0] * 9
for i in a:
    c[min(8, i // 400)] += 1
s = sum(i > 0 for i in c[:8])
print(max(s, 1), s + c[8])

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

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


color=[0]*8
free=0

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

num = sum(color)

ans_1 = num

if ans_1==0:
    ans_1=1

ans_2 = num+free


print(ans_1,ans_2)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A = [a//400 for a in A]
l = len({0,1,2,3,4,5,6,7}&set(A))
S = sum(a>7 for a in A)
print(max(l, 1), l+S)

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

r_s=list(range(0,2801,400))
r_s[0]=1
r_s.append(3200)

r_e=list(range(399,3200,400))
r_e.append(4800)

def check_color(check):
    N=9
    for i in range(N):
        if r_s[i] <= check and r_e[i] >= check:
            return i
        
checklist=[]
checklist_8=[]
for a in A:


    a=check_color(a)

    if a != 8:
        checklist.append(a)
    else:
        checklist_8.append(a)

max_= len(set(checklist))+len(checklist_8)
min_= len(set(checklist))
        
max_ = max_
min_ = max(1,min_)

print(min_,max_)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
color = [0] * 8
cnt = 0
for i in a:
  if i < 400:
    color[0] = 1
  elif i < 800:
    color[1] = 1
  elif i < 1200:
    color[2] = 1
  elif i < 1600:
    color[3] = 1
  elif i < 2000:
    color[4] = 1
  elif i < 2400:
    color[5] = 1
  elif i < 2800:
    color[6] = 1
  elif i < 3200:
    color[7] = 1
  else:
    cnt += 1
if color.count(1) == 0:
  print(1, cnt)
else:
  print(color.count(1), color.count(1) + cnt)

Solution (Python):
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)

Solution (Python):
N, = list(map(int,input().split()))
a  = list(map(int,input().split()))
s = set()
c6=0
for ai in a:
    if ai>=3200:
        c6 += 1
    else:
        s |= set({ai//400})
print(max(1,len(s)),len(s)+c6)

Solution (Python):
n = int(input())
a_list = [int(x) for x in input().split()]
s = set()
o = 0
for a in a_list:
    r = a // 400
    if r >= 8:
        o += 1
    else:
        s.add(r)
c = len(s)
print(c if c > 0 else 1, c + o)

Solution (Python):
n = int(input())
a_list = [int(x) for x in input().split()]
s = set()
o = 0
for a in a_list:
    r = a // 400
    if r >= 8:
        o += 1
    else:
        s.add(r)
c = len(s)
print(c if c > 0 else 1, c + o)

Solution (Python):
def main():
    n = int(input())
    As = list(map(int, input().split()))
    nums = []
    rainbow = 0
    for A in As:
        num = A // 400
        if num < 8:
            if num not in nums:
                nums.append(num)
        else:
            rainbow += 1
    ans_max = len(nums)+rainbow
    ans_min = max(1, len(nums))
    print(ans_min, ans_max)


if __name__ == "__main__":
    main()

Solution (Python):




def rateToColor(rate):
  if 0 < rate < 400:
    return 0
  elif rate < 800:
    return 1
  elif rate < 1200:
    return 2
  elif rate < 1600:
    return 3
  elif rate < 2000:
    return 4
  elif rate < 2400:
    return 5
  elif rate < 2800:
    return 6
  elif rate < 3200:
    return 7
  else:
    return 8


def solve(n,a):
  flags = [False]*8
  numOfRainbow = 0
  for rate in a:
    color = rateToColor(rate)
    if color != 8:
      flags[color] = True
    else:
      numOfRainbow += 1
  if sum(flags):
    return sum(flags), sum(flags)+numOfRainbow
  else:
    return 1,numOfRainbow


def main():
  N = int(input())
  a = list(map(int,input().split()))
  print(*solve(N,a))
  return

if __name__ == '__main__':
  main()

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]
check = [0] * 9
maxx = 0
minn = 0

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

for i in range(9):
    if i <= 7 and check[i] >= 1:
        maxx += 1
        minn += 1
    if i == 8:
        maxx += check[8]
        if minn == 0 and check[8] >= 1:
            minn = 1

print(minn, maxx)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
cnt=[0]*9
ans=0
for score in a:
    if score <400: 
        cnt[0]+=1
    elif score <800: 
        cnt[1]+=1
    elif score<1200:
        cnt[2]+=1
    elif score<1600:
        cnt[3]+=1
    elif score<2000:
        cnt[4]+=1
    elif score<2400:
        cnt[5]+=1
    elif score<2800:
        cnt[6]+=1
    elif score<3200:
        cnt[7]+=1
    else:
        cnt[8]+=1
for i in cnt[:8:]:
    if i:
        ans+=1
print(max(1,ans),ans+cnt[8])

Solution (Python):
n = int(input())
colors = [0]*8
gold = 0
for a in map(int, input().split()):
    color = a//400
    if 8 <= color:
        gold += 1
        continue
    colors[color] = 1
print(max(sum(colors), 1), sum(colors)+gold)

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

X=[0]*8
Y=0

for a in A:
    if a>=3200:
        Y+=1
    else:
        X[a//400]+=1

a=max(1,8-X.count(0))
b=8-X.count(0)+Y
print(a,b)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
S = set()
_S = 0
for a in A:
    if a <= 399:
        S.add(0)
    elif 400 <= a <= 799:
        S.add(1)
    elif 800 <= a <= 1199:
        S.add(2)
    elif 1200 <= a <= 1599:
        S.add(3)
    elif 1600 <= a <= 1999:
        S.add(4)
    elif 2000 <= a <= 2399:
        S.add(5)
    elif 2400 <= a <= 2799:
        S.add(6)
    elif 2800 <= a <= 3199:
        S.add(7)
    else:
        _S += 1
print(max(1, len(S)), len(S) + _S)

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

for i in range(N):
  aa = int(A[i] / 400)
  if aa > 8:
    aa = 8
  ans[aa] += 1
  
min_a = 0
max_a = 0
for i in range(9):
  if i != 8:
    if ans[i] != 0:
      min_a += 1
      max_a += 1
  else:
    max_a += ans[i]
    
min_a = max(min_a, 1)    
print(min_a, max_a)

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

color = [False]*8
flex = 0
cnt = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif a[i] < 800:
        color[1] = True
    elif a[i] < 1200:
        color[2] = True
    elif a[i] < 1600:
        color[3] = True
    elif a[i] < 2000:
        color[4] = True
    elif a[i] < 2400:
        color[5] = True
    elif a[i] < 2800:
        color[6] = True
    elif a[i] < 3200:
        color[7] = True
    else:
        flex += 1

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

print(str(mi) + " " + str(cnt))