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:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc064/tasks/abc064_c
N = read_a_int()
A = read_ints()

if N == 1:  # コーナーケースかー
    print(1, 1)
    exit()


# 色は400ごとに変化(400で割っておくと処理が楽そう)
import numpy as np
A = np.array(A) // 400

cnt = Counter(A)
# print(cnt)
ans_min = 0
ans_max = 0
for k, v in cnt.items():
    if k >= 8:
        ans_max += v
    else:
        ans_min += 1
        ans_max += 1

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc064/tasks/abc064_c
N = read_a_int()
A = read_ints()

if N == 1:  # コーナーケースかー
    print(1, 1)


# 色は400ごとに変化(400で割っておくと処理が楽そう)
import numpy as np
A = np.array(A) // 400

cnt = Counter(A)
# print(cnt)
ans_min = 0
ans_max = 0
for k, v in cnt.items():
    if k >= 8:
        ans_max += v
    else:
        ans_min += 1
        ans_max += 1

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc064/tasks/abc064_c
N = read_a_int()
A = read_ints()

# 色は400ごとに変化(400で割っておくと処理が楽そう)
import numpy as np
A = np.array(A) // 400

cnt = Counter(A)
# print(cnt)
ans_min = 0
ans_max = 0
for k, v in cnt.items():
    if k >= 8:
        ans_max += v
    else:
        ans_min += 1
        ans_max += 1

print(ans_min, ans_max)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()
ans = 0
yowa = 0
tuyo = 0
dic = defaultdict(int)
d = [0] * 8
for a in A:
    if a < 3200:
        if 1 <= a <= 399:
            d[0] = 1
        elif 400 <= a <= 799:
            d[1] = 1
        elif 800 <= a <= 1199:
            d[2] = 1
        elif 1200 <= a <= 1599:
            d[3] = 1
        elif 1600 <= a <= 1999:
            d[4] = 1
        elif 2000 <= a <= 2399:
            d[5] = 1
        elif 2400 <= a <= 2799:
            d[6] = 1
        elif 2800 <= a <= 3199:
            d[7] = 1
    else:
        tuyo += 1

al = sum(d)

if tuyo == 0:
    mi = al
elif tuyo >= 1:
    if al >= 1:
        mi = al
    else:
        mi = 1
# no zero in d
zero = 7 - al    

mx = min(7, 7-(zero-tuyo))
print(mi, mx)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
if n==1:
  print(1)
  exit(0)
for i in range(n):
  if 1<=a[i]<=399:
    a[i]="gray"
  elif 400<=a[i]<=799:
    a[i]="brown"
  elif 800<=a[i]<=1199:
    a[i]="green"
  elif 1200<=a[i]<=1599:
    a[i]="lightblue"
  elif 1600<=a[i]<=1999:
    a[i]="blue"
  elif 2000<=a[i]<=2399:
    a[i]="yellow"
  elif 2400<=a[i]<=2799:
    a[i]="orange"
  elif 2800<=a[i]<=3199:
    a[i]="red"
  elif 3200<=a[i]:
    a[i]="free"
# print(a)
from collections import Counter
c=Counter(a)
ans=len(c)
free=c["free"]
if free>0:
  ans-=1
print(ans,ans+free)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc064/tasks/abc064_c
N = read_a_int()
A = read_ints()

# 色は400ごとに変化(400で割っておくと処理が楽そう)
import numpy as np
A = np.array(A) // 400

cnt = Counter(A)
# print(cnt)
ans = len(cnt) if cnt[8] == 0 else len(cnt) - 1
print(ans, ans + cnt[8])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
  if 1<=a[i]<=399:
    a[i]="gray"
  elif 400<=a[i]<=799:
    a[i]="brown"
  elif 800<=a[i]<=1199:
    a[i]="green"
  elif 1200<=a[i]<=1599:
    a[i]="lightblue"
  elif 1600<=a[i]<=1999:
    a[i]="blue"
  elif 2000<=a[i]<=2399:
    a[i]="yellow"
  elif 2400<=a[i]<=2799:
    a[i]="orange"
  elif 2800<=a[i]<=3199:
    a[i]="red"
  elif 3200<=a[i]:
    a[i]="free"
# print(a)
from collections import Counter
c=Counter(a)
ans=len(c)
free=c["free"]
if free>0:
  ans-=1
print(ans,ans+free)

Submission status: Wrong Answer

Solution code:
a = int(input())
p = list(map(int,input().split()))
c = 0

for e,i in enumerate(p):
  for j in range(0,8):
    if j*400<= i <(j+1)*400:
      p[e] = j
      break

    p[e] = -1
c = p.count(-1)
# print(p,c)
t = len(set(p))
if c== 0:
  print(t,t)
elif c>0 and t==1:
  print(1,min(c,8)) 

else:
  print(t-(c>0),min(t-1+c,8))

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()
ans = 0
yowa = 0
tuyo = 0
dic = defaultdict(int)
d = [0] * 8
for a in A:
    if a < 3200:
        if 1 <= a <= 399:
            d[0] = 1
        elif 400 <= a <= 799:
            d[1] = 1
        elif 800 <= a <= 1199:
            d[2] = 1
        elif 1200 <= a <= 1599:
            d[3] = 1
        elif 1600 <= a <= 1999:
            d[4] = 1
        elif 2000 <= a <= 2399:
            d[5] = 1
        elif 2400 <= a <= 2799:
            d[6] = 1
        elif 2800 <= a <= 3199:
            d[7] = 1
    else:
        tuyo += 1

al = sum(d)
if al >= 1:
    mi = al
else:
    mi = 1
# no zero in d
tuyo
zero = 7 - al    

mx = min(7, 7-(zero-tuyo))
print(mi, mx)

Submission status: Wrong Answer

Solution code:
N=int(input())
m=list(map(int,input().split()))
ans=0
rainbow=0
table=[0,0,0,0,0,0,0,0]
for i in m:
  if i>3199:
    rainbow+=1
  else:
    if table[i//400]==0:
      ans=ans+1
      table[i//400]=1
print(max(1,sum(table)))
print(min(8,sum(table)+rainbow))

Submission status: Wrong Answer

Solution code:
a = int(input())
p = list(map(int,input().split()))
c = 0

for e,i in enumerate(p):
  for j in range(0,8):
    if j*400<= i <(j+1)*400:
      p[e] = j
      break

    p[e] = -1
c = p.count(-1)
# print(p,c)
t = len(set(p))
if c== 0:
  print(t,t)
elif c>0 and t==1:
  print(1,min(c,8)) 

else:
  print(t-1,min(t-1+c,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = []
free = 0
for x in a:
    if x < 400:color.append("g")
    elif x < 800:color.append("b")
    elif x < 1200:color.append("gr")
    elif x < 1600:color.append("bl1")
    elif x < 2000:color.append("bl2")
    elif x < 2400:color.append("y")
    elif x < 2800:color.append("o")
    elif x < 3200:color.append("r")
    else: free += 1
color = list(set(color))
ans = len(color)
if ans == 0 and free > 0: ans = 1
print(ans, ans + free)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
p = list(map(int,input().split()))
c = 0

for e,i in enumerate(p):
  for j in range(0,8):
    if j*400<= i <(j+1)*400:
      p[e] = j
      break

    p[e] = -1
c = p.count(-1)
# print(p,c)
t = len(set(p))
if c== 0:
  print(t,t)
elif c>0 and t==1:
  print(1,min(t,8)) 

else:
  print(t-1,min(t-1+c,8))

Submission status: Wrong Answer

Solution code:
n = int(input())
kinds = set()
rainbow = 0
for a in list(map(int, input().split())):
    color = a // 400
    if color < 8:
        kinds.add(color)
    else:
        rainbow += 1

print(max(len(kinds), 1), min(8, len(kinds) + rainbow))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = []
free = 0
for x in a:
    if x < 400:color.append("g")
    elif x < 800:color.append("b")
    elif x < 1200:color.append("gr")
    elif x < 1600:color.append("bl1")
    elif x < 2000:color.append("bl2")
    elif x < 2400:color.append("y")
    elif x < 2800:color.append("o")
    elif x < 3200:color.append("r")
    else: free += 1
print(len(list(set(color))), len(list(set(color))) + free)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from operator import itemgetter
from bisect import bisect_left, bisect_right, insort_left, insort_right
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    n = int(input())
    A = list(map(int, input().split()))
    color = defaultdict(int)
    god = 0
    for i in A:
        if i < 400:
            color['gray'] = 1
        elif i < 800:
            color['brown'] = 1
        elif i < 1200:
            color['green'] = 1
        elif i < 1600:
            color['light_blue'] = 1
        elif i < 2000:
            color['blue'] = 1
        elif i < 2400:
            color['yellow'] = 1
        elif i < 2800:
            color['orange'] = 1
        elif i < 3200:
            color['red'] = 1
        else:
            god += 1
    print(color)
    print(len(color), len(color) + god)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  s = set()
  free = 0
  for score in a:
    rank = get_rank(score)
    if (rank == 8):
      free += 1
    else:
      s.add(rank)
  print(max(1, len(s)), min(8, len(s) + free))
  return

if __name__ == "__main__":
  resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())
kinds = set()
rainbow = 0
for a in list(map(int, input().split())):
    color = a // 400
    if color < 8:
        kinds.add(color)
    else:
        rainbow += 1

if kinds:
    mini = len(kinds)
    maxi = min(8, mini + rainbow)
else:
    mini = 1
    maxi = min(8, rainbow)
print(mini, maxi)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
color = []
free = 0
for x in a:
    if x < 400:
        if "g" not in color: color.append("g")
    elif x < 800:
         if "b" not in color: color.append("b")
    elif x < 1200:
        if "gr" not in color: color.append("gr")
    elif x < 1600:
        if "bl1" not in color: color.append("bl1")
    elif x < 2000:
        if "bl2" not in color: color.append("bl2")
    elif x < 2400:
        if "y" not in color: color.append("y")
    elif x < 2800:
        if "o" not in color: color.append("o")
    elif x < 3200:
        if "r" not in color: color.append("r")
    else: free += 1
print(len(color), len(color) + free)

Submission status: Wrong Answer

Solution code:
import math

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

Nagasa = len(L)
over = 0

counter = [0]*8

for i in range (0, Nagasa):
	if L[i] >= 3200:
		over+=1
	else:
		counter[math.floor(L[i]/400)]=1

count = sum(counter)

print(max(1, count), min(8, count+over))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    A = readInts()
    dic = defaultdict(int)
    ok = 0
    for i in range(n):
        if 1 <= A[i] <= 399:
            dic['g'] = 1
        elif 400 <= A[i] <= 799:
            dic['b'] = 1
        elif 800 <= A[i] <= 1199:
            dic['gr'] = 1
        elif 1200 <= A[i] <= 1599:
            dic['w'] = 1
        elif 1600 <= A[i] <= 1999:
            dic['bl'] = 1
        elif 2000 <= A[i] <= 2399:
            dic['f'] = 1
        elif 2400 <= A[i] <= 2799:
            dic['bbb'] = 1
        elif 2800 <= A[i] <= 3199:
            dic['adava'] = 1
        else:
            ok += 1
    cnt = 0
    for k,v in dic.items():
        cnt += 1
    print(cnt,cnt+ok)
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
al = list(map(int, input().split()))


t = 0
d = defaultdict(lambda: 1)
for a in al:
    if a >= 3200:
        t += 1
    else:
        d[str(a // 400)] += 1
print(len(d), len(d)+t)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = [int(x) for x in input().split()]
    colors = [0] * 9
    for aa in a:
        index = -1
        for i in range(8):
            if 400 * i <= aa < 400 * (i + 1):
                index = i
        colors[index] += 1
    answer = 0
    for i in range(8):
        if colors[i] > 0:
            answer += 1
    print(answer, answer + colors[-1])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

for i in range(N):
    if a[i] // 400 < 8:
        C[a[i]//400] = 1
    else:
        C[8] += 1

ans_min = sum(C[:8])
ans_max = sum(C)
print(ans_min,ans_max)

Submission status: Wrong Answer

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

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

for i in range(N):
    if a[i] // 400 < 8:
        C[a[i]//400] = 1
    else:
        C[8] += 1

ans_min = sum(C[:8])
ans_max = min(8,sum(C))
print(ans_min,ans_max)

Submission status: Wrong Answer

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

b=[]
c=0
for i in a:
    if i<8:
        b.append(i)
    else:
        c+=1
b=set(b)

print(len(b),len(b)+c)

Submission status: Wrong Answer

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

rate_map = [0] * 9
for i in a:
    rate_map[8 if i // 400 > 8  else i // 400] += 1
base = len(list(filter(lambda x: bool(x), rate_map[:8])))
# print(rate_map)
print("{} {}".format(base, base+rate_map[8]))

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))
ma = 0
mi = 0
color = [False for _ in range(8)]

red = 0
for i in range(n):
    if 1<=a[i]<= 399:
        color[0] = True
        
    elif 400<=a[i]<=799:
        color[1] = True
        
    elif 800<=a[i]<=1199:
        color[2] = True
        
    elif 1200<=a[i]<=1599:
        color[3] = True
        
    elif 1600<=a[i]<=1999:
        color[4] = True
        
    elif 2000<=a[i]<=2399:
        color[5] = True
        
    elif 2400<=a[i]<=2799:
        color[6] = True
        
    elif 2800<=a[i]<=3199:
        color[7] = True
        
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = 8
        
if c == 0:
    mi = 1
else:
    mi = c
    

print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if 1<=a[i]<= 399:
        color[0] = True
        
    elif 400<=a[i]<=799:
        color[1] = True
        
    elif 800<=a[i]<=1199:
        color[2] = True
        
    elif 1200<=a[i]<=1599:
        color[3] = True
        
    elif 1600<=a[i]<=1999:
        color[4] = True
        
    elif 2000<=a[i]<=2399:
        color[5] = True
        
    elif 2400<=a[i]<=2799:
        color[6] = True
        
    elif 2800<=a[i]<=3199:
        color[7] = True
        
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = 8
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if 1<=a[i]<= 399:
        color[0] = True
        
    elif 400<=a[i]<=799:
        color[1] = True
        
    elif 800<=a[i]<=1199:
        color[2] = True
        
    elif 1200<=a[i]<=1599:
        color[3] = True
        
    elif 1600<=a[i]<=1999:
        color[4] = True
        
    elif 2000<=a[i]<=2399:
        color[5] = True
        
    elif 2400<=a[i]<=2799:
        color[6] = True
        
    elif 2800<=a[i]<=3199:
        color[7] = True
        
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = c
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if 1<=a[i]<= 399:
        color[0] = True
    elif 400<=a[i]<=799:
        color[1] = True
    elif 800<=a[i]<=1199:
        color[2] = True
    elif 1200<=a[i]<=1599:
        color[3] = True
    elif 1600<=a[i]<=1999:
        color[4] = True
    elif 2000<=a[i]<=2399:
        color[5] = True
    elif 2400<=a[i]<=2799:
        color[6] = True
    elif 2800<=a[i]<=3199:
        color[7] = True
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = c
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<=799:
        color[1] = True
    elif 800<=a[i]<=1199:
        color[2] = True
    elif 1200<=a[i]<=1599:
        color[3] = True
    elif 1600<=a[i]<=1999:
        color[4] = True
    elif 2000<=a[i]<=2399:
        color[5] = True
    elif 2400<=a[i]<=2799:
        color[6] = True
    elif 2800<=a[i]<=3199:
        color[7] = True
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = c
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<=799:
        color[1] = True
    elif 800<=a[i]<=1199:
        color[2] = True
    elif 1200<=a[i]<=1599:
        color[3] = True
    elif 1600<=a[i]<=1999:
        color[4] = True
    elif 2000<=a[i]<=2399:
        color[5] = True
    elif 2400<=a[i]<=2799:
        color[6] = True
    elif 2800<=a[i]<=3199:
        color[7] = True
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = 8
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(9)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<800:
        color[1] = True
    elif 800<=a[i]<1200:
        color[2] = True
    elif 1200<=a[i]<1600:
        color[3] = True
    elif 1600<=a[i]<2000:
        color[4] = True
    elif 2000<=a[i]<2400:
        color[5] = True
    elif 2400<=a[i]<2800:
        color[6] = True
    elif 2800<=a[i]<3200:
        color[7] = True
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = 8
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<800:
        color[1] = True
    elif 800<=a[i]<1200:
        color[2] = True
    elif 1200<=a[i]<1600:
        color[3] = True
    elif 1600<=a[i]<2000:
        color[4] = True
    elif 2000<=a[i]<2400:
        color[5] = True
    elif 2400<=a[i]<2800:
        color[6] = True
    elif 2800<=a[i]<3200:
        color[7] = True
    elif a[i]>=3200:
        red += 1    
        
        
c = color.count(True)

if red + c <= 8:
    ma = red + c
else:
    ma = 8
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<800:
        color[1] = True
    elif 800<=a[i]<1200:
        color[2] = True
    elif 1200<=a[i]<1600:
        color[3] = True
    elif 1600<=a[i]<2000:
        color[4] = True
    elif 2000<=a[i]<2400:
        color[5] = True
    elif 2400<=a[i]<2800:
        color[6] = True
    elif 2800<=a[i]<3200:
        color[7] = True
    else:
        red += 1    
        
        
c = color.count(True)
if red + c <= 8:
    ma = red + c
else:
    ma = 8
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<800:
        color[1] = True
    elif 800<=a[i]<1200:
        color[2] = True
    elif 1200<=a[i]<1600:
        color[3] = True
    elif 1600<=a[i]<2000:
        color[4] = True
    elif 2000<=a[i]<2400:
        color[5] = True
    elif 2400<=a[i]<2800:
        color[6] = True
    elif 2800<=a[i]<3200:
        color[7] = True
    else:
        red += 1    
c = color.count(True)
if red + c <= 9:
    ma = red + c
else:
    ma = 9
        
if c == 0:
    mi = 1
else:
    mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<800:
        color[1] = True
    elif 800<=a[i]<1200:
        color[2] = True
    elif 1200<=a[i]<1600:
        color[3] = True
    elif 1600<=a[i]<2000:
        color[4] = True
    elif 2000<=a[i]<2400:
        color[5] = True
    elif 2400<=a[i]<2800:
        color[6] = True
    elif 2800<=a[i]<3200:
        color[7] = True
    else:
        red += 1
        
    c = color.count(True)
    if red + c <= 9:
        ma = red + c
    else:
        ma = 9
        
    if c == 0:
        mi = 1
    else:
        mi = c
        
print(mi,ma)

Submission status: Wrong Answer

Solution code:
#ABC064-C
n = int(input())
a = list(map(int,input().split()))

color = [False for _ in range(8)]
red = 0
for i in range(n):
    if a[i] < 400:
        color[0] = True
    elif 400<=a[i]<800:
        color[1] = True
    elif 800<=a[i]<1200:
        color[2] = True
    elif 1200<=a[i]<1600:
        color[3] = True
    elif 1600<=a[i]<2000:
        color[4] = True
    elif 2000<=a[i]<2400:
        color[5] = True
    elif 2400<=a[i]<2800:
        color[6] = True
    elif 2800<=a[i]<3200:
        color[7] = True
    else:
        red += 1
        
    c = color.count(True)
    if red + c <= 9:
        ma = red + c
        mi = c
    else:
        ma = 9
        mi = c
        
print(mi,ma)