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 = [int(i) for i in input().split()]

L = [0 for i in range(9)] 

for i in A:
    if 1 <= i <= 399:
        L[0] += 1
    if 400 <= i <= 799:
        L[1] += 1
    if 800 <= i <= 1199:
        L[2] += 1
    if 1200 <= i <= 1599:
        L[3] += 1
    if 1600 <= i <= 1999:
        L[4] += 1
    if 2000 <= i <= 2399:
        L[5] += 1
    if 2400 <= i <= 2799:
        L[6] += 1
    if 2800 <= i <= 3199:
        L[7] += 1
    if 3200 <= i:
        L[8] += 1
        
count_0 = L[0:8].count(0)
count_not_0 = 8 - count_0
count_strong = L[8]

if count_not_0 == 0:
    if count_strong >= 1:
        print(1, count_strong,)
    else:
        print(0, 0)
else:
    if count_strong == 0:
        print(count_not_0, count_not_0)
    else:
        print(count_not_0, count_not_0 + count_strong)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
color=set()
free=0
for a in A:
    if a<3200:
        color|={a//400}
    else:
        free+=1
print(str(max(1,len(color)))+' '+str(len(color)+free))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
color = [0]*9
for i in a:
  color[min(8,i//400)] += 1
kind = 0
for i in color[:8]:
  if i:
    kind += 1
if kind == 0 and color[8]:
  color[8] -= 1
  kind += 1
print(kind,kind+color[8])

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
gray=[]
brown=[]
green=[]
skyblue=[]
blue=[]
yellow=[]
orange=[]
red=[]
for i in range(1,3200):
    if 0<i<400:
        gray.append(i)
    elif 399<i<800:
        brown.append(i)
    elif 799<i<1200:
        green.append(i)
    elif 1299<i<1600:
        skyblue.append(i)
    elif 1599<i<2000:
        blue.append(i)
    elif 1999<i<2400:
        yellow.append(i)
    elif 2399<i<2800:
        orange.append(i)
    else:
        red.append(i)
collor=[gray,brown,green,skyblue,blue,yellow,orange,red]
ans0=0
for i in range(len(collor)):
    if len(set(collor[i])&set(a))!=0:
        ans0+=1
cnt=0
for x in a:
    if x>=3200:
        cnt+=1
if ans0!=0:
    print(ans0,ans0+cnt)
else:
    print(1,ans0+cnt)

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

count = 0
for i in range(8):
    if len(list(filter(lambda x:i*400<=x and x<400*(i+1), a))) > 0:
        count+=1

x = len(list(filter(lambda x:3200<=x, a)))
if count==0:
    count=1
    x-=1

print("{} {}".format(count, count+x))

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

x = []
f = 0
for a in A:
    if a//400 < 8:
        x.append(a//400)
    else:
        f += 1
x = set(x)
l = len(x)
print(max(l,1),l+f)

Solution (Python):
n,*a=map(int,open(0).read().split());b=[s//400for s in a if s<3200];c=len(set(b));print(c or 1,n-len(b)+c)

Solution (Python):

n=int(input())
A=list(map(int,input().split()))
s=set()
cnt=0
for a in A:
    c=a//400
    if c>=8:
        cnt+=1
    else:
        s.add(c)
m=len(s)
if m:
    M=m+cnt
else:
    m=1
    M=cnt
print(m,M)

Solution (Python):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    colors = [0] * 9
    for i in range(N):
        c = min(A[i] // 400, 8)
        colors[c] += 1
    tmp = 0
    for i in range(8):
        if colors[i] >= 1:
            tmp += 1
    mn = max(tmp, 1)
    mx = tmp + colors[8]
    print(mn, mx)


if __name__ == "__main__":
    main()

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

check = set()
free = 0
for a in A:
  x = (a-a%400)//400
  if(x < 8):
    check.add(x)
  else:
    free += 1
c = len(check) 
if(c == 0):
  print(1, free)
else:
  print(c, c+free)

Solution (Python):

N=int(input())
A=[0 for i in range(9)]
C=[1,700,800,1200,1600,2000,2400,2800,3200][::-1]
for a in list(map(int,input().split())):
	for i in range(9):
		if C[i]<=a:
			A[8-i]+=1
			break
print(8-A[:-1].count(0)+(A[:-1].count(0)==8),8-A[:-1].count(0)+A[8])

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

colors = [0]*9

for rate in rates:
    if rate < 3200:
        colors[rate // 400] += 1
    else:
        colors[8] += 1

zeros = colors[0:8].count(0)
nonzeros = 8 - zeros

M = nonzeros + colors[8]

if nonzeros == 0:
    m = 1
else:
    m = nonzeros

print(m, M)

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007






f = [0]
for i in range(1,400):
    f.append(0)
for i in range(400,800):
    f.append(1)
for i in range(800,1200):
    f.append(2)
for i in range(1200,1600):
    f.append(3)
for i in range(1600,2000):
    f.append(4)
for i in range(2000,2400):
    f.append(5)
for i in range(2400,2800):
    f.append(6)
for i in range(2800,3200):
    f.append(7)
for i in range(3200,4801):
    f.append(-1)
n = I()
a = LI()
k = [1 for i in range(8)]
s = 0
t = 0
for i in a:
    if f[i] >= 0:
        if k[f[i]]:
            k[f[i]] = 0
            s += 1
    else:
        t += 1
print(max(s,1),min(s+t,n))

Solution (Python):
def main():
    _ = int(input())
    a = [int(s) for s in input().split()]
    print(*solve(a))

def solve(a):
    s = set()
    t = 0
    f = 0

    for x in a:
        y = x // 400
        if x >= 3200:
            t += 1
            f = 1
        else:
            s.add(y)
    
    mi = max(len(s), f)
    ma = len(s) + t
    return mi, ma

main()

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

counts = [0]*9

for i in A:
    color = int(i/400)
    if color > 8:
        color = 8
    counts[color] += 1



v = 8 - counts[:-1].count(0)

if counts[-1] == 0:
    print(v,v)
else:
    if v == 0:
        print(1,counts[-1])
    else :
        print(v,v+counts[-1])

Solution (Python):
from collections import Counter

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

sum=0
b=[]
for a in A:
    a//=400
    if a<8:
        b.append(a)
    else:
        sum+=1
b=Counter(b).most_common()
m=len(b)
if m==0:
    x=1
else:
    x=m
y=m+sum
print(x,y)

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

d = [0 for _ in range(9)]
for x in a:
    p = x // 400
    if p >= 8:
        d[8] += 1
    else:
        d[p] = 1
        
if sum(d) == d[8]:
    print(1, d[8])
else:
    print(sum(d) - d[8], sum(d))

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
color=[0]*8
over=0
for i in range(n):
    if a[i]<=399:
        color[0]+=1
    elif a[i]<=799:
        color[1]+=1
    elif a[i]<=1199:
        color[2]+=1
    elif a[i]<=1599:
        color[3]+=1
    elif a[i]<=1999:
        color[4]+=1
    elif a[i]<=2399:
        color[5]+=1
    elif a[i]<=2799:
        color[6]+=1
    elif a[i]<=3199:
        color[7]+=1
    else:
        over+=1
mini=8-color.count(0) if (8-color.count(0))>0 else 1
maxi=8-color.count(0)+over
print("{} {}".format(mini,maxi))

Solution (Python):
n,*a=map(int,open(0).read().split());b=[s//400for s in a if s<3200];c=len(set(b));print(c or 1,n-len(b)+c)

Solution (Python):
n,*a=map(int,open(0).read().split());b=[s//400for s in a if s<3200];c=len(set(b));print(c or 1,n-len(b)+c)

Solution (Python):
n,*a=map(int,open(0).read().split());b=[s//400for s in a if s<3200];c=len(set(b));print(max(c,1),n-len(b)+c)

Solution (Python):
n,*a=map(int,open(0).read().split());b=[s//400 for s in a if s<3200];c=len(set(b));print(max(c,1),n-len(b)+c)

Solution (Python):
n,*a=map(int,open(0).read().split());b=[s//400 for s in a if s<3200];c=len(set(b));print(max(c,1),n-len(b)+c)

Solution (Python):
n=int(input());b=[s//400 for s in map(int,input().split()) if s<3200];c=len(set(b));print(max(c,1),n-len(b)+c)

Solution (Python):
n,*a=map(int,open(0).read().split())
b=[s//400 for s in a if s<3200]
c=len(set(b))
print(max(c,1),n-len(b)+c)

Solution (Python):
import bisect
N = int(input())
A = [int(i) for i in input().split()]
rank = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
memo = [0] * 9

for i in range(N):
    if A[i] >= 3200:
        memo[8] += 1
    else:
        memo[bisect.bisect_right(rank, A[i])] = 1
    
color = sum(memo[:8])
minc = max(color, 1)
maxc = color + memo[8]

print(minc, maxc)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
jiyuu = 0
cnt = [0] * 8
for i in a:
    if i >= 3200:
        jiyuu += 1
    else:
        cnt[i // 400] += 1
p = 0
for i in cnt:
    p += (i > 0)
print(max(1, p), max(1, p + jiyuu))

Solution (Python):
RATE_RANGE = 400
TOTAL_COLOR_NUM = 8
MAX_RATE = 3200
N = input()
a = map(int, raw_input().split())

rainbow_color_num = 0
kind_num = set()
for _a in a:
  if _a >= MAX_RATE:
    rainbow_color_num += 1
  else:
    kind_num.add(_a / RATE_RANGE)
print max(1, len(kind_num)), len(kind_num) + rainbow_color_num

Solution (Python):

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

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

from collections import defaultdict
from bisect import bisect_right

ans = 0
gold = 0
dic = defaultdict(int)
for i in range(N):
    r = bisect_right(co, A[i])
    dic[r] += 1
    
gold = dic[9]
del dic[9]
ans = len(dic.keys())

if ans == 0:
    
    print(1, gold)
else:
    
    print( ans  , ans+gold )

Solution (Python):
N  = int(input())
using = [0 for _ in range(9)]
def color(i):
    i = int(i)
    if i < 400:
        return 0
    elif i< 800:
        return 1
    elif i<1200:
        return 2
    elif i<1600:
        return 3
    elif i<2000:
        return 4
    elif i<2400:
        return 5
    elif i<2800:
        return 6
    elif i<3200:
        return 7
    else:
        return 8
L = list(map(color, input().split()))
for x in L:
    using[x] += 1
val = using.pop(-1)
if list(filter(lambda x:x!=0,using)) == []:
    print(1,val)
else:
    minimum = len(list(filter(lambda x:x!=0,using)))
    maximum =  minimum + val
    print(minimum,maximum)

Solution (Python):
def rate(n):
    if n <= 399:
        return "gray"
    elif n <= 799:
        return "brown"
    elif n <= 1199:
        return "green"
    elif n <= 1599:
        return "water"
    elif n <= 1999:
        return "blue"
    elif n <= 2399:
        return "yellow"
    elif n <= 2799:
        return "orange"
    elif n <= 3199:
        return "red"
    else:
        return "pro"

n = int(input())
a = list(map(int, input().split()))
ans = []

for i in a:
    ans.append(rate(i))

pro = ans.count("pro")
ANS = set(ans)
ANS.discard("pro")
MIN = len(ANS)
MAX = MIN + pro

print(max(MIN, 1), MAX)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
c=0
l2=[0]*9
for i in l:
  if 1<=i and i<=399:
    if l2[0]==0:
      c+=1
      l2[0]=1
  elif 400<=i and i<=799:
    if l2[1]==0:
      c+=1
      l2[1]=1
  elif 800<=i and i<=1199:
    if l2[2]==0:
      c+=1
      l2[2]=1
  elif 1200<=i and i<=1599:
    if l2[3]==0:
      c+=1
      l2[3]=1
  elif 1600<=i and i<=1999:
    if l2[4]==0:
      c+=1
      l2[4]=1
  elif 2000<=i and i<=2399:
    if l2[5]==0:
      c+=1
      l2[5]=1
  elif 2400<=i and i<=2799:
    if l2[6]==0:
      c+=1
      l2[6]=1
  elif 2800<=i and i<=3199:
    if l2[7]==0:
      c+=1
      l2[7]=1
  else:
    c+=1
    l2[8]+=1
if c==9:
  print(8,8)
else:
  if l2[8]!=0:
    if l2[8]==c:
      print(1,min(c,8))
    else:
      print(c-l2[8],c)
  else:
    print(c,c)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
rate = [0] * 9
for ai in a:
    if ai < 400:
        rate[0] = 1
    elif ai < 800:
        rate[1] = 1
    elif ai < 1200:
        rate[2] = 1
    elif ai < 1600:
        rate[3] = 1
    elif ai < 2000:
        rate[4] = 1
    elif ai < 2400:
        rate[5] = 1
    elif ai < 2800:
        rate[6] = 1
    elif ai < 3200:
        rate[7] = 1
    else:
        rate[8] += 1
res = 0
for i in range(8):
    if rate[i] != 0:
        res += 1
print(str(max(1, res)) + " " + str(res+rate[8]))

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

tmp = []
nine = 0
for a in A:
  check = (a - a%400)//400
  if(check < 8):
    tmp.append(check)
  else:
    nine += 1
color = len(list(set(tmp)))
if(color == 0):
  print(1, nine)
else:
  print(color, color+nine)

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

Solution (Python):



















from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np


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

a.sort()
c = 0
ans = 0
vc = 0
for ai in a:
    if 0<=ai and ai <400 and c<1:
        ans+=1
        c=1
    elif 400<=ai and ai<800 and c<2:
        ans+=1
        c=2
    elif 800<=ai and ai<1200 and c<3:
        ans+=1
        c=3
    elif 1200<=ai and ai<1600 and c<4:
        ans+=1
        c=4
    elif 1600<=ai and ai<2000 and c<5:
        ans+=1
        c=5
    elif 2000<=ai and ai<2400 and c<6:
        ans+=1
        c=6
    elif 2400<=ai and ai<2800 and c<7:
        ans+=1
        c=7
    elif 2800<=ai and ai<3200 and c<8:
        ans+=1
        c=8
    elif 3200<=ai:
        vc+=1

if ans!=0:
    print("{} {}".format(ans, ans+vc))
else:
    print("{} {}".format(1, ans+vc))

Solution (Python):
from collections import defaultdict
N = int(input())
A = list(map(int,input().split()))

dic = defaultdict(int)
for a in A:
    n = a//400
    if n > 7:
        dic[8] += 1
    else: dic[n] += 1

m = len(dic.keys())
if dic[8] > 0:
    m -= 1
    mi = max(1,m)
    ma = m+dic[8]
else:
    mi = ma = m
print(mi,ma)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
color_count = [0 for i in range(8)]
tourist = 0
for i in range(N):
    if a[i] >= 3200:
        tourist += 1
    else:
        A = int(a[i]/400)
        if color_count[A]!=1:
            color_count[A]+=1
        else:
            pass
MIN = sum(color_count)
if MIN != 0:
    print(MIN,(MIN+tourist))
else:
    print(1,tourist)

Solution (Python):
n=int(input())
a_s=list(map(int,input().split()))
color_list=[0]*8
god=0
point_split=[1,400,800,1200,1600,2000,2400,2800,3200]
for a in a_s:
    for i in range(8):
        if point_split[i]<=a<point_split[i+1]:
            color_list[i]+=1
    if a >=3200:
        god+=1

ans=0
for color in color_list:
    if color:
        ans+=1
max=ans+god
if ans==0:
    min=1
else:
    min=ans

print(min,max)

Solution (Python):






n = int(input())
arr = list(map(int, input().split()))
over = 0
collection = [False for _ in range(8)]
for a in arr:
    c = a // 400
    if c >= 8:
        over += 1
    else:
        collection[c] = True
maximum = sum(filter(lambda x: x is True, collection)) + over
minimum = max(1, sum(filter(lambda x: x is True, collection)))
print(minimum, maximum)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
red_exist=1 if n_red else 0
n_min=len(set(A)) if not red_exist else len(set(A))-1
print(1 if not n_min else n_min,n_min+n_red)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
red_exist=1 if n_red else 0
red_only=1 if red_exist and len(list(set(A)))==1 else 0
n_min=len(set(A)) if not red_exist else len(set(A))-1
print(1 if red_only else n_min,n_min+n_red)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
A=list(map(lambda x:x//400 if x<3200 else 8,A))
n_red=A.count(8)
n_min=len(set(A))
n_8=1 if n_red else 0
print(1 if n_min==1 and list(set(A))[0]==8 else n_min-n_8,n_min+n_red-n_8)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
rank_num = [[] for i in range(9)]
for i in range(n):
  if 1<=a[i]<=399:
    rank_num[0].append(a[i])
  if 400<=a[i]<=799:
    rank_num[1].append(a[i])
  if 800<=a[i]<=1199:
    rank_num[2].append(a[i])
  if 1200<=a[i]<=1599:
    rank_num[3].append(a[i])
  if 1600<=a[i]<=1999:
    rank_num[4].append(a[i])
  if 2000<=a[i]<=2399:
    rank_num[5].append(a[i])
  if 2400<=a[i]<=2799:
    rank_num[6].append(a[i])
  if 2800<=a[i]<=3199:
    rank_num[7].append(a[i])
  if 3200<=a[i]:
    rank_num[8].append(a[i])
 
ans = 0
for i in range(8):
  if rank_num[i]:
    ans = ans +1
 
min_ans = max(ans,1)
max_ans = ans +len(rank_num[8])
print(min_ans,max_ans)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
color=[0]*8
free=0
for a in A:
    if 1<=a<=399:color[0]=1
    elif 400<=a<=799:color[1]=1
    elif 800<=a<1199:color[2]=1
    elif 1200<=a<=1599:color[3]=1
    elif 1600<=a<=1999:color[4]=1
    elif 2000<=a<=2399:color[5]=1
    elif 2400<=a<=2799:color[6]=1
    elif 2800<=a<=3199:color[7]=1
    elif 3200<=a<=4800:free+=1
M=sum(color)+free
m=1 if sum(color)==0 and free!=0 else sum(color)
print(m,M)

Solution (Python):
N = int(input())
c = [0]*8
d = 0
for ai in map(int,input().split()):
    if ai <400:
        c[0]=1
    elif 400<= ai <800:
        c[1]=1
    elif 800<= ai <1200:
        c[2]=1
    elif 1200<= ai <1600:
        c[3]=1
    elif 1600<= ai <2000:
        c[4]=1
    elif 2000<= ai <2400:
        c[5]=1
    elif 2400<= ai <2800:
        c[6]=1
    elif 2800<= ai <3200:
        c[7]=1
    elif 3200<= ai:
        d +=1

min_ans=0
for i in c:
    min_ans +=i

max_ans = min_ans + d

if min_ans == 0:
    min_ans = 1

print(min_ans,max_ans)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
color = [0 for _ in range(9)]
for item in a:
    if item <= 399:
        color[0] = True
    elif 400 <= item <= 799:
        color[1] = True
    elif 800 <= item <= 1199:
        color[2] = True
    elif 1200 <= item <= 1599:
        color[3] = True
    elif 1600 <= item <= 1999:
        color[4] = True
    elif 2000 <= item <= 2399:
        color[5] = True
    elif 2400 <= item <= 2799:
        color[6] = True
    elif 2800 <= item <= 3199:
        color[7] = True
    else:
        color[8] += 1

m = color[:8].count(True)
M = m + color[8]
if m:
    print(m, M)
else:
    print(1, M)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
color = []
cnt = 0

for i in range(n):
    c = A[i]//400
    if c<=7:
        color.append(c)
    else:
        cnt += 1

diff = set(color)
minimum = max(len(diff),1)
maximum = len(diff)+cnt

print(minimum, maximum)

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

for k in range(1, 9):
    b = list(filter(lambda x: x < 400*k, a))
    if b:
        cnt += 1
    a = a[len(b):]
if cnt:
    print(cnt, cnt+len(a))
else:
    print(1, len(a))

Solution (Python):
from sys import stderr, setrecursionlimit
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

n = getInt()
a = getInts()
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in a:
    if rate <= 399:
        colors[0] += 1
    elif rate <= 799:
        colors[1] += 1
    elif rate <= 1199:
        colors[2] += 1
    elif rate <= 1599:
        colors[3] += 1
    elif rate <= 1999:
        colors[4] += 1
    elif rate <= 2399:
        colors[5] += 1
    elif rate <= 2799:
        colors[6] += 1
    elif rate <= 3199:
        colors[7] += 1
    else:
        colors[8] += 1

monocolors = len(list(filter(lambda x:x!=0,colors[:-1])))
if monocolors == 0:
    print(1, colors[8])
else:
    print(monocolors, monocolors + colors[8])

Solution (Python):
def colormap(rate):
    if 1 <= rate < 400:
        return 0
    elif 400 <= rate < 800:
        return 1
    elif 800 <= rate < 1200:
        return 2
    elif 1200 <= rate < 1600:
        return 3
    elif 1600 <= rate < 2000:
        return 4
    elif 2000 <= rate < 2400:
        return 5
    elif 2400 <= rate < 2800:
        return 6
    elif 2800 <= rate < 3200:
        return 7
    elif 3200 <= rate:
        return -1


def solve():
    N = int(input())
    a = [int(x) for x in input().split()]

    colors = [colormap(x) for x in a]

    import collections
    count = collections.Counter(colors)
    

    ncolor = len(count) - (-1 in count)

    nmin = 1 if ncolor == 0 else ncolor
    nmax = ncolor + count[-1]

    print(nmin, nmax)


def main():
    solve()


if __name__ == '__main__':
    main()

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

se = set()
high = 0
for a in li:
    if a // 400 <= 7:
        se.add(a // 400)
    else:
        high += 1

print(max(1, len(se)), len(se) + high)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
color = [False] * 8
over3200 = 0
for a in A:
    for i in range(8):
        if a < 400*(i+1):
            color[i] = True
            break
    else:
        over3200 += 1
if sum(color):
    print(sum(color), end=' ')
    print(sum(color) + over3200)
else:
    print(1, end=' ')
    print(over3200)

Solution (Python):
n = int(input())
A = [int(i) for i in input().split()]

B = set()
crown = 0
for i in range(n):
    x = A[i] // 400
    if x < 8:
        B.add(x)
    else:
        crown += 1
        
print(1 if len(B) == 0 else len(B), len(B) + crown)

Solution (Python):
n = int(input())
A = [int(i) for i in input().split()]

B = set()
crown = 0
for a in A:
    if a // 400 >= 8:
        crown += 1
    else:
        B.add(a // 400)

print(max(1, len(B)), len(B) + crown)

Solution (Python):


def main():
    n = int(input())
    an = list(map(int, input().split()))
    colors = [color(a) for a in an]
    mi = max(1, count_colors(colors))
    ma = count_colors(colors) + free_players(colors)
    print(mi, ma)

def color(r):
    assert 1 <= r <= 4800
    if r < 400:
        return "grey"
    elif r < 800:
        return "brown"
    elif r < 1200:
        return "green"
    elif r < 1600:
        return "sky"
    elif r < 2000:
        return "blue"
    elif r < 2400:
        return "yellow"
    elif r < 2800:
        return "orange"
    elif r < 3200:
        return "red"
    else:
        return "free"

def count_colors(colors):
    res = set(colors)
    res -= {"free"}
    return len(res)

def free_players(colors):
    res = 0
    for c in colors:
        if c == "free":
            res += 1
    return res

main()

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

l = [0]*8
over = 0
for r in rates:
    if r >= 3200:
        over += 1
    else:
        l[r//400] += 1

col_num = len(list(filter(lambda x: x > 0, l)))

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

Solution (Python):
colors = [0 for i in range(9)]

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

for a in A:
    color = a // 400 if a < 3600 else 8
    colors[color] += 1

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

if min_color > 0:
    print("{} {}".format(min_color, min_color + colors[8]))
else:
    print("{} {}".format(1, colors[8]))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
kind = 0
cnt = 0
used = [False]*8
for a in A:
    tmp = a//400
    if tmp < 8 and not used[tmp]:
        kind += 1
        used[tmp] = True
    elif tmp >= 8:
        cnt += 1
print(kind if kind > 0 else 1, kind+cnt)

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

for k in range(8):
    if len([i for i in a if 400*k <= i < 400*(k + 1)]) > 0:
        count += 1

r =  len([i for i in a if 3200 <= i])
print('{} {}'.format(max(1, count), count + r))

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

Ans = 0
Cnt = [0]*9
for i in range(N):
    if A[i]>3200:
        A[i] = 3200
    Cnt[A[i]//400] += 1

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



print(max(1,Ans), Ans+Cnt[8])

Solution (Python):
n=int(input())
a=[i for i in list(map(int,input().split()))if i<3200]
k=n-len(a)
c=0
for j in range(8):
    b=[i for i in a if (j)*400<=i and i<(j+1)*400]
    if len(b)>0:
        c+=1
print(str(c if c>0 else 1)+" "+str(k+c))

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

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

s = set()
god = 0
for a in A:
    if a >= 3200:
        god += 1
    else:
        s.add(a // 400)

print("{} {}".format(max(len(s), 1), len(s) + god))

Solution (Python):
n = int(input())
ratings = list(map(int, input().split(" ")))
colors = [400*i for i in range(1, 9)]
flags = [False for i in range(8)]
over3200 = 0
for rate in ratings:
    for i, border in enumerate(colors):
        if rate < border:
            flags[i] = True
            break
        elif i == 7:
            over3200 += 1
minAns = 0
for f in flags:
    if f:
        minAns += 1

maxAns = minAns + over3200
if minAns == 0 and over3200 > 0:
    minAns = 1
print(minAns, maxAns)

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
nums = list(map(int, input().split()))
colors = [0]*9
mi = 0
ma = 0

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

for j in range(8):
    if colors[j] > 0:
        mi += 1
ma = mi
ma += colors[8]
if mi == 0:
    mi = 1

print(mi, ma)

Solution (Python):
import bisect
n = int(input())
a = sorted(list(int(i) for i in input().split()))
minct= 0
ov32 = n-bisect.bisect_left(a,3200)

def calc(n):
    return (n //400)
a2 = list(map(calc, a))
for i in range(8):
 if i in a2:
  minct +=1
minans = 0 

if minct == 0 and ov32>=1:
 minans =1
else:
 minans = minct
if minct+ov32>= 8:
 maxans = minct+ov32
else:
 maxans = minct+ov32
print(*[minans,maxans])

Solution (Python):
n = int(input())
a = list(int(i) for i in input().split())
color = []
for i in range(n):
    for j in range(8):
        if a[i]>=400*j and a[i]<400*(j+1):
            color.append(j)
            break
        elif a[i]>=3200:
            color.append(8)
            break

color_map = {}
for c in color:
    if not c in color_map.keys():
        color_map[c] = 1
    else:
        color_map[c] += 1

cmin = 0
cmax = 0
for k,v in color_map.items():
    if not k==8:
        cmin += 1
    else:
        cmax += v
cmax = cmin+cmax
if cmin==0:
    cmin = 1
print(cmin,cmax)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
arr = [0] * 8
q = 0
for i in a:
    if i >= 3200:
        q += 1
    else:
        arr[i // 400] += 1
p = 0
for i in arr:
    if i != 0:
        p += 1
print(max(1, p), p + q)

Solution (Python):
import bisect
N = int(input())
rate = sorted(list(map(int,input().split())))
allcoder = 0
for i in range(N):
    if rate[i] > 3199:
        allcoder += 1
color = 0        
for i in range(8):
    if bisect.bisect_left(rate,i*400 if i>0 else 1) != bisect.bisect_right(rate,i*400+399) :
        color += 1
print(max(color,1),color+allcoder)

Solution (Python):
N = int(input())
A = [0] * 9
for a in list(map(int, input().split())):
    A[min(a//400, 8)] += 1

ans = len(list(filter(lambda x: x>0, A[:-1])))

max_ans = ans+A[-1]

if A[-1] > 0:
    min_ans = max(1, ans)
else:
    min_ans = ans
print(min_ans, end=" ")
print(max_ans)

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


ansa=[0]*8
ansb=0
for i in range(n):
  if a[i]<400:
    ansa[0]=1
  elif a[i]<800:
    ansa[1]=1
  elif a[i]<1200:
    ansa[2]=1
  elif a[i]<1600:
    ansa[3]=1
  elif a[i]<2000:
    ansa[4]=1
  elif a[i]<2400:
    ansa[5]=1
  elif a[i]<2800:
    ansa[6]=1
  elif a[i]<3200:
    ansa[7]=1
  else:
    ansb+=1
    
if sum(ansa)==0:
  print(1,ansb)
else:  
  print(sum(ansa),sum(ansa)+ansb)

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

c=[0 for i in range(8)]
r=0

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

s=0
for i in c:
    if i!=0:
        s+=1

b=s+r

if s==0:
    s=1
    b=r

print(s,b)

Solution (Python):
N = int(input())
A = [int(_) for _ in input().split()]
colors = [0] * 9
for a in A:
    c = a // 400
    if c < 8:
        colors[c] = 1
    else:
        colors[8] += 1
print(max(sum(colors[:8]), 1), sum(colors))