ZhenlongDai/ACPR huggingface dataset:
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
list1 = []
for counter in range (n):
  d = s.count("D",0,counter)
  i = s.count("I",0,counter)
  number = i-d
  list1.append(number)
  

if max(list1) <=0:
  print(0)
else:
  print(max(list1))



Failing test case input:
5
DDIII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
list1 = []
for counter in range (n+1):
  d = s.count("D",0,counter)
  i = s.count("I",0,counter)
  number = i-d
  list1.append(number)

if max(list1) <=0:
  print(0)
else:
  print(max(list1))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = str(input())
lst_for_ans = []
if S.count("D") > S.count("I"):
    print(0)
else:
    for i in range(len(S)):
       I_count = S[:i].count("I")
       D_count = S[:i].count("D")
       lst_for_ans.append(I_count - D_count)

       print(max(lst_for_ans))

Failing test case input:
7
DIIDDDI

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = str(input())
lst_for_ans = []
for i in range(len(S)+1):
       I_count = S[:i].count("I")
       D_count = S[:i].count("D")
       lst_for_ans.append(I_count - D_count)

print(max(max(lst_for_ans),0))

Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
s = input()
x = 0
l_x = []
for c in s:
  x += 1 if c == 'I' else -1
  l_x.append(x)
    
print(max(l_x))

Failing test case input:
7
DDDIDII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
s = input()
s = input()
x = 0
l_x = [0]
for c in s:
  x += 1 if c == 'I' else -1
  l_x.append(x)
    
print(max(l_x))

Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
s = input()

slist = []
sval = 0
for i in s :
    if i == "I":
        sval += 1
        slist.append(sval)
    else:
        sval -= 1
        slist.append(sval)
print(max(slist))

Failing test case input:
7
DDDIDII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = input()

slist = [0]
sval = 0
for i in s :
    if i == "I":
        sval += 1
        slist.append(sval)
    else:
        sval -= 1
        slist.append(sval)
print(max(slist))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = list(input())

ans = 0
for i in range(len(S)):
  ans = max(ans, S[:i].count("I")-S[:i].count("D"))
print (ans)


Failing test case input:
5
DDIII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = list(input())

ans = 0
for i in range(len(S)+1):
  ans = max(ans, S[:i].count("I")-S[:i].count("D"))
print (ans)
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s =input()
x = 0
l = []
for i in range(n):
    if s[i] == 'I':
        x += 1
    elif s[i] == 'D':
        x -= 1
    l.append(x)
print(max(l))

Failing test case input:
7
DDDIIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s =input()
x = 0
l = [0]
for i in range(n):
    if s[i] == 'I':
        x += 1
    elif s[i] == 'D':
        x -= 1
    l.append(x)
print(max(l))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
l=[]
count=0
for num in range(n):
    if s[num]=='I':
        count += 1
        l.append(count)
    else:
        count -= 1
        l.append(count)
print(max(l))
    


Failing test case input:
7
DDIDIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
l=[0]
count=0
for num in range(n):
    if s[num]=='I':
        count += 1
        l.append(count)
    else:
        count -= 1
        l.append(count)
print(max(l))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
S=list(input())
a=0
l=[]
for s in S:
  if s=='I':
    a+=1
    l.append(a)
  else:
    a-=1
    l.append(a)
print(max(l))

Failing test case input:
7
DDDDIII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n=int(input())
S=list(input())
a=0
l=[0]
for s in S:
  if s=='I':
    a+=1
    l.append(a)
  else:
    a-=1
    l.append(a)
print(max(l))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
bag = []
cnt = 0
for i in s:
  if i == "I":
    cnt += 1
    bag.append(cnt)
  else:
    cnt -= 1
    bag.append(cnt)
 
print(max(bag))

Failing test case input:
7
DDDIDII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
bag = []
cnt = 0
for i in s:
    if i == "I":
        cnt += 1
        bag.append(cnt)
    else:
        cnt -= 1
        bag.append(cnt)
ans = max(bag)
if ans < 0:
    print(0)
else:
    print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
ans=0
x=0
for i in range(n):
  if s[i]=="I":
    x+=1
  if s[i]=="D":
    x-=1
    ans=max(ans,x)
print(ans)

Failing test case input:
7
IDIDIDD

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
ans=0
x=0
for i in range(n):
  if s[i]=="I":
    x+=1
  if s[i]=="D":
    x-=1
  ans=max(ans,x)
print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=input()
i_count=0
max_count=0
for i in range(N):
    if s[i]=="I":
        i_count+=1
        if i_count>max_count:
            max_count=i_count
print(max_count)

Failing test case input:
7
DIIDDDI

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
N=int(input())
s=input()
i_count=0
max_count=0
for i in range(N):
    if s[i]=="I":
        i_count+=1
        if i_count>max_count:
            max_count=i_count
    if s[i]=="D":
        i_count-=1
print(max_count)
Problem: p03827
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = input()
s = input()
x = 0
for chara in s:
  if(chara == "I"):
    x += 1
  else:
    x -=1
print(x)

Failing test case input:
7
IDIDDDI

Expected output:
1


Actual output:
-1


Fixed submission (verdict: Accepted):
n = input()
s = input()
max_x = 0
x = 0
for chara in s:
  if(chara == "I"):
    x = x + 1
  else:
    x = x - 1
  if(max_x < x):
    max_x = x
print(max_x)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = input()
x = 0
for b in a:
  x += int(b.replace('I','1').replace('D','-1'))
print(x)

Failing test case input:
7
IDDDDII

Expected output:
1


Actual output:
-1


Fixed submission (verdict: Accepted):
input()
tmp = x = 0
for a in input():
  x += int(a.replace('I','1').replace('D','-1'))
  if tmp < x:
    tmp = x

print(max([0,tmp]))

Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
x=0
k=[]
s=input()
for i in s:
  if i=="I":
    x=x+1
  elif i=="D":
    x=x-1
  k.append(x)
print(max(k))

   
    

Failing test case input:
7
DDDDIII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
x=0
m=-101
for i in s:
  if x>m:
    m=x
  if i=="I":
    x=x+1
  else:
    x=x-1
  if x>m:
    m=x
print(m)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

m = 0
for i in range(1, N):
    m = max(m, S[:i].count('I') - S[:i].count('D'))
print(m)


Failing test case input:
5
DDIII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()

x = 0
for i in range(1, N+1):
    x = max(x, S[:i].count('I') - S[:i].count('D'))
print(x)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input();s=input();print(max(i-2*s[:i].count('D')for i in range(len(s))))

Failing test case input:
5
DIDII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
input();s=input();print(max(i-2*s[:i].count('D')for i in range(len(s)+1)))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
x = 0
i = 0
for i in range(len(s)):
  i = i + (s[i]=='I') - (s[i]=='D')
  x = max(x,i)
print(x)

Failing test case input:
5
DIDII

Expected output:
1


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
x = 0
j = 0
for i in range(len(s)):
  j = j + (s[i]=='I') - (s[i]=='D')
  x = max(x,j)
print(x)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=0
n=int(input())
s=input()
for i in range(n):
  if s[i]=='I':x+=1
  else:x-=1
print(x)

Failing test case input:
7
DIIDDID

Expected output:
1


Actual output:
-1


Fixed submission (verdict: Accepted):
x=0
res=0
n=int(input())
s=input()
for i in range(n):
  if s[i]=='I':x+=1
  else:x-=1
  res=max(res,x)
print(res)
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
x = 0
ans = 0
for l in S:
	if l == "I":
		x += 1
	elif l == "D":
		x -= 1
	ans = max(ans,x)

Failing test case input:
7
IIDDDID

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
S = input()
x = 0
ans = 0
for l in S:
	if l == "I":
		x += 1
	elif l == "D":
		x -= 1
	ans = max(ans,x)
print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
num = 0
for s in S:
    if s == "I":
        num += 1
    else:
        num -= 1
print(num)


Failing test case input:
7
IDIDDID

Expected output:
1


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
max_num = 0
num = 0
for s in S:
    if s == "I":
        num += 1
    else:
        num -= 1
    max_num = max(max_num, num)
print(max_num)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input()
tmp = x = 0
for c in input():
  x += int(c.replace('D','-1').replace('I','1'))
  if x > 0:
    tmp = x
print(tmp)

Failing test case input:
7
IIDDDID

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
input()
tmp = x = 0
for a in input():
  x += int(a.replace('I','1').replace('D','-1'))
  if tmp < x:
    tmp = x

print(max([0,tmp]))

Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
S = input()

ans = 0
highest = 0
for i in S:
    if i == "I":
        ans += 1
    else:
        ans -= 1
    print(ans)
    if highest <= ans:
        highest = ans 

print(highest)

Failing test case input:
7
DDIIDID

Expected output:
0


Actual output:
-1
-2
-1
0
-1
0
-1
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()

ans = 0
highest = 0
for i in S:
    if i == "I":
        ans += 1
    else:
        ans -= 1
    if highest <= ans:
        highest = ans 

print(highest)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
ans = 0
a = 0
for i in list(S):
  if i=="I":
    ans += 1
    a = max(ans, a)
  else:
    ans -= 1
    
print(ans)

Failing test case input:
5
IDIID

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
ans = 0
a = 0
for i in list(S):
  if i=="I":
    ans += 1
    a = max(ans, a)
  else:
    ans -= 1
    
print(a)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

x = 0
x_list = []
for si in input():
  if si == 'I':
    x = x + 1
  if si == 'D':
    x = x - 1
  x_list.append(x)

print(max(x_list))

Failing test case input:
7
DDIDIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())

x = 0
x_list = [x]
for si in input():
  if si == 'I':
    x = x + 1
  if si == 'D':
    x = x - 1
  x_list.append(x)

print(max(x_list))
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
x=0
ans=[]
for i in S:
  ans.append(x)
  if i=="I":
    x+=1
  elif i=="D":
    x-=1
print(max(ans))

Failing test case input:
5
DIDII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
x=0
ans=[0]
for i in S:
  if i=="I":
    x+=1
  elif i=="D":
    x-=1
  ans.append(x)
print(max(ans))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = list(input())
m=0
sum=0
for i in S:
    if i == "I":
        sum+=1
    else:
        sum-=1
    m=max(sum, 0)
print(m)

Failing test case input:
7
IDIDIDD

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = list(input())
m=0
sum=0
for i in S:
    if i == "I":
        sum+=1
    else:
        sum-=1
    m=max(sum, m)
print(m)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = list(input())

a = [0]*N

x = 0

for i in range(N):
  if S[i] == 'I':
    x += 1
    a[i] = x
  else:
    x -= 1
    a[i] = x
    
print(max(a))

Failing test case input:
7
DDIDDII

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
S = list(input())

a = [0]*N

x = 0

for i in range(N):
  if S[i] == 'I':
    x += 1
    a[i] = x
  else:
    x -= 1
    a[i] = x
    
print(max(max(a),0))

Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = list(input())
count = 0

for i in range(n):
    if ans[i] == 'I':
        count += 1
    elif ans[i] == 'D':
        count -= 1
print(count + 1)

Failing test case input:
7
IIIDDDD

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
ans = list(input())
count = 0
a = set()
for i in range(n):
    if ans[i] == 'I':
        count += 1
        a.add(count)
    elif ans[i] == 'D':
        count -= 1
        a.add(count)

print(max(max(a), 0))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

x = 0
lst = [0]
n = int(input())
s = list(input())

for i in range(n-1):
    if s[i] == 'I':
        x += 1
        lst.append(x)
    else:
        x -= 1
        lst.append(x)

        print(max(lst))

Failing test case input:
7
DDIIDDI

Expected output:
0


Actual output:
0
0
0
0


Fixed submission (verdict: Accepted):

x = 0
lst = [0]
n = int(input())
s = list(input())

for i in range(n):
    if s[i] == 'I':
        x += 1
        lst.append(x)
    else:
        x -= 1
        lst.append(x)

print(max(lst))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

x = 0
lst = [0]
n = int(input())
s = list(input())
 
for i in range(n-1):
    if s[i] == 'I':
        x += 1
        lst.append(x)
    else:
        x -= 1
        lst.append(x)
 
print(max(lst))

Failing test case input:
5
DDIII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):

x = 0
lst = [0]
n = int(input())
s = list(input())

for i in range(n):
    if s[i] == 'I':
        x += 1
        lst.append(x)
    else:
        x -= 1
        lst.append(x)

print(max(lst))
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
can = []
now = 0
for i in range(n):
  if s[i] == 'I':
    now += 1
  else:
    now -= 1
  can.append(now)
print(max(can))

Failing test case input:
7
DDDIIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
can = [0]
now = 0
for i in range(n):
  if s[i] == 'I':
    now += 1
  else:
    now -= 1
  can.append(now)
print(max(can))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
d=[0]*n
for i in range(n):
    if s[i]=="I":
        d[i]=d[i-1]+1
    else:
        d[i]=d[i-1]-1
print(max(d))

Failing test case input:
7
DDIDIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
d=[0]*(n+1)
for i in range(n):
    if s[i]=="I":
        d[i]=d[i-1]+1
    else:
        d[i]=d[i-1]-1
print(max(d))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = str(input())
lst_for_ans = []
for i in range(len(S)):
       I_count = S[:i].count("I")
       D_count = S[:i].count("D")
       lst_for_ans.append(I_count - D_count)

print(max(max(lst_for_ans),0))

Failing test case input:
5
DIDII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = str(input())
lst_for_ans = []
for i in range(len(S)+1):
       I_count = S[:i].count("I")
       D_count = S[:i].count("D")
       lst_for_ans.append(I_count - D_count)

print(max(max(lst_for_ans),0))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
A=list(input())
t=0
ans=-105
for i in A:
  if i=="D":
    t-=1
    ans=max(ans,t)
  else:
    t+=1
    ans=max (ans,t)
print(ans)
    

Failing test case input:
7
DDIDIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n=int(input())
A=list(input())
t=0
ans=0
for i in A:
  if i=="D":
    t-=1
    ans=max(ans,t)
  else:
    t+=1
    ans=max (ans,t)
print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
num = [0]
cu = 0
for i in S:
  if i == "I":
    cu += 1
    num.append(cu)
  else:
    cu -= 1
num.sort()
print(num[0])

Failing test case input:
7
DDDDIII

Expected output:
0


Actual output:
-3


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
num = [0]
cu = 0
for i in S:
  if i == "I":
    cu += 1
    num.append(cu)
  else:
    cu -= 1
num.sort()
print(num[-1])

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = list(input())
count = 0
ans = []
for i in s:
    if i == 'I':
        count += 1
    elif i == 'D':
        count -= 1
    ans.append(count)
print(max(ans))

Failing test case input:
7
DDDDIII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = list(input())
count = 0
ans = [0]
for i in s:
    if i == 'I':
        count += 1
    elif i == 'D':
        count -= 1
    ans.append(count)
print(max(ans))
Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
s = input()
x = 0
ans = 0
for i in range(len(s)):
    ans = max(ans, x)
    if s[i] == 'I':
        x += 1
    else :
        x -= 1
print(ans)
    

Failing test case input:
5
DDIII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
x = 0
ans = 0
for i in range(n):
    ans = max(ans, x)
    if s[i] == 'I':
        x += 1
    else :
        x -= 1
    ans = max(ans, x)
print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input()
s=input()
c,m=0,0
for i in range(len(s)):
    if s[i]=="I":c,m=c+1,max(c,m)
    if s[i]=="D":c,m=c-1,max(c,m)
print(m)

Failing test case input:
5
DDIII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
input()
s=input()
c,m=0,0
for i in range(len(s)):
    if s[i]=="I":
        c+=1
        m=max(c,m)
    if s[i]=="D":
        c=c-1
        m=max(c,m)
print(m)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = list(input())
ans = []
a = 0
for i in s:
  if i == "I":
    a += 1
  else:
    a -= 1
  ans.append(a)
print(max(ans))

Failing test case input:
7
DDDIIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = list(input())
ans = [0]
for i in s:
  if i == "I":
    ans.append(ans[-1] + 1)
  else:
    ans.append(ans[-1] - 1)
print(max(ans))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
Ans=[]
ans=0
for s in S:
  if s=="I":
    ans+=1
    Ans.append(ans)
  else:
    ans-=1
    Ans.append(ans)
print(max(Ans))

Failing test case input:
7
DDDIDII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
Ans=[0]
ans=0
for s in S:
  if s=="I":
    ans+=1
    Ans.append(ans)
  else:
    ans-=1
    Ans.append(ans)
print(max(Ans))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

x = 0
ans = 0
for i in range(N):
	if S[i:i+1]=='I':
		x += 1
	elif S[i:i+1]=='D':
		ans = max(ans, x)
		x -= 1

print(ans)

Failing test case input:
5
DIDII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()

x = 0
ans = 0
for i in range(N):
	if S[i:i+1]=='I':
		x += 1
		ans = max(ans, x)
	elif S[i:i+1]=='D':
		x -= 1

print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
ans = []
x = 0
for i in range(N):
  x = x+1 if S[i] == 'I' else x-1
  ans.append(x)
print(max(ans))

Failing test case input:
7
DDDIDII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
ans = []
x = 0
for i in range(N):
  x = x+1 if S[i] == 'I' else x-1
  ans.append(x)
print(max(max(ans),0))
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
cnt = 0
n = 0
for i in range(n):
  if s[i] == "I":
    n += 1
  elif s[i] =="D":
    n -= 1
  cnt = max(cnt,n)
print(cnt)
            

Failing test case input:
5
DIIDI

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
max1 = -100
n = 0
for i in range(len(s)):
    if s[i] == "I":
        n += 1
    elif s[i] =="D":
        n -= 1
    max1 = max(max1,n)
print(max(max1,0))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = str(input())
x = 0
temp = []
for i in range(len(S)):
    if S[i] == "I":
        x += 1
        temp.append(x)
    else:
        x -= 1
        temp.append(x)

print(max(temp))


Failing test case input:
7
DDIDDII

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
S = str(input())
x = 0
temp = [0]
for i in range(len(S)):
    if S[i] == "I":
        x += 1
        temp.append(x)
    else:
        x -= 1
        temp.append(x)

print(max(temp))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

print(N)
print(S)

x = 0
x_list = [0]
for s in S:
	print(s)
	if s == 'I':
		x += 1
	elif s == 'D':
		x -= 1
	x_list.append(x)
	
print(x_list)
print(max(x_list))

Failing test case input:
5
DDIII

Expected output:
1


Actual output:
5
DDIII
D
D
I
I
I
[0, -1, -2, -1, 0, 1]
1


Fixed submission (verdict: Accepted):
N = int(input())
S = input()




x = 0
x_list = [0]
for s in S:
	
	if s == 'I':
		x += 1
	elif s == 'D':
		x -= 1
	x_list.append(x)
	

print(max(x_list))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = input()
ans = 0
for i in l:
  if i == 'D':
    ans -= 1
  else:
    ans += 1
    
print(ans)

Failing test case input:
5
IIIDD

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
l = input()
ans = 0
max_ans = 0
for i in l:
  if i == 'D':
    ans -= 1
  else:
    ans += 1
  max_ans = max(ans,max_ans)
    
print(max_ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=int(input())
t=str(input())
t=list(t)
ans=0
temp=-999
for i in range(0,s):
  if t[i]=="I":
    ans=ans+1
  else:
    ans=ans-1
  temp=max(ans,temp)
print(temp)

Failing test case input:
7
DDDDIII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
s=int(input())
t=str(input())
t=list(t)
ans=0
temp=0
for i in range(0,s):
  if t[i]=="I":
    ans=ans+1
  else:
    ans=ans-1
  temp=max(ans,temp)
print(temp)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n=int(input())
s=input()
ans=0
for i in s:
  if i=="I":
    ans+=1
  elif i=="D":
    ans-=1
  
if ans<0:
  print(0)
else:
  print(ans)


Failing test case input:
7
IDIDIDD

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):

n=int(input())
s=input()
ans=0
hantei=0
for i in s:
  if i=="I":
    ans+=1
  elif i=="D":
    ans-=1
  if ans>hantei:
    hantei=ans
  
print(hantei)
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
max=0
work=0
line=input()
for i in range(a-1):
    if line[i:i+1] == "I":
        work+=1
    else:
        if max < work:
            max = work
        work-=1
print(str(max))


Failing test case input:
5
IDIID

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
a=int(input())
max=0
work=0
line=input()
for i in range(a):
    if line[i:i+1] == "I":
        work+=1
    else:
        if max < work:
            max = work
        work-=1
if max < work:
    max = work
print(str(max))

Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
S = input()
ans = 0
for i in range(N):
  if S[i] == "I":
    ans += 1
  else:
    ans -= 1
print(ans)

Failing test case input:
7
IIDDDDI

Expected output:
2


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
ans = 0
x = 0
for i in range(N):
  if S[i] == "I":
    x += 1
  else:
    x -= 1
  ans = max(ans,x)
print(ans)

Problem: p03827
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
s = list(input())
ans,box = 0,[]
for i in range(n):
  if s[i] == "I":
    ans += 1
  else:
    ans -= 1
  box.append(ans)
print(max(box))

Failing test case input:
7
DDIDIDI

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
s = list(input())
ans,box = 0,[]
box.append(ans)
for i in range(n):
  if s[i] == "I":
    ans += 1
  else:
    ans -= 1
  box.append(ans)
print(max(box))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
tmp_list = [0]
x = 0
for _ in s:
    if _ == 'I':
        x += 1
    else:
        x -= 1
    tmp_list.append(x)
    print(x)
print(max(tmp_list))

Failing test case input:
7
DDIIIDD

Expected output:
1


Actual output:
-1
-2
-1
0
1
0
-1
1


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
tmp_list = [0]
x = 0
for _ in s:
    if _ == 'I':
        x += 1
    else:
        x -= 1
    tmp_list.append(x)
print(max(tmp_list))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
ans=0
for i in range(n):
  if s[i]=='I':
    tmp=ans+1
  else:
    tmp=ans-1
  if tmp>ans:
    ans=tmp
print(ans)

Failing test case input:
5
DIIDI

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
res=0
ans=0
for i in range(n):
  if s[i]=='I':
    tmp=res+1
  else:
    tmp=res-1
  if tmp>ans:
    ans=tmp
  res=tmp
print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
max_v =0
v =0
for i in S:
  if i=="I":
    v+=0
    if v>max_v:
      max_v=v
  else:
    v-=0


Failing test case input:
7
DIDDDII

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
N=input()
S=input()
max_v =0
v =0
for i in S:
  if i=="I":
    v+=1
    if v>max_v:
      max_v=v
  else:
    v-=1
print(max_v)
Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
s = input()

li = list(s)

x = 0
num_list = list()
for argv in li:
	if argv == "I":
		x += 1
		num_list.append(x)
	elif argv == "D":
		x -= 1
		num_list.append(x)


print(max(num_list))


Failing test case input:
7
DDDIDII

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n = input()
s = input()

li = list(s)

x = 0
num_list = list()
num_list.append(0)
for argv in li:
	if argv == "I":
		x += 1
		num_list.append(x)
	elif argv == "D":
		x -= 1
		num_list.append(x)


print(max(num_list))

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()

x=0
ans=0
for i in range(n):
  x=x+1 if s[i]=='i' else x-1
  ans=max(ans,x)
print(ans)

Failing test case input:
5
DIIDI

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
s=input()

x=0
ans=0
for i in range(n):
  x=x+1 if s[i]=='I' else x-1
  ans=max(ans,x)
print(ans)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
ans = 0
x = 0
for i in s:
  if s == 'I':
    x += 1
  else:
    x -= 1
  ans = max(ans,x)
print(ans)


Failing test case input:
7
IIDDIDD

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
ans = 0
x = 0
for i in s:
  if i == 'I':
    x += 1
  else:
    x -= 1
  ans = max(ans,x)
print(ans)

Problem: p03827
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
S = input()
x = 0
cnt = 0
for i in range(N):
    if S[i]=='I':
        x+=1
    else:
        if x>=cnt:
            cnt = x
        x -= 1
print(cnt)

Failing test case input:
5
DIDII

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
x = 0
cnt = 0
for i in range(N):
    if S[i]=='I':
        x+=1
        if x>=cnt:
            cnt = x
    else:
        x -= 1
print(cnt)

Problem: p03827
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()

mx = n
current = n
for c in s:
  if c == "I":
    current += 1
  elif c == "D":
    current -= 1
  if current > mx:
    mx = current


print(mx)
  
  

Failing test case input:
7
IIDDDID

Expected output:
2


Actual output:
9


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
 
mx = 0
current = 0
for c in s:
  if c == "I":
    current += 1
  elif c == "D":
    current -= 1
  if current > mx:
    mx = current
 
 
print(mx)
Problem: p02298
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
points = [complex(*map(int, input().split())) for _ in range(n)]
edges = [p1 - p0 for p0, p1 in zip(points, points[1:] + [points[0]])]
prev = edges[0]
while edges:
    edge = edges.pop()
    if edge.real * prev.imag - prev.real * edge.imag < 1e-6:
        print(0)
        break
    prev = edge
else:
    print(1)

Failing test case input:
4
-1 0
6 -2
3 1
0 4

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
points = [complex(*map(int, input().split())) for _ in range(n)]
edges = [p1 - p0 for p0, p1 in zip(points, points[1:] + [points[0]])]
prev = edges[0]
while edges:
    edge = edges.pop()
    if edge.real * prev.imag - prev.real * edge.imag < -1e-6:
        print(0)
        break
    prev = edge
else:
    print(1)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a, b =(int(x) for x in input().split())

ans = 0
while ans <= 100:
    ans += 1
    if math.floor(ans * 0.08) == a and  math.floor(ans * 0.1) == b:
        print(ans)
        exit()
print('-1')


Failing test case input:
12 15

Expected output:
150


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
a, b =(int(x) for x in input().split())

ans = 0
while ans <= 10000:
    ans += 1
    if math.floor(ans * 0.08) == a and  math.floor(ans * 0.1) == b:
        print(ans)
        exit()
print('-1')

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math


def invr():
    return(map(int, input().split()))


A, B = invr()

x1 = int(A / 0.08)
y1 = int(x1 * 0.1)

x2 = int(B / 0.1)
y2 = int(x2 * 0.08)



res = -1
if y1 == B:
    res = x1
if y2 == A:
    res = min(res, x2)
print(res)


Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):

import math


def invr():
    return(map(int, input().split()))


A, B = invr()
res = -1
for i in range(1001):
    if int(i * 0.08) == A and int(i*0.1) == B:
        res = i
        break
print(res)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a, b = map(int, input().split())

for i in range(1010):
    tax8 = math.floor(a * 0.08)
    tax10 = math.floor(a * 0.1)

    if a == tax8 and b == tax10:
        print(i)
        exit()

print(-1)

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
for i in range(1010):
    tax8 = int(i * 0.08)
    tax10 = int(i * 0.1)

    if a == tax8 and b == tax10:
        print(i)
        exit()

print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
A,B=map(int,input().split())
def ans(A,B):
	for i in range(1,101):
		if int(math.floor(i*0.1))==B:
			if int(math.floor(i*0.08))==A:
				return i
	return '-1'
print(ans(A,B))

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
A,B=map(int,input().split())
def ans(A,B):
	for i in range(1,1300):
		if int(math.floor(i*0.1))==B:
			if int(math.floor(i*0.08))==A:
				return i
	return '-1'
print(ans(A,B))
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):










mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    a,b = readInts()
    for i in range(1,101):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)
        if a_ == a and b_ == b:
            print(i)
            exit()
    print(-1)
if __name__ == '__main__':
  main()


Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):










mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    a,b = readInts()
    for i in range(1,1001):
        a_ = int(i * 0.08)
        b_ = int(i * 0.1)
        if a_ == a and b_ == b:
            print(i)
            exit()
    print(-1)
if __name__ == '__main__':
  main()

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = list(map(int, input().split()))

a_plus = a+1
b_plus = b+1

price_a = int(a*(100/8))
price_aplus = int(a_plus*(100/8))
price_b = int(b*(100/10))
price_bplus = int(b_plus*(100/10))


al = list(range(price_a, price_aplus+1))
bl = list(range(price_b, price_bplus))
print(al)
print(bl)

ans = list(set(al) & set(bl))

if len(ans) == 0:
  print(-1)
else:
  print(min(ans))

Failing test case input:
97 106

Expected output:
-1


Actual output:
[1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225]
[1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069]
-1


Fixed submission (verdict: Accepted):
a,b = list(map(int, input().split()))

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

a_plus = a+1
b_plus = b+1

price_a = int(a*(100/8))
price_aplus = int(a_plus*(100/8))
price_b = int(b*(100/10))
price_bplus = int(b_plus*(100/10))


if is_integer_num(a_plus*(100/8)):
  al = list(range(price_a+1, price_aplus))
else:
  al = list(range(price_a, price_aplus+1))
bl = list(range(price_b, price_bplus))

ans = list(set(al) & set(bl))

if len(ans) == 0:
  print(-1)
else:
  print(min(ans))

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
import sys
import math

A, B = list(map(int, stdin.readline().rstrip().split()))








def tax(x,ratio):
    return math.floor(x * ratio / 100)


xA = int(A * 100 / 8)
xB = int(B * 100 / 10)

for i in range(max(0, xB-1), xA+2):
    tax_a = tax(i, 8)
    tax_b = tax(i, 10)

    if tax_a == A and tax_b == B:
        print(i)
        sys.exit()

print(-1)


Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
from sys import stdin
import sys
import math

A, B = list(map(int, stdin.readline().rstrip().split()))








def tax(x,ratio):
    return math.floor(x * ratio / 100)


xA = int(A * 100 / 8)
xB = int(B * 100 / 10)

for i in range(max(0, xB-1), xA+10000):
    tax_a = tax(i, 8)
    tax_b = tax(i, 10)

    if tax_a == A and tax_b == B:
        print(i)
        sys.exit()

print(-1)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
import math
for i in range(1,120):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b and (a <= b):
        print(i)
        exit()
print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
import math
for i in range(1,1200):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b and (a <= b):
        print(i)
        exit()
print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int,input().split())
C = -int(min([-A*12.5,-B*10]))
if 10*B<= C <10*(B+1) and 12.5*B<= C< 12.5*(B+1):
  print(C)
else:
  print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
A, B = map(int,input().split())
for i in range(10*B,10*(B+1)):
  if 10*B<= i <10*(B+1) and 12.5*A<= i < 12.5*(A+1):
    print(i)
    break
else:
  print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
for i in range(3000):
    if int(i*0.08)==a and int(i*0.10)==b:
        print(i)
        break
    elif i==3000:
        print("-1")

Failing test case input:
97 106

Expected output:
-1


Actual output:

Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
for i in range(3000):
    if int(i*0.08)==a and int(i*0.10)==b:
        print(i)
        exit()
print("-1")

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
for n in range(1, 101):
    if int(n*0.08) == A and int(n*0.10) == B:
        print(n)
        break
else:
    print('-1')

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
for n in range(1, 1001):
    if int(n*0.08) == A and int(n*0.10) == B:
        print(n)
        break
else:
    print('-1')

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
stdin = input()
a,b = map(int,stdin.split())


answer = a * 12.5

while int(answer*0.1) != b:
    answer=answer+1
    if answer > 100:
        answer = -1
        break;

print(int(answer))


Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
stdin = input()
a,b = map(int,stdin.split())


answer = -1

for i in range(1020):
    if int(i*0.08) == a and int(i*0.1) == b:
        answer = i
        break

print(int(answer))
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import ceil
from math import floor
a,b = map(int,input().split())
l1 = ceil((a-0.50001)/0.08)
r1 = floor((a+0.5)/0.08)
l2 = ceil((a-0.50001)/0.1)
r2 = floor((a+0.5)/0.1)
l3 = max(l1,l2)
r3 = min(r2,r1)
if(l3<=r3):
    print(l3)
else:
    print(-1)




Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
from math import ceil
from math import floor
a,b = map(int,input().split())
l1 = ceil((a)/0.08)
r1 = floor((a+0.999999999999)/0.08)
l2 = ceil((b)/0.1)
r2 = floor((b+0.99999999999)/0.1)
l3 = max(l1,l2)
r3 = min(r2,r1)
if(l3<=r3):
    print(l3)
else:
    print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a,b=map(int,input().split())
tempa1=math.ceil(a/0.08)
tempa2=int((a+1)/0.08)
print(tempa2)
tempb1=math.ceil(b/0.1)
tempb2=int((b+1)/0.1)+1
if tempa1>tempb2 or tempa2<tempb1:
  print(-1)
else:
  print(max(tempa1,tempb1))

Failing test case input:
19 54

Expected output:
-1


Actual output:
250
-1


Fixed submission (verdict: Accepted):
import math
a,b=map(int,input().split())
tempa1=math.ceil(a/0.08)
tempa2=math.ceil((a+1)/0.08)-1
tempb1=math.ceil(b/0.1)
tempb2=int((b+1)/0.1)-1
if tempa1>tempb2 or tempa2<tempb1:
  print(-1)
else:
  print(max(tempa1,tempb1))

Problem: p02755
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B = [int(i) for i in input().split()]

for n in range(1,101):
  print(n)
  if int(n*0.08) == A and int(n*0.1) == B:
    print(n)
    exit()
print("-1")

Failing test case input:
35 141

Expected output:
-1


Actual output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
-1


Fixed submission (verdict: Accepted):
A,B = [int(i) for i in input().split()]

for n in range(1,1200):
  if int(n*0.08) == A and int(n*0.1) == B:
    print(n)
    exit()
print("-1")

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())

import math
flag = 0

for i in range(1250):
	if i*0.08 == A and i*0.1 == B:
		print(i)
		flag = 1
		break

if flag == 0:
	print(-1)


Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())

import math
flag = 0

for i in range(1250):
	if math.floor(i*0.08) == A and math.floor(i*0.1) == B:

		print(i)
		flag = 1
		break

if flag == 0:
	print(-1)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    par = A / B
    if par < 0.8:
        print("-1")
        exit(0)
    else:
        a = math.ceil(A / 0.08)
        b = math.ceil(B / 0.1)
        
        ret = a
        print(a)

Failing test case input:
290 52

Expected output:
-1


Actual output:
3625


Fixed submission (verdict: Accepted):
import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    a = math.ceil(A / 0.08)
    b = math.ceil(B / 0.1)
    
    if math.floor(a * 0.08) == A and math.floor(a * 0.1) == B:
        ret = a
    elif math.floor(b * 0.08) == A and math.floor(b * 0.1) == B:
        ret = b
    else : 
        ret = -1
    print(ret)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = int(tax_price_a / 0.08)
price_10 = int(tax_price_b / 0.10)

if tax_price_b == int(price_8 * 0.1):
    print(price_8)
elif tax_price_a == int(price_10 * 0.8):
    print(price_10)
else:
    print('-1')


Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import math

inputted = list(map(int, input().split()))
tax_price_a = inputted[0]
tax_price_b = inputted[1]

price_8 = math.ceil(tax_price_a / 0.08)
price_10 = math.ceil(tax_price_b / 0.10)

if tax_price_b == int(price_8 * 0.1):
    print(price_8)
elif tax_price_a == int(price_10 * 0.08):
    print(price_10)
else:
    print('-1')

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
ans = -1

for i in range(1,1010):
    if int(1 * 0.08) == A and int(i * 0.1) == B:
        ans = i
        break
print(ans)


Failing test case input:
12 15

Expected output:
150


Actual output:
-1


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
ret = -1
 
for i in range(1,1010):
  if int(i * 0.08) == A and int(i * 0.1) == B:
    ret = i
    break
print(ret)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
num = 0

A_price = A / 8 * 100
while num < 1100:
  X = num / 100 * 10
  if int(X) == B:
    print(int(A_price))
    break
  elif num == 1100:
    print(-1)
    break
  else:
    num += 1

Failing test case input:
27 20

Expected output:
-1


Actual output:
337


Fixed submission (verdict: Accepted):
A,B = map(int, input().split())
num = 0
while num < 1011:
  num += 1
  X = num * 0.08
  if int(X) == A:
    Y = num * 0.1
    if int(Y) == B:
      print(num)
      break
    else:
      pass
  elif num == 1010:
    print(-1)
    break
  else:
    pass
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = input().split()
a = int(a)
b = int(b)
c = 1
for i in range(100):
    d = c*0.08
    e = c*0.1
    d = int(d)
    e = int(e)
    if d == a and e == b:
        print(int(c))
        break
    elif c == 100:
        print('-1')
        break
    else:
        c += 1

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
a,b = input().split()
a = int(a)
b = int(b)
c = 0
for i in range(10000):
    d = c*0.08
    e = c*0.1
    d = int(d)
    e = int(e)
    if d == a and e == b:
        print(c)
        break
    elif c == 9999:
        print('-1')
        break
    else:
        c += 1

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a, b = (int(i) for i in input().split())
x = math.ceil(a / 0.08)
flag = False
if (math.floor(x * 0.1) == b):
    flag = True
else:
    while math.floor(x * 0.08) != a:
        x = x + i
        if (math.floor(x * 0.1) == b):
            flag = True
            break
if flag:
    print(int(x))
else:
    print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
a, b = (int(i) for i in input().split())
x = math.ceil(a / 0.08)
flag = False
while math.floor(x * 0.08) == a:
    if (math.floor(x * 0.1) == b):
        flag = True
        break
    x = x + 1
if flag:
    print(int(x))
else:
    print(-1)

Problem: p02755
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys
import collections as cl
import math

def II(): 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():
    A,B = MI()
    for i in range(101):
        if math.floor( i * 0.08 ) == A and math.floor(i * 0.1) == B:
            print(i)
            exit()

    print(-1)


main()


Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):

import sys
import collections as cl
import math

def II(): 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():
    A,B = MI()
    for i in range(11000):
        if math.floor( i * 0.08 ) == A and math.floor(i * 0.1) == B:
            print(i)
            exit()

    print(-1)


main()