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())
list = list(map(int, input().split()))

huriwake = [0, 0, 0, 0, 0, 0, 0, 0]
rea = 0
count = 0

for i in list:
    if i < 400:
        huriwake[0] = 1
    elif i < 800:
        huriwake[1] = 1
    elif i < 1200:
        huriwake[2] = 1
    elif i < 1600:
        huriwake[3] = 1
    elif i < 2000:
        huriwake[4] = 1
    elif i < 2400:
        huriwake[5] = 1
    elif i < 2800:
        huriwake[6] = 1
    elif i < 3200:
        huriwake[7] = 1
    else:
        rea += 1

for h in huriwake:
    if h == 1:
        count += 1

if count == 0 and rea > 0:
    count += 1
    rea -= 1

min = count

if rea > 0:
    count += rea

max = count

print("{0} {1}".format(min, max))

Solution (Python):
def resolve():
	n = input()
	c = [False] * 8
	p = 0
	for i in list(map(int, input().split())):
		if i >= 3200:
			p += 1
		else:
			c[i//400] = True
	print(sum(c) or 1, sum(c) + p)
resolve()

Solution (Python):
N = int(input())
an = list(map(int, input().split()))
free = 0
check = []
for a in an:
    if a > 3199:
        free += 1
    else:
        check.append(a//400)
print(max(1, len(set(check))), len(set(check))+free)

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

for i in range(n):
    A[i] //= 400
    if A[i] > 7:
        A[i] = "*"
        
over3200 = A.count("*")

base = len(set(A))

if over3200 > 0:
    base -= 1

if over3200 == n:
    print(1,base+over3200)
else:
    print(base,base+over3200)

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

A=[x for x in set(A)]

if A==[9]:
    print(1,count)
else:
    if 9 in A:
        print(len(A)-1,len(A)-1+count)
    else:
        print(len(A),len(A))

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


import collections
c = collections.Counter(A)

f1 = f2 = 0
for k in c.keys():
    if k >= 8:
        f1 += 1
        f2 += c[k]
        
if f1 == 0:
    min_ = max_ = len(c.keys())

else:
    min_ = len(c.keys()) -f1
    max_ = len(c.keys()) -f1 +f2
'''if max_ >8:
    max_ = 8'''
if min_ <1:
    min_ = 1
print(min_, max_)

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

def intinp():
    return int(input())

N = intinp()
a = mapint_inp()

def get_color(x):
    c = None
    if 399 >= x: c = "Gray"
    elif 799 >= x: c = "Blown"
    elif 1199 >= x: c = "Green"
    elif 1599 >= x: c = "Sky"
    elif 1999 >= x: c = "Blue"
    elif 2399 >= x: c = "Yellow"
    elif 2799 >= x: c = "Orange"
    elif 3199 >= x: c = "Red"
    else:
        c = "Any"
    return c

color_set = set()
num_of_any = 0

for a_i in a:
    c_i = get_color(a_i)
    if c_i == "Any":
        num_of_any += 1
        continue
    if c_i not in color_set:
        color_set.add(c_i)

num_of_colors = len(color_set)

if num_of_colors == 0:
    print(1, num_of_any)
else:
    print(num_of_colors, num_of_colors+num_of_any)

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

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

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

cmin = 0
for i in range(8):
    if color[i]>0:
        cmin += 1
        
cmax = cmin+color[8]
if cmin ==0:
    cmin = 1
print(cmin,cmax)

Solution (Python):


import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

    etc, red = [], []
    for a in A:
        etc.append(a // 400) if (a // 400) < 8 else red.append(a // 400)

    ma = len(set(etc)) + len(red)
    mi = len(set(etc)) + 0 if len(set(etc)) != 0 else 1
    print(mi, ma)


if __name__ == '__main__':
    resolve()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

    res1 = []
    res2 = []
    for i in range(n):
        a = A[i] // 400
        if a < 8:
            res1.append(a)
        else:
            res2.append(a)

    ma = len(set(res1)) + len(res2)
    mi = len(set(res1)) + 0 if len(set(res1)) != 0 else 1
    print(mi, ma)


if __name__ == '__main__':
    resolve()

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
A.sort()
dict = [0 for _ in range(8)]
B = []
for a in A:
    if 3200 <= a:
        B.append(a)
        continue
    for i in range(8):
        if i*400 <= a and a < (i+1)*400:
            dict[i]+=1
            break
ds = 8-dict.count(0)
maxNum = ds
minNum = ds
if len(B) > 0:
    maxNum += len(B)
    minNum = max(minNum,1)
print(minNum,maxNum)

Solution (Python):

n = int(input())
A = list(map(int, input().split()))
dp = [0] * 9
for i in A:
    s = i // 400
    if s >= 8:
        dp[-1] += 1
    else:
        dp[s] = 1
 
ans = 0
for j in range(len(dp) - 1):
    ans += dp[j]
    
if ans == 0:
    print(1, dp[-1])
else:    
    print(ans, sum(dp))

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

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

for i in a:
    if i < 400:
        x1 = 1
    elif i < 800:
        x2 = 1
    elif i < 1200:
        x3 = 1
    elif i < 1600:
        x4 = 1
    elif i < 2000:
        x5 = 1
    elif i < 2400:
        x6 = 1
    elif i < 2800:
        x7 = 1
    elif i < 3200:
        x8 = 1
    else:
        x9 += 1
mini = max(x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8, 1)
maxi = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
print(mini, maxi)

Solution (Python):
def resolve():
    import collections
    N = int(input())
    A = list(map(int, input().split()))
    d = collections.OrderedDict([
        (400, 0),
        (800, 0),
        (1200, 0),
        (1600, 0),
        (2000, 0),
        (2400, 0),
        (2800, 0),
        (3200, 0)
    ])
    other = 0
    for a in A:
        for th in d:
            if a < th:
                d[th] += 1
                break
        else:
            other += 1
    mincolor = 0 if other != N else 1
    for th in d:
        if d[th] > 0:
            mincolor += 1
    maxcolor = mincolor+other if other != N else other
    print("{} {}".format(mincolor, maxcolor))
    

if '__main__' == __name__:
    resolve()

Solution (Python):
n=int(input())
s=list(map(int,input().split()))
t=[]
var=0
over=0
for i in s:
    if i//400 >= 8:
        over+=1
    elif i//400 in t:
        pass
    else:
        var+=1
        t.append(i//400)

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

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

rainbow=0
rate=[]

for i in A:
    if (i>=3200):
        rainbow+=1
    else:
        rate.append(i//400)

cnt=len(set(rate))
print(max(1,cnt),cnt+rainbow)

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


def main():
    n = int(input())
    A = list(map(int, input().split()))
    color = defaultdict(int)
    g = 0
    for a in A:
        if a >= 3200:
            g += 1
            continue
        for j in range(8):
            if 400 * j <= a < 400 * (j + 1):
                color[j] = 1
    print(max(1, len(color)), len(color) + g)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    from collections import Counter

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

    a = map(lambda x: min(8, x // 400), a)

    ctr = Counter(a)

    len_ = len(ctr.keys())
    free = ctr[8]
    if free:
        ma = len_ - 1 + free
        mi = max(1, len_ - 1)
        ans = mi, ma
    else:
        ans = len_, len_
    print(*ans)


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in A:
    if i<=399:
        B.append(1)
    elif i<=799:
        B.append(2)
    elif i<=1199:
        B.append(3)
    elif i<=1599:
        B.append(4)
    elif i<=1999:
        B.append(5)
    elif i<=2399:
        B.append(6)
    elif i<=2799:
        B.append(7)
    elif i<=3199:
        B.append(8)
    else:
        C.append(1)

D=set(B)
minans=len(D)
if C:
    maxans=len(C)+minans
else:
    maxans=minans
    
print(max(minans,1), maxans)

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

  
def judge(n):
  return n//400

rate=[0]*8
masters=0
for a in A:
  if judge(a)<8:
    rate[judge(a)]+=1
  else:
    masters+=1
  
count=0
for r in rate:
  if r!=0:
    count+=1
MAX=count+masters


print(max(1,count),MAX)

Solution (Python):
n,*a=map(int,open(0).read().split())

gray=0
brown=0
green=0
water=0
blue=0
yellow=0
orange=0
red=0
overred=0

for i in a:
  if 1<=i<400:
    gray=1
  elif 400<=i<800:
    brown=1
  elif 800<=i<1200:
    green=1
  elif 1200<=i<1600:
    water=1
  elif 1600<=i<2000:
    blue=1
  elif 2000<=i<2400:
    yellow=1
  elif 2400<=i<2800:
    orange=1
  elif 2800<=i<3200:
    red=1
  else:
    overred+=1
    
ans=gray+brown+green+water+blue+yellow+orange+red

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

Solution (Python):
li=[0]*8
o=0
n,*a=map(int,open(0).read().split())
for i in a:
  if i>=3200:o+=1  
  else:li[i//400]=1
if sum(li)==0:print(1,min(o,8))
else:print(sum(li),(sum(li)+o))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
l = []
aaa = 0
for i in a:
    if i<400:
        l.append("hai")
    elif i<800:
        l.append("tya")
    elif i<1200:
        l.append("midori")
    elif i<1600:
        l.append("mizu")
    elif i<2000:
        l.append("ao")
    elif i<2400:
        l.append("ki")
    elif i<2800:
        l.append("dai")
    elif i<3200:
        l.append("aka")
    else:
        aaa+=1
x = len(set(l))
print(max(1,x),x+aaa)

Solution (Python):
import sys
input=sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))

l = [0] * 9
mn = 0
for i in A:
    t = min(i // 400, 8)
    l[t] += 1
for i in range(8):
    if l[i] != 0:
        mn += 1
if mn == 0:
    mn = 1
    mx = l[8]
else:
    mx = mn + l[8]

print(mn, mx)

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

l = [0] * 9
mn = 0
for i in A:
    t = min(i // 400, 8)
    l[t] += 1
for i in range(8):
    if l[i] != 0:
        mn += 1
if mn == 0:
    mn = 1
    mx = l[8]
else:
    mx = mn + l[8]

print(mn, mx)

Solution (Python):
from collections import defaultdict, deque, Counter
import sys
input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

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

d = defaultdict(int)
strong = 0

for a in A:
    if a >= 3200:
        strong += 1
        continue
    d[a // 400] += 1

Cmin = max(len(d), 1)
Cmax = len(d) + strong
print(Cmin, Cmax)

Solution (Python):
N=int(input())
m=list(map(int,input().split()))
ans=0
rainbow=0
table=[0,0,0,0,0,0,0,0]
for i in m:
  if i>3199:
    rainbow+=1
  else:
    if table[i//400]==0:
      ans=ans+1
      table[i//400]=1
print(max(1,sum(table)),sum(table)+rainbow)

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



for i in range(n):
  if 1<=a[i]<=399:
    a[i]="gray"
  elif 400<=a[i]<=799:
    a[i]="brown"
  elif 800<=a[i]<=1199:
    a[i]="green"
  elif 1200<=a[i]<=1599:
    a[i]="lightblue"
  elif 1600<=a[i]<=1999:
    a[i]="blue"
  elif 2000<=a[i]<=2399:
    a[i]="yellow"
  elif 2400<=a[i]<=2799:
    a[i]="orange"
  elif 2800<=a[i]<=3199:
    a[i]="red"
  elif 3200<=a[i]:
    a[i]="free"

from collections import Counter
c=Counter(a)
ans=len(c)
free=c["free"]

v_min=ans
v_max=ans
if free>0:
  v_min-=1
if free>0:
  v_max+=free-1
if free==n:
  v_min=1
print(v_min,v_max)

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  


N = read_a_int()
A = read_ints()

if N == 1:  
    print(1, 1)
    exit()



import numpy as np
A = np.array(A) // 400

cnt = Counter(A)

ans_min = 0
ans_max = 0
for k, v in cnt.items():
    if k >= 8:
        ans_max += v
    else:
        ans_min += 1
        ans_max += 1
if ans_min == 0:
    ans_min = 1  
print(ans_min, ans_max)

Solution (Python):
import math

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

Nagasa = len(L)
over = 0

counter = [0]*8

for i in range (0, Nagasa):
	if L[i] >= 3200:
		over+=1
	else:
		counter[math.floor(L[i]/400)]=1

count = sum(counter)

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
color = []
free = 0
for x in a:
    if x < 400:color.append("g")
    elif x < 800:color.append("b")
    elif x < 1200:color.append("gr")
    elif x < 1600:color.append("bl1")
    elif x < 2000:color.append("bl2")
    elif x < 2400:color.append("y")
    elif x < 2800:color.append("o")
    elif x < 3200:color.append("r")
    else: free += 1
color = list(set(color))
ans = len(color)
if ans == 0 and free > 0: ans = 1
print(ans, len(color) + free)

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

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

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

def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  s = set()
  free = 0
  for score in a:
    rank = get_rank(score)
    if (rank == 8):
      free += 1
    else:
      s.add(rank)
  print(max(1, len(s)), len(s) + free)
  return

if __name__ == "__main__":
  resolve()

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


t = 0
d = defaultdict(lambda: 0)
for a in al:
    if a >= 3200:
        t += 1
    else:
        d[str(a // 400)] += 1
if len(d) == 0:
    print(1, t)
else:
    print(len(d), len(d)+t)

Solution (Python):
n = int(input())
kinds = set()
rainbow = 0
for a in list(map(int, input().split())):
    color = a // 400
    if color < 8:
        kinds.add(color)
    else:
        rainbow += 1

print(max(len(kinds), 1), len(kinds) + rainbow)

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

l=[0 for i in range(9)]
for i in a:
  if i>=3200:
    l[-1]+=1
  else:
    l[i//400]+=1

cnt=0
for i in l[:-1]:
  if i!=0:
    cnt+=1

if cnt==0:
  print(1,l[-1])
else:
  print(cnt,cnt+l[-1])

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    A = readInts()
    dic = defaultdict(int)
    ok = 0
    for i in range(n):
        if 1 <= A[i] <= 399:
            dic['g'] = 1
        elif 400 <= A[i] <= 799:
            dic['b'] = 1
        elif 800 <= A[i] <= 1199:
            dic['gr'] = 1
        elif 1200 <= A[i] <= 1599:
            dic['w'] = 1
        elif 1600 <= A[i] <= 1999:
            dic['bl'] = 1
        elif 2000 <= A[i] <= 2399:
            dic['f'] = 1
        elif 2400 <= A[i] <= 2799:
            dic['bbb'] = 1
        elif 2800 <= A[i] <= 3199:
            dic['adava'] = 1
        else:
            ok += 1
    cnt = 0
    for k,v in dic.items():
        cnt += 1
    if cnt != 0:
        print(cnt,cnt+ok)
    else:
        print(1,ok)
if __name__ == '__main__':
  main()

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

ansl = [0] * 9

for a in al:
    k = min(a // 400, 8)
    ansl[k] += 1

min_ans = 0
for a in ansl[:8]:
    if a > 0:
        min_ans += 1

max_ans = min_ans
if ansl[-1] > 0:
    if min_ans == 0:
        min_ans += 1
        max_ans += ansl[-1]
    else:
        max_ans = min_ans + ansl[-1]

print(min_ans, max_ans)

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

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

count = 0
lst = [0] * 10
for a in A:
    tmp = a // 400
    if tmp >= 8:
        count += 1
    else:
        lst[tmp] = 1

ans = sum(lst)
print (max(1, ans), ans + count)

Solution (Python):
def main():
    n = int(input())
    a = [int(x) for x in input().split()]
    colors = [0] * 9
    for aa in a:
        index = -1
        for i in range(8):
            if 400 * i <= aa < 400 * (i + 1):
                index = i
        colors[index] += 1
    answer = 0
    for i in range(8):
        if colors[i] > 0:
            answer += 1
    print(max(answer, 1), answer + colors[-1])


if __name__ == '__main__':
    main()

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

ans = 0
for left in range(0, 2801, 400):
    ans += 1 if [a for a in A if left <= a <= left + 399] else 0

ans1 = ans + len([a for a in A if a >= 3200])
if ans == 0:
    print(1, ans1)
else:
    print(ans, ans1)

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

C = [0 for _ in range(9)]

for i in range(N):
    if a[i] // 400 < 8:
        C[a[i]//400] = 1
    else:
        C[8] += 1

ans_min = max(1,sum(C[:8]))
ans_max = sum(C)
print(ans_min,ans_max)

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

s=[0]*8
c=0
for ai in a:
    if ai<3200:
        s[ai//400]=1
    else:
        c+=1

ssum=sum(s)
smin=max(1,ssum)
smax=ssum+c
print(smin,smax)

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

s=[0]*8
c=0
for ai in a:
    if ai<3200:
        s[ai//400]=1
    else:
        c+=1

ssum=sum(s)
if ssum==0:
    smin=1
else:
    smin=ssum
smax=ssum+c
print(str(smin)+" "+str(smax))

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

b=[]
c=0
for i in a:
    if i<8:
        b.append(i)
    else:
        c+=1
b=set(b)

print(max(len(b),1),len(b)+c)

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

rate_map = [0] * 9
for i in a:
    rate_map[8 if i // 400 > 8  else i // 400] += 1
base = len(list(filter(lambda x: bool(x), rate_map[:8])))

print("{} {}".format(min(rate_map[8], 1) if not bool(base) else base, base+rate_map[8]))

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def main():
	n = int(input())
	bb=[0]*8
	free=0
	al=list(IN())
	for rate in al:
		
		cc = rate // 400
		if cc < 8:
			bb[cc]+=1
		else:
			free+=1
	ccc=0
	for b in bb:
		ccc += b>0
	min_n = max(1,ccc)
	max_n = ccc + free
	print(min_n, max_n)
				
	
	
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
ma = 0
mi = 0
color = [False for _ in range(8)]

red = 0
for i in range(n):
    if 1<=a[i]<= 399:
        color[0] = True
        
    elif 400<=a[i]<=799:
        color[1] = True
        
    elif 800<=a[i]<=1199:
        color[2] = True
        
    elif 1200<=a[i]<=1599:
        color[3] = True
        
    elif 1600<=a[i]<=1999:
        color[4] = True
        
    elif 2000<=a[i]<=2399:
        color[5] = True
        
    elif 2400<=a[i]<=2799:
        color[6] = True
        
    elif 2800<=a[i]<=3199:
        color[7] = True
        
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

ma = red + c
        
if c == 0:
    mi = 1
else:
    mi = c
    

print(mi,ma)

Solution (Python):
n = int(input())
li = list(map(int,input().split()))
color = [0]*8
x = 0

for i in li:
    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:
        x += 1

ans = 8-color.count(0)
x += ans
if ans == 0:
    ans += 1
print(ans, x)

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

B = [0] * 9
for a in A:
    if a < 3200:
        B[a // 400] += 1
    else:
        B[8] += 1

count = 0
for b in B[:8]:
    if b:
        count += 1

print(max(count, 1), count + B[8])

Solution (Python):









import numpy as np






N = int(input())
arrA = np.array(input().split(),dtype=np.int64)
bins = np.array([400,800,1200,1600,2000,2400,2800,3200,4801])
arr = np.digitize(arrA,bins)
ans = np.bincount(arr,minlength=9)
ans1 = len(ans[:-1][ans[:-1]>0])
ans2 = ans1 + ans[-1]
if ans1 == 0:
    ans1 = 1
print(ans1,ans2)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    a=list(map(int,input().split()))
    l=[0]*8
    red=0
    for i in range(N):
        if a[i]<3200:
            l[a[i]//400]=1
        else:
            red+=1
    if sum(l)>=1:
        print(sum(l),sum(l)+red)
    else:
        print(1,sum(l)+red)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
ans = 0
cnt_free = sum(x >= 3200 for x in a)
for i in range(8):
    if sum(x >= 400 * i and x < 400 * (i + 1) for x in a) >= 1:
        ans += 1
print(max(1, ans))
print(ans + cnt_free)

Solution (Python):
def myAnswer(N:int,A:list) -> int:
   counter = 0
   free = 0
   rate = [0 for _ in range(8)]
   for a in A:
      if(a <= 399):
         rate[0] += 1
      elif(a <= 799):
         rate [1] += 1
      elif(a <= 1199):
         rate[2] += 1
      elif(a <= 1599):
         rate[3] += 1
      elif(a <= 1999):
         rate[4] += 1
      elif(a <= 2399):
         rate[5] += 1
      elif(a <= 2799):
         rate[6] += 1
      elif(a <= 3199):
         rate[7] += 1
      else:
         free += 1
   for r in rate:
      if(r > 0):
         counter += 1
   if(free == N):
      print(1,free)
   else:
      print(counter,counter+free)


def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   myAnswer(N,A[:])
if __name__ == '__main__':
   main()

Solution (Python):
def GetColor(point):
   color = point//400
   if color>=8:
      color = -1
   return color

N = int(input())
A = map(int,input().split())
Nc = [0 for i in range(9)]
for ai in A:
   Nc[GetColor(ai)]+=1

Nf = Nc[-1]
Ans = 0
for ic in range(len(Nc)-1):
   if Nc[ic]>0:
      Ans+=1

maxNc = Ans+Nf
minNc = max(1,Ans)
print("%d %d"%(minNc,maxNc))

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

b = [0]*9
ans = 0
count = 0
for i in a:
    if i//400 < 8:
        b[i//400] = 1
    else:
        b[8] += 1
print(max(1, sum(b[:8])), sum(b))

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

l = [0]*9
for i in A:
    l[min(i//400,8)] += 1

lf = l[:-1]
ans = 8-lf.count(0)
print(max(1,ans),ans+l[8])

Solution (Python):
import math
l = input().split()
N = int(l[0])
l = input().split()
A = [0] * 13
for i in l:
    index = int(i) // 400
    if index < 8:
        A[index] = 1
    else:
        A[index] += 1
x = sum(A[:8])
y = sum(A[8:])

print(max(1, x), x + y)

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

def main():
    N = int(readline())
    A = list(map(int, readline().rstrip().split()))
    m = [a//400 for a in A if a < 3200]

    mi = len(set(m))
    ma = len(set(m)) + (N - len(m))
    print(max(1, mi), ma)    


if __name__ == '__main__':
    main()