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.



Sample input:
4
2100 2500 2700 2700


Sample output:
2 2

Submission status: Wrong Answer

Solution code:
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 max>7:
      max=8
   if min==0:
      min=1
   print(str(min)+' '+str(max))

Submission status: Wrong Answer

Solution code:
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

if maxcolor >= 9:
    maxcolor = 8

print(mincolor, maxcolor)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)

if "all" in over:
    if num >= 8:
        print("8 8")
    else:
        if num == 0:
            if all_num >= 8:
                print("1" + " " +str(all_num))
            else:
                print("1" + " " + "8")
        if num + all_num >= 8:
            print(str(num) + " " + "8")
        elif num + all_num < 8:
            print(str(num) + " " +str(num + all_num))

else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
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(fixed_colors) + " " + str(max(fixed_colors + free_colors, 1)))


main()

Submission status: Wrong Answer

Solution code:
def main():
    # not use 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_min = n_399 + n_799 + n_1199 + n_1599 + n_1999 + n_2399 + n_2799 + n_3199
    if n_min == 0 and n_free > 0:
        n_min = 1

    n_max = n_min + n_free

    print(n_min, n_max)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
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(fixed_colors) + " " + str(min(fixed_colors + free_colors, 1)))


main()

Submission status: Wrong Answer

Solution code:
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
    if max_color > 8:
        max_color = 8
    print min_color, max_color




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god + 1
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + 1
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_max, color_min)

Submission status: Wrong Answer

Solution code:
N = input()
N = int(N)
a = input().split()
for i in range(N):
    a[i] = int(a[i])
a.sort()

hFlag=0
cFlag=0
gFlag=0
wFlag=0
bFlag=0
yFlag=0
dFlag=0
rFlag=0
oFlag=0
sumMin=0
sumMax=0
Sum = 0

for i in range(N):
    if 1<=a[i] and a[i]<=399:
        hFlag=1
    elif 400<=a[i] and a[i]<=799:
        cFlag=1
    elif 800<=a[i] and a[i]<=1199:
        gFlag=1
    elif 1200<=a[i] and a[i]<=1599:
        wFlag=1
    elif 1600<=a[i] and a[i]<=1999:
        bFlag=1
    elif 2000<=a[i] and a[i]<=2399:
        yFlag=1
    elif 2400<=a[i] and a[i]<=2799:
        dFlag=1
    elif 2800<=a[i] and a[i]<=3199:
        rFlag=1
    elif 3200<=a[i]:
        Sum = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
        if oFlag == 1:
            if sumMax == 8:
                sumMax = 8
            else:
                sumMax += 1
        elif Sum == 0:
            sumMin = 1
            sumMax = 1
            oFlag = 1
        elif Sum == 8:
            sumMin = 8
            sumMax = 8
        else:
            sumMin = Sum
            sumMax = Sum + 1
            oFlag = 1

if Sum == 0 and sumMax == 0 and sumMin == 0:
    sumMin = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
    sumMax = sumMin

print(str(sumMin) + " " + str(sumMax))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = [int(_) for _ in input().split()]
a = np.array(a)
a = np.sort(a)
min = 0
max = 0
m = 0

for i in range(8):
    set_1 = set(np.where(i*400<=a)[0])
    set_2 = set(np.where(a<(i+1)*400)[0])
    match = list(set_1 & set_2)
    if len(match)>0:
        min+=1
if min==0:
    min=1
    if N>8:
        max = 8
    else:
        max = N
else:
    if len(np.where(a>=3200)[0])==0:
        max = min
    else:
        max = min + len(np.where(a>=3200)[0])
        if max>8:
            max = 8
print (min, max)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/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 = '')

if color_kind + tr < 8:
  print(str(color_kind + tr))
else:
  print(str(8))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])/400)
    else:
        count += 1
if len(a2_n) == 0:
    n_min= 1
else:
    n_min = len(set(a2_n))
n_max = n_min+count

print(str(n_min)+" "+str(n_max))

Submission status: Wrong Answer

Solution code:
#Python

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

#print A
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


#print colors
#print list(set(colors))

print len(list(set(colors))),
print len(list(set(colors)))+ free_color_counts

Submission status: Wrong Answer

Solution code:
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 = int(0)
for i in range(N-1):
    if a[i] < 400:
        gray = True
    elif a[i] < 800:
        brown = True
    elif a[i] < 1200:
        green = True
    elif a[i] < 1600:
        sky = True
    elif a[i] < 2000:
        blue = True
    elif a[i] < 2400:
        yellow = True
    elif a[i] < 2800:
        orange = True
    elif a[i] < 3200:
        red = True
    else:
        god+=1
if god > 0:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + god
    color_min = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red) + 1
else:
    color_max = int(gray) + int(brown) + int(green) + int(sky) + int(blue) + int(yellow) + int(orange) + int(red)
    color_min = color_max
print(color_max, color_min)

Submission status: Wrong Answer

Solution code:

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
countmax = count1+ue
print("{} {}".format(countmin, countmax))

Submission status: Wrong Answer

Solution code:
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 max>7:
      max=8
   if min==0:
       min=1
   print(str(min)+' '+str(max))

Submission status: Wrong Answer

Solution code:
#Python

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

#print A
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


#print colors
#print list(set(colors))

if len(list(set(colors)))+ free_color_counts<8:
	print len(list(set(colors))),
	print len(list(set(colors)))+ free_color_counts
else:
	print len(list(set(colors))),
	print 8

Submission status: Wrong Answer

Solution code:
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
    if max_color > 8:
        max_color = 8
    print min_color, max_color




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = input()
N = int(N)
a = input().split()
for i in range(N):
    a[i] = int(a[i])

hFlag=0
cFlag=0
gFlag=0
wFlag=0
bFlag=0
yFlag=0
dFlag=0
rFlag=0
oFlag=0
sumMin=0
sumMax=0
Sum = 0

for i in range(N):
    if 1<=a[i] and a[i]<=399:
        hFlag=1
    elif 400<=a[i] and a[i]<=799:
        cFlag=1
    elif 800<=a[i] and a[i]<=1199:
        gFlag=1
    elif 1200<=a[i] and a[i]<=1599:
        wFlag=1
    elif 1600<=a[i] and a[i]<=1999:
        bFlag=1
    elif 2000<=a[i] and a[i]<=2399:
        yFlag=1
    elif 2400<=a[i] and a[i]<=2799:
        dFlag=1
    elif 2800<=a[i] and a[i]<=3199:
        rFlag=1
    elif 3200<=a[i]:
        Sum = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
        if oFlag == 1:
            if sumMax == 8:
                sumMax = 8
            else:
                sumMax += 1
        elif Sum == 0:
            sumMin = 1
            sumMax = 1
            oFlag = 1
        elif Sum == 8:
            sumMin = 8
            sumMax = 8
        else:
            sumMin = Sum
            sumMax = Sum + 1
            oFlag = 1

if Sum == 0 and sumMax == 0 and sumMin == 0:
    sumMin = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
    sumMax = sumMin

print(str(sumMin) + " " + str(sumMax))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
color = []
over = []
a = input().split()
for i in a:
    arr.append(int(i))
for j in range(n):
    if arr[j] >= 1 and arr[j] <= 399:
        color.append("glay")
    elif arr[j] >= 400 and arr[j] <= 799:
        color.append("brown")
    elif arr[j] >= 800 and arr[j] <= 1599:
        color.append("green")
    elif arr[j] >= 1200 and arr[j] <= 1999:
        color.append("blue")
    elif arr[j] >= 2000 and arr[j] <= 2399:
        color.append("yellow")
    elif arr[j] >= 2400 and arr[j] <= 2799:
        color.append("orange")
    elif arr[j] >= 2800 and arr[j] <= 3199:
        color.append("red")
    elif arr[j] >= 3200:
        over.append("all")

all_num = len(over)
setcolor = list(set(color))
num = len(setcolor)

if "all" in over:
    if num + all_num < 8 and num != 1:
        high = num + all_num
        low = num
        print(str(low)+ " " + str(high))
    elif num <= 8:
        if num + all_num >= 8:
            print(str(num) + " " + "8")
        else:
            print(str(num) + " " +str(num + all_num))
    elif num == 0:
        if all_num >= 8:
            print("1" + " " +str(all_num))
        else:
            print("1" + " " + "8")
else:
    print(str(num) + " " +str(num))

Submission status: Wrong Answer

Solution code:
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
countmax = count1
print("{} {}".format(countmin, countmax))

Submission status: Wrong Answer

Solution code:

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
countmax = min(9, count1+ue)
print("{} {}".format(countmin, countmax))

Submission status: Wrong Answer

Solution code:
#Python

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

#print A
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 free_color_counts >= 8:
	free_color_counts =8

#print colors
#print list(set(colors))
print len(list(set(colors))),
print len(list(set(colors)))+ free_color_counts

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = [int(_) for _ in input().split()]
a = np.array(a)
a = np.sort(a)
min = 0
max = 0
m = 0

if np.min(a)>=3200:
    min = 1
    if len(a)>8:
        max = 8
    else:
        max = len(a)
else:
    for i in range(8):
        set_1 = set(np.where(i*400<=a)[0])
        set_2 = set(np.where(a<(i+1)*400)[0])
        match = list(set_1 & set_2)
        if len(match)>0:
            min+=1
    if len(np.where(a>=3200)[0])==0:
        max = min
    else:
        max = min + len(np.where(a>=3200)[0])
        if max>8:
            max = 8
print (min, max)

Submission status: Wrong Answer

Solution code:
N = input()
N = int(N)
a = input().split()
for i in range(N):
    a[i] = int(a[i])

hFlag=0
cFlag=0
gFlag=0
wFlag=0
bFlag=0
yFlag=0
dFlag=0
rFlag=0
oFlag=0
sumMin=0
sumMax=0
Sum = 0

for i in range(N):
    if 1<=a[i] and a[i]<=399:
        hFlag=1
    elif 400<=a[i] and a[i]<=799:
        cFlag=1
    elif 800<=a[i] and a[i]<=1199:
        gFlag=1
    elif 1200<=a[i] and a[i]<=1599:
        wFlag=1
    elif 1600<=a[i] and a[i]<=1999:
        bFlag=1
    elif 2000<=a[i] and a[i]<=2399:
        yFlag=1
    elif 2400<=a[i] and a[i]<=2799:
        dFlag=1
    elif 2800<=a[i] and a[i]<=3199:
        rFlag=1
    elif 3200<=a[i]:
        Sum = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
        if Sum == 0:
            sumMin = 1
            sumMax = 1
        elif Sum == 8:
            sumMin = 8
            sumMax = 8
        elif oFlag == 1:
            if sumMax == 8:
                sumMax = 8
            else:
                sumMax += 1
        else:
            sumMin = Sum
            sumMax = Sum + 1
            oFlag = 1

if Sum == 0 and sumMax == 0 and sumMin == 0:
    sumMin = hFlag + cFlag + gFlag + wFlag + bFlag + yFlag + dFlag + rFlag
    sumMax = sumMin

print(str(sumMin) + " " + str(sumMax))

Submission status: Wrong Answer

Solution code:
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
if max_ans > 8:
    max_ans = 9
min_ans = len(set(color))
if min_ans == 0 and other != 0:
    min_ans = 1
print(min_ans, max_ans)

Submission status: Wrong Answer

Solution code:
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 + supercoder >= 8:
    print(ctn,8)
else:
    print (ctn,ctn + supercoder)

Submission status: Wrong Answer

Solution code:
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 min==8:
    print(str(8)+' '+str(8))
elif chan==0:
   print(str(min)+' '+str(min))
elif chan!=0:
   max=min+chan
   if max>=8:
      max=8
   if min==0:
       min=1
   print(str(min)+' '+str(max))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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

print(mincolar,mincolar+b)

quit()

Submission status: Wrong Answer

Solution code:
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])/400)
    else:
        count += 1

n_min = len(set(a2_n))
n_max = n_min+count

print(str(n_min)+" "+str(n_max))

Submission status: Wrong Answer

Solution code:
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
if d + e > 8:
    max = 8
print(min, max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)
if(sum(c)>=8*n):
    min+=1
print(min," ",max)

Submission status: Wrong Answer

Solution code:
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

print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
ratesLetter=input().split()
del ratesLetter[0]
rates=[]
colors=[]
over=[]
for rate in ratesLetter:
    rates.append(int(rate))
for rate in rates:
    if rate<=399:
        colors.append('gray')
    elif rate>=400 and rate<=799:
        colors.append('brown')
    elif rate>=800 and rate<=1199:
        colors.append('green')
    elif rate>=1200 and rate<=1599:
        colors.append('lightblue')
    elif rate>=1600 and rate<=1999:
        colors.append('blue')
    elif rate>=2000 and rate<=2399:
        colors.append('yellow')
    elif rate>=2400 and rate<=2799:
        colors.append('orange')
    elif rate>=2800 and rate<=3199:
        colors.append('')
    elif rate>=3200:
        over.append('a')
length=len(set(colors))
print(length, length+len(over))

Submission status: Wrong Answer

Solution code:
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))

MAX ,MIN = len(kind),len(kind)+var

print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
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
print(str(len(colorList)) + " " + str(maxColor))