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):
input()
rates = sorted([int(x) for x in input().split()])
counts = []
for boundary in [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]:
    counts.append(1 if rates and (rates[0] <= boundary) else 0)
    rates = [rate for rate in rates if rate > boundary]
higher = len(rates)
least = sum(counts)
print("{} {}".format(1 if least == 0 else least, least+higher))

Solution (Python):
boundaries = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
input()
rates = sorted([int(x) for x in input().split()])
counts = []
for boundary in boundaries:
    tmp = 0
    while rates and rates[0] <= boundary:
        tmp += 1
        rates.pop(0)
    counts.append(tmp)
least = sum([x > 0 for x in counts[:-1]])
print("{} {}".format(1 if least == 0 else least, counts[-1]+least))

Solution (Python):
import bisect

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

target = 0
l = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
cnt = [0 for i in range(len(l))]

for i in range(n):
    if a[i] >= 3200:
        target += 1
    else:
        x = bisect.bisect_left(l, a[i])
        
        cnt[x] += 1

mi = 0
ma = 0
for i in range(len(l)):
    if cnt[i] != 0:
        mi += 1

ma = mi + target
if mi == 0:
    mi = 1

print (str(mi) + " " + str(ma))

Solution (Python):
def c():
    n = int(input())
    a = list(map(int, input().split()))
    l = list(map(lambda i: min(8, i//400), a))
    over_rate = l.count(8)
    res = set(l)
    if 8 in res: res.remove(8)

    mi = max(1, len(res))
    ma = len(res) + over_rate
    print(mi, ma)

c()

Solution (Python):
input()
a = list(map(int, input().split()))
b = [0] * 9
for i in a:
    if i < 3200:
        b[int(i / 400)] = 1
    else:
        b[8] = b[8] + 1
mini = sum(b[0:8])
if mini == 0:
    mini = 1
maxi = sum(b[0:8]) + b[8]
print(str(mini) + ' ' + str(maxi))

Solution (Python):



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

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

colors = [0, 0, 0, 0, 0, 0, 0, 0]
god = 0
for rate in a:
    color = what_color(rate)
    if color == 8:
        god = god+1
    else:
        colors[color] = 1

sum_colors = sum(colors)

saidai = sum_colors + god
saisyo = sum_colors
if saisyo == 0:
    saisyo = 1

print '{0} {1}'.format(saisyo, saidai)

Solution (Python):
def main():
    N = int(input().strip())

    n_color = [0 for i in range(8)]
    n_free = 0
    rates = list(map(int, input().strip().split()))
    for r in rates:
        if r >= 3200:
            n_free += 1
        else:
            n_color[r // 400] += 1

    n_less_3200 = sum(1 for _ in n_color
                      if _ > 0)

    n_min = max(1, n_less_3200)
    n_max = n_less_3200 + n_free

    print(n_min, n_max)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter
input()
c = Counter([min(int(i)//400,8) for i in input().split()])
lt3200 = [bool(c[i]) for i in range(8)].count(True)
print(max(1, lt3200), lt3200+c[8])

Solution (Python):
def c():
    n = int(input())
    a = list(map(int, input().split()))
    
    def set_col(rate):
        r = rate // 400
        r = min(8, r)
        return r

    l = list(map(set_col, a))
    over_rate = l.count(8)
    res = set(l)
    if 8 in res: res.remove(8)

    mi = max(1, len(res))
    ma = len(res) + over_rate
    print(mi, ma)

c()

Solution (Python):
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in range(memTime):
    member = memLate[color]
    if member // 400 >= 8:
        highLate += 1
    elif ((member // 400) in colorList) == False:
        colorList.append(member // 400)
maxColor = len(colorList) + highLate
minColor = len(colorList)
if minColor == 0:
    minColor = 1
print(str(minColor) + " " + str(maxColor))

Solution (Python):
N =int(input())
scores = [min(int(i)//400, 8) for i in input().split()]
d = [0]*9
for s in scores:
    d[s] = d[s] + 1
lt3200 = [bool(i) for i in d[:8]].count(True)
m = max(1, lt3200)
M = lt3200+d[8]
print('{} {}'.format(m, M))

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

hai = 0
tya = 0
midori = 0
mizu = 0
ao = 0
ki = 0
daidai = 0
aka = 0

niji = 0

for i in range(n):
    if 1 <= a[i] and a[i] <=399:
        hai = 1
    elif 400 <= a[i] and a[i] <= 799:
        tya = 1
    elif 800 <= a[i] and a[i] <= 1199:
        midori = 1
    elif 1200 <= a[i] and a[i] <=1599:
        mizu = 1
    elif 1600 <= a[i] and a[i] <= 1999:
        ao = 1
    elif 2000 <= a[i] and a[i] <= 2399:
        ki = 1
    elif 2400 <= a[i] and a[i] <=2799:
        daidai = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        aka = 1
    elif 3200 <= a[i]:
        niji += 1

mincolor = hai + tya + midori + mizu + ao + ki + daidai + aka

if mincolor == 0:
    mincolor += 1
    niji -= 1

maxcolor = mincolor + niji




print(mincolor, maxcolor)

Solution (Python):
n=int(raw_input())
a=map(int,raw_input().split())
c=[0]*8
mx=0
for i in xrange(n):
    if a[i]/400<=7:
        c[a[i]/400]=1
    else:
        mx+=1
print max(1,sum(c)),sum(c)+mx

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
god = 0
for i in range(N):
    if a[i] < 400:
        gray = 1
    elif a[i] < 800:
        brown = 1
    elif a[i] < 1200:
        green = 1
    elif a[i] < 1600:
        sky = 1
    elif a[i] < 2000:
        blue = 1
    elif a[i] < 2400:
        yellow = 1
    elif a[i] < 2800:
        orange = 1
    elif a[i] < 3200:
        red = 1
    else:
        god+=1
zako = gray + brown + green + sky + blue + yellow + orange + red
if god > 0 and zako == 0:
    color_max = god
    color_min = 1
elif god > 0 and zako != 0:
    color_max = zako + god
    color_min = zako
else:
    color_max = zako
    color_min = zako
print(color_min, color_max)

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

color = [0] * 8
supercoder = 0
ctn = 0

for i in range(N):
    if ratio[i] <= 399:
        color[0] += 1
    elif ratio[i] <= 799:
        color[1] += 1
    elif ratio[i] <= 1199:
        color[2] += 1
    elif ratio[i] <= 1599:
        color[3] += 1
    elif ratio[i] <= 1999:
        color[4] += 1
    elif ratio[i] <= 2399:
        color[5] += 1
    elif ratio[i] <= 2799:
        color[6] += 1
    elif ratio[i] <= 3199:
        color[7] += 1
    else:
        supercoder += 1

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

if ctn == 0 and supercoder > 0:
    print(1,supercoder)

else:
    print (ctn,ctn + supercoder)

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

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
a = na()


s = set()
x = 0
for v in a:
    if v < 3200:
        s.add(int(v / 400))
    else:
        x += 1

y = len(s)
z = x + y

if x > 0:
    y = max(1, y)

print("%d %d" % (y, z))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
 
COLOR = 8
cnt, ov = [0] * COLOR, 0
for r in a:
    if r < 3200:
        cnt[r // 400] = 1
    else:
        ov += 1

used = 0
for c in cnt:
    if c > 0:
        used += 1

print(max(1, used), used + ov)

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

def cl(n):
    return n//400

buff=[0]*9

for i in a:
    color=cl(i)
    if color>8:
        color=8
    buff[color]+=1


min=0
for i in range(len(buff)-1):
    if buff[i]>=1:
        min+=1

max=min+buff[8]

if min==0:
    min=1

print(str(min)+" "+str(max))

Solution (Python):
def main():
    N = int(input().strip())

    n_399 = 0
    n_799 = 0
    n_1199 = 0
    n_1599 = 0
    n_1999 = 0
    n_2399 = 0
    n_2799 = 0
    n_3199 = 0
    n_free = 0
    rates = list(map(int, input().strip().split()))
    for r in rates:
        if r <= 399:
            n_399 = 1
        elif r <= 799:
            n_799 = 1
        elif r <= 1199:
            n_1199 = 1
        elif r <= 1599:
            n_1599 = 1
        elif r <= 1999:
            n_1999 = 1
        elif r <= 2399:
            n_2399 = 1
        elif r <= 2799:
            n_2799 = 1
        elif r <= 3199:
            n_3199 = 1
        else:
            n_free += 1

    n_less_3200 = n_399 + n_799 + n_1199 + \
        n_1599 + n_1999 + n_2399 + n_2799 + n_3199
    n_rest = N - n_less_3200

    n_min = n_less_3200
    if n_less_3200 == 0 and n_free > 0:
        n_min = 1

    n_max = n_less_3200 + n_free
    if n_less_3200 + n_free >= N:
        n_max = N

    print(n_min, n_max)

if __name__ == '__main__':
    main()

Solution (Python):


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


i=0
free_color_counts=0
colors=[]
while i<N:
	if A[i]>=1 and A[i]<=399:
		c='Hai'
		colors.append(c)
	elif A[i]>=400 and A[i]<=799:
		c='Cha'
		colors.append(c)
	elif A[i]>=800 and A[i]<=1199:
		c='Midori'
		colors.append(c)
	elif A[i]>=1200 and A[i]<=1599:
		c='Mizu'
		colors.append(c)
	elif A[i]>=1600 and A[i]<=1999:
		c='Ao'
		colors.append(c)
	elif A[i]>=2000 and A[i]<=2399:
		c='Ki'
		colors.append(c)
	elif A[i]>=2400 and A[i]<=2799:
		c='Dai'
		colors.append(c)
	elif A[i]>=2800 and A[i]<=3199:
		c='Aka'
		colors.append(c)
	elif A[i]>=3200:
		free_color_counts+=1

	i+=1





if len(list(set(colors)))==0:
	print 1,
	print free_color_counts
else:
	print len(list(set(colors))),
	print len(list(set(colors)))+ free_color_counts

Solution (Python):
inf=float('inf')
N = int(input())
x = list(map(int, input().split()))
a=[0]*8
b=0
for i in range(0,N):
    if x[i]>=3200:
        b +=1
        x[i]=inf
for j in range(0,8):
    for i in range(0,N):
        if x[i]<400:
            a[j] +=1
            x[i] = inf
        x[i] -= 400
 
 
mincolar=0
for i in a:
    if i!=0:
        mincolar +=1
if mincolar!=0:
    print(mincolar,mincolar+b)
else:
    print(1,b)
quit()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
choice=0
colour={}
for elements in a:
	if elements>=1 and elements<=399:colour[1]=1
	elif elements>=400 and elements<=799:colour[2]=2
	elif elements>=800 and elements<=1199:colour[3]=3
	elif elements>=1200 and elements<=1599:colour[4]=4
	elif elements>=1600 and elements<=1999:colour[5]=5
	elif elements>=2000 and elements<=2399:colour[6]=6
	elif elements>=2400 and elements<=2799:colour[7]=7
	elif elements>=2800 and elements<=3199:colour[8]=8
	else:choice+=1

m=len(colour)
if m==0 and choice!=0:m=1
print(m,len(colour)+choice)

Solution (Python):
l=[0]*13
input()
for i in input().split():
  l[int(i)//400]+=1
r=sum([1 for a in l[:8] if a > 0])
print(max(1,r),r+sum(l[8:]))

Solution (Python):
N=int(input())
gray=0
brown=0
green=0
cyan=0
blue=0
yellow=0
dai=0
red=0
chan=0
A=input().split()
for i in range(N):
    a=int(A[i])
    if a<400:
        gray=1    
    elif a<800:
        brown=1
    elif a<1200:
        green=1   
    elif a<1600:
        cyan=1
    elif a<2000:
        blue=1
    elif a<2400:
        yellow=1
    elif a<2800:
        dai=1
    elif a<3200:
        red=1    
    else:
        chan=chan+1
min=gray+brown+green+cyan+blue+yellow+dai+red
 
 
if chan==0:
   print(str(min)+' '+str(min))
else:
   max=min+chan
   if min==0:
      min=1
   print(str(min)+' '+str(max))

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

num=[0,0,0,0,0,0,0,0,0]
counter=0

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

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0 and num[8]==0:
    min=0
    max=0

elif counter==0 and num[8]!=0:
    min=1
    max=num[8]

else:
    min=counter
    max=counter+num[8]


print(str(min)+" "+str(max))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
 
COLOR = 8
cnt, ov = [0] * COLOR, 0
for i in range(N):
    if a[i] < 3200:
        cnt[a[i] // 400] += 1
    else:
        ov += 1
 
used = 0
for c in cnt:
    if c > 0:
        used += 1

unused = N - used 
print(max(1, used), used + min(unused, ov))

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
 
COLOR = 8
cnt, ov = [0] * COLOR, 0
for r in a:
    if r < 3200:
        cnt[r // 400] = 1
    else:
        ov += 1

used = 0
for c in cnt:
    if c > 0:
        used += 1

unused = N - used

print(max(1, used), used + min(unused, ov))

Solution (Python):
import numpy as np
N = int(input())
a = np.array(list(map(int, input().split())))

c = np.array([0] * 8)

a //= 400

for i in range(8):
    num = np.sum(a == i)
    c[i] = num
red = np.sum(a >= 8)


mincol = np.sum(c != 0)
maxcol = mincol + red
if mincol == 0:
    mincol = 1

print(mincol, maxcol)

Solution (Python):


n = input()
a = [int(i) for i in input().split()]
color = [0, 0, 0, 0, 0, 0, 0, 0]
tr = 0

for i in a:
  if i < 3200 and color[int(i/400)] == 0:
    color[int(i / 400)] = 1
  elif i >= 3200:
    tr += 1

color_kind = 0
for i in color:
  if i == 1:
    color_kind += 1

if color_kind > 0:
  print(str(color_kind) + " ", end = '')
else:
  print(str(1) + " ", end = '')

print(str(color_kind + tr))

Solution (Python):
import sys
import numpy as np
from math import *
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    color_list = [0 for i in range(8)]
    top_coder_num = 0
    for i in range(N):
        rate = int(input_raw[i])
        if rate>= 1 and rate < 400:
            color_list[0] = 1
        elif rate>= 400 and rate < 800:
            color_list[1] = 1
        elif rate>= 800 and rate < 1200:
            color_list[2] = 1
        elif rate>= 1200 and rate < 1600:
            color_list[3] = 1
        elif rate>= 1600 and rate < 2000:
            color_list[4] = 1
        elif rate>= 2000 and rate < 2400:
            color_list[5] = 1
        elif rate>= 2400 and rate < 2800:
            color_list[6] = 1
        elif rate>= 2800 and rate < 3200:
            color_list[7] = 1
        elif rate >= 3200:
            top_coder_num += 1

    min_color = sum(color_list)
    if min_color == 0 and top_coder_num >= 1:
        min_color = 1
    max_color = sum(color_list) + top_coder_num

    print min_color, max_color




if __name__ == '__main__':
    main()

Solution (Python):

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


def main():
    input()
    rates = get_ln_int_inputs()

    colors = [0] * 8
    free_colors = 0
    for rate in rates:
        if rate >= 3200:
            free_colors += 1
        else:
            colors[rate // 400] = 1
    fixed_colors = sum(colors)

    print(str(max(fixed_colors, 1)) + " " + str(max(fixed_colors + free_colors, 1)))


main()

Solution (Python):


"""
Created on Fri May 26 01:33:48 2017

@author: kenta
"""

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

hai = 0;cha = 0;midori = 0; mizu = 0;ao = 0;ki = 0;dai = 0;aka = 0;ue=0
for i in range(N):
    if 1<= a[i] < 400:
        hai +=1
    elif 400<= a[i] < 800:
        cha += 1
    elif 800<= a[i] < 1200:
        midori += 1
    elif 1200<= a[i] < 1600:
        mizu += 1
    elif 1600<= a[i] < 2000:
        ao += 1    
    elif 2000<= a[i] < 2400:
        ki += 1 
    elif 2400<= a[i] < 2800:
        dai += 1
    elif 2800<= a[i] < 3200:
        aka += 1
    else:
        ue += 1

count1 = 0
if hai > 0:
    count1 += 1
if cha > 0:
    count1 += 1
if midori> 0:
    count1 += 1
if mizu > 0:
    count1 += 1
if ao > 0:
    count1 += 1
if ki > 0:
    count1 += 1
if dai > 0:
    count1 += 1
if aka > 0:
    count1 += 1

countmin = count1
if countmin == 0:
    if ue >0:
        countmin += 1
countmax = count1+ue
print("{} {}".format(countmin, countmax))

Solution (Python):
n = input()
a = input()
tmp_a = a.split()
a_list = []
o_list = []
flag = 0

for i in range(int(n)):
    if int(tmp_a[i]) < 400:
        a_list.append("gray")
    elif 400 <= int(tmp_a[i]) and int(tmp_a[i]) < 800:
        a_list.append("brown")
    elif 800 <= int(tmp_a[i]) and int(tmp_a[i]) < 1200:
        a_list.append("green")
    elif 1200 <= int(tmp_a[i]) and int(tmp_a[i]) < 1600:
        a_list.append("sky")
    elif 1600 <= int(tmp_a[i]) and int(tmp_a[i]) < 2000:
        a_list.append("blue")
    elif 2000 <= int(tmp_a[i]) and int(tmp_a[i]) < 2400:
        a_list.append("yellow")
    elif 2400 <= int(tmp_a[i]) and int(tmp_a[i]) < 2800:
        a_list.append("orange")
    elif 2800 <= int(tmp_a[i]) and int(tmp_a[i]) < 3200:
        a_list.append("red")
    else:
        o_list.append("other")

n_other = len(o_list)

if len(set(a_list))==0:
    min_num = 1
else:
    min_num = len(set(a_list))

max_num = len(set(a_list))+n_other



print(min_num, max_num)

Solution (Python):
al=[0]*13
input()
for i in input().split():
    al[int(i)//400]+=1
tuyoi=sum(al[8:])
iru=sum([1 for a in al[:8] if a > 0])
print(max(1,iru),iru+tuyoi)

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

    color = set()
    etc = 0
    for a in A:
        idx = a // 400
        if idx >= 8:
            etc += 1
        else:
            color.add(idx)

    min_ = len(color)
    if min_ == 0:
        min_ = 1
    max_ = len(color) + etc

    print(min_, max_)

main()

Solution (Python):
from collections import Counter
input()
c = Counter([min(int(i)//400,8) for i in input().split()])
ans = 0
for i in range(8):
 ans += bool(c[i])
print(max(ans,1),ans+c[8])

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

memo = [0 for i in range(9)]
for i in a:
	if(i < 3200):
		memo[i / 400] = memo[i / 400] + 1
	else:
		memo[8] = memo[8] + 1;

cnt = 0
for i in range(8):
	if memo[i] > 0:
		cnt = cnt + 1;
free = memo[8]

if cnt == 0:
	print 1, memo[8]
else:
	print cnt, memo[8] + cnt

Solution (Python):
n=int(input())
a=input().split()
min=0
max=0
c=[]
for i in range(n):
    per=int(int(a[i])/400)
    
    if per not in c and per<8:
        min+=1
        max+=1
    if (per>=8):
        max+=1
    c.append(per)
flag=0
for i in range(n):
    if(c[i]<8):
        flag=1
if flag==0:
    min+=1
print(min," ",max)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
kind = []
var = 0

def d_color(num):
     if 1<=num and num<=399:
         return "a"
     elif 400<=num and num<=799:
         return "b"
     elif 800<=num and num<=1199:
         return "c"
     elif 1200<=num and num<=1599:
         return "d"
     elif 1600<=num and num<=1999:
         return "e"
     elif 2000<=num and num<=2399:
         return "f"
     elif 2400<=num and num<=2799:
         return "g"
     else:
         return "h"

for i in range(n):
    if a[i]<3200:
        kind.append(d_color(a[i]))
    else:
        var += 1

kind = list(set(kind))

MIN ,MAX = len(kind),len(kind)+var
if MIN == 0:
    MIN =1 

print(MIN,MAX)

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

a.sort()
color = []
other = 0
for i in a:
    if i < 400 * 1:
        color.append('1')
    elif i < 400 * 2:
        color.append('2')
    elif i < 400 * 3:
        color.append('3')
    elif i < 400 * 4:
        color.append('4')
    elif i < 400 * 5:
        color.append('5')
    elif i < 400 * 6:
        color.append('6')
    elif i < 400 * 7:
        color.append('7')
    elif i < 400 * 8:
        color.append('8')
    else:
        other += 1
max_ans = len(set(color)) + other
min_ans = len(set(color))
if min_ans == 0 and other != 0:
    min_ans = 1
print(min_ans, max_ans)

Solution (Python):
N = int(input())
a = map(int, input().split())
rate_under = []
rate_upper = []
for i in a:
    x = i // 400
    if(x >= 8):
        rate_upper.append(x)
    else:
        rate_under.append(x)
min = len(set(rate_under))
max = min + len(rate_upper)
if(min == 0):
    min = 1
print(str(min) + " " + str(max))

Solution (Python):
a = input()
b = input().split()
c = [0, 0, 0, 0, 0, 0, 0, 0]
d = 0
e = 0
for i in b:
    j = 0
    while j < len(c):
        if j == 0 and c[j] == 0 and (1 <= int(i) < 400):
            c[j] += 1
            d += 1
        elif c[j] == 0 and (400 * j <= int(i) < 400 * (j+1)):
            c[j] += 1
            d += 1
        j += 1
    if int(i) >= 3200:
        e += 1
min, max = d, d+e
if d == 0:
    min = 1
print(min, max)

Solution (Python):


N = int(input())
rates = [int(x) for x in input().split()]

rates.sort()
uppers = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
accum = list()
counts = list()

for upper in uppers:
    accum.append(len([x for x in rates if x <= upper]))

counts.append(accum[0])
for i in range(1, 9):
    counts.append(accum[i] - accum[i-1])

_least = sum([1 for count in counts[:-1] if count > 0])
max_scorerer = counts[-1]

if _least == 0:
    least = 1
    most = max_scorerer
else:
    least = _least
    most = least + max_scorerer

print("{} {}".format(least, most))

Solution (Python):

"""
Created on Sun Aug 28 21:42:33 2016

@author: you
"""

n = int(input())
a = list(map(int, input().split()))
colornum = 0
colorflag = [0,0,0,0,0,0,0,0]
rainbow = 0
maxvalue = 0
minvalue = 0
for i in range(n):
    if colorflag[0] == 0 and a[i] < 400:
        colornum = colornum + 1
        colorflag[0] = 1
    elif colorflag[1] == 0 and a[i] >= 400 and a[i] < 800:
        colornum = colornum + 1
        colorflag[1] = 1
    elif colorflag[2] == 0 and a[i] >= 800 and a[i] < 1200:
        colornum = colornum + 1
        colorflag[2] = 1
    elif colorflag[3] == 0 and a[i] >= 1200 and a[i] < 1600:
        colornum = colornum + 1
        colorflag[3] = 1
    elif colorflag[4] == 0 and a[i] >= 1600 and a[i] < 2000:
        colornum = colornum + 1
        colorflag[4] = 1
    elif colorflag[5] == 0 and a[i] >= 2000 and a[i] < 2400:
        colornum = colornum + 1
        colorflag[5] = 1
    elif colorflag[6] == 0 and a[i] >= 2400 and a[i] < 2800:
        colornum = colornum + 1
        colorflag[6] = 1
    elif colorflag[7] == 0 and a[i] >= 2800 and a[i] < 3200:
        colornum = colornum + 1
        colorflag[7] = 1
    elif a[i] >= 3200:
        rainbow = rainbow + 1
for j in range(8):
    if colorflag[j] == 1:
        minvalue = minvalue + 1
maxvalue = minvalue + rainbow
if minvalue == 0:
    minvalue = 1
    maxvalue = rainbow
print(minvalue,maxvalue)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
b = set(ai // 400 for ai in a if ai < 3200)
m = len([ai for ai in a if ai > 3199])

if m == 0:
    print("{0} {0}".format(len(b)))
else:
    print("{0} {1}".format(max(len(b), 1), len(b) + m))

Solution (Python):
n = int(input())
a = input().split()
list = []
list_of_topcoder = []

for i in range(n):
    if 1<=int(a[i])<=399:
        if "gray" not in list:
            list.append("gray")
        else:
            pass
    elif 400<=int(a[i])<=799:
        if "brown" not in list:
            list.append("brown")
        else:
            pass
    elif 800<=int(a[i])<=1199:
        if "green" not in list:
            list.append("green")
        else:
            pass
    elif 1200<=int(a[i])<=1599:
        if "water" not in list:
                list.append("water")
        else:
            pass
    elif 1600<=int(a[i])<=1999:
        if "blue" not in list:
            list.append("blue")
        else:
            pass
    elif 2000<=int(a[i])<=2399:
        if "yellow" not in list:
            list.append("yellow")
        else:
            pass
    elif 2400<=int(a[i])<=2799:
        if "orange" not in list:
            list.append("orange")
        else:
            pass
    elif 2800<=int(a[i])<=3199:
        if "red" not in list:
            list.append("red")
        else:
            pass
    elif 3200<=int(a[i])<=4800:
        list_of_topcoder.append(i)

if len(list) != 0:
    print(len(list), len(list)+len(list_of_topcoder))
else:
    print(1, len(list_of_topcoder))

Solution (Python):

borders = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
def getcolor(rate):
    i = 0
    for border in borders:
        if rate < border:
            return i
        i += 1
    return -1

N = int(input())
rates = [int(x) for x in input().split(" ")]
colors = [0 for _ in range(len(borders))]
topcoders = 0

for rate in rates:
    c = getcolor(rate)
    if c != -1:
        colors[c] = 1
    else:
        topcoders += 1

s_c = sum(colors)
ans = "{0} {1}".format(max(s_c, 1), s_c + topcoders)
print(ans)

Solution (Python):
nb = int(input())
alist = list(map(int,input().split()))
R = [0]*9
for r in alist:
  r //= 400
  if r < 8:
    R[r] = 1
  else:
    R[8] += 1
amin = max(1,sum(R[:8]))
amax = sum(R)
print("{} {}".format(amin,amax))

Solution (Python):
import numpy as np

if __name__ == "__main__":
    N = int(input())
    a = input().split()

    a = list(map(int, a))
    a = np.array(a)

    colors_flag = np.zeros(8)
    other = 0
    for rate in a:
        if(rate >= 3200):
            other += 1
        elif(colors_flag[int(rate/400)] == 1):
            continue
        else:
            colors_flag[int(rate/400)] = 1
    color_num = np.sum(colors_flag)
    print(int(color_num if color_num != 0 else 1), int(color_num + other))

Solution (Python):
N = int(input())
n = [int(i)//400 for i in input().split()]
c = 0
for i in n:
    if i >= 8:
        c += 1
n_kind = [i for i in n if i<8]
a = len(set(n_kind))
if a == 0:
    print(1,c)
else:print(a,a+c)

Solution (Python):
input();A=map(int,input().split());C=[0]*99;D=0
for a in A:a//=400;D+=a>7;C[a]=a<8
E=sum(C);print(max(E,1),E+D)

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

COLOR_LIST = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]
free_color = 0
color_contain = [0, 0, 0, 0, 0, 0, 0, 0]



for i in a:
	cnt = 0
	for j in COLOR_LIST:
		if i > j:
			cnt += 1
	
	if cnt < len(color_contain):
	    color_contain[cnt] = 1
	else:
	    free_color += 1

if free_color == 0:
	min_ans = sum(color_contain)
	max_ans = sum(color_contain)
else:
    min_ans = max(1, sum(color_contain))
    max_ans = sum(color_contain) + free_color
print(min_ans, max_ans)

Solution (Python):
N=int(input())
nums=input().split()
r1=0
r2=0
r3=0
r4=0
r5=0
r6=0
r7=0
r8=0
r9=0
for n in range(0,N):
    if 1<=int(nums[n])<=399:
        r1=1
    if 400<=int(nums[n])<=799:
        r2=1
    if 800<=int(nums[n])<=1199:
        r3=1
    if 1200<=int(nums[n])<=1599:
        r4=1
    if 1600<=int(nums[n])<=1999:
        r5=1
    if 2000<=int(nums[n])<=2399:
        r6=1
    if 2400<=int(nums[n])<=2799:
        r7=1
    if 2800<=int(nums[n])<=3199:
        r8=1
    if 3200<=int(nums[n]):
        r9=r9+1

if r1==r2==r3==r4==r5==r6==r7==r8==0 :
    if 1<=r9<=8:
        p1=r9
        p2=1
    else:
        p1=8
        p2=1
else:
    p1=r1+r2+r3+r4+r5+r6+r7+r8+r9
    p2=r1+r2+r3+r4+r5+r6+r7+r8

print(p2,p1)

Solution (Python):


import sys
import os

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

B = [0] * 8
any_color = 0

for a in A:
    if a <= 399:
        B[0] += 1
    elif a <= 799:
        B[1] += 1
    elif a <= 1199:
        B[2] += 1
    elif a <= 1599:
        B[3] += 1
    elif a <= 1999:
        B[4] += 1
    elif a <= 2399:
        B[5] += 1
    elif a <= 2799:
        B[6] += 1
    elif a <= 3199:
        B[7] += 1
    else:
        any_color += 1

if any_color == N:
    print(1, any_color)
else:
    colored_num = len([b for b in B if b > 0])
    zero_num = len([b for b in B if b == 0])
    max_num = colored_num + any_color
    print(colored_num, max_num)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
col = [0 for i in range(n)]
cnt = 0
for i in range(n):
    if 1 <= a[i] <=399:
        col[i] = "b"
    elif 400<= a[i]<=799:
        col[i] = "c"
    elif 800<= a[i]<=1199:
        col[i] = "d"
    elif 1200<= a[i]<=1599:
        col[i] = "e"
    elif 1600<= a[i]<=1999:
        col[i] = "f"
    elif 2000<= a[i]<=2399:
        col[i] = "g"
    elif 2400<= a[i]<=2799:
        col[i] = "h"
    elif 2800<= a[i]<=3199:
        col[i] = "j"
    else:
        col[i] = "k"
        cnt += 1
colv = list(set(col))
mn =mx = len(colv)
if "k" in colv:
        mn -=1
        mx += cnt-1
        if mn == 0:
            mn =1
        
print(str(mn)+" "+str(mx))

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

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

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

count = 0

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

for i in a:
	check(i)

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

color_min = 8 - count
color_max = color_min+colors[8]

if color_min==0:
	color_min = 1

print(color_min,color_max)