Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#from collections import Counter
import math
N=int(input())
A=list(map(int,input().split()))
l=[]
n=1
for i in A:
    l.append(i-n)
    n+=1
l.sort()
#中央値
#切り捨て
c=int(math.floor(N/2))
b=A[c]
ans_l=[]
ans=0
for j in l:
    ans+=abs(j-l[b])

print(ans)

Fixed submission:
#from collections import Counter
import math
N=int(input())
A=list(map(int,input().split()))
l=[]
n=1
for i in A:
    l.append(i-n)
    n+=1
l.sort()
#中央値
#切り捨て
c=int(math.floor(N/2))

ans_l=[]
ans=0
for j in l:
    ans+=abs(j-l[c])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N=int(input())
A=list(map(int,input().split()))
l=[]
n=1
for i in A:
    l.append(i-n)
    n+=1
c=Counter(l)
c=c.most_common(N)
ans_l=[]
for i in range(len(c)):
    b=c[i][0]
    ans=0
    for j in l:
        ans+=abs(j-b)
    ans_l.append(ans)
print(min(ans_l))

Fixed submission:
#from collections import Counter
import math
N=int(input())
A=list(map(int,input().split()))
l=[]
n=1
for i in A:
    l.append(i-n)
    n+=1
l.sort()
#中央値
#切り捨て
c=int(math.floor(N/2))

ans_l=[]
ans=0
for j in l:
    ans+=abs(j-l[c])

print(ans)
Buggy python submission (verdict: Runtime Error):
d,n=map(int,input().split())
if(n==100):
    n=101#100番目は100ではなく101になるので
print(m*pow(100,d))



Fixed submission:
d,n=map(int,input().split())
if(n==100):
    n=101#100番目は100ではなく101になるので
print(n*pow(100,d))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
l=[]
no_even=0
def no_even(A,N):
    flag=0
    for i in range(N):
        if A[i]%2==0:
            flag=1
            break
    if flag==0:
        return True
    else:
        return False

count=0

while no_even(A,N)==False:
    for i in range(N):
        if A[i]%2==0:
            l.append(A[i])
    flag=0
    for i in range(N):
        if A[i]==max(l) and flag==0:
            A[i]=int(A[i]/2)
            flag=1
        else:
            A[i]*=3
#    print(A)    
    count+=1
print(count)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
def count_two(num):
    flag=0
    count=0
    while flag==0:
        if num%2==0:
            count+=1
            num=int(num/2)
        else:
            flag=1
    return count

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

X = INT()
# ans = 0
# for b in range(1, 1000):
#     for p in range(2, 1000):
#         tmp = b ^ p
#         # print(tmp)
#         if tmp <= X:
#             ans = max(ans, tmp)
#             # print(tmp)
#         else:
#             break
# print(ans)
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

x = X
r = []
for i in range(2, x + 1):
    c = 2
    while i ** c <= x:
        r.append(i ** c)
        c += 1
ans = sorted(r)[-1]
print(ans)



exit()


for x in range(X, 0, -1):
    prime = prime_decomposition(x)
    c = Counter(prime)
    # print(c.values())
    value = c.values()
    # print(v)
    print(c)
    for v in value:
        d = v
    if len(c) == 1 and d >= 2:
        print(x)
        exit()
    elif x == 1:
        print(x)
        exit()
    



Fixed submission:
x=int(input())
m=int(x**0.5)
r=[1]
for i in range(2,x+1):
        c=2
        while i**c<=x:
                r.append(i**c)
                c+=1
ans=sorted(r)[-1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
x=list(map(int,input().split()))
l=[]       
for i in range(N):
    temp=[]
    for j in range(N):
        if i!=j:
            temp.append(x[j])
    l.append(temp)
length=N-1

for i in range(N):
    l[i]=sorted(l[i])
    print(l[i][(length+1)//2-1])


Fixed submission:
N=int(input())
x=list(map(int,input().split()))
y=sorted(x)
left=y[N//2-1]
right=y[N//2]

for i in x:
    if i<=left:
        print(right)
    elif i>=right:
        print(left)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
b=[]
for i in range(N):
    b=[]
    count=0
    b.append(0)
    for j in range(N):
        if i!=j:
            b.append(A[j])
    b.append(0)
    for k in range(N):
        count+=abs(b[k+1]-b[k])
        #print(count)
    print(count)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
cost=[0]*(N+1)
cost[0]=abs(A[0]-0)#0からA[0]の距離
for i in range(1,N):#from 1 to N
    cost[i]=abs(A[i]-A[i-1])+cost[i-1]#累積和
    #cost[1]=abs(A[1]-A[0])+cost[0] 今までの距離+現在の距離
#cost[0:N]
cost[N]=abs(A[N-1])+cost[N-1]#今までの距離+現在の距離(0から最後のところまでの距離)

print(cost[N]-cost[1]+abs(A[1]-0))
for i in range(1,N-1):
    ans=cost[i-1]+cost[N]-cost[i+1]+abs(A[i+1]-A[i-1])
    print(ans)
print(cost[N-2]+abs(0-A[N-2]))
Buggy python submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
C = []

for i in range(50):
    C.append(["#"] * 100)
for i in range(50):
    C.append(["."] * 100)

h = 0
w = 0
for i in range(A-1):
    C[h][w] = "."
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        row += 2

# 下から．二次元でもできる．
h = -1
w = 0

for i in range(B-1):
    C[h][w] = "#"
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        h -= 2

print(100, 100)
for i in range(100):
    print(*C[i], sep="")

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

A, B = MAP()
C = []

for i in range(50):
    C.append(["#"] * 100)
for i in range(50):
    C.append(["."] * 100)

h = 0
w = 0
for i in range(A-1):
    C[h][w] = "."
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        h += 2

# 下から．二次元でもできる．
h = -1
w = 0

for i in range(B-1):
    C[h][w] = "#"
    w += 2
    if w >= 100:
        # 端まで行ったら最初っから
        w = 0
        # 一行開けて下に書く
        h -= 2

print(100, 100)
for i in range(100):
    print(*C[i], sep="")
Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
s=[str(input()) for i in range(n)]
m=int(input())
t=[str(input()) for i in range(m)]
s_s=set(s)
t_s=set(t)
#import pdb;pdb.set_trace()
s_c=collections.Counter(s)
t_c=collections.Counter(t)
a_l=[]
for i in s_c.keys():
    a_l.append(s_c[i]-t_c[i])
if max(a_l)>0:
    ans=max(a_l)
else:
    ans=0
print(ans)
import pdb;pdb.set_trace()


Fixed submission:
import collections
n=int(input())
s=[str(input()) for i in range(n)]
m=int(input())
t=[str(input()) for i in range(m)]
s_s=set(s)
t_s=set(t)
#import pdb;pdb.set_trace()
s_c=collections.Counter(s)
t_c=collections.Counter(t)
a_l=[]
for i in s_c.keys():
    a_l.append(s_c[i]-t_c[i])
if max(a_l)>0:
    ans=max(a_l)
else:
    ans=0
print(ans)
Buggy python submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n;
    int a[110];
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
       

    sort(a,a+n,greater<int>());//a[0:n]
    int Alice=0;
    int Bob=0;
    for(int i=0;i<n;i++){
        if(i%2==0){//even Alice
            Alice += a[i];
        }
        else{
            Bob += a[i];
        }
    }
    cout<<Alice-Bob<<endl;

}


Fixed submission:
#088B
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
#print(a)

player_a=[]
player_b=[]

for i in range(len(a)):
	if(i==0 or i%2==0):
		player_a.append(a[i])
	else:
		player_b.append(a[i])

sum_a=sum(player_a)
sum_b=sum(player_b)

ans=sum_a-sum_b

print(ans)
Buggy python submission (verdict: Runtime Error):
#escape_ck_ans
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
a=[0]*3
b=[0]*3
a[0]=0#一つ固定する
a[1]=c[1][1]-c[0][1]
a[2]=c[2][2]-c[0][2]
b[0]=c[0][0]
b[1]=c[0][1]
b[2]=c[0][2]
flag=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=a[i]+b[i]:
            flag=False
if flag=True:
    print("Yes")
else:
    print("No")
""" 
print("Yes") if flag(is true) else print("No")
"""

Fixed submission:
#escape_ck_ans
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
a=[0]*3
b=[0]*3
a[0]=0#一つ固定する
a[1]=c[1][1]-c[0][1]
a[2]=c[2][2]-c[0][2]
b[0]=c[0][0]
b[1]=c[0][1]
b[2]=c[0][2]
flag=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=a[i]+b[j]:
            flag=False
if flag==True:
    print("Yes")
else:
    print("No")
""" 
print("Yes") if flag(is true) else print("No")
"""
Buggy python submission (verdict: Runtime Error):
#include<iostream>
#include<set>
using namespace std;

int main(){
    int N;
    int d[110];
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>d[i];
    }
    set<int>values;
    for (int i=0;i<N;i++){
        values.insert(d[i]);
    }
    cout<<values.size()<<endl;
}

Fixed submission:
#ABC085B
n=int(input())
l=[]
for i in range(n):
	l.append(input())
#set型のオブジェクトはコンストラクタset()でも生成できる。
#引数としてリストやタプルのようなイテラブルオブジェクトを指定すると、重複する要素が除外されて一意な値のみが要素となるsetオブジェクトが生成される。
s_l=set(l)
#s_l=sorted(s_l)
#set to list by sorted
#print(type(s_l))
ans=len(s_l)
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(str,input().split()))
a_c=collections.Counter(a)
l=sorted(a_c.values())
ans=0
for i in range(len(l)-k):
    ans+=l[i]
print(ans)

Fixed submission:
import collections
n,k=map(int,input().split())
a=list(map(str,input().split()))
a_c=collections.Counter(a)
l=sorted(a_c.values())
ans=0
for i in range(len(l)-k):
    ans+=l[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
    


S=''.join(S)

if flag==False:
    print("UNRESTORABLE")
else:
    S=list(S)
    for i in range(len(T)):
        S[i+memo]=T[i]
    S=S.replace('?','a')
    print(S)



Fixed submission:
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
    



if flag==False:
    print("UNRESTORABLE")
else:
    S=list(S)
    for i in range(len(T)):
        S[i+memo]=T[i]
    
    S=''.join(S)    
    S=S.replace('?','a')
    print(S)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
S=list(S)
for i in range(len(T)):
    S[i+memo]=T[i]

S=''.join(S)

if flag==False:
    print("UNRESTORABLE")
else:
    S=S.replace('?','a')
    print(S)



Fixed submission:
S=input()
T=input()
flag=False
for i in range(len(S)-len(T)+1):
    dif=0
    same=0
    s=S[i:i+len(T)]#len(T)
    for j in range(len(T)):
        if s[j]!='?':#sが言葉の時
            if s[j]!=T[j]:
                #print("st",s[i],T[i])
                dif+=1
            else:
                same+=1
#                flag=True

        #else:#?のとき
    if dif==0:
        #dst=S.replace(s,T)
        flag=True
        memo=i#複数replace対策
    



if flag==False:
    print("UNRESTORABLE")
else:
    S=list(S)
    for i in range(len(T)):
        S[i+memo]=T[i]
    
    S=''.join(S)    
    S=S.replace('?','a')
    print(S)
Buggy python submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

h, w = MAP()

# a = [[0] * (w + 2)] * (h + 2)
s = [list(input()) for _ in range(h)]

dx = [1, 0, -1, 0, 1, -1, -1, 1]
dy = [0, 1, 0, -1, 1, 1, -1, -1]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            continue
            # スルー
        num = 0
        for d in range(8):
            ni = i + dy[d]
            nj = j + dx[d]
            # niとnjで有効なのはsの定義域．
            # ni w 0 <= ni <= w - 1
            # nj h 0 <= nj <= h - 1
            
            if ni < 0 or w <= ni:
                continue
                # スルー
            if nj < 0 or h <= nj:
                continue
                # スールー
            if s[ni][nj] == "#":
                num += 1
            s[i][j] = str(num)
            # (num + "0")

for i in range(h):
    print("".join(s[i]))


Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

h, w = MAP()

# a = [[0] * (w + 2)] * (h + 2)
s = [list(input()) for _ in range(h)]

dx = [1, 0, -1, 0, 1, -1, -1, 1]
dy = [0, 1, 0, -1, 1, 1, -1, -1]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            continue
            # スルー
        num = 0
        for d in range(8):
            ni = i + dy[d]
            nj = j + dx[d]
            # niとnjで有効なのはsの定義域．
            # ni w 0 <= ni <= w - 1
            # nj h 0 <= nj <= h - 1
            
            if ni < 0 or h <= ni:
                continue
                # スルー
            if nj < 0 or w <= nj:
                continue
                # スールー
            if s[ni][nj] == "#":
                num += 1
        s[i][j] = str(num)
            # (num + "0")

for i in range(h):
    print("".join(s[i]))
Buggy python submission (verdict: Runtime Error):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = list(int())
if "9" in N:
    print("Yes")
else:
    print("No")


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

N = list(input())
if "9" in N:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
#include<iostream>
using namespace std;

int main(){
	string s;
	cin>>s;
	int N=s.size();
	string ans;
	for(int i=0;i<N;i+=2) ans+=s[i];
		//in string, it means odd number
	cout<<ans<<endl;
}

Fixed submission:
s=str(input())
l_s=[]
for i in range(len(s)):
	if((i+1)%2!=0):
		l_s.append(s[i])

odd=''.join(l_s)
print(odd)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans=-1
for i in range(len(A)):
    base=A[i]
    count=0
    for j in range(len(A)):
        if abs(A[j]-base)<=1:
            count+=1
    ans=max(ans,count)
print(ans)
    


    

Fixed submission:
from collections import Counter
#先に数えておく
N=int(input())
A=list(map(int,input().split()))
low=min(A)
high=max(A)

c_l=Counter(A)
ans=-1
for x in range(low,high+1):
    #範囲
    a=x-1
    b=x
    c=x+1
    num=c_l[a]+c_l[b]+c_l[c]
    ans=max(num,ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

T=[]
for i in range(N):
    T.append(int(input()))

if N==1:
    print(T[0])
else:
    a=lcm(T[0],T[1])
    for i in range(N):
        a=lcm(a,T[i])
print(a)

    



Fixed submission:
N=int(input())
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

T=[]
for i in range(N):
    T.append(int(input()))

if N==1:
    print(T[0])
else:
    a=lcm(T[0],T[1])
    for i in range(N):
        a=lcm(a,T[i])
    print(a)
Buggy python submission (verdict: Time Limit Exceeded):
#21:06
N,M=map(int,input().split())
l=[]
for i in range(M):
    l.append(list(map(int,input().split())))
first=[]
last=[]

for t in l:
    if t[0]==1:
        first.append(t[1])
    elif t[1]==N:
        last.append(t[0])
flag=False
for s in first:
    if s in last:
        flag=True
        break
if flag:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
#21:06
N,M=map(int,input().split())
l=[]
for i in range(M):
    l.append(list(map(int,input().split())))
first=[]
last=[]
H=[[] for i in range(N)]
for t in l:
    H[t[0]-1].append(t[1])
    H[t[1]-1].append(t[0])
#if H[0][0]==H[N-1][0]
#print(any(N in H[0]))
#for v in H[0]:
if any(N in H[v-1] for v in H[0]):
    #N is exist in first
    #1 to i to N
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = min(n + c)

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)






    


Fixed submission:
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = n + c

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)

Buggy python submission (verdict: Runtime Error):
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1

for i in range(N):
    if 3200 <= A[i]:
        red_cnt += 1
not_red_color = 0
for i in range(8):
    if ex_red[i] > 0:
        not_red_color += 1
    
zero_num = 8 - not_red_color

if red_cnt<=1:
    ans = red_cnt + not_red_color
else:#red_cnt more than 2
    assign = red_cnt - 1
    if zero_num >= assign:
        ans = assign + not_red_color + 1
    else:
        ans = zero_num + not_red_colot + 1

#if red_cnt != 0:
min_ans = not_red_color

# if zero_num >= red_cnt:
#     ans = red_cnt + not_red_color
# else:
#     ans = zero_num + not_red_color

print(min_ans, ans)


Fixed submission:
#13:27
N = int(input())
A = list(map(int,input().split()))
ex_red = [0]*8
red_cnt = 0

for i in range(8):#0-7
    for j in range(N):
        if 400*i<=A[j] and A[j]<400*(i+1):
            ex_red[i]+=1
n = 0
for i in range(N):
    if 3200 <= A[i]:
        n += 1
not_red_color = 0
c = 0
for i in range(8):
    if ex_red[i] > 0:
        c += 1
#print(c)#soreigai_count
#print(n)#red_count

max_ans = n + c

#min_ans
if c >= 1:
    min_ans = c
elif c == 0:
    min_ans = 1
print(min_ans, max_ans)