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 = [False]*8
rainbow = 0
for i in range(N):
    if 1<=a[i]<=399:
        colors[0] = True
    elif 400<=a[i]<=799:
        colors[1] = True
    elif 800<=a[i]<=1199:
        colors[2] = True
    elif 1200<=a[i]<=1599:
        colors[3] = True
    elif 1600<=a[i]<=1999:
        colors[4] = True
    elif 2000<=a[i]<=2399:
        colors[5] = True
    elif 2400<=a[i]<=2799:
        colors[6] = True
    elif 2800<=a[i]<=3199:
        colors[7] = True
    else:
        rainbow += 1
if rainbow == 0:
    ans = colors.count(True)
    print(ans,ans)
else:
    tmp = colors.count(True)
    if tmp==0:
        min_ = 1
        max_ = rainbow
        print(min_,max_)
    else:
        min_ = colors.count(True)
        max_ = colors.count(True) + rainbow
        print(min_,max_)

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

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
R = [0 for i in range(9)]
for i in range(n):
    if A[i] < 3200: R[A[i]//400] += 1
    else: R[8] += 1
mi = 0
for i in range(8):
    if R[i] > 0: mi += 1
if mi == 0 and R[8] > 0:
    print(mi+1, mi+R[8])
else:
    print(mi, mi+R[8])

Solution (Python):
n = int(input())
A = [int(x) for x in input().split()]
colored = [False] * 8
cnt = 0
super= 0
for a in A:
    if 3200 <= a:
        super += 1
        continue
    rank = a // 400
    if not colored[rank]:
        colored[rank] = True
        cnt += 1
mn = 1 if cnt == 0 and super != 0 else cnt
mx = cnt + super
print(mn, mx)

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

Solution (Python):
N=int(input())
a=input().split()
b=[int(c) for c in a]
list1=[0]*8
number=0
for d in b:
    if 1<=d and 399>=d:
        list1[0]+=1
    elif 400<=d and d<=799:
        list1[1]+=1
    elif 800<=d and d<=1199:
        list1[2]+=1
    elif 1200<=d and d<=1599:
        list1[3]+=1
    elif 1600<=d and d<=1999:
        list1[4]+=1
    elif 2000<=d and d<=2399:
        list1[5]+=1
    elif 2400<=d and d<=2799:
        list1[6]+=1
    elif 2800<=d and d<=3199:
        list1[7]+=1
    else:
        number+=1
while 0 in list1:
    list1.remove(0)
kazu=len(list1)
if kazu==0:
    if number==0:
        print(str(0)+' '+str(0))
    else:
        print(str(1)+' '+str(number))
else:
    if number==0:
        print(str(kazu)+' '+str(kazu))
    else:
        print(str(kazu)+' '+str(kazu+number))

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

dic = [False]*8

cnt = 0

for i in range(n):
  tmp = A[i] // 400
  if(tmp >= 8):
    cnt += 1
  else:
    dic[tmp] = True
if(sum(dic) == 0 and cnt > 0):
  print('1 ' + str(cnt))
else:
  print(str(sum(dic)) + ' ' + str(sum(dic) + cnt))

Solution (Python):


n = int(input())
a = list(map(int,input().split()))
color = [0] * 8
wc = 0

for i in range(n):
    for j in range(8):
        if a[i] >= j*400 and a[i] <= (j+1)*400 - 1:
            color[j] = 1
    if a[i] >= 3200:
        wc += 1
            
mi = sum(color)
ma = mi + wc

print(max(mi,1) , ma)

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

color = set()
over = 0
for a in A :
    if a < 3200 :
        color.add(a//400)
    else :
        over += 1

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

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
x = [i//400 for i in a]
mina = len(set([i for i in x if i < 8]))
maxa = mina + len([i for i in x if i >= 8])
print(max(mina, 1), maxa)

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

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

rate = sum([(cs[i] != 0) for i in range(0,8)])

print("{} {}".format(max(rate,1),rate+cs[8]))

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    a=LI()
    L=[0]*8
    F=0
    for i in range(N):
        if a[i]>=3200:
            F+=1
            continue
        b=a[i]//400
        L[b]=1
        
    ans=sum(L)
    aaa=0
    if min(a)>=3200:
        aaa+=1
    print(ans+aaa,ans+F)
        

main()

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

gray=[]
brown=[]
green=[]
light_blue=[]
blue=[]
yellow=[]
orange=[]
red=[]
free=[]

count=0

for i in a:
    if 0<i<400:
        gray.append(i)
    elif 400<=i<800:
        brown.append(i)
    elif 800<=i<1200:
        green.append(i)
    elif 1200<=i<1600:
        light_blue.append(i)
    elif 1600<=i<2000:
        blue.append(i)
    elif 2000<=i<2400:
        yellow.append(i)
    elif 2400<=i<2800:
        orange.append(i)
    elif 2800<=i<3200:
        red.append(i)
    else:
        free.append(i)

if len(gray)>=1:
    count+=1
if len(brown)>=1:
    count+=1
if len(green)>=1:
    count+=1
if len(light_blue)>=1:
    count+=1
if len(blue)>=1:
    count+=1
if len(yellow)>=1:
    count+=1
if len(orange)>=1:
    count+=1
if len(red)>=1:
    count+=1

if count>0:
    print(count,count+len(free))
else:
    print(min(1,len(free)),len(free))

Solution (Python):
def coder(n):
    return int(n)//400
n=int(input())
aList=list(map(coder,input().split()))
Max=0
Min=0
c=0
C=0
tmp=[]
for i in range(n):
    if aList[i]<=7 and tmp.count(aList[i])==0:
        tmp.append(aList[i])
    elif aList[i]>=8:
        C+=1
c=len(tmp)
Max=c+C
if c>0:
    Min=c
else:
    Min=1
print("{} {}".format(Min,Max))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<= 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma = x+y
print('{} {}'.format(mi, ma))

Solution (Python):
def col(n):
  if 1<=n<400:
    return 1
  if 400<=n<800:
    return 2
  if 800<=n<1200:
    return 3
  if 1200<=n<1600:
    return 4
  if 1600<=n<2000:
    return 5
  if 2000<=n<2400:
    return 6
  if 2400<=n<2800:
    return 7
  if 2800<=n<3200:
    return 8
  if n>=3200:
    return 9

n=int(input())
l=list(map(int,input().split()))
list=[]
for i in l:
  list.append(col(i))
p=list.count(9)
if p==0:
  print(len(set(list)),len(set(list)))
elif len(set(list))==1:
  print(1,p)
else:
  print(len(set(list))-1,len(set(list))+p-1)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
l = []
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<=7:
        x.add(i)
    else:
        y+=1
x = len(x)
if x:
    mi = x
else:
    mi = 1
ma = x+y
print('{} {}'.format(mi, ma))

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

cnt=0
q=set()
for num in a:
    if num>=8:
        cnt+=1
    else:
        q.add(num)
        
ans=len(q)
if ans==0:
    print(1,cnt)
else:
    print(ans,ans+cnt)

Solution (Python):
n = int(input())
a = [int(_) for _ in input().split()]
col = [0] * n
cnt = 0
for i in range(n):
    if a[i] >= 3200:
        col[i] = 8
        cnt += 1
    else:
        col[i] = a[i] // 400
ans_min = len(set(col))
ans_max = ans_min
if cnt == n:
    ans_min = 1
    ans_max = cnt
elif cnt > 0:
    ans_min -= 1
    ans_max = ans_min + cnt
print(ans_min, ans_max)

Solution (Python):


n = int(input().rstrip())

score_list = [int(i) for i in input().rstrip().split()]

under3200 = set([int(i/400) for i in score_list if i < 3200])
over3200 = [i for i in score_list if i >= 3200]

minColor = max(1, len(under3200))
maxColor = len(under3200) + len(over3200)

print("{} {}".format(minColor, maxColor))

Solution (Python):
from collections import Counter
n = int(input())
a = [min(x//400, 8) for x in map(int, input().split())]
a = Counter(a)

if len(a) == 1 and a[8] != 0:
    min_a = 1
    max_a = a[8]
elif a[8] != 0:
    min_a = len(a)-1
    max_a = min_a+a[8]
else:
    min_a = max_a = len(a)
print(min_a, max_a)

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

l = [0]*9
cam = 0
for d in data:
    num = d//400 if d//400 < 8 else 8
    if num==8: cam += 1
    if l[num] == 0: l[num] = 1

score = sum(l[:8])
print(max(1,score), score+cam)

Solution (Python):
N = int(input())
X = list(map(int, input().split()))
X = [x//400 for x in X]
min_X = len(set([x for x in X if x < 8]))
max_X = min_X + len([x for x in X if x >= 8])

print(max([min_X, 1]), max_X)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
mi=0
ma=0
l=[]
count=0
for i in range(N):
 if a[i]<3200:
  l.append(a[i]//400)
 else:
  count=count+1

print(max(1,len(set(l))),max(1,len(set(l))+count))

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

gray = 0
brown = 0
green = 0
light_blue = 0
blue = 0
yellow = 0
orange = 0
red = 0
ex = 0

for i in range(n):
    if a[i] <= 399:
        gray = 1
    elif a[i] <= 799:
        brown = 1
    elif a[i] <= 1199:
        green = 1
    elif a[i] <= 1599:
        light_blue = 1
    elif a[i] <= 1999:
        blue = 1
    elif a[i] <= 2399:
        yellow = 1
    elif a[i] <= 2799:
        orange = 1
    elif a[i] <= 3199:
        red = 1
    else:
        ex += 1

if ex == n:
    min_color = 1
    max_color = ex
else:
    min_color = gray + brown + green + light_blue + blue + yellow + orange + red
    max_color = min_color + ex

print('{}'.format(min_color) +' {}'.format(max_color))

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

for i in range(N):
    if(a[i] < 3200):
        set_a.add(a[i]//400)
    else:
        cnt += 1

print(max(len(set_a), 1), min(len(set_a)+cnt, N))

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

Solution (Python):
import numpy as np

n = int(input())
A = list(map(int, input().split()))
d = [0]*(3200+1)

for a in A:
    if a > 3200:
        a = 3200
    d[a] += 1

cnt = 0
for i in range(0, 3200, 400):
    if np.count_nonzero(d[i:i+400]) > 0:
        cnt += 1
        
if d[3200] == 0:
    print(cnt, cnt)
else:
    if cnt == 0:
        print(1, d[3200])
    else:
        print(cnt, cnt+d[3200])

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

s = set(color)
print(max(1, len(s)), len(s) + top)

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

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

cnt=0
l=[]
for i in a:
  p=i//400
  if p<=7:
    l.append(p)
  else:
    cnt+=1

d=len(set(l))

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

Solution (Python):
def main():
    participants = int(input())
    ratings = list(map(int, input().split()))
    color = [0] * 9
    for rating in ratings:
        color[min(rating // 400, 8)] += 1
    answer = 0
    for i in range(8):
        if color[i] > 0:
            answer += 1
    print(max(1, answer), answer + color[-1])


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
f = [False]*8
c = 0
for a in A:
    if a < 400:
        f[0] = True
    elif a < 800:
        f[1] = True
    elif a < 1200:
        f[2] = True
    elif a < 1600:
        f[3] = True
    elif a < 2000:
        f[4] = True
    elif a < 2400:
        f[5] = True
    elif a < 2800:
        f[6] = True
    elif a < 3200:
        f[7] = True
    else:
        c += 1
print(max(f.count(True), 1), f.count(True)+c)

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

Solution (Python):
import numpy as np
from collections import Counter
input()
rates = np.array(input().split(), dtype=np.int64) // 400
over3199 = (rates >= 8).sum()
colors = len(Counter(rates[rates < 8]).keys())
print(max(1, colors), colors + over3199)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
color = [0] * 8
select = 0
for i in range(N):
    for j in range(8):
        if 400 * j <= A[i] < 400 * (j + 1):
            color[j] += 1
            break
        elif 400 * (j + 1) == 3200:
            select += 1
            break
ans = 0

for k in range(8):
    if color[k] != 0:
        ans += 1
print(max(ans, 1), ans + select)

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

ans=[0]*8
count=0
for i in range(n):
    if 8<=a[i]//400:
        count+=1
    else:
        ans[a[i]//400]=1

if sum(ans)==0:
    print(1,min(8,count))
else:
    print(sum(ans),sum(ans)+count)

Solution (Python):
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(4100000)

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

min_ans = sum(c)
max_ans = min_ans + cnt

if min_ans == 0:
    print(1, cnt)
else:
    print(min_ans, max_ans)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
lis=[0]*9
for i in range(n):
    if 1<=a[i]<=399: lis[0]+=1
    elif a[i]<=799:  lis[1]+=1
    elif a[i]<=1199: lis[2]+=1
    elif a[i]<=1599: lis[3]+=1
    elif a[i]<=1999: lis[4]+=1
    elif a[i]<=2399: lis[5]+=1
    elif a[i]<=2799: lis[6]+=1
    elif a[i]<=3199: lis[7]+=1
    else: lis[8]+=1

min_color = 0
for i in range(len(lis)-1):
    if lis[i]>0: min_color+=1
max_color = min_color + lis[-1]
if min_color ==0:
    print(1,max_color)
else:
    print(min_color,max_color)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
c=[0]*8
sum=0
tmp=0

for i in a:
    n=int(i/400)
    if(i<3200 and c[n]==0):
        c[n]+=1
        sum+=1
    elif(i>=3200):
        tmp+=1
print(sum if sum!=0 else sum+1,sum+tmp)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
check=[0]*8
while i<n and a[i]<3200:
    a_i=a[i]
    for j in range(8):
        if check[j]==0 and a_i>=400*j and a_i<400*(j+1):
            check[j]=1
            break
    i+=1
if sum(check)==0:
    ans_min=1
    ans_max=n
else:
    ans_min=sum(check)
    ans_max=ans_min+n-i
print(ans_min,ans_max)

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

c = 0
for i in A: c += 1 if i<3200 else 0
Am = set()
for i in A:
    if i<3200:
        Am.add(i//400)

minc = len(Am) if c>0 else len(Am)+1

AM = set([int(v)//400 if v<3200 else i+50 for i, v in enumerate(A)])
maxc = len(AM)

print(minc, maxc)

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

lst2 = [0]*9

for i in range(n):
    for j in range(8):
        if lst1[i] < 400*(j+1):
            lst2[j] += 1
            break
    if lst1[i] >= 3200:
        lst2[8] += 1

ans = 0
for i in range(8):
    if lst2[i]:
        ans += 1

print(max(1,ans))
print(ans+lst2[8])

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
lis = [0]*8
fr = 0
for i in a:
    col = i // 400
    if col > 7:
        fr += 1
    else:
        lis[col] = 1
mi = max(lis.count(1),1)
mx = lis.count(1) + fr

print(mi,mx)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A.sort()
dic = {1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0}
count = 0
for a in A:
  if a < 400:
    dic[1] += 1
  elif 400 <= a < 800:
    dic[2] += 1
  elif 800 <= a < 1200:
    dic[3] += 1
  elif 1200 <= a < 1600:
    dic[4] += 1
  elif 1600 <= a < 2000:
    dic[5] += 1
  elif 2000 <= a < 2400:
    dic[6] += 1
  elif 2400 <= a < 2800:
    dic[7] += 1
  elif 2800 <= a < 3200:
    dic[8] += 1
  else:
    count += 1
total = 0
for i in range(1, 9):
  if dic[i] != 0:
    total += 1
m = total + count
if total == 0:
  print(1, m)
else:
  print(total, m)

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

l=[0]*9

for i in range(n):
  if a[i]<400:
    l[0]="t"
  elif a[i]<800:
    l[1]="t"
  elif a[i]<1200:
    l[2]="t"
  elif a[i]<1600:
    l[3]="t"
  elif a[i]<2000:
    l[4]="t"
  elif a[i]<2400:
    l[5]="t"
  elif a[i]<2800:
    l[6]="t"
  elif a[i]<3200:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if l[8]==0:
  print(countt,countt)
else:
  print(max(countt,1),countt+l[8])

Solution (Python):
n = int(input())
al = list(map(int, input().split()))
count = [0] * 8
overred = 0

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

color = 8 - count.count(0)

if color != 0:
    color_min = color
    color_max = color_min + overred
else:
    color_min = 1
    color_max = overred

print(color_min, color_max)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
d = {}
e = 0
for ai in a:
  s = ai // 400
  if s > 7:
    e += 1
  else:
    if s in d:
      d[s] += 1
    else:
      d[s] = 1
print(max(1, len(d)), len(d) + e)

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

for i in l:
  x = i//400
  if x >= 8:
    ans[8] += 1
  else:
    ans[x] += 1
count = 0
for i in range(8):
  if ans[i] > 0:
    count += 1
if ans[8]==0:
  print(count,count)
else:
  if count != 0:
    print(count,count+ans[8])
  else:
    print(1,ans[8])

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

for i in range(len(rates)):
    rates[i] = int(rates[i]) // 400

MAX = 0
MIN = 0
j = 0
while j <= 8:
    for k in range(N):
        if j != 8 and j == rates[k]:
            MAX += 1
            MIN += 1
            break
        elif j == 8 and j <= rates[k]:
            MAX += 1
            if MIN == 0:
                MIN = 1
                continue
            continue
    j += 1

print(MIN, MAX)

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

li = [0] * 9

for i in a:
    if i >= 3200:
        li[-1] += 1
    else:
        li[i//400] += 1

ans = 0

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

if li[-1] == 0:
    print(ans, ans)
else:
    if ans == 0:
        print(1, li[-1])
    else:
        print(ans, ans+li[-1])

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
d = {}
e = 0
for ai in a:
  s = ai // 400
  if s > 7:
    e += 1
  else:
    if s in d:
      d[s] += 1
    else:
      d[s] = 1
print(max(1, len(d)), len(d) + e)

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

min_c=color
if min_c==0:
	min_c+=1
max_c=color+god
if max_c>8:
	mac_c=8
		
print(min_c,max_c)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





n=ii()
arr= limii()

bs = [0,399,799,1199,1599,1999,2399,2799,3199,4801]
bc = [0,1,2,3,4,5,6,7,8]
ans = [0,0,0,0,0,0,0,0,0]

for i in range(n):
    score = arr[i]
    chk=True
    ank=0
    while chk:
        if bs[ank]<score<=bs[ank+1]:
            chk=False
        ank+=1
    ans[ank-1]+=1

for i in range(8):
    if ans[i]>0:
        ans[i]=1
if sum(ans[:-1])!=0:
    print(str(sum(ans[:-1]))+" "+str(sum(ans)))
else:
    print(str(1)+" "+str(sum(ans)))

Solution (Python):

n = int(input())
a = list(map(int, input().split()))
a.sort()
free=0
cset=set()
for rate in a:
    color = int(rate / 400)
    if color >=8:
        free+=1
    else:
        cset.add(color)

colormin=len(cset)
colormax=colormin+free
 
print(str(max(1,colormin)), colormax)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
x = dict()
y = []
if N==1:
    S = "1"+" "+"1"
    print(S)
    exit()
for i in range(N):
    if a[i]<=399:
        x["gray"] = 1
    elif a[i]<=799:
        x["brown"] = 1
    elif a[i]<=1199:
        x["green"] = 1
    elif a[i] <=1599:
        x["lightblue"] = 1
    elif a[i] <= 1999:
        x["blue"] = 1
    elif a[i]<=2399:
        x["yellow"] = 1
    elif a[i]<=2799:
        x["orange"] = 1
    elif a[i]<=3199:
        x["red"] = 1
    else:
        y.append(a[i])

ans = 0
for idx in x:
    ans += 1
n = len(y)
m = ans
M = ans + n
s = ""
if m==0:
    m=1
s = str(m)+" "+str(M)
print(s)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
free=0
cset=set()
for rate in a:
    color = int(rate / 400)
    if color >=8:
        free+=1
    else:
        cset.add(color)

colormin=len(cset)
colormax=colormin+free

print(str(max(1,colormin)), colormax)

Solution (Python):
n = int(input())
s = list(map(int, input().split()))
a = [0]*9
c = ""
mn = 400
mx = 399
for i in s:
    if 1 <= i <= mx:
        a[0] = 1
    elif mn <= i <= mx+mn:
        a[1] = 1
    elif mn*2 <= i <= mx+mn*2:
        a[2] = 1
    elif mn*3 <= i <= mx+mn*3:
        a[3] = 1
    elif mn*4 <= i <= mx+mn*4:
        a[4] = 1
    elif mn*5 <= i <= mx+mn*5:
        a[5] = 1
    elif mn*6 <= i <= mx+mn*6:
        a[6] = 1
    elif mn*7 <= i <= mx+mn*7:
        a[7] = 1
    elif  mn*8 <= i <= mn*12:
        a[8] += 1

if a[8] > 0:
    c = "".join(map(str,a))
    c = c.replace("0","")
    if len(c) == 1:
        print(1,sum(a))
    else:
        print(sum(a)-a[8],sum(a))
elif a[8] == 0:
    print(sum(a), sum(a))

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

    

print(str(max(1, sum(ans))) + " " + str(sum(ans)+over))

Solution (Python):
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()

A=many_int()

def color_check(num):
    if 1<=num<=399:
        return "hai"
    elif 400<=num<=799:
        return "tya"
    elif 800<=num<=1199:
        return "midori"
    elif 1200<=num<=1599:
        return "mizu"
    elif 1600<=num<=1999:
        return "ao"
    elif 2000<=num<=2399:
        return "ki"
    elif 2400<=num<=2799:
        return "dai"
    elif 2800<=num<=3199:
        return "aka"
    return ""

output = []
overs = 0
for a in A:
    if a >= 3200:
        overs+=1
    else:
        output.append(color_check(a))

cols = len(set(output))
if cols==0:
    cols = 1 
    overs -= 1 
print(cols, cols+overs)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
rate = [0]*9
ans = 0

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

for i in range(8):
    if rate[i] != 0:
        ans += 1

if ans == 0:
    print("1", rate[8])
elif rate[8] != 0:
    print(ans, ans+rate[8])
else:
    print(ans, ans)

Solution (Python):
n = int(input())
a = [0 for i in range(13)]
for i in map(int, input().split()):
    a[i // 400] += 1
ans = 0
add = 0
for i in range(8):
    if a[i]:
        ans += 1
for i in range(8,13):
    if a[i]:
        add += a[i]
if ans == 0:
    print(1, add)
else:
    print(ans, ans+add)

Solution (Python):
int_n = int(input())
arr_int_a = list(map(int, input().split()))

w_s = set()
counter = 0
for i in arr_int_a:
    if i < 3200:
        w_s.add(i // 400)
    else:
        counter += 1

print(len(w_s) if len(w_s) != 0 else 1, len(w_s) + counter)

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
color = [0] * 9
flag = False
for i in range(len(A)):
	flag = False
	for j in range(8):
		if 400 * j <= A[i] and A[i] <= 400 * (j + 1) - 1:
			color[j] = 1
			flag = True
	if flag == False:
		color[-1] += 1
print(max(sum(color[:-1]),1),sum(color))

Solution (Python):
N = int(input())
a=list(map(int,input().split()))
b=[0]*8
x=0
for i in range(0,N):
    if a[i]>=3200:
        x=x+1
        continue
    else:
        b[a[i]//400]=1
y=x
for i in range(0,8):
    x=x+b[i]
if x-y==0:
    print(1,x)
else:
    print(x-y,x)

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
rate = [0] * 8
rate_big = 0
for i in range(N):
    if A[i] < 3200:
        rate[A[i] // 400] += 1
    else:
        rate_big += 1
ans_min = 0
ans_max = 0
for j in range(8):
    if rate[j] > 0:
        ans_min += 1
if ans_min == 0:
    ans_min = 1
    ans_max = rate_big
else:
    ans_max = ans_min+rate_big
print(ans_min, ans_max, sep=" ")

Solution (Python):
n=int(input())
ci=[0]*8
ov=0
a=list(map(int,input().split()))
for pt in a:
  if pt>=3200:
    ov+=1
  else:
    ci[pt//400]=1
ans = sum(ci)
print(max(1,ans),ans+ov)

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

colors = [0 for _ in range(8)]
over = 0

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

c = colors.count(1)

maxi = c + over

if c == 0:
    mini = 1
else:
    mini = c

print(mini, maxi)