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())))
c=[0]*8
k=-1
for i in range(n):
    if a[i]<400:
        c[0]=1
    elif a[i]<800:
        c[1]=1
    elif a[i]<1200:
        c[2]=1
    elif a[i]<1600:
        c[3]=1
    elif a[i]<2000:
        c[4]=1
    elif a[i]<2400:
        c[5]=1
    elif a[i]<2800:
        c[6]=1
    elif a[i]<3200:
        c[7]=1
    else:
        k=i
        break

d=0
for i in range(8):
    if c[i]==1:
        d+=1
if n==1 or d==0:
    print(1, end=" ")
else:
    print(d, end=" ")

if n==1:
    print(1)
elif k==-1:
    print(d)
else:
    print(d+(n-k))

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

def check(n):
    if(n<400):
        color='ash'
    elif(n<800):
        color='brown'
    elif(n<1200):
        color='green'
    elif(n<1600):
        color='water'
    elif(n<2000):
        color='blue'
    elif(n<2400):
        color='yellow'
    elif(n<2800):
        color='orange'
    elif(n<3200):
        color='red'
    else:
        color='free'
    return color
c=[]
r=0
for i in a:
    color=check(i)
    if(color not in c and color!='free'):
        c.append(color)
    elif(color=='free'):
        r+=1
print(max(len(c),1),len(c)+r)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    cnt = 0
    col = set()
    for a in A:
        if a>=3200:
            cnt += 1
        else:
            col.add(a//400)
    print(max(1,len(col)), len(col)+cnt)
if __name__ == '__main__':
    main()

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

l = [0] * 9

for i in range(n):
    s = min(a[i] // 400, 8)
    l[s] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

print(max(m, 1), l[-1] + m)

Solution (Python):
n = int(input())
s = set()
c = 0
for i in map(int, input().split()):
  if i >= 3200:
    c += 1
  else:
    s.add(i//400)
print(max(1, len(s)), len(s)+c)

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
b = set()
d = 0
for i in a:
    c = i // 400
    if c < 8:
        b.add(c)
    else:
        d += 1
print(max(len(b),1),len(b)+d)

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

def CheckColor(a, count):
    if 1 <= a and a <= 399:
        count[0] += 1
    elif 400 <= a and a <= 799:
        count[1] += 1
    elif 800 <= a and a <= 1199:
        count[2] += 1
    elif 1200 <= a and a <= 1599:
        count[3] += 1
    elif 1600 <= a and a <= 1999:
        count[4] += 1
    elif 2000 <= a and a <= 2399:
        count[5] += 1
    elif 2400 <= a and a <= 2799:
        count[6] += 1
    elif 2800 <= a and a <= 3199:
        count[7] += 1
    else:
        count[8] += 1

ans = 0
count = [0 for _ in range(9)]

for a in A:
    CheckColor(a, count)

for c in count[:8]:
    if c != 0:
        ans += 1

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

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
cnt1 = cnt2 = cnt3 = cnt4 = cnt5 = cnt6 = cnt7 = cnt8 = cnt9 = 0
for num in a:
  if 1<=num<400:
    cnt1 += 1
  elif 400<=num<800:
    cnt2 += 1
  elif 800<=num<1200:
    cnt3 += 1 
  elif 1200<=num<1600:
    cnt4 += 1   
  elif 1600<=num<2000:
    cnt5 += 1 
  elif 2000<=num<2400:
    cnt6 += 1
  elif 2400<=num<2800:
    cnt7 += 1
  elif 2800<=num<3200:
    cnt8 += 1
  else:
    cnt9 += 1
cnt = [cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,cnt7,cnt8]

ans = 0
for c in cnt:
  if c != 0:
    ans += 1

print(max(ans,1),ans+cnt9)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
C = set()
d = 0
for a in A:
  c = a // 400
  if c < 8: C.add(c)
  else:
    d += 1
print(max(len(C),1),min(n,len(C) + d))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
wild_cnt = 0
colors = []
for i in a:
  if 1 <= i <= 399:
    colors.append("g")
  elif 400 <= i <= 799:
    colors.append("br")
  elif 800 <= i <= 1199:
    colors.append("gr")
  elif 1200 <= i <= 1599:
    colors.append("wa")
  elif 1600 <= i <= 1999:
    colors.append("bl")
  elif 2000 <= i <= 2399:
    colors.append("y")
  elif 2400 <= i <= 2799:
    colors.append("o")
  elif 2800 <= i <= 3199:
    colors.append("r")
  elif 3200 <= i:
    wild_cnt += 1

if len(set(colors)) == 0:
  print(str(1) + " " + str(min(n,wild_cnt)))
else:
  print(str(len(set(colors)))+ " " +str(min(n,len(set(colors)) + wild_cnt)))

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

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

color = [0] * 8

a = 400 
free = 0
    
for i in range(0,N):
    if rate[i] < a:
        color[0] = 1
    elif a <= rate[i] < 2*a:
        color[1] = 1
    elif 2*a <= rate[i] < 3*a:
        color[2] = 1
    elif 3*a <= rate[i] < 4*a:
        color[3] = 1
    elif 4*a <= rate[i] < 5*a:
        color[4] = 1
    elif 5*a <= rate[i] < 6*a:
        color[5] = 1
    elif 6*a <= rate[i] < 7*a:
        color[6] = 1
    elif 7*a <= rate[i] < 8*a:
        color[7] = 1
    elif 8*a <= rate[i]:
        free += 1
        

min_color = 0
max_color = 0

min_color = color.count(1)
max_color = min_color + free

print( max(min_color,1), max_color)

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

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
lin = [0]*9

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

mi = lin[:-1].count(1)
ma = mi+lin[-1]
if mi == 0:
    mi = 1
print(mi,ma)

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

b=[ai//400 for ai in a]

ans=0
for i in range(8):
    if i in b:
        ans+=1

m=sum([b.count(i) for i in range(8,13)])

print(ans if ans else 1,ans+m)

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
C = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
A_class = []
free_color = 0
from bisect import bisect_right
for a in A:
  cls = bisect_right(C, a)
  if cls == 8:
    free_color += 1
  else:
    A_class.append(cls)

max_class = len(set(A_class)) + free_color
min_class = max(len(set(A_class)), 1)
print(min_class, max_class)

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

licol = [0]*9
for i in range(n):
  if li[i]//400 <= 7:
    licol[li[i]//400] += 1
  else:
    licol[8] += 1
ans = 0
for i in range(8):
  if licol[i] != 0:
    ans += 1
if ans == 0:
  print(1,end=" ")
else:
  print(ans,end=" ")
print(ans+licol[8])

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    C=[0]*9
    n=int(input())
    for a in map(int,input().split()):
        s=a//400
        if(s>=8): C[8]+=1
        else: C[s]+=1

    cnt=sum(1 for i in range(8) if(C[i]))
    print(max(1,cnt),cnt+C[-1])
resolve()

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

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

iro=[0]*8
free=0
for i in range(n):
    if a[i]>=3200:
        free+=1
    else:
        iro[a[i]//400]+=1
print(max(1,8-iro.count(0)),8-iro.count(0)+free)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
c=0
for i in range(n):
    if A[i]>=3200:
        c+=1
        A[i]=8
    else:
        A[i]//=400
m=len(set(A))
if c:
    if m==1:
        print(1,c)
    else:
        print(m-1,m-1+c)
else:
    print(m,m)

Solution (Python):
N = int(input())
array = list(map(int,input().split()))
hai = []
tya = []
midori = []
mizu = []
ao = []
ki = []
dai = []
aka = []
mu = []
for i in array:
    if i <= 399:
        hai.append(i)
        continue
    if i <= 799:
        tya.append(i)
        continue
    if i <= 1199:
        midori.append(i)
        continue
    if i <= 1599:
        mizu.append(i)
        continue
    if i <= 1999:
        ao.append(i)
        continue
    if i <= 2399:
        ki.append(i)
        continue
    if i <= 2799:
        dai.append(i)
        continue
    if i <= 3199:
        aka.append(i)
        continue
    mu.append(i)
ans = 0
if len(hai) != 0:
    ans += 1
if len(tya) != 0:
    ans += 1
if len(midori) != 0:
    ans += 1
if len(mizu) != 0:
    ans += 1
if len(ao) != 0:
    ans += 1
if len(ki) != 0:
    ans += 1
if len(dai) != 0:
    ans += 1
if len(aka) != 0:
    ans += 1
ans_min = max(ans,1)
ans_max = ans + len(mu)
print(ans_min,ans_max)

Solution (Python):
L = [["A", 1, 399],
	["B", 400, 799],
	["C", 800, 1199],
	["D", 1200, 1599],
	["E", 1600, 1999],
	["F", 2000, 2399],
	["G", 2400, 2799],
	["H", 2800, 3199],
    ["I", 3200, 4800]]

N = int(input())
P = [int(i) for i in input().split()]
C = []

cnt_I = 0
for i in P:
  if i >= 3200:
    cnt_I += 1
  for c, m, x in L:
      if m <= i and i <= x:
        C.append(c)
        break
        
if "I" in C:
  mx = len(set(C)) - 1 + cnt_I
  mn = len(set(C)) - 1
  if mn == 0:
    mn = 1
else:
  mx = len(set(C))
  mn = len(set(C))

print(mn, mx)

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

d = [0, 0, 0, 0, 0, 0, 0, 0, 0]


for i in a:
  if i < 400:
    d[0] = 1
    continue
  elif i < 800:
    d[1] = 1
  elif i < 1200:
    d[2] = 1
  elif i < 1600:
    d[3] = 1
  elif i < 2000:
    d[4] = 1
  elif i < 2400:
    d[5] = 1
  elif i < 2800:
    d[6] = 1
  elif i < 3200:
    d[7] = 1
  else:
    d[8] += 1
    
min = sum(d[:-1])
if min == 0:
  min = 1
max = sum(d)
print(min, max)

Solution (Python):
from collections import OrderedDict
rate = (
  ('gray', 400),
  ('brown', 800),
  ('green', 1200),
  ('water', 1600),
  ('blue', 2000),
  ('yellow', 2400),
  ('orange', 2800),
  ('red', 3200),
  ('rainbow', 4801),
)

n = int(input())
a = []
for i in map(int, input().split()):
  for color, border in rate:
    if i < border:
      a.append(color)
      break

rainbow = 0
colors = list(set(a))
if 'rainbow' in colors:
  rainbow = a.count('rainbow')
  colors.remove('rainbow')
  if len(colors) == 0:
    colors.append('rainbow')
    print(len(colors), rainbow)
    exit(0)

print(len(colors), len(colors)+rainbow)

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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a1=0
a2=0
a3=0
a4=0
a5=0
a6=0
a7=0
a8=0
wild=0
for i in range(n):
    if 0<=a[i]<=399:
        a1+=1
    elif 400<=a[i]<=799:
        a2+=1
    elif 800<=a[i]<=1199:
        a3+=1
    elif 1200<=a[i]<=1599:
        a4+=1
    elif 1600<=a[i]<=1999:
        a5+=1
    elif 2000<=a[i]<=2399:
        a6+=1
    elif 2400<=a[i]<=2799:
        a7+=1
    elif 2800<=a[i]<=3199:
        a8+=1
    else:
        wild+=1
ans=0
r=[]
r.append(a1)
r.append(a2)
r.append(a3)
r.append(a4)
r.append(a5)
r.append(a6)
r.append(a7)
r.append(a8)
for i in range(8):
    if r[i]!=0:
        ans+=1
print(max(ans,1),ans+wild)

Solution (Python):
from collections import Counter as C
N = int(input())
A = C([min(int(a)//400, 8) for a in input().split()])

a = sum([A[i]>0 for i in range(8)])
print(max(a, 1), a+A[8])

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

if ans==0:
  ans=1
print(ans,ans1)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
C=set()
d=0
for a in A:
    c=a//400
    if c<8:C.add(c)
    else:d+=1
print(max(len(C),1),len(C)+d)

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

Solution (Python):
gray, brown, green, sky_blue, blue, yellow, orange, red = [0] * 8
N = int(input())
alist = list(map(int, input().split()))
free = 0
for a in alist:
    if 1 <= a <= 399:
        gray += 1
    elif 400 <= a <= 799:
        brown += 1
    elif 800 <= a <= 1199:
        green += 1
    elif 1200 <= a <= 1599:
        sky_blue += 1
    elif 1600 <= a <= 1999:
        blue += 1
    elif 2000 <= a <= 2399:
        yellow += 1
    elif 2400 <= a <= 2799:
        orange += 1
    elif 2800 <= a <= 3199:
        red += 1
    else:
        free += 1
colors = [color for color in [gray, brown, green, sky_blue, blue, yellow, orange, red] if color > 0]
print(max(1, len(colors)), len(colors) + free)

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

C=[0,0,0,0,0,0,0,0]
R=0

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

m=0
for i in range(8):
    if C[i]>0:
        m+=1
if m==0:
    print(1,R)
else:
    print(m,m+R)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
mighty = 0
s = set()
for x in A:
    if x < 400:
        s.add('gray')
    elif x < 800:
        s.add('brown')
    elif x < 1200:
        s.add('green')
    elif x < 1600:
        s.add('water')
    elif x < 2000:
        s.add('blue')
    elif x < 2400:
        s.add('yellow')
    elif x < 2800:
        s.add('orange')
    elif x < 3200:
        s.add('red')
    else:
        mighty += 1
answer = max(1, len(s))
answer_max = answer + mighty
answer_max = min(answer_max, N)
print(answer, answer_max)

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

def col(x):
  if x >= 1 and x <= 399:
    return 'glay'
  elif x >= 400 and x <= 799:
    return 'brown'
  elif x >= 800 and x <= 1199:
    return 'green'
  elif x >= 1200 and x <= 1599:
    return 'light-blue'
  elif x >= 1600 and x <= 1999:
    return 'blue'
  elif x >= 2000 and x <= 2399:
    return 'yellow'
  elif x >= 2400 and x <= 2799:
    return 'orange'
  elif x >= 2800 and x <= 3199:
    return 'red'
  else:
    return 'joker'

Col_Lst = []
count = 0
count_joker = 0
for num in range(N):
  color = col(lst[num])
  if color == 'joker':
    count_joker += 1
  else:
    if color in Col_Lst:
      pass
    else:
      count += 1
  Col_Lst.append(color)

mn = 0
mx = 0
if count == 0:
  mn = 1
  mx = count_joker
else:
  mn = count
  mx = count + count_joker
  
print('%d %d' %(mn, mx))

Solution (Python):
def examC():
    N = I()
    a = LI()
    d = defaultdict(int)
    for i in a:
        d[min(i//400,8)] += 1
    ansL = len(d)
    ansR = len(d)
    if d[8]!=0:
        ansL = max(ansL-1,1)
        ansR = ansR + d[8]-1
    print(ansL, ansR)


import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

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

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

agg = [0] * 9
free = 0

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

minimum = len([x for x in agg if x > 0])
maximum = minimum + free
if minimum == 0:
    minimum = 1

print(minimum, maximum)

Solution (Python):

N = int(input())
a = list(map(int, input().split()))
L = [0 for i in range(8)]
s = 0
for i in range(N):
    if a[i] < 3200:
        L[a[i]//400] = L[a[i]//400] + 1
    else:
        s = s + 1
n = 0
for i in range(8):
    if L[i] > 0:
        n = n + 1
nmin = n
nmax = n + s
if nmin == 0:
    nmin = 1
print(str(nmin)+" "+str(nmax))

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

Solution (Python):
N = int(input())
A = [0 for _ in range(9)]
for a in map(int,input().split()):
  A[min(a//400,8)]+=1
rate_num = 8-A[:-1].count(0)
print(max(1,rate_num), rate_num+A[-1])

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

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

print(str(min_ans)+' '+str(min_ans+count))

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

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

if count==0:
    min1=min_ans
elif min_ans==0:
    min1=1
else:
    min1=max(1,min_ans)
max1=min_ans+count
print(min1,max1)

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

ans = [0] * 8
over_3200 = 0

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

print(max(sum(ans), 1), end=' ')
print(sum(ans) + over_3200)

Solution (Python):
N=int(input())
A = list(map(int, input().split()))
gray=any([1<=i<=399 for i in A])
brown=any([400<=i<=799 for i in A])
green=any([800<=i<=1199 for i in A])
sky=any([1200<=i<=1599 for i in A])
blue=any([1600<=i<=1999 for i in A])
yellow=any([2000<=i<=2399 for i in A])
orange=any([2400<=i<=2799 for i in A])
red=any([2800<=i<=3199 for i in A])
color_list=[gray,brown,green,sky,blue,yellow,orange,red]
count= color_list.count(True)
change=len([i for i in A if 3200<=i])
if count==0:
    print(1,change)
else:
    print(count,count+change)

Solution (Python):
N=int(input())
A = list(map(int, input().split()))
gray=any([1<=i<=399 for i in A])
brown=any([400<=i<=799 for i in A])
green=any([800<=i<=1199 for i in A])
sky=any([1200<=i<=1599 for i in A])
blue=any([1600<=i<=1999 for i in A])
yellow=any([2000<=i<=2399 for i in A])
orange=any([2400<=i<=2799 for i in A])
red=any([2800<=i<=3199 for i in A])
color_list=[gray,brown,green,sky,blue,yellow,orange,red]
count= color_list.count(True)
change=len([i for i in A if 3200<=i])
if count==0:
    print(1,change)
else:
    print(count,count+change)

Solution (Python):

a=int(input())
b=[]
c=[0,0,0,0,0,0,0,0,0]
ans1=0
ans2=0
jdg=0

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

for i in range(a):
    if(int(b[i])<3200):
        jdg=int(b[i]/400)
        c[jdg]+=1
    else:
        c[8]+=1

for i in range(8):
    if(c[i] >= 1):
        ans1+=1
ans2=ans1+c[8]
if(ans1==0):
    ans1=1

print('%d %d' % (ans1, ans2))

Solution (Python):
people = int(input())
rates = list(map(int, input().split(' ')))
colors = [0 for i in range(8)]

color_var = 0
for i in range(people):
    if rates[i] // 400 <= 7:
        if colors[rates[i] // 400] == 0 :
            colors[rates[i] // 400] += 1
    else:
        color_var += 1
        
min_colors = max(colors.count(1), 1)
max_colors = colors.count(1) + color_var

print(min_colors, max_colors)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
col=[False for i in range(8)]
val=0
count=0
for i in range(n):
  m=l[i]
  if m<400:
    col[0]=True
  if 400<=m<800:
    col[1]=True
  if 800<=m<1200:
    col[2]=True
  if 1200<=m<1600:
    col[3]=True
  if 1600<=m<2000:
    col[4]=True
  if 2000<=m<2400:
    col[5]=True
  if 2400<=m<2800:
    col[6]=True
  if 2800<=m<3200:
    col[7]=True
  if m>=3200:
    val+=1
for i in range(8):
  if col[i]:
    count+=1
print(max(1,count),count+val)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
c=[0,0,0,0,0,0,0,0]
d=0
for x in a:
  if x<400 and c[0]==0:
    c[0]+=1
  elif 399<x<800 and c[1]==0:
    c[1]+=1
  elif 799<x<1200 and c[2]==0:
    c[2]+=1
  elif 1199<x<1600 and c[3]==0:
    c[3]+=1
  elif 1599<x<2000 and c[4]==0:
    c[4]+=1
  elif 1999<x<2400 and c[5]==0:
    c[5]+=1
  elif 2399<x<2800 and c[6]==0:
    c[6]+=1
  elif 2799<x<3200 and c[7]==0:
    c[7]+=1
  elif 3199<x:
    d+=1
e=sum(c)
print(max(e,1),e+d)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
data=[0]*9
for i in range(n):
    if a[i]//400>=8:
        data[8]+=1
    else:
        data[a[i]//400]+=1
count=0
for i in range(8):
    if data[i]!=0:
        count+=1
if count==0:
    print("1"+" "+str(data[8]))
else:
    print(str(count)+" "+str(count+data[8]))

Solution (Python):
import copy
import heapq
import math
import fractions

def j(n):
    if n:print("Yes")
    else:print("No")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printmultiplerow(a):
    for i in a:
        print(i)
def printrow(a):
    for i in range(len(a)-1):
        print(a[i],end = " ")
    print(a[-1])



n = ip()
a = iprow()
for i in range(n):
    a[i]//=400
any = 0
for i in range(n):
    if a[i] >=8:
        a[i]=-1
        any+=1
for i in range(n-1,-1,-1):
    if a[i]==-1:
        a.pop(i)
l = len(set(a))
print(max(1,l),l+any)

Solution (Python):
N = int(input())
an = list(map(int, input().split()))
over_cnt = 0
colors = []
for a in an:
    rate = a // 400
    if rate >= 8:
        over_cnt += 1
    elif rate not in colors:
        colors.append(rate)

print(max(len(colors), 1), len(colors) + over_cnt)

Solution (Python):
def read_input():
  n = int(input())
  a = [int(item) for item in input().split()]
  return n,a

def main():
  n,a = read_input()
  l = [0 for i in range(8)]
  experts = 0
  for score in a:
    if score > 3199:
      experts += 1
    else:
      l[score//400] += 1
  minimum = 8-l.count(0)
  maximum = minimum + experts
  if minimum == 0:
    minimum = 1
  print(minimum, maximum)

if __name__ == '__main__':
  main()

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
a.sort()
c = [0] * 9
for i in range(N):
  if a[i] // 400 > 8:
    c[8] += 1
  else:
    c[a[i] // 400] += 1
res = 0
for i in range(8):
  res += c[i] > 0
print(max(res, 1), res + c[8])

Solution (Python):
N = int(input())
List = input().split()
counter = [0 for _ in range(8)]
prime = 0
for item in List:
  if int(item) >=3200:
    prime +=1
  else:
    num = int(item)//400
    counter[num] += 1

minimum = max(8 - counter.count(0),1)
if counter.count(0) != 8:
  maximum = minimum + prime
else:
  maximum = prime
  
print(minimum, maximum)

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

N = int(input())
rating = [int(r) for r in input().split()]
rating.sort()

color = ['gray', 'brown', 'green', 'cyan', 'blue', 'yellow', 'orange', 'red']
c_count = {c: 0 for c in color}

count_over = 0
for r in rating:
    if r < 400:    c_count[color[0]] += 1
    elif r < 800:  c_count[color[1]] += 1
    elif r < 1200: c_count[color[2]] += 1
    elif r < 1600: c_count[color[3]] += 1
    elif r < 2000: c_count[color[4]] += 1
    elif r < 2400: c_count[color[5]] += 1
    elif r < 2800: c_count[color[6]] += 1
    elif r < 3200: c_count[color[7]] += 1
    else:          count_over += 1
     
dif_c_count = 0
for v in c_count.values():
    if v != 0: dif_c_count += 1 

mini, maxi = dif_c_count if dif_c_count != 0 else 1, dif_c_count + count_over
print(mini, maxi)

Solution (Python):
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    A = string_to_int(inputs[0])
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
    rate_num = len(rate)

    counter_overs = 0
    rate_set = set()
    for a in A:
        if a >= 3200:
            counter_overs += 1
        else:
            hit = None
            for i, r in enumerate(reversed(rate)):
                if a <= r:
                    hit = i
            rate_set.add(hit)
    if len(rate_set) == 0:
        
        max_num = counter_overs
        min_num = 1
    else:
        sum_all = len(rate_set) + counter_overs
        
        max_num = sum_all
        min_num = len(rate_set)
    return "{} {}".format(min_num, max_num)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)

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

    R = [1]
    for i in range(1, 8):
        R.append(400 * i)
    
    
    st = set()
    free = 0
    for ai in A:
        if ai >= 3200:
            free += 1
            continue
        for ri in R[::-1]:
            if ai >= ri:
                st.add(ri)
                break
    
    
    

    print(max(1, len(st)), len(st) + free)

if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np

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

colors = np.array([0 for _ in range(9)])
for a in A:
    if 1 <= a <= 399: colors[0] += 1
    elif 400 <= a <= 799: colors[1] += 1
    elif 800 <= a <= 1199: colors[2] += 1
    elif 1200 <= a <= 1599: colors[3] += 1
    elif 1600 <= a <= 1999: colors[4] += 1
    elif 2000 <= a <= 2399: colors[5] += 1
    elif 2400 <= a <= 2799: colors[6] += 1
    elif 2800 <= a <= 3199: colors[7] += 1
    else: colors[8] += 1

if colors[8] == 0:
    ans = len(colors[colors > 0])
    print(ans, ans)
else:
    legend = colors[8]
    colors = colors[:8]
    v = len(colors[colors > 0])
    print(max(1, v), v + legend)