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:
color_used = [0 for i in range(9)]

N = int(input())
a = [int(i) for i in input().split()]
for i in range(N):
    for j in range(1,9):
        if a[i] < 400*j:
            color_used[j-1] += 1
            break
    else:
        color_used[8] += 1

ma = 0
for i in range(8):
    if color_used[i]:
        ma += 1
ma = min(8, ma+min(8-ma, color_used[8]))

mi = 0
for i in range(8):
    if color_used[i]:
        mi += 1

if mi==0:
    if color_used[8]:
        mi = 1
    else:
        mi = 0

print(mi, ma)

Submission status: Wrong Answer

Solution code:
col = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 5000]
nums = [0 for _ in range(9)]
N = int(input())
a = list(map(int, input().split()))
for x in a:
    for i in range(9):
        if x < col[i]:
            nums[i] += 1
            break
cnt = 0
for i in range(8):
    if nums[i] > 0:
        cnt += 1
print(max(cnt, 1), min(cnt+nums[8], 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
list_a = list(map(int, input().split()))
dict_a = {}
for number in list_a:
    try:
        dict_a[number//400] += 1
    except KeyError:
        dict_a[number//400] = 1
count = 0
count_niji = 0
for key,value in dict_a.items():
    if key < 8:
        count += 1
    else:
        count_niji += value
if count == 0:
    print(1,1)
else:
    print(count,count + count_niji)

Submission status: Wrong Answer

Solution code:
n = int(input())
listA = list(map(int, input().split()))
colorL = [0, 0, 0, 0, 0, 0, 0, 0]
min=0
max=0
index=0
while index < len(listA):
    if listA[index] >0 and listA[index]<400 and colorL[0]==0:
        colorL[0]=1
        min+=1
        max+=1
    elif listA[index] >399 and listA[index]<800 and colorL[1]==0:
        colorL[1]=1
        min += 1
        max += 1
    elif listA[index] > 799 and listA[index] < 1200 and colorL[2] == 0:
        colorL[2] = 1
        min += 1
        max += 1
    elif listA[index] > 1199 and listA[index] < 1600 and colorL[3] == 0:
        colorL[3] = 1
        min += 1
        max += 1
    elif listA[index] > 1599 and listA[index] < 2000 and colorL[4] == 0:
        colorL[4] = 1
        min += 1
        max += 1
    elif listA[index] > 1999 and listA[index] < 2400 and colorL[5] == 0:
        colorL[5] = 1
        min += 1
        max += 1
    elif listA[index] > 2399 and listA[index] < 2800 and colorL[6] == 0:
        colorL[6] = 1
        min += 1
        max += 1
    elif listA[index] > 2799 and listA[index] < 3200 and colorL[7] == 0:
        colorL[7] = 1
        min += 1
        max += 1
    elif listA[index] > 3199:
        max+=1
    index+=1

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

Submission status: Wrong Answer

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

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

if a.count(8) > 0:
    if len(set(a)) != 1:
        print(len(set(a))-1,len(set(a)) -1 +a.count(8))
    else:
        print(1,1)
else:
    print(len(set(a)),len(set(a)))

Submission status: Wrong Answer

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

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

if a.count(8) > 0:
    print(len(set(a))-1,len(set(a)) -1 +a.count(8))
else:
    print(len(set(a)),len(set(a)))

Submission status: Wrong Answer

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

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

if a.count(8) > 0:
    print(len(set(a)),len(set(a))+a.count(8))
else:
    print(len(set(a)),len(set(a)))

Submission status: Wrong Answer

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

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

if a.count(8) > 0:
    print(len(set(a)),len(set(a))+2)
else:
    print(len(set(a)),len(set(a)))

Submission status: Wrong Answer

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

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

if a.count(8) > 0:
    print(len(set(a)),len(set(a))+2)
else:
    print([len(set(a)),len(set(a))])

Submission status: Wrong Answer

Solution code:


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

colors = [0 for i in range(8)]
special = 0
for i in range(N):
    if a[i]<3200:
        if colors[int(a[i]/400)]==0:
            colors[int(a[i]/400)]=1
    else:
        special += 1
        
print str(sum(colors)) + " " +str(sum(colors)+special)

Submission status: Wrong Answer

Solution code:

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

colors = [0 for i in range(8)]
special = 0
for i in range(N):
    if a[i]<3200:
        if colors[int(a[i]/400)]==0:
            colors[int(a[i]/400)]+=1
    else:
        special += 1
        
print str(sum(colors)) + " " +str(sum(colors)+special)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
hai, tya, midori = 0, 0, 0
miz, ao, ki = 0, 0, 0
yanagi, aka, got = 0, 0, 0

for i in a:
  if i<=399:
    hai = 1
  elif i<=799:
    tya = 1
  elif i<=1199:
    midori = 1
  elif i <= 1599:
    miz = 1
  elif i <= 1999:
    ao = 1
  elif i <= 2399:
      ki = 1
  elif i <= 2799:
      yanagi = 1
  elif i <= 3199:
      aka = 1
  elif i <= 4800:
    got += 1
minn = hai+tya+midori+miz+ao+ki+yanagi+aka
if minn + got > 7:
  maxx = 8
else:
  maxx = minn+got
if minn==0:
    minn = 1
print(minn, maxx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
hai, tya, midori = 0, 0, 0
miz, ao, ki = 0, 0, 0
yanagi, aka, got = 0, 0, 0

for i in a:
  if i<=399:
    hai = 1
  elif i<=799:
    tya = 1
  elif i<=1199:
    midori = 1
  elif i <= 1599:
    miz = 1
  elif i <= 1999:
    ao = 1
  elif i <= 2399:
      ki = 1
  elif i <= 2799:
      yanagi = 1
  elif i <= 3199:
      aka = 1
  elif i <= 4800:
    got += 1
minn = hai+tya+midori+miz+ao+ki+yanagi+aka
if minn + got >= 8:
  maxx = 8
else:
  maxx = minn+got
if minn==0 and got >=1:
    minn = 1
print(minn, maxx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
hai, tya, midori = 0, 0, 0
miz, ao, ki = 0, 0, 0
yanagi, aka, got = 0, 0, 0

for i in a:
  if i<=399:
    hai = 1
  elif i<=799:
    tya = 1
  elif i<=1199:
    midori = 1
  elif i <= 1599:
    miz = 1
  elif i <= 1999:
    ao = 1
  elif i <= 2399:
      ki = 1
  elif i <= 2799:
      yanagi = 1
  elif i <= 3199:
      aka = 1
  elif i <= 4800:
    got += 1
minn = hai+tya+midori+miz+ao+ki+yanagi+aka
if minn + got >= 8:
  maxx = 8
else:
  maxx = minn+got
print(minn, maxx)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
    if 1 <= a[i] <= 399:
        li[0] += 1
    elif 400 <= a[i] <= 799:
        li[1] += 1
    elif 800 <= a[i] <= 1199:
        li[2] += 1
    elif 1200 <= a[i] <= 1599:
        li[3] += 1
    elif 1600 <= a[i] <= 1999:
        li[4] += 1
    elif 2000 <= a[i] <= 2399:
        li[5] += 1
    elif 2400 <= a[i] <= 2799:
        li[6] += 1
    elif 2800 <= a[i] <= 3199:
        li[7] += 1
    else:
        li[8] += 1
if li[8] == 0:
    print(str(9 - li.count(0))+" "+str(9 - li.count(0)))
else:
    print(str(8 - li.count(0))+" "+str(8 - li.count(0)+li[8]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = []
for i in range(n):
    if 1 <= a[i] <= 399:
        li.append("0")
    elif 400 <= a[i] <= 799:
        li.append("1")
    elif 800 <= a[i] <= 1199:
        li.append("2")
    elif 1200 <= a[i] <= 1599:
        li.append("3")
    elif 1600 <= a[i] <= 1999:
        li.append("4")
    elif 2000 <= a[i] <= 2399:
        li.append("5")
    elif 2400 <= a[i] <= 2799:
        li.append("6")
    elif 2800 <= a[i] <= 3199:
        li.append("7")
    else:
        li.append("8")
k = li.count("8")
t = len(list(set(li)))
if k == 0:
    print(str(t) + " " + str(t + k))
else:
    print(str(t-1) + " " + str(t + k-1))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = []
for i in range(n):
    if 1 <= a[i] <= 399:
        li.append("0")
    elif 400 <= a[i] <= 799:
        li.append("1")
    elif 800 <= a[i] <= 1199:
        li.append("2")
    elif 1200 <= a[i] <= 1599:
        li.append("3")
    elif 1600 <= a[i] <= 1999:
        li.append("4")
    elif 2000 <= a[i] <= 2399:
        li.append("5")
    elif 2400 <= a[i] <= 2799:
        li.append("6")
    elif 2800 <= a[i] <= 3199:
        li.append("7")
    else:
        li.append("10")
k = li.count("10")
t = len(list(set(li)))
if k == 0:
    print(str(t) + " " + str(t + k))
else:
    print(str(t-1) + " " + str(t + k-1))

Submission status: Wrong Answer

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

s = set()
count = 0
for i in range(n):
    if a[i] // 400 >= 8:
        count += 1
    else:
        s.add(a[i]//400)

print(len(s) if len(s) > 0 else 1, min(8, len(s)+count))

Submission status: Wrong Answer

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

s = set()
count = 0
for i in range(n):
    if a[i] // 400 >= 8:
        count += 1
    else:
        s.add(a[i]//400)

print(len(s), min(8, len(s)+count))

Submission status: Wrong Answer

Solution code:
na = lambda: list(map(int, input().split()))
n = int(input())
a = na()
ans = set()
pro = 0
for i in a:
    if i >= 3200:
        pro += 1
        continue
    ans.add(i // 400)
print(len(ans) if len(ans) > 0 else 0,  len(ans)+pro)

Submission status: Wrong Answer

Solution code:
na = lambda: list(map(int, input().split()))
n = int(input())
a = na()
ans = set()
pro = 0
for i in a:
    if i >= 3200:
        pro += 1
    ans.add(i // 400)
a = len(ans)-pro
print((a if a > 0 else 1),  len(ans))

Submission status: Wrong Answer

Solution code:
na = lambda: list(map(int, input().split()))
n = int(input())
a = na()
ans = set()
pro = 0
for i in a:
    if i >= 3200:
        pro += 1
        continue
    ans.add(i // 400)
print(len(ans), len(ans)+pro)

Submission status: Wrong Answer

Solution code:
na = lambda: list(map(int, input().split()))
n = int(input())
a = na()
ans = set()
pro = 0
for i in a:
    if i >= 3200:
        pro += 1
        continue
    ans.add(i // 400)
print(len(ans), (8 if len(ans)+pro >= 8 else len(ans)+pro))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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

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

    n = 8 - ans.count(0)
    print(max(1, n), min(8, n + ex))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
  a[i] = min(a[i], 3200)
  b.append(a[i] // 400)
if 8 in b:
  free = b.count(8)
  b_max = len(set(b[:-free])) + len(b[-free:])
  print("{} {}".format(max(len(set(b)) - 1, 1), b_max))
else:
  print("{} {}".format(len(set(b)), len(set(b))))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
  a[i] = min(a[i], 3200)
  b.append(a[i] // 400)
if 8 in b:
  free = b.count(8)
  b_max = len(set(b[:-free])) + len(b[-free:])
  print("{} {}".format(len(set(b)) - 1, b_max))
else:
  print("{} {}".format(len(set(b)), len(set(b))))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
rates = {}

def add_rates(i):
    if i not in rates:
        rates[i] = 1
    else:
        rates[i] += 1

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

cnt = len(rates)
if 8 not in rates:
    print(cnt, cnt)
else:
    print(cnt-1, cnt-1+rates[8])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
c = [0 for i in range(8)]
cnt = 0
for i in a:
    if i >= 3200:
        cnt += 1
    else:
        c[i // 400] = 1
ans = sum(c) + cnt
print(sum(c), ans)

Submission status: Wrong Answer

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

color_set = set()
all = 0

for a in a_list:
    if 1 <= a <= 399:
        color_set.add("gray")
    elif 400 <= a <= 799:
        color_set.add("brown")
    elif 800 <= a <= 1199:
        color_set.add("green")
    elif 1200 <= a <= 1599:
        color_set.add("lightblue")
    elif 1600 <= a <= 1999:
        color_set.add("blue")
    elif 2000 <= a <= 2399:
        color_set.add("yellow")
    elif 2400 <= a <= 2799:
        color_set.add("orange")
    elif 2800 <= a <= 3199:
        color_set.add("red")
    else:
        all += 1
print(len(color_set), all+len(color_set))

Submission status: Wrong Answer

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

color_set = set()
all = 0

for a in a_list:
    if 1 <= a <= 399:
        color_set.add("gray")
    elif 400 <= a <= 799:
        color_set.add("brown")
    elif 800 <= a <= 1199:
        color_set.add("green")
    elif 1200 <= a <= 1599:
        color_set.add("lightblue")
    elif 1600 <= a <= 1999:
        color_set.add("blue")
    elif 2000 <= a <= 2399:
        color_set.add("yellow")
    elif 2400 <= a <= 2799:
        color_set.add("orange")
    elif 2800 <= a <= 3199:
        color_set.add("red")
    else:
        all += 1
print(max(len(color_set),1), min(all+len(color_set), 8))

Submission status: Wrong Answer

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

color_set = set()
all = 0

for a in a_list:
    if 1 <= a <= 399:
        color_set.add("gray")
    elif 400 <= a <= 799:
        color_set.add("brown")
    elif 800 <= a <= 1199:
        color_set.add("green")
    elif 1200 <= a <= 1599:
        color_set.add("lightblue")
    elif 1600 <= a <= 1999:
        color_set.add("blue")
    elif 2000 <= a <= 2399:
        color_set.add("yellow")
    elif 2400 <= a <= 2799:
        color_set.add("orange")
    elif 2800 <= a <= 3199:
        color_set.add("red")
    else:
        all += 1
print(len(color_set), min(all+len(color_set), 8))

Submission status: Wrong Answer

Solution code:
def color(s):
    if s < 400:
        return 0
    if s < 800:
        return 1
    if s < 1200:
        return 2
    if s < 1600:
        return 3
    if s < 2000:
        return 4
    if s < 2400:
        return 5
    if s < 2800:
        return 6
    if s < 3200:
        return 7
    return 8


N = int(input())

a = [color(int(i)) for i in input().split()]
ans = 0
table = [False for i in range(10)]
for i in a:
    if i == 8:
        ans += 1
    else:
        table[i] = True

ret = 0
for f in table:
    if f:
        ret += 1

ans1 = max(ret,1)
ans2 = min(ret+ans,8)

print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
N = int( input())
A = list( map( int, input().split()))
C = [0]*8
col = 0
for a in A:
    for i in range(8):
        if a < (i+1)*400:
            C[i] = 1
            break
    else:
        col += 1
print("{} {}".format( sum(C), sum(C)+col))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))

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

for i in range(n):
    if A[i] // 400 >= 8:
        count[8] += 1
        
    elif count[A[i] // 400] == 0:
        count[A[i]//400] += 1

if count[8] == n:
    print(1, min(n, 8))
else:
    print(sum(count) - count[8], min(sum(count), 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))


def coloring(score):
    if score < 400:
        return "gray"
    elif score < 800:
        return "brown"
    elif score < 1200:
        return "green"
    elif score < 1600:
        return "cyan"
    elif score < 2000:
        return "blue"
    elif score < 2400:
        return "yellow"
    elif score < 2800:
        return "orange"
    elif score < 3200:
        return "red"
    else:
        return "?"


s = set()
num = 0

for score in A:
    color = coloring(score)
    if color == "?":
        num += 1
    else:
        s.add(color)

if len(s) >= 1:
    print(len(s), min(len(s) + num, 8))
else:
    print(1, min(num, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))


def coloring(score):
    if score < 400:
        return "gray"
    elif score < 800:
        return "brown"
    elif score < 1200:
        return "green"
    elif score < 1600:
        return "cyan"
    elif score < 2000:
        return "blue"
    elif score < 2400:
        return "yellow"
    elif score < 2800:
        return "orange"
    elif score < 3200:
        return "red"
    else:
        return "?"


s = set()
num = 0

for score in A:
    color = coloring(score)
    if color == "?":
        num += 1
    else:
        s.add(color)

print(len(s), min(len(s) + num, 8))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
A=list(map(int, input().split()))
for i in range(N):
    A[i]=0 if A[i]>=3200 else A[i]//400+1
if len(Counter(A).items())==1  and (0 in Counter(A)):
    print(1, A.count(0))
else:
    print(len(Counter(A).items())-(0 in Counter(A)), min((len(Counter(A).items())-(0 in Counter(A))+A.count(0)),8))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
A=list(map(int, input().split()))
for i in range(N):
    A[i]=0 if A[i]>=3200 else A[i]//400+1
if len(Counter(A).items())==1  and (0 in Counter(A)):
    print(1, A.count(0))
print(len(Counter(A).items())-(0 in Counter(A)), min((len(Counter(A).items())-(0 in Counter(A))+A.count(0)),8))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
A=list(map(int, input().split()))
for i in range(N):
    A[i]=0 if A[i]>=3200 else A[i]//400+1
print(len(Counter(A).items())-(0 in Counter(A)), min((len(Counter(A).items())-(0 in Counter(A))+A.count(0)),8))

Submission status: Wrong Answer

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

col = set()
wildc = 0

for i in range(N):
  if A[i] >= 3200:
    wildc += 1
  else:
    col.add(A[i] // 400)

a = len(col) if len(col) > 0 else 1
b = min(8, len(col)+wildc)
print(a, b)

Submission status: Wrong Answer

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

col = set()
wildc = 0

for i in range(N):
  if A[i] >= 3200:
    wildc += 1
  else:
    col.add(A[i] // 400)

print(len(col), min(8, len(col)+wildc))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x) for x in input().split()]

extra = 0
cnt = set()
for a in A:
    r = a // 400
    if r < 8:
        cnt.add(r)
    else:
        extra += 1
print(max(1, len(cnt)), min(len(cnt) + extra, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x) for x in input().split()]

extra = 0
cnt = {}
for a in A:
    r = a // 400
    if r < 8:
        cnt[r] = cnt.get(r, 0) + 1
    else:
        extra += 1
print(max(1, len(cnt)), min(len(cnt) + extra, 8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(x) for x in input().split()]

extra = 0
cnt = {}
for a in A:
    r = a // 400
    if r < 8:
        cnt[r] = cnt.get(r, 0) + 1
    else:
        extra += 1
print(len(cnt), min(len(cnt) + extra, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
from collections import defaultdict
ans = defaultdict(int)
b = 0
for rate in a:
    if rate <= 399:
        ans[0] += 1
    elif rate <= 799:
        ans[1] += 1
    elif rate <= 1199:
        ans[2] += 1
    elif rate <= 1599:
        ans[3] += 1
    elif rate <= 1999:
        ans[4] += 1
    elif rate <= 2399:
        ans[5] += 1
    elif rate <= 2799:
        ans[6] += 1
    elif rate <= 3199:
        ans[7] += 1
    else:
        b += 1

cnt = 0
for i in ans:
    if i > 0:
        cnt+=1
print(max(cnt,1), cnt+b)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
a = [int(x) // 400 for x in input().split()]

c = Counter(a)

cnt1, cnt2 = 0, 0
for k, v in c.items():
    if k < 8:
        cnt1 += 1
    else:
        cnt2 += v

if cnt1 == 0:
    print(1, min(cnt2, 8))
else:
    print(cnt1, min(cnt1 + cnt2, 8))

Submission status: Wrong Answer

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

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

colors = []
n_minus = 0
for ai in a:
    c = color(ai)
    if c == -1:
        n_minus += 1
    else:
        colors.append(c)
colors = list(set(colors))
if len(colors) == 0:
    print(1, min(max(n_minus, 1), 8))
else:
    print(len(colors), min(len(colors) + n_minus, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
from collections import defaultdict
ans = defaultdict(int)
b = 0
for rate in a:
    if rate <= 399:
        ans[0] += 1
    elif rate <= 799:
        ans[1] += 1
    elif rate <= 1199:
        ans[2] += 1
    elif rate <= 1599:
        ans[3] += 1
    elif rate <= 1999:
        ans[4] += 1
    elif rate <= 2399:
        ans[5] += 1
    elif rate <= 2799:
        ans[6] += 1
    elif rate <= 3199:
        ans[7] += 1
    else:
        b += 1

cnt = 0
for i in ans:
    if i > 0:
        cnt+=1
print(max(cnt,1), cnt+min(7,b))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
from collections import defaultdict
ans = defaultdict(int)
b = 0
for rate in a:
    if rate < 399:
        ans[0] += 1
    elif rate < 799:
        ans[1] += 1
    elif rate < 1199:
        ans[2] += 1
    elif rate < 1599:
        ans[3] += 1
    elif rate < 1999:
        ans[4] += 1
    elif rate < 2399:
        ans[5] += 1
    elif rate < 2799:
        ans[6] += 1
    elif rate < 3199:
        ans[7] += 1
    else:
        b += 1

cnt = 0
for i in ans:
    if i > 0:
        cnt+=1
print(max(cnt,1), cnt+min(7,b))

Submission status: Wrong Answer

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

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

colors = []
n_minus = 0
for ai in a:
    c = color(ai)
    if c == -1:
        n_minus += 1
    else:
        colors.append(c)
colors = list(set(colors))
if len(colors) == 0:
    print(1, min(n_minus, 8))
else:
    print(len(colors), min(len(colors) + n_minus, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
from collections import defaultdict
ans = defaultdict(int)
b = 0
for rate in a:
    if rate < 399:
        ans[0] += 1
    elif rate < 799:
        ans[1] += 1
    elif rate < 1199:
        ans[2] += 1
    elif rate < 1599:
        ans[3] += 1
    elif rate < 1999:
        ans[4] += 1
    elif rate < 2399:
        ans[5] += 1
    elif rate < 2799:
        ans[6] += 1
    elif rate < 3199:
        ans[7] += 1
    else:
        b += 1

cnt = 0
for i in ans:
    if i > 0:
        cnt+=1
print(cnt, cnt+min(7,b))

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())
a = [int(x) // 400 for x in input().split()]

c = Counter(a)

cnt1, cnt2 = 0, 0
for k, v in c.items():
    if k < 8:
        cnt1 += 1
    else:
        cnt2 += v

print(cnt1, min(cnt1 + cnt2, 8))

Submission status: Wrong Answer

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

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

colors = []
n_minus = 0
for ai in a:
    c = color(ai)
    if c == -1:
        n_minus += 1
    elif c not in colors:
        colors.append(c)
n_colors = len(colors)
print(n_colors, min(n_colors + n_minus, 8))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
count_color=[0]*8
wild_color=0
for i in range (N):
    if a[i]<400:
        count_color[0]=1
    elif a[i]<800:
        count_color[1]=1
    elif a[i]<1200:
        count_color[2]=1
    elif a[i]<1600:
        count_color[3]=1
    elif a[i]<2000:
        count_color[4]=1
    elif a[i]<2400:
        count_color[5]=1
    elif a[i]<2800:
        count_color[6]=1
    elif a[i]<3200:
        count_color[7]=1
    else:
        wild_color+=1
color=count_color.count(1)
print (color,color+wild_color)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
count_color=[0]*8
wild_color=0
for i in range (N):
    if a[i]<400:
        count_color[0]=1
    elif a[i]<800:
        count_color[1]=1
    elif a[i]<1200:
        count_color[2]=1
    elif a[i]<1600:
        count_color[3]=1
    elif a[i]<2000:
        count_color[4]=1
    elif a[i]<2400:
        count_color[5]=1
    elif a[i]<2800:
        count_color[6]=1
    elif a[i]<3200:
        count_color[7]=1
    else:
        wild_color+=1
color=count_color.count(1)
print (color, min(color+wild_color,8))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
count_color=[0]*8
wild_color=0
for i in range (N):
    if a[i]<400:
        count_color[0]=1
    elif a[i]<800:
        count_color[1]=1
    elif a[i]<1200:
        count_color[2]=1
    elif a[i]<1600:
        count_color[3]=1
    elif a[i]<2000:
        count_color[4]=1
    elif a[i]<2400:
        count_color[5]=1
    elif a[i]<2800:
        count_color[6]=1
    elif a[i]<3200:
        count_color[7]=1
    else:
        wild_color+=1
color=count_color.count(1)
print (color, min(color+wild_color,9))