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()))
rate = {"a":0, "b":0, "c":0, "d":0, "e":0, "f":0, "g":0, "h":0}
ratez = {"z":0}
for i in range(N):
    if A[i] >=1 and A[i] <= 399:
        rate["a"] += 1
    if A[i] >=400 and A[i] <= 799:
        rate["b"] += 1
    if A[i] >=800 and A[i] <= 1199:
        rate["c"] += 1
    if A[i] >=1200 and A[i] <= 1599:
        rate["d"] += 1
    if A[i] >=1600 and A[i] <= 1999:
        rate["e"] += 1
    if A[i] >=2000 and A[i] <= 2399:
        rate["f"] += 1
    if A[i] >=2400 and A[i] <= 2799:
        rate["g"] += 1
    if A[i] >=2800 and A[i] <= 3199:
        rate["h"] += 1
    if A[i] >=3200:
        ratez["z"] += 1
keys = [k for k, v in rate.items() if v != 0]

if ratez["z"] == 0:
    print(len(keys), len(keys))
elif len(keys) == 8:
    print(8, 8)
elif len(keys) == 0 and ratez["z"] <= 8:
    print(1, ratez["z"])
elif len(keys) == 0 and ratez["z"] > 8:
    print(1, 8)
elif ratez["z"] + len(keys) <= 8:
    print(len(keys), len(keys)+ratez["z"])
elif ratez["z"] + len(keys) > 8:
    print(len(keys), 8)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
rate = {"a":0, "b":0, "c":0, "d":0, "e":0, "f":0, "g":0, "h":0}
ratez = {"z":0}
for i in range(N):
    if A[i] >=1 and A[i] <= 399:
        rate["a"] += 1
    if A[i] >=400 and A[i] <= 799:
        rate["b"] += 1
    if A[i] >=800 and A[i] <= 1199:
        rate["c"] += 1
    if A[i] >=1200 and A[i] <= 1599:
        rate["d"] += 1
    if A[i] >=1600 and A[i] <= 1999:
        rate["e"] += 1
    if A[i] >=2000 and A[i] <= 2399:
        rate["f"] += 1
    if A[i] >=2400 and A[i] <= 2799:
        rate["g"] += 1
    if A[i] >=2800 and A[i] <= 3199:
        rate["h"] += 1
    if A[i] >=3200:
        ratez["z"] += 1
keys = [k for k, v in rate.items() if v != 0]

if ratez["z"] == 0:
    print(len(keys), len(keys))
elif len(keys) == 8:
    print(8, 8)
elif len(keys) == 0 and ratez["z"] <= 8:
    print(1, ratez["z"])
elif len(keys) == 0 and ratez["z"] > 8:
    print(1, 8)
elif ratez["z"] + len(keys) <= 8:
    print(len(keys), len(keys)+ratez["z"])
elif ratez["z"] + len(keys) > 8:
    print(ratez["z"], 8)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
rate = {"a":0, "b":0, "c":0, "d":0, "e":0, "f":0, "g":0, "h":0}
ratez = {"z":0}
for i in range(N):
    if A[i] >=1 and A[i] <= 399:
        rate["a"] += 1
    if A[i] >=400 and A[i] <= 799:
        rate["b"] += 1
    if A[i] >=800 and A[i] <= 1199:
        rate["c"] += 1
    if A[i] >=1200 and A[i] <= 1599:
        rate["d"] += 1
    if A[i] >=1600 and A[i] <= 1999:
        rate["e"] += 1
    if A[i] >=2000 and A[i] <= 2399:
        rate["f"] += 1
    if A[i] >=2400 and A[i] <= 2799:
        rate["g"] += 1
    if A[i] >=2800 and A[i] <= 3199:
        rate["h"] += 1
    if A[i] >=3200:
        ratez["z"] += 1
keys = [k for k, v in rate.items() if v != 0]

if ratez["z"] == 0:
    print(len(keys), len(keys))
elif len(keys) == 8:
    print(8, 8)
elif ratez["z"] + len(keys) <= 8:
    print(len(keys), len(keys)+ratez["z"])
elif ratez["z"] + len(keys) > 8:
    print(ratez["z"], 8)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
rate = {"a":0, "b":0, "c":0, "d":0, "e":0, "f":0, "g":0, "h":0}
ratez = {"z":0}
for i in range(N):
    if A[i] >=1 and A[i] <= 399:
        rate["a"] += 1
    if A[i] >=400 and A[i] <= 799:
        rate["b"] += 1
    if A[i] >=800 and A[i] <= 1199:
        rate["c"] += 1
    if A[i] >=1200 and A[i] <= 1599:
        rate["d"] += 1
    if A[i] >=1600 and A[i] <= 1999:
        rate["e"] += 1
    if A[i] >=2000 and A[i] <= 2399:
        rate["f"] += 1
    if A[i] >=2400 and A[i] <= 2799:
        rate["g"] += 1
    if A[i] >=2800 and A[i] <= 3199:
        rate["h"] += 1
    if A[i] >=3200:
        ratez["z"] += 1
keys = [k for k, v in rate.items() if v != 0]

if ratez["z"] == 0:
    print(len(keys), len(keys))
elif len(keys) == 8:
    print(8, 8)
if ratez["z"] <= len(keys) and len(keys) != 8:
    print(len(keys), len(keys)+ratez["z"])
if ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) <= 8:
    print(ratez["z"], len(keys)+ratez["z"])
if ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) > 8 and ratez["z"] <= 8:
    print(ratez["z"], 8)
if ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) > 8 and ratez["z"] > 8:
    print(8, 8)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
rate = {"a":0, "b":0, "c":0, "d":0, "e":0, "f":0, "g":0, "h":0}
ratez = {"z":0}
for i in range(N):
    if A[i] >=1 and A[i] <= 399:
        rate["a"] += 1
    if A[i] >=400 and A[i] <= 799:
        rate["b"] += 1
    if A[i] >=800 and A[i] <= 1199:
        rate["c"] += 1
    if A[i] >=1200 and A[i] <= 1599:
        rate["d"] += 1
    if A[i] >=1600 and A[i] <= 1999:
        rate["e"] += 1
    if A[i] >=2000 and A[i] <= 2399:
        rate["f"] += 1
    if A[i] >=2400 and A[i] <= 2799:
        rate["g"] += 1
    if A[i] >=2800 and A[i] <= 3199:
        rate["h"] += 1
    if A[i] >=3200:
        ratez["z"] += 1
keys = [k for k, v in rate.items() if v != 0]

if ratez["z"] == 0:
    print(len(keys), len(keys))
elif len(keys) == 8:
    print(8, 8)
elif ratez["z"] <= len(keys) and len(keys) != 8:
    print(len(keys), len(keys)+ratez["z"])
elif ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) <= 8:
    print(ratez["z"], len(keys)+ratez["z"])
elif ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) > 8 and ratez["z"] <= 8:
    print(ratez["z"], 8)
elif ratez["z"] > len(keys) and len(keys) != 8 and ratez["z"] + len(keys) > 8 and ratez["z"] > 8:
    print(8, 8)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
x=0
for z in range(a):
  if b[z]<=399:
    c=c+1
  if 400<=b[z]<799:
    d=d+1
  if 800<=b[z]<=1199:
    e=e+1
  if 1200<=b[z]<=1599:
    f=f+1
  if 1600<=b[z]<=1999:
    g=g+1
  if 2000<=b[z]<=2399:
    h=h+1
  if 2400<=b[z]<=2799:
    i=i+1
  if 2800<=b[z]<=3199:
    j=j+1
  if b[z]>=3200:
    k=k+1
if c!=0:
  x=x+1
if d!=0:
  x=x+1
if e!=0:
  x=x+1
if f!=0:
  x=x+1
if g!=0:
  x=x+1
if h!=0:
  x=x+1
if i!=0:
  x=x+1
if j!=0:
  x=x+1
if k+x>a:
  print(x,a)
elif (c+d+e+f+g+h+i+j)==0 and k!=0:
  print(x,1)
else:
  print(x,k+x)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
x=0
for z in range(a):
  if b[z]<=399:
    c=c+1
  if 400<=b[z]<799:
    d=d+1
  if 800<=b[z]<=1199:
    e=e+1
  if 1200<=b[z]<=1599:
    f=f+1
  if 1600<=b[z]<=1999:
    g=g+1
  if 2000<=b[z]<=2399:
    h=h+1
  if 2400<=b[z]<=2799:
    i=i+1
  if 2800<=b[z]<=3199:
    j=j+1
  if b[z]>=3200:
    k=k+1
if c!=0:
  x=x+1
if d!=0:
  x=x+1
if e!=0:
  x=x+1
if f!=0:
  x=x+1
if g!=0:
  x=x+1
if h!=0:
  x=x+1
if i!=0:
  x=x+1
if j!=0:
  x=x+1
if k+x>a:
  print(x,a)
elif c+d+e+f+g+h+i+j==0 and k!=0:
  print(x,1)
else:
  print(x,k+x)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
x=0
for z in range(a):
  if b[z]<=399:
    c=c+1
  if 400<=b[z]<799:
    d=d+1
  if 800<=b[z]<=1199:
    e=e+1
  if 1200<=b[z]<=1599:
    f=f+1
  if 1600<=b[z]<=1999:
    g=g+1
  if 2000<=b[z]<=2399:
    h=h+1
  if 2400<=b[z]<=2799:
    i=i+1
  if 2800<=b[z]<=3199:
    j=j+1
  if b[z]>=3200:
    k=k+1
if c!=0:
  x=x+1
if d!=0:
  x=x+1
if e!=0:
  x=x+1
if f!=0:
  x=x+1
if g!=0:
  x=x+1
if h!=0:
  x=x+1
if i!=0:
  x=x+1
if j!=0:
  x=x+1
if k+x>a:
  print(x,a)
else:
  print(x,k+x)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
x=0
for z in range(a):
  if b[z]<=399:
    c=c+1
  if 400<=b[z]<799:
    d=d+1
  if 800<=b[z]<=1199:
    e=e+1
  if 1200<=b[z]<=1599:
    f=f+1
  if 1600<=b[z]<=1999:
    g=g+1
  if 2000<=b[z]<=2399:
    h=h+1
  if 2400<=b[z]<=2799:
    i=i+1
  if 2800<=b[z]<=3199:
    j=j+1
  if b[z]>=3200:
    k=k+1
if c!=0:
  x=x+1
if d!=0:
  x=x+1
if e!=0:
  x=x+1
if f!=0:
  x=x+1
if g!=0:
  x=x+1
if h!=0:
  x=x+1
if i!=0:
  x=x+1
if j!=0:
  x=x+1
if k+x>a:
  print(a)
else:
  print(k+x)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
tuyoi = 0
c = [0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
    if 1 <= i <= 399:
        c[0] = 1
    elif 400 <= i <= 799:
        c[1] = 1
    elif 800 <= i <= 1199:
        c[2] = 1
    elif 1200 <= i <= 1599:
        c[3] = 1
    elif 1600 <= i <= 1999:
        c[4] = 1
    elif 2000 <= i <= 2399:
        c[5] = 1
    elif 2400 <= i <= 2799:
        c[6] = 1
    elif 2800 <= i <= 3199:
        c[7] = 1
    else:
        tuyoi += 1
b = sum(c)
if b ==0:
    mi = 1
else:
    mi = b
if b + tuyoi <= 8:
    ma = b + tuyoi
else:
    ma = 8
print(mi, ma)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = 0
c = [0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
    if 1 <= i <= 399:
        c[0] = 1
    elif 400 <= i <= 799:
        c[1] = 1
    elif 800 <= i <= 1199:
        c[2] = 1
    elif 1200 <= i <= 1599:
        c[3] = 1
    elif 1600 <= i <= 1999:
        c[4] = 1
    elif 2000 <= i <= 2399:
        c[5] = 1
    elif 2400 <= i <= 2799:
        c[6] = 1
    elif 2800 <= i <= 3199:
        c[7] = 1
    else:
        b += 1
b2 = sum(c)
if b >= b2:
    mi = b
else:
    mi = b2
if b + b2 <= 8:
    ma = b + b2
else:
    ma = 8
print(mi, ma)

Submission status: Wrong Answer

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

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

for a in A:
    if a < 400:
        rate[0] += 1
    elif a < 800:
        rate[1] += 1
    elif a < 1200:
        rate[2] += 1
    elif a < 1600:
        rate[3] += 1
    elif a < 2000:
        rate[4] += 1
    elif a < 2400:
        rate[5] += 1
    elif a < 2800:
        rate[6] += 1
    elif a < 3200:
        rate[7] += 1
    else:
        rate[8] += 1

ans = 0
for i in range(8):
    if rate[i] >= 1:
        ans += 1
if ans == 0:
    print(1, rate[i])
else:
    print(ans, ans + rate[8])

Submission status: Wrong Answer

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

rate = [0 for _ in range(8)]

for a in A:
    if a < 400:
        rate[0] += 1
    elif a < 800:
        rate[1] += 1
    elif a < 1200:
        rate[2] += 1
    elif a < 1600:
        rate[3] += 1
    elif a < 2000:
        rate[4] += 1
    elif a < 2400:
        rate[5] += 1
    elif a < 2800:
        rate[6] += 1
    else:
        rate[7] += 1

ans = 0
for i in range(7):
    if rate[i] >= 1:
        ans += 1
if ans == 0:
    print(1, rate[i])
else:
    print(ans, ans + rate[7])

Submission status: Wrong Answer

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

rate = [0 for _ in range(8)]

for a in A:
    if a < 400:
        rate[0] += 1
    elif a < 800:
        rate[1] += 1
    elif a < 1200:
        rate[2] += 1
    elif a < 1600:
        rate[3] += 1
    elif a < 2000:
        rate[4] += 1
    elif a < 2400:
        rate[5] += 1
    elif a < 3000:
        rate[6] += 1
    else:
        rate[7] += 1

ans = 0
for i in range(7):
    if rate[i] >= 1:
        ans += 1
if ans == 0:
    print(1, rate[i])
else:
    print(ans, ans + rate[7])

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
zako=set()
aka=list()
for i in a:
    if 1<= i <=399:
        zako.add('g')
    elif 400<=i<=799:
        zako.add('Br')
    elif 800<=i<=1199:
        zako.add('gre')
    elif 1200<=i<=1599:
        zako.add('mizu')
    elif 1600<=i<=1999:
        zako.add('blu')
    elif 2000<=i<=2399:
        zako.add('ye')
    elif 2400<=i<=2799:
        zako.add('ora')
    elif 2800<=i<=3199:
        zako.add('red')
    else:
        aka.append(1)
print((len(zako)),(len(zako)+len(aka)))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
zako=set()
aka=list()
for i in a:
    if i <=399:
        zako.add('g')
    elif 400<=i<=799:
        zako.add('Br')
    elif 800<=i<=1199:
        zako.add('gre')
    elif 1200<=i<=1599:
        zako.add('mizu')
    elif 1600<=i<=1999:
        zako.add('blu')
    elif 2000<=i<=2399:
        zako.add('ye')
    elif 2400<=i<=2799:
        zako.add('ora')
    elif 2800<=i<=3199:
        zako.add('red')
    else:
        aka.append(1)
print((len(zako)),(len(zako)+len(aka)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = [0] * 9
for aa in a:
  if aa <= 399:
    ans[0] += 1
  elif 400 <= aa <= 799:
    ans[1] += 1
  elif 800 <= aa <= 1199:
    ans[2] += 1
  elif 1200 <= aa <= 1599:
    ans[3] += 1
  elif 1600 <= aa <= 1999:
    ans[4] += 1
  elif 2000 <= aa <= 2399:
    ans[5] += 1 
  elif 2400 <= aa <= 2799:
    ans[6] += 1
  elif 2800 <= aa <= 3199:
    ans[7] += 1
  elif aa >= 3200:
    ans[8] += 1

if sum(ans[:8]) == 0:
  print(1,ans[8])
else:
  l = sum(ans[:8])
  r = l+ans[8]
  print(l,r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = [0] * 9
for aa in a:
  if aa <= 399:
    ans[0] += 1
  elif 400 <= aa <= 799:
    ans[1] += 1
  elif 800 <= aa <= 1199:
    ans[2] += 1
  elif 1200 <= aa <= 1599:
    ans[3] += 1
  elif 1600 <= aa <= 1999:
    ans[4] += 1
  elif 2000 <= aa <= 2399:
    ans[5] += 1 
  elif 2400 <= aa <= 2799:
    ans[6] += 1
  elif 2800 <= aa <= 3199:
    ans[7] += 1
  elif aa >= 3200:
    ans[8] += 1

if ans[-1] == 0:
  n = 8-ans[:-1].count(0)
  print(n,n)
else:
  n = 9-ans.count(0)
  if ans[:-1].count(0) >= ans[-1]: 
    print(n,n+ans[-1])
  elif ans[:-1].count(0) < ans[-1]: 
    k = ans[:-1].count(0)
    print(n,n+k)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = [0] * 9
for aa in a:
  if aa <= 399:
    ans[0] += 1
  elif 400 <= aa <= 799:
    ans[1] += 1
  elif 800 <= aa <= 1199:
    ans[2] += 1
  elif 1200 <= aa <= 1599:
    ans[3] += 1
  elif 1600 <= aa <= 1999:
    ans[4] += 1
  elif 2000 <= aa <= 2399:
    ans[5] += 1 
  elif 2400 <= aa <= 2799:
    ans[6] += 1
  elif 2800 <= aa <= 3199:
    ans[7] += 1
  elif aa >= 3200:
    ans[8] += 1

if ans[-1] == 0:
  n = 8-ans.count(0)
  print(n,n)
else:
  n = 9-ans.count(0)
  if ans[:-1].count(0) >= ans[-1]: 
    print(n,n+ans[-1])
  elif ans[:-1].count(0) < ans[-1]: 
    k = ans[:-1].count(0)
    print(n,n+k)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = [0] * 9
for aa in a:
  if aa <= 399:
    ans[0] += 1
  elif 400 <= aa <= 799:
    ans[1] += 1
  elif 800 <= aa <= 1199:
    ans[2] += 1
  elif 1200 <= aa <= 1599:
    ans[3] += 1
  elif 1600 <= aa <= 1999:
    ans[4] += 1
  elif 2000 <= aa <= 2399:
    ans[5] += 1 
  elif 2400 <= aa <= 2799:
    ans[6] += 1
  elif 2800 <= aa <= 3199:
    ans[7] += 1
  elif aa >= 3200:
    ans[8] += 1

if ans[-1] == 0:
  n = 9-ans.count(0)
  print(n,n)
else:
  n = 9-ans.count(0)
  if ans[:-1].count(0) >= ans[-1]: 
    print(n,n+ans[-1])
  elif ans[:-1].count(0) < ans[-1]: 
    k = ans[:-1].count(0)
    print(n,n+k)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = [0] * 9
for aa in a:
  if aa <= 399:
    ans[0] += 1
  elif 400 <= aa <= 799:
    ans[1] += 1
  elif 800 <= aa <= 1199:
    ans[2] += 1
  elif 1200 <= aa <= 1599:
    ans[3] += 1
  elif 1600 <= aa <= 1999:
    ans[4] += 1
  elif 2000 <= aa <= 2399:
    ans[5] += 1 
  elif 2400 <= aa <= 2799:
    ans[6] += 1
  elif 2800 <= aa <= 3199:
    ans[7] += 1
  elif aa >= 3200:
    ans[8] += 1

if ans[-1] == 0:
  n = 9-ans.count(0)
  print(n,n)
else:
  n = 9-ans.count(0)
  if ans[:-1].count(0) >= 2:
    print(n,n+2)
  elif ans[:-1].count(0) == 1:
    print(n,n+1)
  elif ans[:-1].count(0) == 0:
    print(n,n)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = [0] * 9
for aa in a:
  if aa <= 399:
    ans[0] += 1
  elif 400 <= aa <= 799:
    ans[1] += 1
  elif 800 <= aa <= 1199:
    ans[2] += 1
  elif 1200 <= aa <= 1599:
    ans[3] += 1
  elif 1600 <= aa <= 1999:
    ans[4] += 1
  elif 2000 <= aa <= 2399:
    ans[5] += 1 
  elif 2400 <= aa <= 2799:
    ans[6] += 1
  elif 2800 <= aa <= 3199:
    ans[7] += 1
  elif aa >= 3200:
    ans[8] += 1

if ans[-1] == 0:
  n = 9-ans.count(0)
  print(n,n)
else:
  n = 9-ans.count(0)
  if ans.count(0) >= 2:
    print(n,n+2)
  else:
    print(n,n+ans.count(0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

rate=[0]*9
ansmin=0
ansmax=0
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i < 400*j:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)
if ansmin == 0:
  ansmin=1

if over != 0:
  if ansmax + over >= 8:
    ansmax = 8
  else:
    ansmax = ansmax + over
#print(rate)
print(ansmin, ansmax)

Submission status: Wrong Answer

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

rate=[0]*9
ansmin=0
ansmax=0
a.sort()
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i <= 400*j-1:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)
if ansmin == 0:
  ansmin=1

if over != 0:
  if ansmax + over >= 8:
    ansmax = 8
  else:
    ansmax = ansmax + over
#print(rate)
print(ansmin, ansmax)

Submission status: Wrong Answer

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

rate=[0]*9
ansmin=0
ansmax=0
a.sort()
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i <= 400*j-1:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)

if over != 0:
  if ansmax + over >= 8:
    ansmax = 8
  else:
    ansmax = ansmax + over
#print(rate)
print(ansmin, ansmax)

Submission status: Wrong Answer

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

rate=[0]*10
ansmin=0
ansmax=0
a.sort()

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i <= 400*j-1:
      rate[j]=1
      break
    elif i >= 3200:
      rate[9]+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)

if rate[9]!=0:
  if ansmax + rate[9] >= 8:
    ansmax = 8
  else:
    ansmax = ansmax + rate[9]
#print(rate)
print(ansmin, ansmax)

Submission status: Wrong Answer

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

rate=[0]*10
ansmin=0
ansmax=0
a.sort()

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i <= 400*j-1:
      rate[j]=1
      break
    elif i >= 3200:
      rate[9]+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)

if ansmax + rate[9] >= 8:
  ansmax = 8
else:
  if rate[8]!=0:
    ansmax = ansmax + rate[9]
#print(rate)
print(ansmin, ansmax)

Submission status: Wrong Answer

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

rate=[0]*9
ansmin=0
ansmax=0
a.sort()

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i <= 400*j-1:
      rate[j]=1
      break
    elif i >= 3200:
      rate[8]+=1
      break
      
ansmin = len([i for i in rate if i>=1])
ansmax = len([i for i in rate if i>=1])

if ansmax + rate[8]-1 >= 8:
  ansmax = 8
else:
  if rate[8]!=0:
    ansmax = ansmax + rate[8]-1
#print(rate)
print(ansmin, ansmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = [int(i) for i in input().split()]
color = [int(0) for i in range(8)]
wild = 0

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

ans = color.count(1)

if wild == 0:
  print(ans,ans)
elif wild + ans <= 8:
  print(ans,ans+wild)
elif wild + ans > 8:
  print(ans,8)
elif ans == 0 and wild <= 8:
  print(1,wild)
elif ans == 0 and wild > 8:
  print(1,8)

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = [int(i) for i in input().split()]
color = [int(0) for i in range(8)]
wild = 0

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

ans = color.count(1)

if wild == 0:
  print(ans,ans)
elif wild + ans < 8:
  print(ans,ans+wild)
elif wild + ans >= 8:
  print(ans,8)
elif ans == 0 and wild < 8:
  print(1,wild)
elif ans == 0 and wild >= 8:
  print(1,8)

Submission status: Wrong Answer

Solution code:
n = int(input())
rate = [int(i) for i in input().split()]
color = [int(0) for i in range(8)]
wild = 0

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

ans = color.count(1)

if wild == 0:
  print(ans,ans)
elif wild + ans < 8:
  print(ans,ans+wild)
elif wild + ans >= 8:
  print(ans,8)

Submission status: Wrong Answer

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

cnt = [0] * 9
for i in a:
    x = min(i // 400, 8)
    if x >= 8:
        cnt[8] += 1
    else:
        cnt[x] = 1

if sum(cnt[:8]) == 0:
    l = 1
    r = min(8, cnt[8])
else:
    l = sum(cnt[:8])
    r = min(8, l+cnt[8])
print(l, r)

Submission status: Wrong Answer

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

cnt = [0] * 9
for i in a:
    x = min(i // 400, 8)
    cnt[x] += 1

if cnt[:8].count(0) == 8:
    l = 1
    r = min(8, cnt[8])
else:
    l = 8 - cnt[:8].count(0)
    r = min(8, l+cnt[8])
print(l, r)

Submission status: Wrong Answer

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

cnt = [0] * 9
for i in a:
    x = i // 400
    if x >= 9:
        cnt[8] += 1
    else:
        cnt[x] += 1

if cnt[:8].count(0) == 8:
    l = 1
    r = min(8, cnt[8])
else:
    l = 8 - cnt[:8].count(0)
    r = min(8, l+cnt[8])
print(l, r)

Submission status: Wrong Answer

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

cnt = [0] * 9
for i in a:
    x = i // 400
    if x >= 9:
        cnt[8] += 1
    else:
        cnt[x] += 1
print(cnt)
if cnt[:8].count(0) == 8:
    l = 1
    r = min(8, cnt[8])
else:
    l = 8 - cnt[:8].count(0)
    r = min(8, l+cnt[8])
print(l, r)

Submission status: Wrong Answer

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

cnt = [0] * 9
for i in a:
    x = i // 400
    if x >= 9:
        cnt[8] += 1
    else:
        cnt[x] += 1
l = 8 - cnt[:8].count(0)
r = min(8, l+cnt[8])
print(l, r)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
c = [False]*8
k = 0
ans = 0
for i in range(n):
  cn = a[i]//400
  if cn < 8:
    if c[cn] == False:
      ans += 1
      c[cn] = True
  else:
    k += 1

Submission status: Wrong Answer

Solution code:
N = int(input())
lsa = list(map(int,input().split()))
lsb = []
joker = 0
for i in lsa:
    if i >=1 and i <=399:
        lsb.append('1')
    elif i >=400 and i <=799:
        lsb.append('2')
    elif i >=800 and i <=1199:
        lsb.append('3')
    elif i >=1200 and i <=1599:
        lsb.append('4')
    elif i >=1600 and i <=1999:
        lsb.append('5')
    elif i >=2000 and i <=2399:
        lsb.append('6')
    elif i >=2400 and i <=2799:
        lsb.append('7')
    elif i >=2800 and i <=3199:
        lsb.append('8')
    elif i >=3200:
        joker += 1
s1 = len(set(lsb)) 
s2 = s1+joker
print(s1,s2)

Submission status: Wrong Answer

Solution code:
N = int(input())
lsa = list(map(int,input().split()))
lsb = []
joker = 0
for i in lsa:
    if i >=1 and i <=399:
        lsb.append('1')
    elif i >=400 and i <=799:
        lsb.append('2')
    elif i >=800 and i <=1199:
        lsb.append('3')
    elif i >=1200 and i <=1599:
        lsb.append('4')
    elif i >=1600 and i <=1999:
        lsb.append('5')
    elif i >=2000 and i <=2399:
        lsb.append('6')
    elif i >=2400 and i <=2799:
        lsb.append('7')
    elif i >=2800 and i <=3199:
        lsb.append('8')
    elif i >=3200:
        joker += 1
s1 = len(set(lsb)) 
s2 = min(s1+joker,8)
print(s1,s2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
free = 0
for i in range(N):
  if a[i] < 400: gray += 1
  elif a[i] < 800: brown += 1
  elif a[i] < 1200: green += 1
  elif a[i] < 1600: water += 1
  elif a[i] < 2000: blue += 1
  elif a[i] < 2400: yellow += 1
  elif a[i] < 2800: orange += 1
  elif a[i] < 3200: red += 1
  else: free += 1
cnt = 0
if gray: cnt += 1
if brown: cnt += 1
if green: cnt += 1
if water: cnt += 1
if blue: cnt += 1
if yellow: cnt += 1
if orange: cnt += 1
if red: cnt += 1
cntmax = cnt
if free: cntmax = free + cnt
print(cnt, cntmax)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
gray = 0
brown = 0
green = 0
water = 0
blue = 0
yellow = 0
orange = 0
red = 0
free = 0
for i in range(N):
  if a[i] < 400: gray += 1
  elif a[i] < 800: brown += 1
  elif a[i] < 1200: green += 1
  elif a[i] < 1600: water += 1
  elif a[i] < 2000: blue += 1
  elif a[i] < 2400: yellow += 1
  elif a[i] < 2800: orange += 1
  elif a[i] < 3200: red += 1
  else: free += 1
cnt = 0
if gray: cnt += 1
if brown: cnt += 1
if green: cnt += 1
if water: cnt += 1
if blue: cnt += 1
if yellow: cnt += 1
if orange: cnt += 1
if red: cnt += 1
cntmax = cnt
if free: cntmax = min(8, free + cnt)
print(cnt, cntmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
color = [0]*9
for aa in a:
    if aa < 400:
        color[0] += 1
    elif 400 <= aa  and aa < 799:
        color[1] += 1
    elif 800 <=  aa  and aa < 1199:
        color[2] += 1
    elif 1200 <= aa  and  aa < 1599:
        color[3] += 1
    elif 1600 <= aa  and  aa < 1999:
        color[4] += 1
    elif 2000 <= aa  and  aa < 2399:
        color[5] += 1
    elif 2400 <= aa  and  aa < 2799:
        color[6] += 1
    elif 2500 <= aa  and  aa < 3199:
        color[7] += 1
    elif aa >= 3200:
        color[8] += 1


if color[-1] == 0:
    z = color.count(0)
    ans = 9 - z
    print(ans,ans)
else:
    minnum = sum(color[:-1])
    if color.count(0) >= 2:
        maxnum = minnum + 2
    else:
        maxnum = minnum + 1
    print(minnum,maxnum)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        cnt[a[i]//400] += 1
    else:
        free += 1
print(min(1,8-cnt.count(0)),8-cnt.count(0)+free)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        cnt[a[i]//400] += 1
    else:
        free += 1
print(8-cnt.count(0),8-cnt.count(0)+free)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt = [0]*8
free = 0
for i in range(n):
    if a[i] <= 3199:
        cnt[a[i]//400] += 1
    else:
        free += 1
print(8-cnt.count(0),min(8,8-cnt.count(0)+free))