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())
A=list(map(int,input().split()))
ans = [0]*8
r = 0
for i in range(n):
  if A[i] < 3200:
    ans[A[i]//400] = 1
  else:
    r += 1
print(*[sum(ans),sum(ans)+r])

Submission status: Wrong Answer

Solution code:
N = int(input())
A=list(map(int, input().split()))
ls = [0]*9
for i in range(N):
    if 1 <= A[i] <= 399:
        ls[0] += 1
    elif 400 <= A[i] <= 799:
        ls[1] += 1
    elif 800 <= A[i] <= 1199:
        ls[2] += 1
    elif 1200 <= A[i] <= 1599:
        ls[3] += 1
    elif 1600 <= A[i] <= 1999:
        ls[4] += 1
    elif 2000 <= A[i] <= 2399:
        ls[5] += 1
    elif 2400 <= A[i] <= 2799:
        ls[6] += 1
    elif 2800 <= A[i] <= 3199:
        ls[7] += 1
    else:
        ls[8] += 1
c = 0
for i in range(8):
    if ls[i]:
        c += 1
m = c if c > 0 else int(ls[-1]>0)
M = min(8, c + ls[-1])
print(m, M)

Submission status: Wrong Answer

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

A.sort()
irregular_cnt=0
reg_cnt = 0
for i in range(n):
    a = A[i]
    a //= 400
    A[i] = a
    if a>7:
        irregular_cnt += 1

prev = -1

for i in range(n):
    a = A[i]
    if a<8 and prev!=a:
        reg_cnt+=1
        prev = a
if reg_cnt==0 and irregular_cnt>0:    
    print(str(1)+" "+str(min(8, irregular_cnt)))
else:
    print(str(reg_cnt)+" "+str(min(8, reg_cnt+irregular_cnt)))

Submission status: Wrong Answer

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

A.sort()
irregular_cnt=0
reg_cnt = 0
for i in range(n):
    a = A[i]
    a //= 400
    A[i] = a
    if a>7:
        irregular_cnt += 1

prev = -1

for i in range(n):
    a = A[i]
    if a<8 and prev!=a:
        reg_cnt+=1
        prev = a


print(str(reg_cnt)+" "+str(min(8, reg_cnt+irregular_cnt)))

Submission status: Wrong Answer

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

A.sort()
irregular_cnt=0
reg_cnt = 1
for i in range(n):
    a = A[i]
    a //= 400
    A[i] = min(a,8)
    if i>0 and A[i-1]!=A[i] and a<8:
        reg_cnt += 1
    if a>7:
        irregular_cnt += 1

print(str(reg_cnt)+" "+str(min(8, reg_cnt+irregular_cnt)))

Submission status: Wrong Answer

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

A.sort()
irregular_cnt=0
reg_cnt = 1
for i in range(n):
    a = A[i]
    a //= 400
    A[i] = a
    if i>0 and A[i-1]!=A[i] and a<8:
        reg_cnt += 1
    if a>7:
        a = 8
        irregular_cnt += 1

print(str(reg_cnt)+" "+str(min(8, reg_cnt+irregular_cnt)))

Submission status: Wrong Answer

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())

colors = [0 for i in range(8)]
tyty = 0

for a in A:
  c = a//400
  if c>=8:
    tyty+=1
  else:
    colors[c]+=1

cNum = 8-colors.count(0)
    
minC = max(cNum,1)
maxC = min(8,cNum+tyty)
#print(cNum,colors,tyty)
print(minC,maxC)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())

colors = [0 for i in range(8)]
tyty = 0

for a in A:
  c = a//400
  if c>=8:
    tyty+=1
  else:
    colors[c]+=1

cNum = 0
for c in colors:
  if c>0:
    cNum +=1
    
minC = 1 if tyty>0 and c==0 else cNum
maxC = min(8,cNum+tyty)
#print(cNum,colors,tyty)
print(minC,maxC)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())

colors = [0 for i in range(8)]
tyty = 0

for a in A:
  c = a//400
  if c>=8:
    tyty+=1
  else:
    colors[c]+=1

cNum = 0
for c in colors:
  if c>0:
    cNum +=1
    
minC = 1 if tyty>0 else cNum
maxC = min(8,cNum+tyty)

print(minC,maxC)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())
A=(np.array(A)//400).astype("int32")

color_num=0

colors=np.zeros(9).astype("int32")

for a in A:
    colors[min(a,8)]+=1
c=np.count_nonzero(colors[:-1])

#print(colors,c)
min_color_num = 1 if (c<2 and colors[-1]>0) else c
max_color_num = min(8,c+colors[-1])

print(min_color_num,max_color_num)

Submission status: Wrong Answer

Solution code:
#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc064/tasks/abc064_c


def check(a):
    if a < 400:
        return 0
    elif a < 799:
        return 1
    elif a < 1199:
        return 2
    elif a < 1599:
        return 3
    elif a < 1999:
        return 4
    elif a < 2399:
        return 5
    elif a < 2799:
        return 6
    elif a < 3199:
        return 7
    else:
        return 8


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

ratings = [
    '1-399', '400-799', '800-1199', '1200-1599', '1600-1999',
    '2000-2399', '2400-2799', '2800-3199', '3200-']
d = {r: 0 for r in ratings}

for a in A:
    d[ratings[check(a)]] += 1

ans = 0
for k, v in d.items():
    if k != '3200-' and v != 0:
        ans += 1

top = d['3200-']
if top == 0:
    print(ans, ans)
elif ans == 0:
    print(1, top)
else:
    print(ans, ans+top)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())
A=(np.array(A)//400).astype("int32")

color_num=0

colors=np.zeros(9)

for a in A:
    colors[min(a,8)]+=1
c=np.count_nonzero(colors[:-2])

min_color_num = 1 if (c==0 and colors[-1]>0) else c
max_color_num = min(8,c+max(int(colors[-1]),0))

print(min_color_num,max_color_num)

Submission status: Wrong Answer

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())
A=(np.array(A)//400).astype("int32")

color_num=0

colors=np.zeros(9)

for a in A:
    colors[min(a,8)]+=1
c=np.count_nonzero(colors[:-1])

min_color_num = 1 if (c==0 and colors[-1]>0) else c
max_color_num = min(8,c+max(int(colors[-1]),0))

print(min_color_num,max_color_num)

Submission status: Wrong Answer

Solution code:
def cordtest(AAA):
  jisyo ={'H':0,'C':0,'G':0,'M':0,'B':0,'Y':0,'O':0,'R':0,'A':0}
  for i in AAA:
    
    if i < 399:
      jisyo['H'] +=1
    elif 400 <= i <=799:
      jisyo['C'] +=1
    elif 800 <= i <=1199:
      jisyo['G'] +=1
    elif 1200 <= i <=1599:
      jisyo['M'] +=1
    elif 1600 <= i <=1999:
      jisyo['B'] +=1
    elif 2000 <= i <=2399:
      jisyo['Y'] +=1
    elif 2400 <= i <= 2799:
      jisyo['O'] +=1
    elif 2800 <= i <= 3199:
      jisyo['R'] +=1
    else:
      jisyo['A'] +=1
  maxi = 0
  mini = 0
  for i,j in jisyo.items():
    
    if i != 'A':
      if j >0:
        mini +=	1
    else:
      maxi += j
  ans = maxi + mini
  if mini ==0:
    mini =1
  
  return print(mini,ans)
N = int(input())
AA = list(map(int,input().split()))
cordtest(AA)

Submission status: Wrong Answer

Solution code:
def cordtest(AAA):
  jisyo ={'H':0,'C':0,'G':0,'M':0,'B':0,'Y':0,'O':0,'R':0,'A':0}
  for i in AAA:
    
    if i < 399:
      jisyo['H'] +=1
    elif 400 <= i <=799:
      jisyo['C'] +=1
    elif 800 <= i <=1199:
      jisyo['G'] +=1
    elif 1200 <= i <=1599:
      jisyo['M'] +=1
    elif 1600 <= i <=1999:
      jisyo['B'] +=1
    elif 2000 <= i <=2399:
      jisyo['Y'] +=1
    elif 2400 <= i <= 2799:
      jisyo['O'] +=1
    elif 2800 <= i <= 3199:
      jisyo['R'] +=1
    else:
      jisyo['A'] +=1
  maxi = 0
  mini = 0
  for i,j in jisyo.items():
    
    if i != 'A':
      if j >0:
        mini +=	1
    else:
      maxi += j
  ans = maxi + mini
  
  return print(mini,ans)
N = int(input())
AA = list(map(int,input().split()))
cordtest(AA)

Submission status: Wrong Answer

Solution code:
def cordtest(AAA):
  jisyo ={'H':0,'C':0,'G':0,'M':0,'B':0,'Y':0,'O':0,'R':0,'A':0}
  for i in AAA:
    
    if i < 399:
      jisyo['H'] +=1
    elif 400 <= i <=799:
      jisyo['C'] +=1
    elif 800 <= i <=1199:
      jisyo['G'] +=1
    elif 1200 <= i <=1599:
      jisyo['M'] +=1
    elif 1600 <= i <=1999:
      jisyo['B'] +=1
    elif 2000 <= i <=2399:
      jisyo['Y'] +=1
    elif 2400 <= i <= 2799:
      jisyo['O'] +=1
    elif 2800 <= i <= 3199:
      jisyo['R'] +=1
    else:
      jisyo['A'] +=1
  maxi = 0
  mini = 0
  for i,j in jisyo.items():
    
    if i != 'A':
      if j >0:
        mini +=	1
    else:
      maxi += j
  ans = maxi + mini
  if ans >= 8:
    ans = 8
  return print(mini,ans)
N = int(input())
AA = list(map(int,input().split()))
cordtest(AA)

Submission status: Wrong Answer

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

free = 0

for i in range(N):
    rate = a[i] // 100
    if 1 <= rate <= 3:
        a[i] = "red"
    elif 4 <= rate <= 7:
        a[i] = "brown"
    elif 8 <= rate <= 11:
        a[i] = "green"
    elif 12 <= rate <= 15:
        a[i] = "cyan"
    elif 16 <= rate <= 19:
        a[i] = "blue"
    elif 20 <= rate <= 23:
        a[i] = "yellow"
    elif 24 <= rate <= 27:
        a[i] = "orange"
    elif 28 <= rate <= 31:
        a[i] = "red"
    else:
        a[i] = "free"

min_samples = len(set(a))
if "red" in a:
    min_samples -= 1

print(min_samples,min_samples + a.count("free"))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

c = [0]*9
for i in a:
  t = i // 400
  if t < 8:
    c[t] = 1
  else:
    c[8] += 1
cmin = max(sum(c[:-1]), min(c[8], 1))
cmax = min(sum(c), 8)
print(cmin, cmax)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

c = [0]*9
for i in a:
  t = i // 400
  if t < 8:
    c[t] = 1
  elif t >= 8:
    c[8] += 1
cmin = max(sum(c[:-1]), min(c[8], 1))
cmax = min(sum(c[:-1]) + c[8], 8)
print(cmin, cmax)

Submission status: Wrong Answer

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

l = [0,0,0,0,0,0,0,0,0]


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

if n == 1 and a[0] >= 3200:
  print(1,1)
  exit()
  
for i in range(len(l)-1):
  if l[i] > 0:
    ans += 1
if sum(l[0:7]) >= l[8]:
  print(ans,ans + l[8])
else:
  print(ans+(ans-l[8]),ans+l[8])

Submission status: Wrong Answer

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

l = [0,0,0,0,0,0,0,0,0]


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

for i in range(len(l)-1):
  if l[i] > 0:
    ans += 1
print(ans,ans + l[8])

Submission status: Wrong Answer

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

l = [0,0,0,0,0,0,0,0,0]


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

Submission status: Wrong Answer

Solution code:
N = int(input())
N_List = list(map(int,input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p= (Number_NRD + Number_NRU,8)[Number_NRD +Number_NRU>=8]
min_p= (Number_NRD,1)[Number_NRD == 0]
print(str(min_p) + " " + str(max_p))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 22 04:19:50 2020

@author: liang
"""

N = int(input())
A = [int(x) for x in input().split()]
d = [False]*8
count = 0
ans = 0
for a in A:
    if a//400 >= 8:
        count += 1
    else:
        if d[a//400] == False:
            ans += 1
            d[a//400] = True

if count == 0:
    print(ans,ans)
else:
    print(ans,ans+count)

Submission status: Wrong Answer

Solution code:
n = int(input())
al = list(map(int, input().split()))
ratel = [0,0,0,0,0,0,0,0,0]

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

for a in al:
    i = check(a)
    ratel[i] += 1


zeroc = 0
ratec = 0
for i in range(8):
    if ratel[i] == 0:
        zeroc += 1
    else:
        ratec += 1

if ratel[8] == 0:
    print(ratec,ratec)
elif 1 <= ratel[8] <= 8:
    if ratec == 0:
        print(1,ratel[8])
    elif ratel[8] < zeroc:
        print(ratec, ratec+ratel[8])
    elif ratel[8] >= zeroc:
        print(ratec,ratec+ratel[8])
else:
    if ratec == 0:
        print(1,8)
    else:
        print(ratec,8)

Submission status: Wrong Answer

Solution code:
n = int(input())
al = list(map(int, input().split()))
ratel = [0,0,0,0,0,0,0,0,0]

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

for a in al:
    i = check(a)
    ratel[i] += 1


zeroc = 0
ratec = 0
for i in range(8):
    if ratel[i] == 0:
        zeroc += 1
    else:
        ratec += 1

if ratel[8] == 0:
    print(ratec,ratec)
elif 1 <= ratel[8] <= 8:
    if ratec == 0:
        print(1,ratel[8])
    elif ratec + ratel[8] < 8:
        print(ratec, ratec+ratel[8])
    elif ratec + ratel[8] >= 8:
        print(ratec,8)
else:
    if ratec == 0:
        print(1,8)
    else:
        print(ratec,8)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [i // 400 for i in A if i < 3200]
if B == []:
  print(1, N)
elif len(B) == N:
  C = len(set(B))
  print(C, C)
else:
  print(len(set(B)), N)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [i // 400 for i in A if i < 3200]
if B == []:
  print(1, N)
elif len(B) == N:
  C = len(set(B))
  print(C, C)
else:
  print(len(B), N)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = [i // 400 for i in A if i < 3200]
if B == []:
  print(1, min(N, 8))
elif len(A) == len(B):
  C = len(set(B))
  print(C, C)
else:
  print(len(B), min(len(A), 8))

Submission status: Wrong Answer

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    n = i_input()
    a = i_list()
    dic = {399:0, 799:0, 1199:0, 1599:0, 1999:0, 2399:0, 2799:0, 3199:0}
    cnt = 0
    for i in a:
        if i < 400:
            dic[399] = 1
        elif i < 800:
            dic[799] = 1
        elif i < 1200:
            dic[1199] = 1
        elif i < 1600:
            dic[1599] = 1
        elif i < 2000:
            dic[1999] = 1
        elif i < 2400:
            dic[2399] = 1
        elif i < 2800:
            dic[2799] = 1
        elif i < 3200:
            dic[3199] = 1
        else:
            cnt += 1
    c = sum(list(dic.values()))
    print(c, c+cnt)





if __name__=="__main__":
    main()

Submission status: Wrong Answer

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

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


print(max(1, counter), min(8, counter + rate[8]))

Submission status: Wrong Answer

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

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


print(counter, min(8, counter + rate[8]))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
rate = [0] * 9
for v in map(int, input().split()):
    if v // 400 < 8:
        rate[v // 400] = 1
    else:
        rate[8] += 1

ans = sum(rate[:8])
if ans == 0:
    print('1 {}'.format(min(8, rate[8])))
elif rate[8] == 0:
    print('{} {}'.format(ans, ans))
else:
    print('{} {}'.format(ans, min(8, ans + rate[8])))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
rate = [0] * 9
for v in map(int, input().split()):
    if v // 400 < 8:
        rate[v // 400] = 1
    else:
        rate[8] += 1

ans = sum(rate[:8])
if ans == 0:
    print('1 {}'.format(min(8, ans + rate[8])))
elif rate[8] == 0:
    print('{} {}'.format(ans, ans))
else:
    print('{} {}'.format(ans, min(8, ans + rate[8])))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
rate = [0] * 9
for v in map(int, input().split()):
    if v // 400 < 8:
        rate[v // 400] = 1
    else:
        rate[8] += 1

ans = sum(rate[:8])
if ans == 0:
    print('1 {}'.format(rate[8]))
elif rate[8] == 0:
    print('{} {}'.format(ans, ans))
else:
    print('{} {}'.format(ans, min(8, ans + rate[8])))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
rate = [0] * 9
for v in map(int, input().split()):
    if v // 400 < 8:
        rate[v // 400] = 1
    else:
        rate[8] += 1

print(rate)
ans = sum(rate[:8])
if ans == 0:
    print('1 {}'.format(rate[8]))
elif rate[8] == 0:
    print('{} {}'.format(ans, ans))
else:
    print('{} {}'.format(ans, min(8, ans + rate[8])))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
rate = [0] * 9
for v in map(int, input().split()):
    if v // 400 < 8:
        rate[v // 400] = 1
    else:
        rate[8] += 1

ans = sum(rate[:8])
if ans == 0:
    print('1 1')
elif rate[8] == 0:
    print('{} {}'.format(ans, ans))
else:
    print('{} {}'.format(ans, min(8, ans + rate[8])))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
rate = [0] * 9
for v in map(int, input().split()):
    if v // 400 < 8:
        rate[v // 400] = 1
    else:
        rate[8] += 1

ans = sum(rate[:8])
if rate[8] == 0:
    print('{} {}'.format(ans, ans))
else:
    print('{} {}'.format(ans, min(8, ans + rate[8])))

Submission status: Wrong Answer

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

color = []
rainbow = 0

for i in range(N):
    if 1 <= a[i] <= 399:
        color.append('gray')
    elif 400 <= a[i] <= 799:
        color.append('brown')
    elif 800 <= a[i] <= 1199:
        color.append('green')
    elif 1200 <= a[i] <= 1599:
        color.append('sky')
    elif 1600 <= a[i] <= 1999:
        color.append('blue')
    elif 2000 <= a[i] <= 2399:
        color.append('yellow')
    elif 2400 <= a[i] <= 2799:
        color.append('orange')
    elif 2800 <= a[i] <= 3199:
        color.append('red')
    else:
        rainbow += 1
        color.append('all')

if len(set(color)) == 1 and rainbow > 0:
    mini = 1
elif rainbow == 0:
    mini = len(set(color))
else:
    mini = max(1, len(set(color))-1)

if rainbow > 1:
    maxi = len(set(color)) + rainbow - 1
elif len(set(color)) == 1:
    maxi = 1
else:
    maxi = len(set(color)) + rainbow

print(mini, maxi)

Submission status: Wrong Answer

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

color = []
rainbow = 0

for i in range(N):
    if 1 <= a[i] <= 399:
        color.append('gray')
    elif 400 <= a[i] <= 799:
        color.append('brown')
    elif 800 <= a[i] <= 1199:
        color.append('green')
    elif 1200 <= a[i] <= 1599:
        color.append('sky')
    elif 1600 <= a[i] <= 1999:
        color.append('blue')
    elif 2000 <= a[i] <= 2399:
        color.append('yellow')
    elif 2400 <= a[i] <= 2799:
        color.append('orange')
    elif 2800 <= a[i] <= 3199:
        color.append('red')
    else:
        rainbow += 1
        color.append('all')

if len(set(color)) == 1 and rainbow > 0:
    mini = 1
elif rainbow == 0:
    mini = len(set(color))
else:
    mini = max(1, len(set(color))-1)

if color.count('all') > 1:
    maxi = len(set(color)) + rainbow - 1
else:
    maxi = len(set(color)) + rainbow

print(mini, maxi)

Submission status: Wrong Answer

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

color = []

for i in range(N):
    if 1 <= a[i] <= 399:
        color.append('gray')
    elif 400 <= a[i] <= 799:
        color.append('brown')
    elif 800 <= a[i] <= 1199:
        color.append('green')
    elif 1200 <= a[i] <= 1599:
        color.append('sky')
    elif 1600 <= a[i] <= 1999:
        color.append('blue')
    elif 2000 <= a[i] <= 2399:
        color.append('yellow')
    elif 2400 <= a[i] <= 2799:
        color.append('orange')
    else:
        color.append('red')

mini = len(set(color))
if color.count('red') > 1:
    maxi = len(set(color)) + color.count('red') - 1
else:
    maxi = len(set(color)) + color.count('red')

print(mini, maxi)

Submission status: Wrong Answer

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

Sum = 0
for i in range(8):
    if data[i] != 0:
        Sum += 1
m = max(1, Sum)
M = min(8, Sum + data[8])

print(m,M)

Submission status: Wrong Answer

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

Sum = 0
for i in range(9):
    if data[i] != 0:
        Sum += 1
m = max(1, Sum - data[8])
M = min(8, Sum + data[8])

print(m,M)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
L = []
H = []

for i in range(N):
  a = A[i]//400
  if a > 7:
    H.append(a)
  else:
    L.append(a)
    
print(str(len(set(L)))+" "+str(len(set(L))+len(H)))

Submission status: Wrong Answer

Solution code:

N = int(input())
A = list(map(int,input().split()))
colors = [0] * 9
for a in A:
  index = min(a // 400,8)
  colors[index] += 1
min_color = max(sum([1 for c in colors[:-1] if c != 0]),1)
max_color = min(min_color+colors[-1]-1,8)
print(min_color,max(min_color,max_color))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
colors = [0] * 9
for a in A:
  index = min(a // 400,8)
  colors[index] += 1
min_color = max(sum([1 for c in colors[:-1] if c != 0]),1)
max_color = min(min_color+colors[-1],8)
print(min_color,max(min_color,max_color))

Submission status: Wrong Answer

Solution code:
# C

N = int(input())
A = list(map(int,input().split()))
colors = [0] * 9
for a in A:
  index = min(a // 400,8)
  colors[index] += 1
min_color = sum([1 for c in colors[:-1] if c != 0])
max_color = min(min_color+colors[-1],8)
print(min_color,max(min_color,max_color))

Submission status: Wrong Answer

Solution code:

N = int(input())
A = list(map(int,input().split()))
colors = [0] * 8
for a in A:
  index = min(a // 400,8)-1
  colors[index] += 1
min_color = sum([1 for c in colors[:-1] if c != 0])
max_color = min(min_color+colors[-1],8)
print(min_color,max(min_color,max_color))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
colors = [0] * 8
for a in A:
  index = min (a // 400,7)

  colors[index] += 1

min_color = sum([1 for c in colors if c != 0])
max_color = min(min_color+colors[-1]-1,8)
print(min_color,max(min_color,max_color))

Submission status: Wrong Answer

Solution code:

N = int(input())
A = list(map(int,input().split()))
colors = [0] * 8
for a in A:
  index = min (a // 400,7)

  colors[index] += 1

min_color = sum([1 for c in colors if c != 0])
max_color = min(min_color+colors[-1]-1,7)
print(min_color,max(min_color,max_color))

Submission status: Wrong Answer

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

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

color = sum(rate[0:8])
# print(rate, val)

dai = color + rate[8]

if rate[8]==0:
    syo=color
else:
    if color==0:
        syo=1

    elif color>rate[8]:
            syo=color
    else:
        syo=rate[8]


print(syo,dai)

Submission status: Wrong Answer

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

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

if num==0:
    val = len(set(rate))
else:
    val = len(set(rate)) -1
# print(rate, val)

dai = val + num
if dai >8:
    dai=8

syo=val
if num<val:
    syo=1
else:
    syo=num

print(syo,dai)

Submission status: Wrong Answer

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

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

if num==0:
    val = len(set(rate))
else:
    val = len(set(rate)) -1
# print(rate, val)

dai = val + num
if dai >8:
    dai=8

syo=val
if syo<1:
    syo=1

print(syo,dai)

Submission status: Wrong Answer

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

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

if num==0:
    val = len(set(rate))
else:
    val = len(set(rate)) -1
print(rate, val)

dai = val + num
if dai >8:
    dai=8

syo=val 
if syo<1:
    syo=1

print(syo,dai)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
out = [0]*9
for i in range(N):
    if A[i]>=3200:
        out[8] += 1
    else:
        out[A[i]//400]=1
MIN = sum(out[0:8])
MAX = MIN + out[8]
if MIN>=1:
    print(MIN, min(MAX,8))
else:
    print(1,min(MAX,8))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
out = [0]*9
for i in range(N):
    if A[i]>=3200:
        out[8] += 1
    else:
        out[A[i]//400]=1
MIN = sum(out[0:8])
MAX = MIN + out[8]
print(MIN, min(MAX,8))