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())

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

memo = [0]*9

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

ans = 0

for i in range(len(memo)):
    if i == 8:
        ex = memo[-1]
    elif memo[i] != 0:
        ans += 1

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

Solution (Python):
n = int(input())
array = [int(item) for item in input().split()][:n]
colors = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for rate in array:
    if rate > 0 and rate < 400:
        colors[0] += 1
    elif rate < 800:
        colors[1] += 1
    elif rate < 1200:
        colors[2] += 1
    elif rate < 1600:
        colors[3] += 1
    elif rate < 2000:
        colors[4] += 1
    elif rate < 2400:
        colors[5] += 1
    elif rate < 2800:
        colors[6] += 1
    elif rate < 3200:
        colors[7] += 1
    elif rate <= 4800:
        colors[8] += 1

count = 0
count += 1 if colors[0] > 0 else 0
count += 1 if colors[1] > 0 else 0
count += 1 if colors[2] > 0 else 0
count += 1 if colors[3] > 0 else 0
count += 1 if colors[4] > 0 else 0
count += 1 if colors[5] > 0 else 0
count += 1 if colors[6] > 0 else 0
count += 1 if colors[7] > 0 else 0
min = count
count += colors[8]
max = count
if colors[8] > 0 and min == 0:
    min = 1

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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
cc=Counter()
cnt=0
for i in a:
    if i<=399:
        cc['gray']+=1
    elif i<=799:
        cc['brown']+=1
    elif i<=1199:
        cc['green']+=1
    elif i<=1599:
        cc['cyan']+=1
    elif i<=1999:
        cc['blue']+=1
    elif i<=2399:
        cc['yellow']+=1
    elif i<=2799:
        cc['orange']+=1
    elif i<=3199:
        cc['red']+=1
    else:
        cnt+=1
mini=len(cc)
if len(cc)==0:
    mini=1
else:
    mini=len(cc)
maxi=len(cc)+cnt
print(mini,maxi)

Solution (Python):
input();l=[0]*8;c=0
for i in map(int,input().split()):
  i//=400
  if i<8: l[i]=1
  else: c+=1
s=sum(l);print(max(s,1),s+c)

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

Solution (Python):

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

color=[0 for i in range(8)]
free=0

for rate in a:
    if(rate<=399):
        color[0]+=1
    elif(rate<=799):
        color[1]+=1
    elif(rate<=1199):
        color[7]+=1
    elif(rate<=1599):
        color[2]+=1
    elif(rate<=1999):
        color[3]+=1
    elif(rate<=2399):
        color[4]+=1
    elif(rate<=2799):
        color[5]+=1
    elif(rate<=3199):
        color[6]+=1
    else:
        free+=1

if(free == N ):
    print(1,free)
else:
    ans=len([i for i in color if i != 0])
    print(ans,ans+free)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
lst=[0]*8
num=0
for i in range(n):
  if 3200<=a[i]:
    num+=1
  for j in range(8):
    if 400*j<=a[i]<400*(j+1):
      if lst[j]==0:
        lst[j]+=1

print(*[max(1,sum(lst)),sum(lst)+num])

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

rate = [False] * 9

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

not_free_rate = rate.count('T')
free_rate = rate[8]


if not_free_rate == 0:
    min_num = 1
else:
    min_num = not_free_rate


print(min_num, not_free_rate+free_rate)

Solution (Python):
def ratecolor(List):
    ratebar = [0]*8
    for r in List:
        if r>=1 and r<400:
            ratebar[0]=1
        elif r>=400 and r<800:
            ratebar[1]=1
        elif r>=800 and r<1200:
            ratebar[2]=1
        elif r>=1200 and r<1600:
            ratebar[3]=1
        elif r>=1600 and r<2000:
            ratebar[4]=1
        elif r>=2000 and r<2400:
            ratebar[5]=1
        elif r>=2400 and r<2800:
            ratebar[6]=1
        else:
            ratebar[7]=1
        
    l = len([i for i in ratebar if i>=1])
    
    return l
    

N = int(input())
A = [int(i) for i in input().split(" ")]
_3200 = [i for i in A if i<3200]
Upper3200 = len([i for i in A if i>=3200])

n = ratecolor(_3200)

if n==0:
    print("{} {}".format(1,Upper3200))
else:
    print("{} {}".format(n,n+Upper3200))

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,2801,400):
  for j in range(N):
    if i<=a[j]<=399+i:
      count+=1
      break
c=0
for i in range(N):
  if 3200<=a[i]:
    c+=1

if count!=0:
  print(count,count+c)
else:
  print(1,c)

Solution (Python):

import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque


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

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

Min = max(sum(cnt[:8]),1)
Max = sum(cnt[:8]) + cnt[8]

print(Min, Max)

Solution (Python):

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

color = set()
flg = 0
for ai in a:
    if ai // 400 < 8:
        color.add(ai // 400)
    else:
        flg += 1
        
if len(color) == 0:
    print(1, len(color) + flg)
else:
    print(len(color), len(color) + flg)

Solution (Python):
from bisect import bisect_left
import numpy as np

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

border = np.arange(399, 3200, 400)
cnt = np.zeros(len(border) + 1, dtype=np.int)
for i in a:
    cnt[bisect_left(border, i)] += 1

k = np.count_nonzero(cnt[:-1])
print(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])

Solution (Python):
import numpy as np

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

border = list(range(400, 3201, 400))
cnt = [0] * (len(border) + 1)
for aa in a:
    for i, k in enumerate(border):
        if aa < k:
            cnt[i] += 1
            break
    else:
        cnt[i+1] += 1

k = np.count_nonzero(cnt[:-1])
print(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])

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

border = list(range(400, 3201, 400))
cnt = [0] * (len(border) + 1)
for aa in a:
    for i, k in enumerate(border):
        if aa < k:
            cnt[i] += 1
            break
    else:
        cnt[i+1] += 1

k = len([i for i in cnt[:-1] if i > 0])
print(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])

Solution (Python):
from bisect import bisect_left
import numpy as np

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

border = np.arange(399, 3200, 400)
cnt = [0] * (len(border) + 1)
for i in a:
    cnt[bisect_left(border, i)] += 1

k = np.count_nonzero(cnt[:-1])
print(k, k + cnt[-1]) if k != 0 else print(1, cnt[-1])

Solution (Python):

import math
import itertools
import statistics

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



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


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


ans_max = ans+count[8]

"""
if ans+count[8] <= 8:
    ans_max = ans+count[8]
else:
    ans_max = 8
"""
   
if ans==0:
    ans = 1

print(str(ans)+" "+str(ans_max))

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

Solution (Python):
from bisect import bisect_right
from collections import Counter

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

rate = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]

idx = []

for a in A:
    idx.append(bisect_right(rate, a))



c = Counter(idx)



min_c = len(c.keys())
if (7 in c.keys()) and (8 in c.keys()):
    min_c -= 1
max_c = 0
for i in range(8):
    if i in c.keys():
        max_c += 1
if 8 in c.keys():
    
    
    max_c += c[8]
    
    

print(min_c, max_c)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ans=[0]*9
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:
    ans[8]+=1
print(max(sum(ans[:8]),1),sum(ans))

Solution (Python):
def solve():
    _ = int(input())
    a = list(map(int, input().split()))
    
    counter = [0] * 9
    for ai in a:
        counter[min(8, ai // 400)] += 1
    
    ans_min = 0
    for i in range(8):
        if 0 < counter[i]:
            ans_min += 1
    
    ans_max = ans_min + counter[-1]
    if ans_min == 0:
        ans_min = 1
    print(ans_min, ans_max)


if __name__ == '__main__':
    solve()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
cnt=[0]*9
for i in a:
  k=i//400
  if k>=8:
    cnt[8]+=1
  else:
    cnt[k]+=1
z=0
for i in range(8):
  if cnt[i]>=1:
    z+=1
print(1 if z==0 else z,z+cnt[8])

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

for p in a:
  if p<=399:
    con.add("灰")
  elif p<=799:
    con.add("茶")
  elif p<=1199:
    con.add("緑")
  elif p<=1599:
    con.add("水")
  elif p<=1999:
    con.add("青")
  elif p<=2399:
    con.add("黄")
  elif p<=2799:
    con.add("橙")
  elif p<=3199:
    con.add("赤")
  else:
    wild +=1
    
mini=max(1,len(con))
maxi=len(con)+wild
print(mini,maxi)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
C = [a // 400 for a in A]
mini = sum([1 for c in range(8) if c in C])
print(max(mini, 1), mini + sum([1 for c in C if c >= 8]))

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

scores = [0, 0, 0, 0, 0, 0, 0, 0]
x = [0]

def evaluation(list):
    for i in list:
        if 0 <= i <= 399:
            scores[0] = 1
        elif 400 <= i <= 799:
            scores[1] = 1
        elif 800 <= i <= 1199:
            scores[2] = 1
        elif 1200 <= i <= 1599:
            scores[3] = 1
        elif 1600 <= i <= 1999:
            scores[4] = 1
        elif 2000 <= i <= 2399:
            scores[5] = 1
        elif 2400 <= i <= 2799:
            scores[6] = 1
        elif 2800 <= i <= 3199:
            scores[7] = 1
        else:
            x.append(1)

evaluation(l)

y = sum(scores)
z = sum(x)

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

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

scores = [0, 0, 0, 0, 0, 0, 0, 0]
x = 0

def evaluation(list):
    for i in list:
        if 0 <= i <= 399:
            scores[0] = 1
        elif 400 <= i <= 799:
            scores[1] = 1
        elif 800 <= i <= 1199:
            scores[2] = 1
        elif 1200 <= i <= 1599:
            scores[3] = 1
        elif 1600 <= i <= 1999:
            scores[4] = 1
        elif 2000 <= i <= 2399:
            scores[5] = 1
        elif 2400 <= i <= 2799:
            scores[6] = 1
        elif 2800 <= i <= 3199:
            scores[7] = 1

for j in range(n):
    if l[j] >= 3200:
        x += 1

evaluation(l)
y = sum(scores)

if n==1:
    print(1,1)
else:
    print(max(1, y), y + x)

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    a[i] = a[i] // 400
    if a[i] >= 8:
        a[i] = 8
non_free = [i for i in a if i != 8]
if len(non_free) == 0:
    min_ans = 1
    max_ans = a.count(8)
else:
    min_ans = len(set(non_free))
    max_ans = len(set(non_free)) + a.count(8)
print(min_ans, max_ans)

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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
r=[0]*8
f=0

for i in range(n):
    if(a[i]>=3200):
        f+=1
    else:
        r[a[i]//400]=1;

c=sum(r)

print(1 if(c==0) else c,end=" ")
print(f+c)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
w = [0 for i in range(8)]
count = 0
sup = 0
for i in a:
    if i < 3200 and w[i//400]==0:
        count+=1
        w[i//400] += 1
    elif i >= 3200:
        sup += 1
if count == 0:
    print(1,sup)
elif sup == 0:
    print(count,count)
else:
    b= count+sup
    print(count,b)

Solution (Python):
N = int(input())
check = [False]*8
over = 0
a_s = list(map(int, input().split()))
for a in a_s:
  if 1 <=a<=399:
    check[0] = True
  elif 400<=a<=799:
    check[1]=True
  elif 800<=a<=1119:
    check[2]=True
  elif 1200<=a<=1599:
    check[3]=True
  elif 1600<=a<=1999:
    check[4]=True
  elif 2000<=a<=2399:
    check[5]=True
  elif 2400<=a<=2799:
    check[6]=True
  elif 2800<=a<=3199:
    check[7]=True
  if a >= 3200:
    over += 1
mn = check.count(True)

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
a = LIST()
a.sort()
arr = [0, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
r = -1
for i in range(len(arr)):
    if a[0] < arr[i]:
        r = i
        break
ans = 1 if r != -1 else 0
ans2 = 0
for i in range(n):
    if a[i] >= arr[r]:
        r = -1
        for j in range(len(arr)):
            if a[i] < arr[j]:
                r = j
                break
        if r == -1:
            ans2 += 1
        else:
            ans += 1
print(ans if ans > 0 else 1, ans + ans2)

Solution (Python):
num = int(input())
list = [int(x) for x in input().split()]

count = 0
any = 0

color = []

for i in range(num):
    if 1 <= list[i] < 400:
        color.append("gray")
    elif 400 <= list[i] < 800:
        color.append("brown")
    elif 800 <= list[i] < 1200:
        color.append("green")
    elif 1200 <= list[i] < 1600:
        color.append("sky")
    elif 1600 <= list[i] < 2000:
        color.append("blue")
    elif 2000 <= list[i] < 2400:
        color.append("yellow")
    elif 2400 <= list[i] < 2800:
        color.append("orange")
    elif 2800 <= list[i] < 3200:
        color.append("red")
    else:
        color.append("any")



if "gray" in color:
    count += 1
else:
    None


if "brown" in color:
    count += 1
else:
    None


if "green" in color:
    count += 1
else:
    None


if "sky" in color:
    count += 1
else:
    None


if "blue" in color:
    count += 1
else:
    None


if "yellow" in color:
    count += 1
else:
    None


if "orange" in color:
    count += 1
else:
    None


if "red" in color:
    count += 1
else:
    None



if count == 0:
    print("1",color.count("any"))
else:
    print(count,count+color.count("any"))

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

l = [False] * 8
top = 0
for i, val in enumerate(a):
    if 1 <= val <= 399:
        l[0] = True
    if 400 <= val <= 799:
        l[1] = True
    if 800 <= val <= 1199:
        l[2] = True
    if 1200 <= val <= 1599:
        l[3] = True
    if 1600 <= val <= 1999:
        l[4] = True
    if 2000 <= val <= 2399:
        l[5] = True
    if 2400 <= val <= 2799:
        l[6] = True
    if 2800 <= val <= 3199:
        l[7] = True
    if 3200 <= val:
        top += 1

c = l.count(True)
mn = c if c != 0 else 1
mx = c + top
print("{} {}".format(mn, mx))

Solution (Python):
N=int(input())
A=[int(i) for i in input().split()]
col=[0 for i in range(9)]
for a in A:
  if a<3200:
    col[a//400]+=1
  else:
    col[-1]+=1
ans=0

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

MIN=1 if ans==0 else ans
MAX=ans+col[-1]
print(MIN,MAX)

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = a[i]//400
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1
        
mini = max(sum(rate_list), 1)
maxi = sum(rate_list)+perfect

print(mini, maxi)

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

colors = ["gray","brown","green","water","blue","yellow","orange","red","other"]
d = {x: 0 for x in colors}

for x in a:
    rate = x // 400
    if rate == 0:
        d["gray"] += 1
    elif rate == 1:
        d["brown"] += 1 
    elif rate == 2:
        d["green"] += 1 
    elif rate == 3:
        d["water"] += 1 
    elif rate == 4:
        d["blue"] += 1 
    elif rate == 5:
        d["yellow"] += 1 
    elif rate == 6:
        d["orange"] += 1 
    elif rate == 7:
        d["red"] += 1 
    elif rate > 7:
        d["other"] += 1 

num = 0
for x in d:
    if d[x] > 0 and x != "other":
        num += 1

if num == 0:
    print("1" + " " + str(d["other"]))
else:
    print(num, num+d["other"])

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(8):
    
    if len([j for j in a if j > 400*i-1 and j < 400*(i+1)]) > 0:
       ans += 1 
ans_min = ans
ans_max = ans + len([i for i in a if 3200 <= i])
print(max(ans_min,1),max(ans_max,1))

Solution (Python):
MIN=set()
tourist=0

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

for i in range(n):
  if a[i]>=3200:
    tourist+=1
  else:
    for g in range(1,9):
        low=(g-1)*400
        high=g*400-1
        if low<=a[i] and a[i]<=high:
          MIN.add(g)

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

Solution (Python):
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

cl = 8-c[:-1].count(0)
cmin = max(1, cl)
cmax = cl+c[8]
print(cmin, cmax)

Solution (Python):
def rate(n:int) ->str:
    if 1 <= n <= 399:
        return 'hai'
    elif n <= 799:
        return 'cha'
    elif n <= 1199:
        return 'mido'
    elif n <= 1599:
        return 'mizu'
    elif n <= 1999:
        return 'ao'
    elif n <= 2399:
        return 'ki'
    elif n <= 2799:
        return 'dai'
    elif n <= 3199:
        return 'aka'
    else:
        return 'neutral'

def main():
    n = int(input())
    a = [int(x) for x in input().split()]
    d = {}
    n_count = 0
    for aa in a:
        buf = rate(aa)
        if buf == 'neutral':
            n_count += 1
            continue
        if buf not in d:
            d[buf] = 0
        d[buf] += 1
    if n_count >= 1:
        if d:
            print(len(d.values()),len(d.values()) + n_count)
        else:
            print('1',n_count)
    else:
        print(len(d.values()),len(d.values()))

if __name__ == '__main__':
    main()

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

color = [False for _ in range(8)]
wild = 0
for i in a:
    if i < 3200:
        color[i // 400] = True
    else:
        wild += 1

mini = 0
for i in color:
    if i:
        mini += 1
if mini == 0:
    mini = 1
    maxi = wild
else:
    maxi = mini + wild
print(mini, maxi)

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

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

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

color = {1:[],2:[], 3:[],4:[],5:[],6:[],7:[],8:[]}
suki = []
iroiro = 0
for i in range(n):
    if a[i] < 1600:
        if a[i] < 800:
            if a[i] < 400:
                color[1].append(a[i])
            else:
                color[2].append(a[i])
        else:
            if a[i] < 1200:
                color[3].append(a[i])
            else:
                color[4].append(a[i])
    else:
        if a[i] < 2400:
            if a[i] < 2000:
                color[5].append(a[i])
            else:
                color[6].append(a[i])
        else:
            if a[i] < 2800:
                color[7].append(a[i])
            elif 2800 <= a[i] < 3200:
                color[8].append(a[i])
            else:
                suki.append(a[i])

for k in color.keys():
    if len(color[k]) != 0:
        iroiro += 1
    else:
        pass
Co = len(suki)
if iroiro != 0:
    ans = iroiro + Co
    print(iroiro,ans)
else:
    print(1,Co)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(n):
    if a[i]<=399:
        c.append('0')
    elif a[i]<=799:
        c.append('1') 
    elif a[i]<=1199:
        c.append('2')
    elif a[i]<=1599:
        c.append('3')
    elif a[i]<=1999:
        c.append('4')
    elif a[i]<=2399:
        c.append('5')
    elif  a[i]<=2799:
        c.append('6')
    elif  a[i]<=3199:
        c.append('7')
x=n-len(c)

c=list(set(c))

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

Solution (Python):
N=int(input())
A=[int(x)for x in input().split()]
array=[0]*9
def wake(x):
    if x<3200:
        array[x//400]+=1
    else:
        array[8]+=1
    return
for i in A:
    wake(i)
ans1=sum(1 for x in array[:-1]if x>0)
ans=8-array.count(0)
if array[8]==0:
    ans+=1
else:
    ans+=array[8]

if ans1==0:
    ans1+=1

print(ans1,ans)

Solution (Python):
n=int(input())
s=list(map(int,input().split()))
l=[0 for _ in range(13)]
for x in s:
    l[x//400]+=1
j=sum(r>0 for r in l[:8])
print(max(1,j),j+sum(l[8:]))

Solution (Python):

from collections import Counter, deque







import sys



ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(input())
    a = list(map(int,ipti().split()))
    color = [0] * 8
    over_3199 = 0

    for i in range(n):
        c = a[i]//400
        if c < 8:
            color[c] = 1
        else:
            over_3199 += 1

    color_sum = sum(color)
    ans_min = max(color_sum, 1)
    ans_max = color_sum + over_3199

    print(ans_min, ans_max)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
scorelist = list(map(int, input().split(" ")))
color1 = len(set([int(i/400) for i in scorelist if i < 3200]))
color2 = len([i for i in scorelist if i >= 3200])
ans_min = max(1, color1)
ans_max = color1 + color2
print("{} {}".format(ans_min, ans_max))

Solution (Python):


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

scorelist = list(map(int, input().rstrip().split(" ")))

color1 = len(set([int(i/400) for i in scorelist if i < 3200]))

color2 = len([i for i in scorelist if i >= 3200])

ans_min = max(1, color1)
ans_max = color1 + color2

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

Solution (Python):
N=int(input())
rates=list(map(int,input().split()))
colors=[]
over3200=0
for n in range(0,N):
    color=rates[n]//400
    if color<8:
        if not color in colors:
            colors.append(color)
    else:
        over3200+=1
if len(colors)==0:
    Min=1
else:
    Min=len(colors)
Max=len(colors)+over3200
print(Min,Max)

Solution (Python):

n=int(input())
a=list(map(int,input().split()))
color=[False]*8
strongman=0
for i in a:
    x=i//400
    if x<8:
        color[x]=True
    else:
        strongman+=1
human=0
for i in color:
    if i==True:
        human+=1
color_min=max(human,1)
color_max=human+strongman
print(color_min,color_max)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
chk = []
ans = [0]*2
if a[0] >= 3200:
  ans[0] = 1
  ans[1] = n
else:
  for i in range(n):
    if a[i] < 400:
      chk.append('hai')
    elif 399 < a[i] < 800:
      chk.append('cha')
    elif 799 < a[i] < 1200:
      chk.append('mi')
    elif 1199 < a[i] < 1600:
      chk.append('miz')
    elif 1599 < a[i] < 2000:
      chk.append('ao')
    elif 1999 < a[i] < 2400:
      chk.append('ki')
    elif 2399 < a[i] < 2800:
      chk.append('dai')
    elif 2799 < a[i] < 3200:
      chk.append('aka')
    else:
      ans[1] += 1
  if 'hai' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'cha' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'mi' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'miz' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'ao' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'ki' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'aka' in chk:
    ans[0] += 1
    ans[1] += 1
  if 'dai' in chk:
    ans[0] += 1
    ans[1] += 1
print(' '.join(map(str,ans)))

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


for i in A:
    if i < 3200:
        a = i//400
        L[a] += 1
    else:
        t += 1
 
c = 0
for i in L:
    if i!= 0:
        c += 1
max_num = max(c, 1)
min_num = c+t
print(max_num,min_num)

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

C = [0]*9
for a in A:
  if a>=8:
    C[8] +=1
  elif C[a]==0:
    C[a] = 1

mi = sum(C[:-1])
mini = mi
if mi == 0:
  mini = 1
ma = mi+C[-1]
print(mini,ma)

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
ans = 0
for i in range(8):
    if c[i] != 0:
        ans += 1
if ans == 0:
    print(1, c[8])
else:
    print(ans, ans + c[8])

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

Solution (Python):



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


kanmuri_count = {
    "king": 0
}


for a in a_list:
    if a<400 and not "gray" in kanmuri_count:
        kanmuri_count["gray"] = 1
    elif a>=400 and a<800 and not "brown" in kanmuri_count:
        kanmuri_count["brown"] = 1
    elif a>=800 and a<1200 and not "green" in kanmuri_count:
        kanmuri_count["green"] = 1
    elif a>=1200 and a<1600 and not "cyan" in kanmuri_count:
        kanmuri_count["cyan"] = 1
    elif a>=1600 and a<2000 and not "blue" in kanmuri_count:
        kanmuri_count["blue"] = 1
    elif a>=2000 and a<2400 and not "yellow" in kanmuri_count:
        kanmuri_count["yellow"] = 1
    elif a>=2400 and a<2800 and not "orange" in kanmuri_count:
        kanmuri_count["orange"] = 1
    elif a>=2800 and a<3200 and not "red" in kanmuri_count:
        kanmuri_count["red"] = 1
    elif a>=3200:
        kanmuri_count["king"] += 1


cur_clount = len(kanmuri_count) - 1
ans = cur_clount + kanmuri_count["king"]
print("%d %d"%(max(cur_clount,1), ans))

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

c = 0
for i in B:
    if i!= 0:
        c += 1

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

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