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

b=[0,0,0,0,0,0,0,0]
cnt=0

for i in range(n):
    if a[i]//400==0:
        b[0]+=1
    if a[i]//400==1:
        b[1]+=1
    if a[i]//400==2:
        b[2]+=1
    if a[i]//400==3:
        b[3]+=1
    if a[i]//400==4:
        b[4]+=1
    if a[i]//400==5:
        b[5]+=1
    if a[i]//400==6:
        b[6]+=1
    if a[i]//400==7:
        b[7]+=1
    if a[i]//400>=8:
        cnt+=1
if cnt>0:
    print(max(1,len(b)-b.count(0)),len(b)-b.count(0)+cnt)
else:
    print(len(b)-b.count(0),len(b)-b.count(0)+cnt)

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

cnt = [0 for i in range(8)]
count = 0

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

ans_min = sum(cnt)
ans_max = ans_min + count
if ans_min == 0:
    ans_min =1

print("{} {}".format(ans_min, ans_max))

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

Solution (Python):
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()

tmp = []
for i in range(n):
    if 1 <= a[i] and a[i] <= 399:
        tmp.append('ha')
    if 400 <= a[i] and a[i] <= 799:
        tmp.append('cha')
    if 800 <= a[i] and a[i] <= 1199:
        tmp.append('mi')
    if 1200 <= a[i] and a[i] <= 1599:
        tmp.append('mizu')
    if 1600 <= a[i] and a[i] <= 1999:
        tmp.append('ao')
    if 2000 <= a[i] and a[i] <= 2399:
        tmp.append('ki')
    if 2400 <= a[i] and a[i] <= 2799:
        tmp.append('da')
    if 2800 <= a[i] and a[i] <= 3199:
        tmp.append('aka')
    if 3200 <= a[i]:
        tmp.append('nanndemo')

z = 0
for i in range(len(tmp)):
    if tmp[i] == 'nanndemo':
        z += 1
if z == len(tmp):
    print(1, len(tmp))
    exit()

cnt = 0
tmp2 = list(set(tmp))
for i in range(len(tmp2)):
    if tmp2[i] != 'nanndemo':
        cnt += 1
min_x = cnt

cnt2 = 0
for i in range(len(tmp)):
    if tmp[i] == 'nanndemo':
        cnt2 += 1

if cnt2 == 0:
    max_x = len(set(tmp))
    print(min_x, max_x)
    exit()
cnt3 = 0
if cnt2 != 0:
    for i in range(len(tmp2)):
        if tmp2[i] != 'nanndemo':
            cnt3 += 1
max_xx = cnt3+cnt2
print(min_x, max_xx)

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

Solution (Python):
from collections import Counter


N = int(input())
a = Counter(map(lambda x: min(8, int(x) // 400), input().split()))
super_coders = a.pop(8, 0)
mn = len(a)
if mn == 0 and super_coders:
    mn = 1
mx = len(a) + super_coders
print(mn, mx)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
free = 0
color = set()
for i in range(N):
    if A[i]<3200:
        color.add(A[i]//400)
    else:
        free += 1
c = len(color)
if c>0:
    print(c,c+free)
else:
    print(1,free)

Solution (Python):
C = {i:0 for i in range(9)}
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    a = A[i]
    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
if cmin==0:
    cmin = 1
    cmax = C[8]
else:
    cmax = cmin+C[8]
print(cmin,cmax)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
B = [0 for i in range(8)]
a = 0
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:
    a += 1
b = sum(B)
m = b
M = b + a
if b == 0:
  m = 1
print(m, M, sep=' ')

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
X = [0]*8
y = 0

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

if sum(X) == 0:
    print(1, y)
else:
    print(sum(X), sum(X)+y)

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

N = int(input())
a = list(map(int, input().split()))
cnt = [0]*9

for ai in a:
    i = min(ai//400, 8)
    cnt[i] += 1

m = 0
M = 0

for i in range(8):
    if cnt[i]>0:
        m += 1
        M += 1

if cnt[-1]>0:
    if m==0:
        m = 1
    
    M += cnt[-1]

print(m, M)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):a[i]=min(a[i],3200)//400
m=a.count(8)
s=set(a)
s.discard(8)
print(max(1,len(s)),len(s)+m)

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

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
L = [0]*8
tourist = int()
for a in A:
    n = a//400
    if n > 7:
        tourist += 1
    else:
        L[n] = 1

cnt = int()
for l in L:
    if l == 1:
        cnt += 1

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

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

T=[0]*9

S=list(map(int,input().split()))

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

goukeimin=0



for i in range(8):
    goukeimin+=T[i]
if goukeimin==0:
    print(1,sum(T))
else:
    print(goukeimin,sum(T))

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

a.sort()

colors = [0,0,0,0,0,0,0,0]
mulch = 0

for i in a:
  if i < 400:
    colors[0] += 1
  elif i < 800:
    colors[1] += 1
  elif i < 1200:
    colors[2] += 1
  elif i < 1600:
    colors[3] += 1
  elif i < 2000:
    colors[4] += 1
  elif i < 2400:
    colors[5] += 1
  elif i < 2800:
    colors[6] += 1
  elif i < 3200:
    colors[7] += 1
  else:
    mulch += 1
    
if len([j for j in colors if j > 0]) > 0:
  mi = len([j for j in colors if j > 0])
else:
  mi = 1

if mulch > 0:
  if len([j for j in colors if j > 0]) == 0:
    ma = mulch
  else:  
    ma = mi + mulch
else:
  ma = mi
  
print(mi, ma)

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    n=int(readline())
    a=list(map(int,readline().split()))

    flags=[False]*8
    free=0
    for i in range(n):
        if a[i]//400<=7:
            flags[a[i]//400]=1
        else:
            free+=1

    color_max=flags.count(1)+free
    color_min=max(1,flags.count(1))
    print(color_min,color_max)

if __name__=="__main__":
    main()

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

overRed = 0

for i in a:
  ide = i // 400
  if 8 <= ide:
      overRed += 1
  else:
      c[ide] = True

min_num = 1 if c.count(True) == 0 and overRed != 0 else c.count(True)
max_num = c.count(True)+overRed

print(min_num,max_num)

Solution (Python):
maxColorNum = 8
rates = [False] * maxColorNum
overRed = 0
N = int(input())
people = list(map(int, input().split()))
for i in people:
    idx = i // 400
    if idx >= maxColorNum:
        overRed += 1
    else:
        rates[idx] = True
minNum = 1 if rates.count(True) == 0 and overRed != 0 else rates.count(True)
maxNum = rates.count(True) + overRed

print(str(minNum) + " " + str(maxNum))

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
color = set([])
select = 0
for i in range(N):
  if A[i] <= 399:
    color.add(0)
  elif A[i] <= 799:
    color.add(1)
  elif A[i] <= 1199:
    color.add(2)
  elif A[i] <= 1599:
    color.add(3)
  elif A[i] <= 1999:
    color.add(4)
  elif A[i] <= 2399:
    color.add(5)
  elif A[i] <= 2799:
    color.add(6)
  elif A[i] <= 3199:
    color.add(7)  
  else:
    select += 1

if select == N:
  print(1,select)
  exit()
MIN = len(color)
MAX = MIN + select
print(MIN,MAX)

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

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

As_other = [a for a in As if a<8]
reds = len(As)-len(As_other)

print(max(len(set(As_other)), 1), len(set(As_other))+reds)

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

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

if k != n:
  min_c = len(list(c))
  max_c = len(list(c)) + k
else:
  min_c = 1
  max_c = n
print(min_c, max_c)

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

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

if special==0:
    print(variety,variety)
elif variety==0:
    print(1,special)
else:
    print(variety,variety+special)

Solution (Python):
def check(score):
  if score >= 3200:
    return -1
  for i,rating in enumerate(scores):
    if rating[0] <= score <= rating[1]:
      return i
n = int(input())
a = list(map(int,input().split()))
thopes = 0
colors = set()
scores = [(1,399),(400,799),(800,1199),(1200,1599),(1600,1999),(2000,2399),(2400,2799),(2800,3199)]
for score in a:
  ind = check(score)
  if ind==-1:
    thopes+=1
  else:
    colors.add(ind)
n = len(colors)
print(max(1,n),thopes+n)

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

Solution (Python):
from collections import Counter
n = int(input())
x = list(map(int,input().strip().split()))

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
elem = len(set(rate))

_min = elem
_max = elem +over
if elem  == 0:
  _min = 1



print(str(_min),str(_max))

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
gray = 399
brown = 799
green = 1199
lblue = 1599
blue = 1999
yellow = 2399
orange = 2799
red = 3199
count = 0
result = [0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
    if 0 < i <= gray:
        result[0] += 1
    elif gray < i <= brown:
        result[1] += 1
    elif brown < i <= green:
        result[2] += 1
    elif green < i <= lblue:
        result[3] += 1
    elif lblue < i <= blue:
        result[4] += 1
    elif blue < i <= yellow:
        result[5] += 1
    elif yellow < i <= orange:
        result[6] += 1
    elif orange < i <= red:
        result[7] += 1
    else:
        count += 1
minout = sum(i>0 for i in result)
maxout = minout + count
if minout == 0:
    minout = 1
print(minout, maxout)

Solution (Python):
from collections import Counter

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

colors = []
over = 0

for a in A:
    if 1 <= a <= 399:
        colors.append("gray")
    if 400 <= a <= 799:
        colors.append("brawn")
    if 800 <= a <= 1199:
        colors.append("green")
    if 1200 <= a <= 1599:
        colors.append("water")
    if 1600 <= a <= 1999:
        colors.append("blue")
    if 2000 <= a <= 2399:
        colors.append("yellow")
    if 2400 <= a <= 2799:
        colors.append("orange")
    if 2800 <= a <= 3199:
        colors.append("red")
    if 3200 <= a:
        over += 1

counter = Counter(colors)

if len(A) == over:
    print(1, over)
    exit()

if over > 0:
    max_num = len(counter) + over
    print(len(counter), max_num)
else:
    print(len(counter), len(counter))

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

colors = [False for _ in range(8)]


allmite = 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:
    allmite += 1

colors_cnt = colors.count(True)

ans_min = max(colors_cnt, 1)
ans_max = colors.count(True) + allmite

print(ans_min, ans_max)

Solution (Python):
n = int(input())
a = map(int, input().split())
c = [0]*9

for i in a:
    col = i//400
    if 3200 <= i:
        c[8] += 1
    else:
        c[col] = 1
print(max(1,sum(c[:8])),sum(c))

Solution (Python):
import sys
import itertools
import copy
from collections import defaultdict

input = sys.stdin.readline

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

n = I()
mylist = [0 for i in range(8)]
mylist2 = MI()
num = 0

for i in mylist2:
    temp = i // 400
    if temp <= 7:
        mylist[temp] = 1
    else:
        num += 1
        
max = sum(mylist) + num

min = sum(mylist)
if min == 0:
    min = 1
    
print(str(min) + " " + str(max))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
num=[0]*8
up2800=0
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:
        up2800+=1
num2=8-num.count(0)
if num2==0:
    print(1,up2800)
else:
    print(num2,num2+up2800)

Solution (Python):
def main():
    n = int(input())
    rate_count = [0] * 13
    a = tuple(map(int, input().split()))
    for ae in a:
        rank = ae // 400
        rate_count[rank] += 1

    reds = sum(rate_count[8:])
    res = 0
    for i1 in range(8):
        res += rate_count[i1] > 0
    r_min = max(res, 1)
    r_max = res + reds
    print(r_min, r_max)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
 
n = int(sys.stdin.readline().rstrip())
a = [int(x) for x in sys.stdin.readline().rstrip().split()]
 
counter = [0,0,0,0,0,0,0,0]
counter_wild = 0
 
for x in a:
    if x < 400:
        counter[0] += 1
    elif x < 800:
        counter[1] += 1
    elif x < 1200:
        counter[2] += 1
    elif x < 1600:
        counter[3] += 1
    elif x < 2000:
        counter[4] += 1
    elif x < 2400:
        counter[5] += 1
    elif x < 2800:
        counter[6] += 1
    elif x < 3200:
        counter[7] += 1
    else:
        counter_wild += 1
 
c = len(list(filter(lambda x: x != 0,counter)))
 
if counter_wild == 0:
    minimum_num = c
    maximum_num = c
else:
    minimum_num = max(1,c)
    maximum_num = c+counter_wild
 
print(minimum_num,maximum_num)

Solution (Python):
import sys

n = int(sys.stdin.readline().rstrip())
a = [int(x) for x in sys.stdin.readline().rstrip().split()]

a_set = set()
counter_wild = 0
for x in a:
    if x>=3200:
        counter_wild+=1
    else:
        a_set.add(x//400)
print(max(1,len(a_set)),len(a_set)+counter_wild)

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

others = 0
rates = [False for i in range(8)]
for i in a:
    if i <= 399: rates[0] = True
    elif i <= 799: rates[1] = True
    elif i <= 1199: rates[2] = True
    elif i <= 1599: rates[3] = True
    elif i <= 1999: rates[4] = True
    elif i <= 2399: rates[5] = True
    elif i <= 2799: rates[6] = True
    elif i <= 3199: rates[7] = True
    else:
        others += 1
        
min_ans = rates.count(True)
if min_ans == 0: min_ans = 1
max_ans = rates.count(True)
if others > 0:
    max_ans += others

print(min_ans, max_ans)

Solution (Python):




import sys
from fractions import gcd
import math
from math import ceil,floor
import collections











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



ans = [0,0,0,0,0,0,0,0]
tmp = 0

for i in range(0,N):
    if A[i] >= 3200:
        tmp += 1
    else:
        ans[A[i]//400] = 1

print(max(1,sum(ans)),sum(ans)+tmp)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
l=[]
for i in range(n):
    if a[i]<400:
        l.append("hai")
    elif a[i]<800:
        l.append("cha")
    elif a[i]<1200:
        l.append("midori")
    elif a[i]<1600:
        l.append("mizu")
    elif a[i]<2000:
        l.append("ao")
    elif a[i]<2400:
        l.append("ki")
    elif a[i]<2800:
        l.append("orange")
    elif a[i]<3200:
        l.append("red")
    else:
        l.append("free")
ls=set(l)
if "free" not in ls:
    print(len(ls),len(ls))
else:
    x=len(ls)-1
    y=x+l.count("free")
    
        
    
    if x==0:
        x=1
    print(x,y)

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

fix_color = set()
n_any_color = 0
for color in a:

  if color < 400:
    fix_color.add(400)
  elif color < 800:
    fix_color.add(800)
  elif color < 1200:
    fix_color.add(1200)
  elif color < 1600:
    fix_color.add(1600)
  elif color < 2000:
    fix_color.add(2000)
  elif color < 2400:
    fix_color.add(2400)
  elif color < 2800:
    fix_color.add(2800)
  elif color < 3200:
    fix_color.add(3200)
  else:
    n_any_color += 1

n_min = max(1, len(fix_color))
n_max = len(fix_color) + n_any_color
print(n_min, n_max)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
colors = [0]*9
for ai in a:
  if ai >= 3200:
    colors[8] += 1
  else:
    colors[ai//400] = 1
    
cmin = max(1, sum(colors[0:8]))
cmax = sum(colors)

print(cmin, cmax)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
B=set()
b=0
for a in A:
    if a>=3200:
        b+=1
    else:
        B.add(a//400)
print(max(1,len(B)),len(B)+b)

Solution (Python):
from collections import defaultdict


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

    color = defaultdict(int)

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

    min_ans = len(color)
    max_ans = len(color)

    if 8 in color:
        min_ans = max(1, min_ans-1)
        max_ans += color[8] - 1

    print(min_ans, max_ans)


if __name__ == "__main__":
    main()

Solution (Python):
li = [0]*9

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

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

print(max(1,sum(li[:-1])),sum(li))

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

ans = [0]*8
leng = 0

for i in range(N):
    now = A[i]//400
    if now < 8:
        ans[now] = 1
    else:
        leng += 1

mi = sum(ans) if sum(ans) > 0 else 1
print(mi, sum(ans) + leng)

Solution (Python):
def main():
    DIFF = 400

    N = int(input())

    ctr = [0] * 9
    for x in map(int, input().split()):
        ctr[min(x // DIFF, 8)] += 1

    le_red = sum(c > 0 for c in ctr[:8])
    gt_red = ctr[8]

    if gt_red:
        if le_red:
            print(le_red, le_red + gt_red)
        else:
            print(1, gt_red)
    else:
        print(le_red, le_red)


if __name__ == '__main__':
    main()

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

ans = [0]*8
leng = 0

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

mi = sum(ans) if sum(ans) > 0 else 1
print(mi, sum(ans) + leng)

Solution (Python):

import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=list(map(int,input().split()))
    check=[0]*8
    tuyo=0
    for i in l:
        x=i//400
        if x>=8:
            tuyo+=1
        else:
            check[x]+=1
    if tuyo==n:
        print(1,tuyo)
    else:
        cnt=0
        for j in check:
            if j>0:
                cnt+=1
        print(cnt,cnt+tuyo)
resolve()

Solution (Python):
import math
import numpy as np

n = int(input())
a = list(map(int, input().split()))
check = [0] * 9
for i, val in enumerate(a):
    tar = math.floor(val / 400)
    if (tar > 8):
        tar = 8

    check[int(tar)] += 1


checkA = np.array(check[:8])

num = np.count_nonzero(checkA != 0)

less = max(num, 1)

more = num + check[8]


print(less, more)
'''
checkA = np.array(check[:8])
num = np.count_nonzero(checkA != 0)
if (num == 0):
    num = 1
rest = 8 - num

more = min(8, num + check[8])

print(num, more)
'''

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
bo = [False] * 8
free = 0
for x in a:
    now = x//400
    if now < 8:
        bo[now] = True
    else:
        free += 1
mi = sum(bo) if sum(bo) > 0 else 1
print(mi, sum(bo) + free)

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

cnt = [0] * 9
free = 0

for _a in a:
    r = _a//400
    if r < 8:
        cnt[r] = 1
    else:
        free += 1

if free == n:
    print(1, free)
else:
    print(sum(cnt), sum(cnt) + free)

Solution (Python):
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()
ans = []
for i in range(n):
    if 1 <= a[i] and a[i] <= 399:
        ans.append('hai')
    if 400 <= a[i] and a[i] <= 799:
        ans.append('tya')
    if 800 <= a[i] and a[i] <= 1199:
        ans.append('midori')
    if 1200 <= a[i] and a[i] <= 1599:
        ans.append('mizu')
    if 1600 <= a[i] and a[i] <= 1999:
        ans.append('ao')
    if 2000 <= a[i] and a[i] <= 2399:
        ans.append('ki')
    if 2400 <= a[i] and a[i] <= 2799:
        ans.append('daidai')
    if 2800 <= a[i] and a[i] <= 3199:
        ans.append('aka')
    if a[i] >= 3200:
        ans.append('nanndemoii')
tmp = 0
for i in range(n):
    if ans[i] == 'nanndemoii':
        tmp += 1
if tmp == n:
    print(1, n)
    exit()

set_ans = list(set(ans))

min_cnt = 0
for i in range(len(set_ans)):
    if set_ans[i] != 'nanndemoii':
        min_cnt += 1

max_cnt = 0
for i in range(n):
    if ans[i] == 'nanndemoii':
        max_cnt += 1
max_cnt += min_cnt
print(min_cnt, max_cnt)

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

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

mx = sum(count[:8]) + count[8]
mn = 0
if sum(count[:8]) == 0 and count[8] != 0:
    mn = 1
else:
    mn = sum(count[:8])

print(mn, mx)

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

Solution (Python):
def resolve():
  n = int(input())
  aa = list(map(int, input().split()))
  s = set()
  num = 0
  for a in aa:
    if a >= 3200:
      num += 1
    else:
      s.add(a // 400)
  print(max(len(s), 1), len(s) + num)
  return

if __name__ == "__main__":
  resolve()

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
ls = [0]*8
now = 0
for i in range(N):
  if 3200 <= A[i]:
    now += 1
  else:
    ls[A[i]//400] += 1
if 8-ls.count(0) >= 1:
  minimum = 8-ls.count(0)
else:
  minimum = 1
print(minimum,8-ls.count(0)+now)

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

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

if len(ALL) == 0:
    print(1,cnt)
else:
    print(len(ALL),len(ALL)+cnt)

Solution (Python):
n = int(input())
rates = set()
over = 0
people = list(map(int, input().split()))
for rate in people:
    if rate // 400 >= 8:
        over += 1
    else:
        rates.add(rate // 400)
print(max(1, len(rates)), len(rates) + over)