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):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    num_list = i_list()

    tmp_list = [0] * 8
    count = 0

    max_count = 0

    for num in num_list:
        if num // 400 >= 8:
            max_count += 1
            continue
        if tmp_list[num//400] == 0:        
            tmp_list[num//400] = 1

    for i in tmp_list:
        if i == 1:
            count += 1
    
    if count == 0:
        print(1, max_count)
    else:
        print(count, count + max_count)
        

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
rate = list(map(int,input().split()))
ratecolor = 0
free = 0
ratecolor = 0
color = [0]*9
for i in range(n):
    if(rate[i] >= 3200):
        free += 1
    else:
        for j in range(9):
            if(rate[i] < j*400 + 400):
                if(color[j] == 0):
                    color[j] += 1
                    ratecolor += 1
                break
print(ratecolor if ratecolor != 0 else 1,ratecolor+free)

Solution (Python):
def index(rate):
    if rate <= 3199:
        idx = rate // 400
    else:
        idx = 'free'
    return idx


def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    color_lst = [0] * 8

    free = 0
    for i in range(n):
        rate = a_lst[i]
        idx = index(rate)
        if idx == 'free':
            free += 1
        else:
            color_lst[idx] = 1

    types = 0
    for i in range(8):
        if color_lst[i] == 1:
            types += 1

    if types > 0:
        minimum = types
    else:
        minimum = 1

    maximum = types
    max_add = free
    maximum += max_add

    print(minimum, maximum)


if __name__ == '__main__':
    main()

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

p = set()
q = 0
for i in range(n):
  if a[i] < 3200:
    p.add(a[i]//400)
  else:
    q += 1

p = len(p)
print(max(p, 1), p+q)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
rate = {"a":0, "b":0, "c":0, "d":0, "e":0, "f":0, "g":0, "h":0}
ratez = {"z":0}
for i in range(N):
    if A[i] >=1 and A[i] <= 399:
        rate["a"] += 1
    if A[i] >=400 and A[i] <= 799:
        rate["b"] += 1
    if A[i] >=800 and A[i] <= 1199:
        rate["c"] += 1
    if A[i] >=1200 and A[i] <= 1599:
        rate["d"] += 1
    if A[i] >=1600 and A[i] <= 1999:
        rate["e"] += 1
    if A[i] >=2000 and A[i] <= 2399:
        rate["f"] += 1
    if A[i] >=2400 and A[i] <= 2799:
        rate["g"] += 1
    if A[i] >=2800 and A[i] <= 3199:
        rate["h"] += 1
    if A[i] >=3200:
        ratez["z"] += 1
keys = [k for k, v in rate.items() if v != 0]

if ratez["z"] == 0:
    print(len(keys), len(keys))
elif len(keys) == 0:
    print(1, ratez["z"])
else:
    print(len(keys), len(keys)+ratez["z"])

Solution (Python):



import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
2100 2500 2700 2700"""
        output = """2 2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1100 1900 2800 3200 3200"""
        output = """3 5"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990"""
        output = """1 1"""
        self.assertIO(input, output)


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

    C = [0] * 9
    for a in A:
        for i in range(8):
            if 400*i <= a <= 400*i+399:
                C[i] = 1
                break
        else:
            C[8] += 1

    print(f"{max(1, C[:8].count(1))} {C[:8].count(1)+C[8]}")


if __name__ == "__main__":
    
    resolve()

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

cnt = [0] * 9
for i in a:
    x = min(i // 400, 8)
    if x >= 8:
        cnt[8] += 1
    else:
        cnt[x] = 1

if sum(cnt[:8]) == 0:
    l = 1
    r = cnt[8]
else:
    l = sum(cnt[:8])
    r = l+cnt[8]
print(l, r)

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
x=0
for z in range(a):
  if b[z]<=399:
    c=c+1
  if 400<=b[z]<799:
    d=d+1
  if 800<=b[z]<=1199:
    e=e+1
  if 1200<=b[z]<=1599:
    f=f+1
  if 1600<=b[z]<=1999:
    g=g+1
  if 2000<=b[z]<=2399:
    h=h+1
  if 2400<=b[z]<=2799:
    i=i+1
  if 2800<=b[z]<=3199:
    j=j+1
  if b[z]>=3200:
    k=k+1
if c!=0:
  x=x+1
if d!=0:
  x=x+1
if e!=0:
  x=x+1
if f!=0:
  x=x+1
if g!=0:
  x=x+1
if h!=0:
  x=x+1
if i!=0:
  x=x+1
if j!=0:
  x=x+1
if k+x>a:
  print(x,a)
elif (c+d+e+f+g+h+i+j)==0 and k!=0:
  print(1,k)
else:
  print(x,k+x)

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

N = cin()[0]
a = cin()
b = [0 for _ in range(9)]
for i in range(N):
    ind = min(8, a[i] // 400)
    if ind <= 7:  b[ind] = 1
    else:  b[ind] += 1
ma = sum(b)
if b[ind] < N:  mi = sum(b[:-1])
else:  mi = 1
print(mi, ma)

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

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

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

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

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
zako=set()
aka=list()
for i in a:
    if 1<= i <=399:
        zako.add('g')
    elif 400<=i<=799:
        zako.add('Br')
    elif 800<=i<=1199:
        zako.add('gre')
    elif 1200<=i<=1599:
        zako.add('mizu')
    elif 1600<=i<=1999:
        zako.add('blu')
    elif 2000<=i<=2399:
        zako.add('ye')
    elif 2400<=i<=2799:
        zako.add('ora')
    elif 2800<=i<=3199:
        zako.add('red')
    else:
        aka.append(1)
if len(zako)==0:
    print(1,len(aka))
else:
    print((len(zako)),(len(zako)+len(aka)))

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

if sum(ans[:8]) == 0:
  l = 1
  r = ans[8]
else:
  l = sum(ans[:8])
  r = l+ans[8]
print(l,r)

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

rate=[0]*9
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i < 400*j:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)
if ansmin == 0:
  ansmin=1

if over > 0:
  ansmax += over
    

print(ansmin, ansmax)

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

a.sort()

if a[0] >= 3200:
    print(1, n)
    exit()

ans = [0] * 9
for i in a:
    if i >= 3200:
        ans[8] += 1
    else:
        ans[i//400] = 1

print(sum(ans) - ans[-1], sum(ans))

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

cnt = [0] * 9
for i in a:
    x = min(i // 400, 8)
    if x >= 8:
        cnt[8] += 1
    else:
        cnt[x] = 1

if sum(cnt[:8]) == 0:
    l = 1
    r = cnt[8]
else:
    l = sum(cnt[:8])
    r = l+cnt[8]
print(l, r)

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

Solution (Python):
N = int(input())
lsa = list(map(int,input().split()))
lsb = []
joker = 0
for i in lsa:
    if i >=1 and i <=399:
        lsb.append('1')
    elif i >=400 and i <=799:
        lsb.append('2')
    elif i >=800 and i <=1199:
        lsb.append('3')
    elif i >=1200 and i <=1599:
        lsb.append('4')
    elif i >=1600 and i <=1999:
        lsb.append('5')
    elif i >=2000 and i <=2399:
        lsb.append('6')
    elif i >=2400 and i <=2799:
        lsb.append('7')
    elif i >=2800 and i <=3199:
        lsb.append('8')
    elif i >=3200:
        joker += 1
s1 = len(set(lsb)) 
s2 = s1+joker
print(max(s1,1),s2)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
free = 0
for i in range(N):
  if a[i] < 400: gray += 1
  elif a[i] < 800: brown += 1
  elif a[i] < 1200: green += 1
  elif a[i] < 1600: water += 1
  elif a[i] < 2000: blue += 1
  elif a[i] < 2400: yellow += 1
  elif a[i] < 2800: orange += 1
  elif a[i] < 3200: red += 1
  else: free += 1
cnt = 0
if gray: cnt += 1
if brown: cnt += 1
if green: cnt += 1
if water: cnt += 1
if blue: cnt += 1
if yellow: cnt += 1
if orange: cnt += 1
if red: cnt += 1
cntmax = cnt
if free: cntmax = free + cnt
if not cnt: cnt += 1
print(cnt, cntmax)

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

for i in range(n):
    c=a[i]//400
    if a[i]<3200 and c not in color:
        color.append(c)
        count+=1
    elif a[i]>=3200:
        free+=1
      
min,max=0,0
if count==0:
    max=free
    min=1
else:
    max=count+free
    min=count
    
print(min,max)

Solution (Python):

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

seen = [False]*8
cnt = 0
cnt_3200 = 0
for i in a:
    i = i//400
    if i >= 8:
        cnt_3200 += 1
    elif (seen[i] == False):
        cnt += 1
        seen[i] = True
    
if cnt == 0:
    print(1,cnt_3200)
else:
    print(cnt,cnt+cnt_3200)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        cnt[a[i]//400] += 1
    else:
        free += 1
print(max(1,8-cnt.count(0)),8-cnt.count(0)+free)

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

c = [0] * 9
for i in range(N):
    if a[i] >= 3200:
        c[8] += 1
    else:
        for j in range(8):
            if 400*j <= a[i] and a[i] <= 400 * (j + 1) -1:
                c[j] = 1

min1 = max(1, sum(c[:8]))
max1 = sum(c)

print(min1, max1)

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

colors = [0] * 8
over = 0

for i in arr:
    if i >= 3200:
        over += 1
    else:
        colors[i // 400] += 1

res = 8 - colors.count(0)
if res:
    print(res, res+over)
else:
    print(1, over)

Solution (Python):
import collections as c
input();a=c.Counter(i//400 for i in [*map(int,input().split())])
b,c=len(set([i for i in a.keys()if i<8])),sum([j for i,j in a.items()if i>=8])
print([b,1][b==0],b+c)

Solution (Python):
import collections as c
input();a=c.Counter(i//400 for i in [*map(int,input().split())])
b,c=len(set([i for i,j in a.items()if i<8])),sum([j for i,j in a.items()if i>=8])
print([b,1][b==0],b+c)

Solution (Python):
import collections as c
input();a=c.Counter(i//400 for i in list(map(int,input().split())))
b,c=len(set([i for i,j in a.items() if i<8])),sum([j for i,j in a.items()if i>=8])
print([b,1][b==0],b+c)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
count=0
ans=1
color_lis=[0,0,0,0,0,0,0,0]
for i in range(n):
  if a[i]//400>=8:
    count+=1
  else:
    color_lis[a[i]//400]=1
ans=sum(color_lis)
if count>0:
  flag=1
else:
  flag=0
ans1 = max(flag,ans)
ans2 = ans+count
print(ans1,ans2)

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    a = LI()
    lst = [False]*8
    god = 0
    for i in a:
        rank = i//400
        if rank<=7:
            lst[rank] = True
        else:
            god += 1
    ans = lst.count(True)
    if ans == 0:
        ans = 1
        god -= 1

    print(ans,ans + god)

main()

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

c = [0] * 9
for num in a:
    if num < 400:
        c[0] += 1
    elif num < 800:
        c[1] += 1
    elif num < 1200:
        c[2] += 1
    elif num < 1600:
        c[3] += 1
    elif num < 2000:
        c[4] += 1
    elif num < 2400:
        c[5] += 1
    elif num < 2800:
        c[6] += 1
    elif num < 3200:
        c[7] += 1
    else:
        c[8] += 1
mi = 0
ma = 0
for i in range(8):
    if c[i] >= 1:
        mi += 1
        ma += 1
ma += c[8]
if mi == 0:
    if c[8] >= 1:
        mi += 1
print(str(mi) + " " + str(ma))

Solution (Python):

import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)




def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


N = z()
A = zz()
lis = list(range(-1, 3200, 400))
ok = 0
set_ = []
for i in range(N):
    if (A[i] >= 3200):
        ok += 1
    else:
        idx = bisect.bisect_left(lis, A[i])
        set_.append(idx)
set_ = set(set_)
min_ = max(len(set_), 1)
max_ = len(set_) + ok

print(min_, max_)

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

border = 3200 // 400
arr = [0] * 8
over = 0
for a in aa:
    x = a // 400

    if x >= border:
        over += 1
        continue

    arr[x] = 1

s = sum(arr)

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
c = [0] * 9
for i in A:
    if i < 3200:
        c[i//400]+=1
    else:
        c[8]+=1
cnt = 0
for i in range(8):
    if c[i] != 0:
        cnt += 1
mini = max(1,cnt)
maxi = cnt+c[8]
print(mini,maxi)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
cin = [0, 0, 0, 0, 0, 0, 0, 0]
kin = 0
pin = 0
flag = 0
for i in A:
    if i < 3200:
        cin[i//400] += 1
        pin = 1
    else:
        kin += 1
        flag = 1
if pin == 0:
    print(1, kin)
else:
    print(8-cin.count(0), 8-cin.count(0)+kin)

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

color = [0]*8
freer=0

for i in a:
    if i<3200:
        color[i//400]+=1
    else:
        freer+=1
        
ans_base = 8-color.count(0)

if ans_base==0:
    ans_min = 1
else:
    ans_min = ans_base
    
ans_max = ans_base+freer
        
print(ans_min, ans_max)

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

for i in range(N):
    temp=a[i]//400
    if temp>8:
        ans[8]+=1
    else:
        ans[temp]+=1
nin=0
for i in range(8):
    if ans[i]!=0:
        nin+=1
if nin==0 and ans[8]!=0:
    nin+=1
    nax=ans[8]
else:
    nax=nin+ans[8]
print(nin,nax)

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

s = set()
b = 0
for i in a:
    if i < 3200:
        s.add(i//400)
    else:
        b += 1
else:
    min = len(s)
    print(max(min, 1), min + b)

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

if min==0:
  min=1
print(min,max)

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

b=[0 for _ in range(8)]
for r in a:
  t=r//400
  if t>=8:
    ch+=1
  else:
    b[t]+=1
    
c=8-b.count(0)
print(str(max(1,c))+' '+str(c+ch))

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

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

ans = 0
if col[8] == N:
  print(1, N)
  exit()
  
for i in range(8):
  if col[i] > 0:
    ans += 1
print(ans, end=" ")
ans += col[8]
print(ans)

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

color=[]
free=0
Sans,Mans=0,0
for i in a:
    if i//400<8 and i//400 not in color:
        color.append(i//400)
        Sans+=1
    elif i>=3200:
        free+=1
        


 

 

Mans=Sans+free
if Sans==0:
    Sans=1
print(Sans,Mans)

Solution (Python):

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

mini = 0
color_list = []
for i in a:
    if (i//400)<8 and ((i//400 in color_list) == False):
        mini += 1
        color_list.append(i//400)

maxi = mini
for j in a:
    if j >= 3200:
        maxi += 1
if mini == 0:
    mini = 1
print(mini,maxi)

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
L=[i//400 for i in L]
a=[i for i in L if i<8]
b=[i for i in L if i>7]
a=len(set(a))
b=len(b)
if a==0:
  mi=1
  ma=b
else:
  mi=a
  ma=mi+b
print(mi,ma)

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

A = [a // 400 for a in A]

C = [0 for _ in range(9)]
for a in A:
    if a > 8:
        a = 8
    C[a] += 1

cnt_0 = 0
cnt_n0 = 0
for c in C:
    if c == 0:
        cnt_0 += 1
    else:
        cnt_n0 += 1


if C[-1] == 0:
    ans_min = cnt_n0
    ans_max = cnt_n0
else:
    if sum(C) == C[-1]:
        ans_min = 1
    else:
        ans_min = cnt_n0 - 1

    ans_max = cnt_n0 - 1 + C[-1]


print(ans_min, ans_max)

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

ans = 0
t = 400
while t < 3201:
  for i in a:
    if i >= t-400 and i < t:
      ans += 1
      break
  t += 400

s = 0
for i in a:
  if i >= 3200: s += 1

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

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

m = len(set(a))
M = len(set(a))
if 8 in a:
    m -= 1
    M += a.count(8)
    M -= 1

if m == 0:
    m = 1
print(m, M)

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

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

if sum(R[:-1])!=0:
  M = 8-R[:-1].count(0)+R[-1]
  m = 8-R[:-1].count(0)
  print(m,M)
else:
  print(1,R[-1])

Solution (Python):
is_alive = [0]*8

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

count_over=0

for i in range(0,N,1):
    if a[i]>=3200:
        count_over +=1
    else:
        is_alive[a[i]//400]=1

print(max(1,sum(is_alive)),sum(is_alive)+count_over)

Solution (Python):
N = int(input())
rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
p = [0] * 9

A = [int(a) for a in input().split(" ")]
A.sort()

j = 0
for i in range(len(A)):
  while j < 8:
    if rate[j] <= A[i] < rate[j + 1]:
      p[j] = 1
      break
    else:
      j += 1
  else:
    p[8] = len(A[i:])
    break

print(str(max([sum(p[:8]), 1])) + " " + str(sum(p)))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
c = [False] * 8
o = 0
for i in range(N):
    for j in range(8):
        if a[i] >= 400*j and a[i] < 400*(j+1):
            c[j] = True
    if a[i] >= 3200:
        o += 1
if c.count(True) > 0:
    print(c.count(True), c.count(True)+o)
else:
    print(1, o)

Solution (Python):
import collections
def f(n,ais):
	cc,extra = collections.Counter(),0
	for ai in ais:
		if ai/400 < 8: cc[ai/400] +=1
		else: extra +=1
	print len(cc) + (1 if (len(cc) == 0 and extra) else 0), min(10000, len(cc) + extra)
	
f(int(raw_input()), map(int, raw_input().split()))

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

c=[0]*8
maxc=0
for a in A:
    if a>=3200:
        maxc+=1
    else:
        c[a//400]=1
minc = c.count(1)
ans = minc+maxc
print(max(minc,1),ans)

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

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

list_over_3200 = []
list_under_3200 = []
for num in a:
    if num < 3200:
        list_under_3200.append(num // 400)
    else:
        
        list_over_3200.append(num)
maxAns = len(set(list_under_3200)) + len(list_over_3200)
if len(set(list_under_3200)) == 0:
    minAns = 1
else:
    minAns = len(set(list_under_3200))
print(minAns, maxAns)

Solution (Python):
def main():
    n=int(input())
    ans=[0]*8
    other = 0
    for a in map(int,input().split()):
        if a >= 3200:
            other+=1
        else:
            ans[a//400] = 1
    a = ans.count(1)
    print(a if a != 0 else 1, a+other)
    
if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
dic = {}
over = 0
color = 8
for i in range(n):
    if a[i]<400:
        dic.setdefault(400,0)
        dic[400] += 1
    elif a[i]<800:
        dic.setdefault(800,0)
        dic[800] += 1
    elif a[i]<1200:
        dic.setdefault(1200,0)
        dic[1200] += 1
    elif a[i]<1600:
        dic.setdefault(1600,0)
        dic[1600] += 1
    elif a[i]<2000:
        dic.setdefault(2000,0)
        dic[2000] += 1
    elif a[i]<2400:
        dic.setdefault(2400,0)
        dic[2400] += 1
    elif a[i]<2800:
        dic.setdefault(2800,0)
        dic[2800] += 1
    elif a[i]<3200:
        dic.setdefault(3200,0)
        dic[3200] += 1
    else:
        over += 1

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

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

free = 0
colors = {}

for a in A:
    if a < 3200:
        ai = a // 400
        colors[ai] = True

    else:
        free += 1

lc = len(colors)

print(max(1, lc), lc + free)

Solution (Python):


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

n = 399
a, b, c, d, e, f, g, h, z = 0,0,0,0,0,0,0,0,0

for i in A:
    if i >= 1 and i <= n:
        a = 1
    elif i >= 400 and i <= n + 400:
        b = 1
    elif i >= 2*400 and i <= 2*400 + n:
        c = 1
    elif i >= 3*400 and i <= 3*400 + n:
        d = 1
    elif i >= 4*400 and i <= 4*400 + n:
        e = 1
    elif i >= 5*400 and i <= 5*400 + n:
        f = 1
    elif i >= 6*400 and i <= 6*400 + n:
        g = 1
    elif i >= 7*400 and i <= 7*400 + n:
        h = 1
    else:
        z += 1

min_num, max_num = 0, 0
        
min_num = a+b+c+d+e+f+g+h


max_num = min_num + z
min_num = max(1, min_num)

print(min_num,max_num)

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

w = []
num = 0
for i in a:
    if 1 <= i <= 399:
        if 1 not in w:
            w.append(1)
    elif 400 <= i <= 799:
        if 400 not in w:
            w.append(400)
    elif 800 <= i <= 1199:
        if 800 not in w:
            w.append(800)
    elif 1200 <= i <= 1599:
        if 1200 not in w:
            w.append(1200)
    elif 1600 <= i <= 1999:
        if 1600 not in w:
            w.append(1600)
    elif 2000 <= i <= 2399:
        if 2000 not in w:
            w.append(2000)
    elif 2400 <= i <= 2799:
        if 2400 not in w:
            w.append(2400)
    elif 2800 <= i <= 3199:
        if 2800 not in w:
            w.append(2800)
    else:
        num += 1
if 0 < len(w):
    print(len(w), len(w)+num)
else:
    print(1, len(w)+num)

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


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
cnt = []
over = 0
for i in range(n):
    m = a[i] // 400
    if m < 8:
        if m not in cnt:
            cnt.append(m)
    else:
        over += 1
if len(cnt) > 0:
    print(len(cnt), len(cnt)+over)
else:
    print(1, len(cnt)+over)

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

ans = []
over = 0
for i in range(N):
  n = a[i] // 400
  if n < 8:
    if n not in ans:
      ans.append(n)
  else:
    over += 1
    
cnt = len(ans) + over
if len(ans) > 0:
  print(len(ans), cnt)
else:
  print(1, cnt)

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

cnt = 0
for i in a:
    if i >= 8:
        cnt += 1
c = len(set(a)) - (1 if cnt != 0 else 0)

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

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

rank=[0]*9

for aa in a:
    rank[aa//400 if aa<3200 else 8]+=1

cnt=8
for i in range(8):
    if rank[i]==0:
        cnt-=1

print('{} {}'.format(max(1,cnt),cnt+rank[8]))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
color = [0,0,0,0,0,0,0,0,0]
if min(a) >= 3200:
  print(1,len(a))
  quit()
for ai in a:
  if ai <= 3199:
    rnk = ai // 400
    color[rnk] += 1
  else:
    color[8] += 1

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

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

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

mm=len(set([i for i in s if i<8])) 
o=len([i for i in s if 8<=i]) 
print(mm if 1<=mm else 1,min(N,mm+o))

Solution (Python):
from collections import defaultdict

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

count=defaultdict(int)
count3200=0
for i in range(N):
  if a[i] < 3200:
    count[a[i] // 400] += 1
  else:
    count3200 += 1
    
print(max(len(count),1),len(count)+count3200)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=[0 for i in range(9)]
for i in range(n):
    b[min([a[i]//400,8])]+=1

ans1=len([i for i in b[:8] if i>0])
ans2=ans1+b[8]
ans1=max([ans1,1])
print(ans1,ans2)

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

Solution (Python):
import collections

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

colors = [min(8, i // 400) for i in rates]
CTR_colors = collections.Counter(colors)

ans = len(CTR_colors)

if (CTR_colors[8] > 0):
    ans -= 1

    if (ans == 0):
        mini_ans = ans + 1
    else:
        mini_ans = ans
    
    max_ans = min(100, ans + CTR_colors[8])

else:
    mini_ans, max_ans = ans, ans

print(mini_ans, max_ans)

Solution (Python):
import sys
from collections import defaultdict
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    A = list(map(int, input().split()))
    rate = set()
    top = 0
    for a in A:
        if a >= 3200:
            top += 1
        else:
            rate.add(a // 400)
    print("{} {}".format(max(1, len(rate)), len(rate) + top))
    
    

if __name__ == "__main__":
    main()

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

lst = [0] * 8
s = 0

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

colour = 0
for i in lst:
    if i >= 1:
        colour += 1

m = max(1, colour)
M = colour + s

print(m, M)