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())
la = list(map(int, input().split()))

lv = list()
l9 = list()

for i in range(N):
    if 1 <= la[i] <= 399:
        if 1 not in lv:
            lv.append(1)
    if 400 <= la[i] <= 799:
        if 2 not in lv:
            lv.append(2)
    if 800 <= la[i] <= 1199:
        if 3 not in lv:
            lv.append(3)
    if 1200 <= la[i] <= 1599:
        if 4 not in lv:
            lv.append(4)
    if 1600 <= la[i] <= 1999:
        if 5 not in lv:
            lv.append(5)
    if 2000 <= la[i] <= 2399:
        if 6 not in lv:
            lv.append(6)
    if 2400 <= la[i] <= 2799:
        if 7 not in lv:
            lv.append(7)
    if 2800 <= la[i] <= 3199:
        if 8 not in lv:
            lv.append(8)
    if la[i] >= 3200:
        l9.append(9)

print(max(len(lv), 1), min(9, len(lv)+len(l9)))

Submission status: Wrong Answer

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

lv = list()
l9 = list()

for i in range(N):
    if 1 <= la[i] <= 399:
        if 1 not in lv:
            lv.append(1)
    if 400 <= la[i] <= 799:
        if 2 not in lv:
            lv.append(2)
    if 800 <= la[i] <= 1199:
        if 3 not in lv:
            lv.append(3)
    if 1200 <= la[i] <= 1599:
        if 4 not in lv:
            lv.append(4)
    if 1600 <= la[i] <= 1999:
        if 5 not in lv:
            lv.append(5)
    if 2000 <= la[i] <= 2399:
        if 6 not in lv:
            lv.append(6)
    if 2400 <= la[i] <= 2799:
        if 7 not in lv:
            lv.append(7)
    if 2800 <= la[i] <= 3199:
        if 8 not in lv:
            lv.append(8)
    if la[i] >= 3200:
        l9.append(9)

print(len(lv), min(9, len(lv)+len(l9)))

Submission status: Wrong Answer

Solution code:
def inp():
    return(int(input()))


def invr():
    return(map(int, input().split()))


n = inp()

ratings = invr()

flags = [0]*8
c = 0
a = 0
for r in ratings:
    if r >= 1 and r < 400 and flags[0] == 0:
        c += 1
        flags[0] = 1
    if r >= 400 and r < 800 and flags[1] == 0:
        c += 1
        flags[1] = 1
    if r >= 800 and r < 1200 and flags[2] == 0:
        c += 1
        flags[2] = 1
    if r >= 1200 and r < 1600 and flags[3] == 0:
        c += 1
        flags[3] = 1
    if r >= 1600 and r < 2000 and flags[4] == 0:
        c += 1
        flags[4] = 1
    if r >= 2000 and r < 2400 and flags[5] == 0:

        c += 1
        flags[5] = 1
    if r >= 2400 and r < 2800 and flags[6] == 0:
        c += 1
        flags[6] = 1
    if r >= 2800 and r < 3200 and flags[7] == 0:
        c += 1
        flags[7] = 1
    if r >= 3200:
        a += 1
print(c, a+c)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
_ = input()
a = list(map(int, input().split()))
rank_set={x//400 for x in a if x < 3200}
cnt_over3200=len(list(filter(lambda x: x>=3200, a)))
ans=len(rank_set)
if ans == 0:
    print('{} {}'.format(1, min(cnt_over3200, 8)))
else:
    print('{} {}'.format(ans, min(ans+cnt_over3200, 8)))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
_ = input()
a = list(map(int, input().split()))
rank_set={x//400 for x in a if x < 3200}
cnt_over3200=len(list(filter(lambda x: x>=3200, a)))
ans=len(rank_set)
if ans == 0:
    print('{} {}'.format(1, cnt_over3200))
else:
    print('{} {}'.format(ans, min(ans+cnt_over3200, 8)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
_ = input()
a = list(map(int, input().split()))

#a=[1100, 1900, 2800, 3200, 3200]
rank_set={x//400 for x in a if x < 3200}
cnt_over3200=len(list(filter(lambda x: x>=3200, a)))
ans=len(rank_set)
print('{} {}'.format(ans, min(ans+cnt_over3200, 8)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
_ = input()
a = list(map(int, input().split()))

#a=[1100, 1900, 2800, 3200, 3200]
rank_set={x//400  for x in a if x < 3200}
cnt_over3200=len(list(filter(lambda x: x>=3200, a)))
ans=len(rank_set)
print('{} {}'.format(ans, min(ans+cnt_over3200, 8)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys

def f(r):
    '''
    >>> f(399)
    0
    >>> f(400)
    1
    >>> f(3200)
    8
    '''
    from bisect import bisect
    R = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
    return bisect(R, r)

def solve(N: int, a: "List[int]"):
    from collections import Counter
    b = tuple(map(f, a))
    c = Counter(b)
    return max(1, len(c)-(1 if c[8] else 0)), min(8, len(c)+(c[8]-1 if c[8] else 0))


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(*solve(N, a))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    test()
    main()

Submission status: Wrong Answer

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

L = set()
cnt = 0
for a in A:
    c = a//400
    if c >= 8:
        cnt += 1
    else:
        L.add(a//400)

print(len(L),len(L)+cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

a = np.bincount(a//400)

fixed = np.where(a[:8]>0)[0].shape[0]
colorful = a[8:].sum()

print(fixed, fixed+colorful)

Submission status: Wrong Answer

Solution code:
# ABC064
# C
# Colorful Leaderboard

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

color_list = [0]*8
over = 0
for i in range(n):
    _ = a_list[i] // 400
    if _ < 8:
        color_list[_] = 1
    else:
        over += 1

_tmp = sum(color_list)
print("%d %d"%(_tmp, _tmp+over))

Submission status: Wrong Answer

Solution code:
# ABC 064 C
N = int(input())
from collections import Counter
def get_color(a):
    if a<400:
        return 1
    elif a<800:
        return 2
    elif a<1200:
        return 3
    elif a<1600:
        return 4
    elif a<2000:
        return 5
    elif a<2400:
        return 6
    elif a<2800:
        return 7
    elif a<3200:
        return 8
    else:
        return 999

A = [get_color(int(j)) for j in input().split()]
C_A = Counter(A)

if C_A[999]>0:
    print(len(set(A))-1,len(set(A))-1+C_A[999])
else:
    print(min(len(set(A)),8),min(len(set(A)),8))

Submission status: Wrong Answer

Solution code:
# ABC 064 C
N = int(input())
from collections import Counter
def get_color(a):
    if a<400:
        return 1
    elif a<800:
        return 2
    elif a<1200:
        return 3
    elif a<1600:
        return 4
    elif a<2000:
        return 5
    elif a<2400:
        return 6
    elif a<2800:
        return 7
    elif a<3200:
        return 8
    else:
        return 999

A = [get_color(int(j)) for j in input().split()]
C_A = Counter(A)

if C_A[999]>0:
    print(len(set(A))-1,min(len(set(A))-1+C_A[999],8))
else:
    print(min(len(set(A)),8),min(len(set(A)),8))

Submission status: Wrong Answer

Solution code:
# ABC 064 C
N = int(input())
from collections import Counter
def get_color(a):
    if a<400:
        return 1
    elif a<800:
        return 2
    elif a<1200:
        return 3
    elif a<1600:
        return 4
    elif a<2000:
        return 5
    elif a<2400:
        return 6
    elif a<2800:
        return 7
    elif a<3200:
        return 8
    else:
        return 999

A = [get_color(int(j)) for j in input().split()]
C_A = Counter(A)

if 999 in set(A):
    print(len(set(A))-1,min(len(set(A))-1+C_A[999],8))
else:
    print(min(len(set(A)),8),min(len(set(A)),8))

Submission status: Wrong Answer

Solution code:
# ABC 064 C
N = int(input())
from collections import Counter
def get_color(a):
    if a<400:
        return 1
    elif a<800:
        return 2
    elif a<1200:
        return 3
    elif a<1600:
        return 4
    elif a<2000:
        return 5
    elif a<2400:
        return 6
    elif a<2800:
        return 7
    elif a<3200:
        return 8
    else:
        return 999

A = [get_color(int(j)) for j in input().split()]
C_A = Counter(A)

if 999 in set(A):
    print(len(A) -C_A[999],min(len(A),8))
else:
    print(min(len(set(A)),8),min(len(set(A)),8))

Submission status: Wrong Answer

Solution code:
N = int(input())
def get_color(a):
    if a<400:
        return 1
    elif a<800:
        return 2
    elif a<1200:
        return 3
    elif a<1600:
        return 4
    elif a<2000:
        return 5
    elif a<2400:
        return 6
    elif a<2800:
        return 7
    elif a<3200:
        return 8
    else:
        return 999

A = [get_color(int(j)) for j in input().split()]
if 999 in set(A):
    print(len(set(A))-1,min(len(set(A))+1,8))
else:
    print(min(len(set(A)),8),min(len(set(A)),8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
L = [0] * 8
cnt = 0
for i in a:
    if 1 <= i < 400:
        L[0] = 1
    elif 400 <= i < 800:
        L[1] = 1
    elif 800 <= i < 1200:
        L[2] = 1
    elif 1200 <= i < 1600:
        L[3] = 1
    elif 1600 <= i < 2000:
        L[4] = 1
    elif 2000 <= i < 2400:
        L[5] = 1
    elif 2400 <= i < 2800:
        L[6] = 1
    elif 2800 <= i < 3200:
        L[7] = 1
    else:
        cnt += 1
m = sum(L)
M = m + cnt
print(m, M)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
L = [0] * 8
cnt = 0
for i in a:
    if 1 <= i < 400:
        L[0] = 1
    elif 400 <= i < 800:
        L[1] = 1
    elif 800 <= i < 1200:
        L[2] = 1
    elif 1200 <= i < 1600:
        L[3] = 1
    elif 1600 <= i < 2000:
        L[4] = 1
    elif 2000 <= i < 2400:
        L[5] = 1
    elif 2400 <= i < 2800:
        L[6] = 1
    elif 2800 <= i < 3200:
        L[7] = 1
    else:
        cnt += 1
m = sum(L)
M = m + min(cnt, 8 - m)
print(m, M)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
L = [0] * 8
cnt = 0
for i in a:
    if 1 <= i < 400:
        L[0] = 1
    elif 400 <= i < 800:
        L[1] = 1
    elif 800 <= i < 1200:
        L[2] = 1
    elif 1200 <= i < 1600:
        L[3] = 1
    elif 1600 <= i < 2000:
        L[4] = 1
    elif 2000 <= i < 2400:
        L[5] = 1
    elif 2400 <= i < 2800:
        L[6] = 1
    elif 2800 <= i < 3200:
        L[7] = 1
    else:
        cnt += 1
m = sum(L)
M = m + min(cnt, 8)
print(m, M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = [False]*8
ov = 0

for i in range(n):
    if a[i] < 3200:
        l[a[i]//400] = True
    else:
        ov += 1

ans = l.count(True)

print(ans, ans + ov)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = [False]*9
ov = 0

for i in range(n):
    if a[i] < 3200:
        l[a[i]//400] = True
    else:
        ov += 1

ans = l.count(True)

print(ans, min(ans + ov, 8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
l = [False]*9
ov = 0

for i in range(n):
    if a[i] < 3200:
        l[a[i]//400] = True
    else:
        ov += 1

ans = l.count(True)

print(ans, min(ans + ov, 9))

Submission status: Wrong Answer

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

d=[0 for i in range(9)]

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

count=0
k=[]
for i in d:
  if i!=0:
    k.append(1)
    count+=1
  else:
    k.append(0)
if count-k[8]>1 and count+d[8]-k[8]<=9:
  print(count-1,count+d[8]-1)
elif count-k[8]>1 and count+d[8]-k[8]>9:
  print(count-1,9)
elif count+d[8]-k[8]<=9:
  print(1,count+d[8]-1)
else:
  print(1,9)

Submission status: Wrong Answer

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

d=[0 for i in range(9)]

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

Submission status: Wrong Answer

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

d=[0 for i in range(9)]

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

Submission status: Wrong Answer

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

d=[0 for i in range(9)]

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 13:29:53 2020

@author: shinba
"""

n = int(input())

data = {}

f = 0

for i in map(int,input().split()):
    if 1 <= i < 400:
        data["gray"] = 1
    elif 400 <= i < 800:
        data["brown"] = 1
    elif 800 <= i < 1200:
        data["green"] = 1
    elif 1200 <= i < 1600:
        data["w"] = 1
    elif 1600 <= i < 2000:
        data["blue"] = 1
    elif 2000 <= i < 2400:
        data["y"] = 1
    elif 2400 <= i < 2800:
        data["o"] = 1
    elif 2800 <= i < 3200:
        data["r"] = 1
    else:
        f += 1

print(min(len(data),1),len(data)+f)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 13:29:53 2020

@author: shinba
"""

n = int(input())

B = ["gray","brown","green","w","blue","y","o","r","f"]
data = {}

for b in B:
    data[b] = 0

for i in map(int,input().split()):
    if 1 <= i < 400:
        data["gray"] += 1
    elif 400 <= i < 800:
        data["brown"] += 1
    elif 800 <= i < 1200:
        data["green"] += 1
    elif 1200 <= i < 1600:
        data["w"] += 1
    elif 1600 <= i < 2000:
        data["blue"] += 1
    elif 2000 <= i < 2400:
        data["y"] += 1
    elif 2400 <= i < 2800:
        data["o"] += 1
    elif 2800 <= i < 3200:
        data["r"] += 1
    else:
        data["f"] += 1

f = data["f"]
data["f"] = 0
ans = 0
for i in data.values():
    if i != 0:
        ans += 1

if ans == 0:
    print(1,min(9,f))
else:
    print(ans,min(9,ans+f))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

x = [0]*9

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

res = sum(x[:-1])

if res > 0:
    print("{} ".format(res),end="")
else:
    if x[8] == 0:
        print("0 ")
    else:
        print("1 ")

print(min(8,res+x[8]))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

x = [0]*9

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

res = sum(x[:-1])

if res > 0:
    print("{} ".format(res),end="")
else:
    print("1 ")


if res+x[8] >= 8:
    print("8")
else:
    print(res+x[8])

Submission status: Wrong Answer

Solution code:
n=int(input())
r=list(map(int,input().split()))
rlist=[]
def color(n):
    if n<400:
        return 1
    elif n<800:
        return 2
    elif n<1200:
        return 3
    elif n<1600:
        return 4
    elif n<2000:
        return 5 
    elif n<2400:
        return 6 
    elif n<2800:
        return 7 
    elif n<3200:
        return 8 
    else:
        return 9

for _ in range(n):
    co=color(r[_])
    rlist.append(co)

ans1=len(set(rlist))

if rlist.count(9)==0:
    print(ans1,ans1,sep=" ")

else:    
    if ans1==1:
        print(1,min(8,rlist.count(9)),sep=" ")

    else:
        print(min(8,ans1-1),min(8,ans1-1+rlist.count(9)),sep=" ")

Submission status: Wrong Answer

Solution code:
n=int(input())
r=list(map(int,input().split()))
rlist=[]
def color(n):
    if n<400:
        return 1
    elif n<800:
        return 2
    elif n<1200:
        return 3
    elif n<1600:
        return 4
    elif n<2000:
        return 5 
    elif n<2400:
        return 6 
    elif n<2800:
        return 7 
    elif n<3200:
        return 8 
    else:
        return 9

for _ in range(n):
    co=color(r[_])
    rlist.append(co)

ans1=len(set(rlist))
if rlist.count(9)==0:
    print(ans1,ans1,sep=" ")
else:
    print(min(8,ans1-1),min(8,ans1-1+rlist.count(9)),sep=" ")

Submission status: Wrong Answer

Solution code:
N = int(input())

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

x = [0]*9

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

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

if res != 0:
    print("{} ".format(res),end="")
else:
    print(1)

if res+x[8] >= 8:
    print("8")
else:
    print(res+x[8])

Submission status: Wrong Answer

Solution code:
N = int(input())

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

x = [0]*9

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

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

if res >= 8:
    print("8 ",end="")
elif res == 0:
    print(1)
else:
    print("{} ".format(res),end="")

if res+x[8] >= 8:
    print("8")
else:
    print(res+x[8])

Submission status: Wrong Answer

Solution code:
N = int(input())

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

x = [0]*9

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

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

if res >= 8:
    print("8 ",end="")
else:
    print("{} ".format(res),end="")

if res+x[8] >= 8:
    print("8")
elif res == 0:
    print(1)
else:
    print(res+x[8])

#print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

x = [0]*9

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

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

if res >= 8:
    print("8 ",end="")
else:
    print("{} ".format(res),end="")

if res+x[8] >= 8:
    print("8")
else:
    print(res+x[8])

#print(x)

Submission status: Wrong Answer

Solution code:
def main():
    n, *x = map(int, open(0).read().split())

    a = sum([i < 400 for i in x])
    b = sum([i < 800 for i in x])
    c = sum([i < 1200 for i in x])
    d = sum([i < 1600 for i in x])
    e = sum([i < 2000 for i in x])
    f = sum([i < 2400 for i in x])
    g = sum([i < 2800 for i in x])
    h = sum([i < 3200 for i in x])
    xxx = sum([i >= 3200 for i in x])

    i = [a, (b - a), (c - b), (d - c), (e - d), (f - e), (g - f), (h - g)]
    ans = sum([j >= 1 for j in i])
    print(max(ans, 1), min(8, ans + xxx))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n, *x = map(int, open(0).read().split())

    a = sum([i < 400 for i in x])
    b = sum([i < 800 for i in x])
    c = sum([i < 1200 for i in x])
    d = sum([i < 1600 for i in x])
    e = sum([i < 2000 for i in x])
    f = sum([i < 2400 for i in x])
    g = sum([i < 2800 for i in x])
    h = sum([i < 3200 for i in x])
    xxx = sum([i >= 3200 for i in x])

    i = [a, (b - a), (c - b), (d - c), (e - d), (f - e), (g - f), (h - g)]
    ans = sum([j > 1 for j in i])
    print(max(ans, 1), min(8, ans + xxx))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n, *x = map(int, open(0).read().split())

    a = sum([i < 400 for i in x])
    b = sum([i < 800 for i in x])
    c = sum([i < 1200 for i in x])
    d = sum([i < 1600 for i in x])
    e = sum([i < 2000 for i in x])
    f = sum([i < 2400 for i in x])
    g = sum([i < 2800 for i in x])
    h = sum([i < 3200 for i in x])
    xxx = sum([i >= 3200 for i in x])

    i = [a, (b - a), (c - b), (d - c), (e - d), (f - e), (g - f), (h - g)]
    ans = sum([j > 0 for j in i])
    print(max(ans, 1), min(8, ans + xxx))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n, *x = map(int, open(0).read().split())

    a = sum([i < 400 for i in x])
    b = sum([i < 800 for i in x])
    c = sum([i < 1200 for i in x])
    d = sum([i < 1600 for i in x])
    e = sum([i < 2000 for i in x])
    f = sum([i < 2400 for i in x])
    g = sum([i < 2800 for i in x])
    h = sum([i < 3200 for i in x])
    xxx = sum([i >= 3200 for i in x])

    i = [a, (b - a), (c - b), (d - c), (e - d), (f - e), (g - f), (h - g)]
    ans = sum([j > 0 for j in i])
    print(max(ans, xxx != 0), min(8, ans + xxx))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n, *x = map(int, open(0).read().split())

    a = sum([i < 400 for i in x])
    b = sum([i < 800 for i in x])
    c = sum([i < 1200 for i in x])
    d = sum([i < 1600 for i in x])
    e = sum([i < 2000 for i in x])
    f = sum([i < 2400 for i in x])
    g = sum([i < 2800 for i in x])
    h = sum([i < 3200 for i in x])
    xxx = sum([i >= 3200 for i in x])

    i = [a, (b - a), (c - b), (d - c), (e - d), (f - e), (g - f), (h - g)]
    ans = sum([j > 0 for j in i])
    print(max(ans, xxx != 0), ans + min(xxx, 8))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n, *x = map(int, open(0).read().split())

    a = sum([i < 400 for i in x])
    b = sum([i < 800 for i in x])
    c = sum([i < 1200 for i in x])
    d = sum([i < 1600 for i in x])
    e = sum([i < 2000 for i in x])
    f = sum([i < 2400 for i in x])
    g = sum([i < 2800 for i in x])
    h = sum([i < 3200 for i in x])
    xxx = sum([i >= 3200 for i in x])

    i = [a, (b - a), (c - b), (d - c), (e - d), (f - e), (g - f), (h - g)]
    ans = sum([j > 0 for j in i])
    print(max(ans, xxx != 0), ans + xxx)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n, *x = map(int, open(0).read().split())

    a = sum([i < 400 for i in x])
    b = sum([i < 800 for i in x])
    c = sum([i < 1200 for i in x])
    d = sum([i < 1600 for i in x])
    e = sum([i < 2000 for i in x])
    f = sum([i < 2400 for i in x])
    g = sum([i < 2800 for i in x])
    h = sum([i < 3200 for i in x])
    xxx = sum([i >= 3200 for i in x])

    i = [a, (b - a), (c - b), (d - c), (e - d), (f - e), (g - f), (h - g)]
    ans = sum([j > 0 for j in i])
    print(ans, ans + xxx)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
from fractions import gcd
import math
def resolve():
    N=pin()
    X=[x//400 for x in tupin()]
    s=set()
    free=0
    for x in X:
        if x>=8:free+=1
        else: s.add(x)
    print(len(s),len(s)+free)
        
    
        #print("".join(X).split("0"))
#%%submit!      
resolve()