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
s=0
n=0
N=int(input())
L=list(map(int,input().split()))
t=list()
b=list()
c=list()
d=list()
e=list()
f=list()
g=list()
r=list()
for i in range(N):
  a=L[i]
  if a<=399:
    t.append(a)
  elif a<=799:
    b.append(a)
  elif a<=1199:
    c.append(a)
  elif a<=1599:
    d.append(a)
  elif a<=1999:
    e.append(a)
  elif a<=2399:
    f.append(a)
  elif a<=2799:
    g.append(a)
  elif a<=3199:
    r.append(a)
  else:
    s+=1
if len(t)>0:
  n+=1
if len(b)>0:
  n+=1
if len(c)>0:
  n+=1
if len(d)>0:
  n+=1
if len(e)>0:
  n+=1
if len(f)>0:
  n+=1
if len(g)>0:
  n+=1
if len(r)>0:
  n+=1
if n==0:
  print(1,min(8,n+s))
  sys.exit()
print(n,min(8,n+s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import collections

count = collections.defaultdict(int)
other = 0
for a in A:
    if 1 <= a <= 399:
        count['gray'] += 1
    elif 400 <= a <= 799:
        count['brown'] += 1
    elif 800 <= a <= 1199:
        count['green'] += 1
    elif 1200 <= a <= 1599:
        count['mizu'] += 1
    elif 1600 <= a <= 1999:
        count['blue'] += 1
    elif 2000 <= a <= 2399:
        count['yellow'] += 1
    elif 2400 <= a <= 2799:
        count['daidai'] += 1
    elif 2800 <= a <= 3199:
        count['brown'] += 1
    else:
        other += 1

if len(count):
    min_count = len(count)
else:
    min_count = 1


max_count = len(count) + other

print(min_count, max_count)

Submission status: Wrong Answer

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

import collections

count = collections.defaultdict(int)
other = 0
for a in A:
    if 1 <= a <= 399:
        count['gray'] += 1
    elif 400 <= a <= 799:
        count['brown'] += 1
    elif 800 <= a <= 1199:
        count['green'] += 1
    elif 1200 <= a <= 1599:
        count['mizu'] += 1
    elif 1600 <= a <= 1999:
        count['blue'] += 1
    elif 2000 <= a <= 2399:
        count['yellow'] += 1
    elif 2400 <= a <= 2799:
        count['daidai'] += 1
    elif 2800 <= a <= 3199:
        count['brown'] += 1
    else:
        other += 1

if len(count):
    min_count = len(count)
else:
    min_count = 1


if other:
    max_count = len(count) + other
else:
    max_count = len(count)

print(min_count, max_count)

Submission status: Wrong Answer

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

import collections

count = collections.defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        count['gray'] += 1
    elif 400 <= a <= 799:
        count['brown'] += 1
    elif 800 <= a <= 1199:
        count['green'] += 1
    elif 1200 <= a <= 1599:
        count['mizu'] += 1
    elif 1600 <= a <= 1999:
        count['blue'] += 1
    elif 2000 <= a <= 2399:
        count['yellow'] += 1
    elif 2400 <= a <= 2799:
        count['daidai'] += 1
    elif 2800 <= a <= 3199:
        count['brown'] += 1
    else:
        count['other'] += 1

if 'other' not in count:
    min_count = len(count)
elif 'other' in count and len(count) == 1:
    min_count = 1
else:
    min_count = len(count) - 1


if 'other' in count:
    max_count = len(count)-1 + count['other']
else:
    max_count = len(count)

print(min_count, max_count)

Submission status: Wrong Answer

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

import collections

count = collections.defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        count['gray'] += 1
    elif 400 <= a <= 799:
        count['brown'] += 1
    elif 800 <= a <= 1199:
        count['green'] += 1
    elif 1200 <= a <= 1599:
        count['mizu'] += 1
    elif 1600 <= a <= 1999:
        count['blue'] += 1
    elif 2000 <= a <= 2399:
        count['yellow'] += 1
    elif 2400 <= a <= 2799:
        count['daidai'] += 1
    elif 2800 <= a <= 3199:
        count['brown'] += 1
    else:
        count['other'] += 1

if 'other' not in count:
    min_count = len(count)
elif 'other' in count and len(count) == 1:
    min_count = 1
else:
    min_count = len(count) - 1


if 'other' in count:
    max_count = min(8, len(count)-1 + count['other'])
else:
    max_count = len(count)

print(min_count, max_count)

Submission status: Wrong Answer

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

import collections

count = collections.defaultdict(int)
for a in A:
    if 1 <= a <= 399:
        count['gray'] += 1
    elif 400 <= a <= 799:
        count['brown'] += 1
    elif 800 <= a <= 1199:
        count['green'] += 1
    elif 1200 <= a <= 1599:
        count['mizu'] += 1
    elif 1600 <= a <= 1999:
        count['blue'] += 1
    elif 2000 <= a <= 2399:
        count['yellow'] += 1
    elif 2400 <= a <= 2799:
        count['daidai'] += 1
    elif 2800 <= a <= 3199:
        count['brown'] += 1
    else:
        count['other'] += 1

if 'other' not in count:
    min_count = len(count)
elif 'other' in count and len(count) == 1:
    min_count = 1
else:
    min_count = len(count) - 1


if 'other' in count:
    max_count = min(7, len(count)-1 + count['other'])
else:
    max_count = len(count)

print(min_count, max_count)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()
rate = [0]*9


for i in a:
  rate[min(i//400,8)]+=1
base = 8-rate[:-1].count(0)
ma = min(8,base+rate[-1])
print(max(base,1),ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()
rate = [0]*9


for i in a:
  rate[min(i//400,8)]+=1
base = 8-rate[:-1].count(0)
ma = min(8,base+rate[-1])
print(base,ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()
rate = [0]*9


for i in a:
  rate[min(i//400,8)]+=1

base = 8-rate[:-1].count(0)
ma = min(9,base+rate[-1])
print(base,ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()
if n==0:
  print(0,0)
  exit()

rate = [0]*9


for i in a:
  rate[min(i//400,8)]+=1

base = 8-rate[:-1].count(0)
ma = min(9,base+rate[-1])
print(base,ma)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()
if n==0:
  print(0,0)
  exit()

rate = [0]*9


for i in a:
  rate[min(i//400,8)]+=1

print(max(1,8-rate[:-1].count(0)),end=" ")
print(min(9,(8-rate[:-1].count(0))+rate[-1]))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

rate = [0]*9
n = readInt()
a = readInts()

for i in a:
  rate[min(i//400,8)]+=1

print(8-rate[:-1].count(0),end=" ")
print(min(9,(8-rate[:-1].count(0))+rate[-1]))

Submission status: Wrong Answer

Solution code:
def Judge_the_color(P):
    if P <= 399:
        return 'gray'
    elif P<=799:
        return 'brown'
    elif P<=1199:
        return 'green'
    elif P<=1599:
        return 'lightblue'
    elif P<=1999:
        return 'blue'
    elif P<=2399:
        return 'yellow'
    elif P<=2799:
        return 'orange'
    elif P<=3199:
        return 'red'
    else:
        return 'WC'

N=int(input())
aaa=list(map(int,input().split()))
l=[]

for a in aaa:
    l.append(Judge_the_color(a))

WCs=l.count('WC')

MIN=len(set(l))
MAX=len(set(l))
if WCs>=1:
    MIN=MIN-1
else:
    pass

if WCs>=1:
    MAX=MAX-1+WCs
else:
    pass

print(MIN,MAX)

Submission status: Wrong Answer

Solution code:
def Judge_the_color(P):
    if P <= 399:
        return 'gray'
    elif P<=799:
        return 'brown'
    elif P<=1199:
        return 'green'
    elif P<=1599:
        return 'lightblue'
    elif P<=1999:
        return 'blue'
    elif P<=2399:
        return 'yellow'
    elif P<=2799:
        return 'orange'
    elif P<=3199:
        return 'red'
    else:
        return 'WC'

N=int(input())
aaa=list(map(int,input().split()))
l=[]

for a in aaa:
    l.append(Judge_the_color(a))

WCs=l.count('WC')

MIN=len(set(l))
MAX=len(set(l))
if WCs>=1:
    MIN=MIN-1
else:
    pass

if WCs>=1:
    MAX=MAX-1+WCs
    if MAX>=8:
        MAX=8
    else:
        pass
else:
    pass

print(MIN,MAX)

Submission status: Wrong Answer

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

    color = [False] * 9
    cnt_anycolor = 0

    for i in a:
        if i <= 399:
            color[0] = True
        elif i <= 799:
            color[1] = True
        elif i <= 1199:
            color[2] = True
        elif i <= 1599:
            color[3] = True
        elif i <= 1999:
            color[4] = True
        elif i <= 2399:
            color[5] = True
        elif i <= 2799:
            color[6] = True
        elif i <= 3199:
            color[7] = True
        else:
            color[8] = True
            cnt_anycolor += 1

    min_color = 0
    max_color = 0

    for c in color:
        if c:
            min_color += 1
            max_color += 1

    if color[8]:
        if not(min_color == 0):
            min_color -= 1
        max_color += (cnt_anycolor - 1)

    print(min_color, max_color)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    color = [False] * 9
    cnt_anycolor = 0

    for i in a:
        if i <= 399:
            color[0] = True
        elif i <= 799:
            color[1] = True
        elif i <= 1199:
            color[2] = True
        elif i <= 1599:
            color[3] = True
        elif i <= 1999:
            color[4] = True
        elif i <= 2399:
            color[5] = True
        elif i <= 2799:
            color[6] = True
        elif i <= 3199:
            color[7] = True
        else:
            color[8] = True
            cnt_anycolor += 1

    min_color = 0
    max_color = 0

    for c in color:
        if c:
            min_color += 1
            max_color += 1

    if color[8]:
        if not(c == 0):
            min_color -= 1
        max_color += (cnt_anycolor - 1)

    print(min_color, max_color)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    color = [False] * 9
    cnt_anycolor = 0

    for i in a:
        if i <= 399:
            color[0] = True
        elif i <= 799:
            color[1] = True
        elif i <= 1199:
            color[2] = True
        elif i <= 1599:
            color[3] = True
        elif i <= 1999:
            color[4] = True
        elif i <= 2399:
            color[5] = True
        elif i <= 2799:
            color[6] = True
        elif i <= 3199:
            color[7] = True
        elif i <= 4800:
            color[8] = True
            cnt_anycolor += 1

    min_color = 0
    max_color = 0

    for c in color:
        if c:
            min_color += 1
            max_color += 1

    if color[8]:
        min_color -= 1
        max_color += cnt_anycolor - 1

    print(min_color, max_color)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    color = [False] * 9
    cnt_anycolor = 0

    for i in a:
        if i <= 399:
            color[0] = True
        elif i <= 799:
            color[1] = True
        elif i <= 1199:
            color[2] = True
        elif i <= 1599:
            color[3] = True
        elif i <= 1999:
            color[4] = True
        elif i <= 2399:
            color[5] = True
        elif i <= 2799:
            color[6] = True
        elif i <= 3199:
            color[7] = True
        else:
            color[8] = True
            cnt_anycolor += 1


    min_color = 0
    max_color = 0

    for c in color:
        if c:
            min_color += 1
            max_color += 1

    if color[8]:
        min_color -= 1
        max_color += cnt_anycolor - 1

    print(min_color, max_color)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

t = set()
c = 0
for i in range(n):
    if a[i] <= 399:
        t.add(1)
    elif a[i] <= 799:
        t.add(2)
    elif a[i] <= 1199:
        t.add(3)
    elif a[i] <= 1599:
        t.add(4)
    elif a[i] <= 1999:
        t.add(5)
    elif a[i] <= 2399:
        t.add(6)
    elif a[i] <= 2799:
        t.add(7)
    elif a[i] <= 3199:
        t.add(8)
    else:
        c += 1
s = len(t)
if c == 0:
    print(s,s)
else:
    print(s,s+c)

Submission status: Wrong Answer

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

t = set()
c = 0
for i in range(n):
    if a[i] <= 399:
        t.add(1)
    elif a[i] <= 799:
        t.add(2)
    elif a[i] <= 1199:
        t.add(3)
    elif a[i] <= 1599:
        t.add(4)
    elif a[i] <= 1999:
        t.add(5)
    elif a[i] <= 2399:
        t.add(6)
    elif a[i] <= 2799:
        t.add(7)
    elif a[i] <= 3199:
        t.add(8)
    else:
        c += 1
s = len(t)
if c == 0:
    print(s,s)
else:
    print(s,min(8,s+c))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color_val=0
bigList=[]
for i in range(1,400):
  if i in a:
    color_val+=1
    break
for s in range(400,800):
  if s in a:
    color_val+=1
    break
for t in range(800,1200):
  if t in a:
    color_val+=1
    break
for u in range(1200,1600):
  if u in a:
    color_val+=1
    break
for q in range(1600,2000):
  if q in a:
    color_val+=1
    break
for e in range(2000,2400):
  if e in a:
    color_val+=1
    break
for f in range(2400,2800):
  if f in a:
    color_val+=1
    break
for g in range(2800,3200):
  if g in a:
    color_val+=1
    break
for z in a:
  if z >=3200:
    bigList.append(z)
    
max=color_val+len(bigList)
if color_val<len(bigList):
  print(len(bigList),max)
else:
  print(color_val,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color_val=0
bigList=[]
for i in range(1,400):
  if i in a:
    color_val+=1
    break
for s in range(400,800):
  if s in a:
    color_val+=1
    break
for t in range(800,1200):
  if t in a:
    color_val+=1
    break
for u in range(1200,1600):
  if u in a:
    color_val+=1
    break
for q in range(1600,2000):
  if q in a:
    color_val+=1
    break
for e in range(2000,2400):
  if e in a:
    color_val+=1
    break
for f in range(2400,2800):
  if f in a:
    color_val+=1
    break
for g in range(2800,3200):
  if g in a:
    color_val+=1
    break
for z in a:
  if z >=3200:
    bigList.append(z)
    
max=color_val+len(bigList)
print(color_val,max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color_val=0
bigList=[]
for i in range(1,400):
  if i in a:
    color_val+=1
    break
for s in range(400,800):
  if s in a:
    color_val+=1
    break
for t in range(800,1200):
  if t in a:
    color_val+=1
    break
for u in range(1200,1600):
  if u in a:
    color_val+=1
    break
for q in range(1600,2000):
  if q in a:
    color_val+=1
    break
for e in range(2000,2400):
  if e in a:
    color_val+=1
    break
for f in range(2400,2800):
  if f in a:
    color_val+=1
    break
for g in range(2800,3200):
  if g in a:
    color_val+=1
    break
for z in a:
  if z >=3200:
    bigList.append(z)
    
if color_val<8:
  color_val+=len(bigList)
  if color_val>8:
    print(color_val-len(bigList),8)
  else:
    print(color_val-len(bigList),color_val)
else:
  print(8,8)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
color_val=0
bigList=[]
for i in range(1,400):
  if i in a:
    color_val+=1
    break
for s in range(400,800):
  if s in a:
    color_val+=1
    break
for t in range(800,1200):
  if t in a:
    color_val+=1
    break
for u in range(1200,1600):
  if u in a:
    color_val+=1
    break
for q in range(1600,2000):
  if q in a:
    color_val+=1
    break
for e in range(2000,2400):
  if e in a:
    color_val+=1
    break
for f in range(2400,2800):
  if f in a:
    color_val+=1
    break
for g in range(2800,3200):
  if g in a:
    color_val+=1
    break
for z in a:
  if z >=3200:
    bigList.append(z)
    
if color_val<8:
  color_val+=len(bigList)
  if color_val>8:
    print(color_val-len(bigList),8)
  else:
    print(color_val-len(bigList),color_val)
else:
  print(8,8)
print(color_val)
print(len(bigList))

Submission status: Wrong Answer

Solution code:
_ = input()
a = [int(x) for x in input().split()]

p = [False] * 8
q = 0
for i in a:
    if 3199 < i:
        q += 1
    else:
        for j in range(8):
            if 400 * j <= i < 400 * (j + 1):
                p[j] = True
else:
    s = sum(p)
    print(s, s + q)

Submission status: Wrong Answer

Solution code:
import collections

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


def color(rate):
    if 1 <= rate <= 399:
        return 'gray'
    elif 400 <= rate <= 799:
        return 'brown'
    elif 800 <= rate <= 1199:
        return 'green'
    elif 1200 <= rate <= 1599:
        return 'water'
    elif 1600 <= rate <= 1999:
        return 'blue'
    elif 2000 <= rate <= 2399:
        return 'yellow'
    elif 2400 <= rate <= 2799:
        return 'orange'
    elif 2800 <= rate <= 3199:
        return 'red'
    elif 3200 <= rate:
        return 'multi'


MAX_COLORS = 8

l = [color(rate) for rate in a]
c = collections.Counter(l)

if 'multi' in c.keys():
    k_not_multi = len([k for k in c.keys() if k != 'multi'])

    _max = min(k_not_multi + c['multi'], MAX_COLORS)
    
    if k_not_multi == 0:
        _min = 1
    else:
        _min = k_not_multi
else:
    _max = _min = len([k for k in c.keys()])

print(_min, _max)

Submission status: Wrong Answer

Solution code:
import collections

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


def color(rate):
    if 1 <= rate <= 399:
        return 'gray'
    elif 400 <= rate <= 799:
        return 'brown'
    elif 800 <= rate <= 1199:
        return 'green'
    elif 1200 <= rate <= 1599:
        return 'water'
    elif 1600 <= rate <= 1999:
        return 'blue'
    elif 2000 <= rate <= 2399:
        return 'yellow'
    elif 2400 <= rate <= 2799:
        return 'orange'
    elif 2800 <= rate <= 3199:
        return 'red'
    elif 3200 <= rate:
        return 'multi'


MAX_COLORS = 8

l = [color(rate) for rate in a]
c = collections.Counter(l)

if 'multi' in c.keys():
    k_not_multi = len([k for k in c.keys() if k != 'multi'])

    _max = min(k_not_multi + c['multi'], MAX_COLORS)
    _min = k_not_multi
else:
    _max = _min = len([k for k in c.keys()])

print(_min, _max)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
S=set()
cnt=0
for i in A:
  if i>=3200:
    cnt+=1
  else:
    S.add(i//400)
low=len(S)
high=cnt+low
print(low,high)

Submission status: Wrong Answer

Solution code:
def main():
    is_exist = [False] * 8
    free = 0
    n = int(input())
    A = list(map(int, (input().split())))
    for a in A:
        color = a // 400
        if color >= 8:
            free += 1
        else:
            is_exist[color] = True

    normal_colors = sum(is_exist)
    minimum = normal_colors
    if free > normal_colors:
        minimum += free - normal_colors

    maximum = free + normal_colors
    print(minimum, maximum)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a=list(map(lambda x:x//400,a))
cnt=0
z=[]
for i in a:
  if i>=8:
    cnt+=1
  else:
    z.append(i)
print(len(set(z)),len(set(z))+cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a=map(lambda x:x//400,a)
cnt=0
z=[]
for i in a:
  if i>=8:
    cnt+=1
  else:
    z.append(i)
print(min(8,len(set(z))),len(set(z))+cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a=map(lambda x:x//400,a)
cnt=0
z=[]
for i in a:
  if i>=8:
    cnt+=1
  else:
    z.append(i)
print(min(8,len(set(z))),min(8,len(set(z))+cnt))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
map(lambda x:x//400,a)
cnt=0
z=[]
for i in a:
  if i>=8:
    cnt+=1
  else:
    z+=[i]
print(min(8,len(set(z))),min(8,len(set(z))+cnt))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
l = [0, 0, 0, 0, 0, 0, 0, 0]
pro = 0
m1 = 0
m2 = 0

for i in a:
    if i < 400:
        l[0] += 1
    elif 400 <= i and i < 800:
        l[1] += 1
    elif 800 <= i and i < 1200:
        l[2] += 1
    elif 1200 <= i and i < 1600:
        l[3] += 1
    elif 1600 <= i and i < 2000:
        l[4] += 1
    elif 2000 <= i and i < 2400:
        l[5] += 1
    elif 2400 <= i and i < 2800:
        l[6] += 1
    elif 2800 <= i and i < 3200:
        l[7] += 1
    elif 3200 <= i:
        pro += 1


if l != [0, 0, 0, 0, 0, 0, 0, 0]:
    for i in l:
        if i != 0:
            m1 += 1
    p = m1 + pro
    m2 = min(8, p)
else:
    m1 = 1
    m2 = min(8, pro)


print(m1, m2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
l = [0, 0, 0, 0, 0, 0, 0, 0]
pro = 0
m1 = 0
m2 = 0

for i in a:
    if i < 400:
        l[0] += 1
    elif 400 <= i and i < 800:
        l[1] += 1
    elif 800 <= i and i < 1200:
        l[2] += 1
    elif 1200 <= i and i < 1600:
        l[3] += 1
    elif 1600 <= i and i < 2000:
        l[4] += 1
    elif 2000 <= i and i < 2400:
        l[5] += 1
    elif 2400 <= i and i < 2800:
        l[6] += 1
    elif 2800 <= i and i < 3200:
        l[7] += 1
    elif 3200 <= i:
        pro += 1


for i in l:
    if i != 0:
        m1 += 1

p = m1 + pro
m2 = min([8, p])
print(m1, m2)

Submission status: Wrong Answer

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

col = [0 for _ in range(9)]
for a in A:
  if a >= 3200:
    col[8] += 1
    continue
  col[a//400] = 1
print(sum(col[:-1]), sum(col))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [x//400 if x//400 <= 7 else 8 for x in a]
p = [0]*8
for i in l:
    if i < 8:
        p[i] = 1
pmin = sum(p) if sum(p) != 0 else 1
pmax = sum(p) + l.count(8)
print(l)
print(p)
print(pmin, pmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [x//400 if x//400 <= 7 else 8 for x in a]
p = [0]*8
for i in l:
    if i < 8:
        p[i] = 1
if p.count(0) == 8:
    pmin = 1
    pmax = sum(p) + min(l.count(8),p.count(0))
else:
    pmin = sum(p) if sum(p) != 0 else 1
    pmax = pmin + min(l.count(8),p.count(0))
print(pmin, pmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [x//400 if x//400 <= 7 else 8 for x in a]
p = [0]*8
for i in l:
    if i < 8:
        p[i] = 1
if p.count(0) == 8:
    pmin = 1
    pmax = pmin + min(l.count(8)-1,p.count(0)-1)
else:
    pmin = sum(p) if sum(p) != 0 else 1
    pmax = pmin + min(l.count(8),p.count(0))
print(pmin, pmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [x//400 if x//400 <= 7 else 8 for x in a]
p = [0]*8
for i in l:
    if i < 8:
        p[i] = 1
if p.count(0) == 8:
    pmin = 1
    pmax = pmin + min(l.count(8)-1,p.count(0)-1)
else:
    pmin = sum(p) if sum(p) != 0 else 1
    pmax = pmin + min(l.count(8),p.count(0))
print(l)
print(p)
print(pmin, pmax)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [x//400 if x//400 <= 7 else 8 for x in a]
p = [0]*8
for i in l:
    if i < 8:
        p[i] = 1
pmin = sum(p) if sum(p) != 0 else 1
pmax = pmin + min(l.count(8),p.count(0))
print(pmin, pmax)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

b = [0] * 9 
for i in range(n):
  if a[i] // 400 < 8:
    b[a[i] // 400] += 1
  else:
    b[8] += 1

minsum = 0
maxsum = 0
for i in range(8):
  if b[i] > 0:
    minsum += 1
if minsum == 0:
  minsum = 1
maxsum = minsum
maxsum += b[8]
print("{} {}".format(minsum, maxsum))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

b = [0] * 9 
for i in range(n):
  if a[i] // 400 < 8:
    b[a[i] // 400] += 1
  else:
    b[8] += 1

minsum = 0
maxsum = 0
for i in range(8):
  if b[i] > 0:
    minsum += 1
maxsum = minsum
maxsum += b[8]
if maxsum == 0:
  maxsum = 1
print("{} {}".format(minsum, maxsum))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

b = [0] * 9 
for i in range(n):
  if a[i] // 400 < 8:
    b[a[i] // 400] += 1
  else:
    b[8] += 1

minsum = 0
maxsum = 0
for i in range(8):
  if b[i] > 0:
    minsum += 1
maxsum = minsum
maxsum += b[8]
print("{} {}".format(minsum, maxsum))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
A=[a for a in A if a<3200]
free=n-len(A)
A=set(map(lambda x: x//400,A))
print(len(A),len(A)+free)

Submission status: Wrong Answer

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

print(str(cnt)+" "+str(cnt+at))

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    a = LI()
    color = 8
    free = 0
    flag = [False]*color
    for ai in a:
        if ai >= 3200:
            free += 1
        else:
            flag[ai//400] = True
    color_min = max(1, sum(flag))
    color_max = min(color, sum(flag)+free)
    print("{} {}".format(color_min, color_max))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    a = LI()
    color = 8
    free = 0
    flag = [False]*color
    for ai in a:
        if ai >= 3200:
            free += 1
        else:
            flag[ai//400] = True
    color_min = sum(flag)
    color_max = min(color, color_min+free)
    print("{} {}".format(color_min, color_max))

if __name__ == '__main__':
    main()