ZhenlongDai/ACPR huggingface dataset:
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = (int(i) for i in input().split())  
if A%B == 0:
  print(A + B)
else:
  print(B - A)

Failing test case input:
6 24

Expected output:
30


Actual output:
18


Fixed submission (verdict: Accepted):
A, B = (int(i) for i in input().split())  
if B%A == 0:
  print(A + B)
else:
  print(B - A)

Problem: p03125
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B = map(int, input().split())
if B % A == 0:
    print(A + B)
else:
    print(A - B)


Failing test case input:
9 32

Expected output:
23


Actual output:
-23


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
if B % A == 0:
    print(A + B)
else:
    print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
C = B%A
if (C == 0):
  print(A+B)
else:
  print(A-B)

Failing test case input:
110 40

Expected output:
-70


Actual output:
70


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
C = B%A
if (C == 0):
  print(A+B)
else:
  print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
print(n+k if n%k ==0 else k-n)

Failing test case input:
54 -1

Expected output:
-55


Actual output:
53


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
print(n+k if k%n ==0 else k-n)

Problem: p03125
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a,b=map(int,input().split())
if b%a==0:
    print(a+b)
else:
    print(a-b)

Failing test case input:
19 110

Expected output:
91


Actual output:
-91


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if b%a==0:
    print(a+b)
else:
    print(b-a)

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

if a%b==0:
    print(a+b)
else:
    print(b-a)

Failing test case input:
4 28

Expected output:
32


Actual output:
24


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

if b%a!=0:
    print(b-a)
else:
    print(b+a)

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

if B%A == 0:
	print(A+B)
else:
  	print(A-B)

Failing test case input:
22 14

Expected output:
-8


Actual output:
8


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

if B%A == 0:
	print(A+B)
else:
  	print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
if (B % A == 0):
  print(A + B)
else:
  print(A - B)

Failing test case input:
111 40

Expected output:
-71


Actual output:
71


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
if (B % A == 0):
  print(A + B)
else:
  print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = [ int(v) for v in input().split() ]

if a % b == 0:
  print(a+b)
else:
  print(b-a)

Failing test case input:
010 40

Expected output:
50


Actual output:
30


Fixed submission (verdict: Accepted):
a, b = [ int(v) for v in input().split() ]

if b % a == 0:
  print(a+b)
else:
  print(b-a)
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(a+b if b%a else b-a)

Failing test case input:
9 32

Expected output:
23


Actual output:
41


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print(a+b if b%a==0 else b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if(b%2 == 0):
  print(a+b)
else:
  print(b-a)

Failing test case input:
19 70

Expected output:
51


Actual output:
89


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if(b%a == 0):
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=map(int, input().split())
if b/a==0:
  print(a+b)
else:
  print(b-a)

Failing test case input:
4 28

Expected output:
32


Actual output:
24


Fixed submission (verdict: Accepted):
a,b=map(int, input().split())
if b%a==0:
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = [int(x) for x in input().split(" ")]
if a % b == 0:
  print(a+b)
else:
  print(b-a)

Failing test case input:
54 -1

Expected output:
-55


Actual output:
53


Fixed submission (verdict: Accepted):
a, b = [int(x) for x in input().split(" ")]
if b % a == 0:
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
if B == A%B ==0:
    print(int(A+B))
else:
    print(int(B-A) )   

Failing test case input:
4 28

Expected output:
32


Actual output:
24


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
if B%A ==0:
    print(A+B)
else:
    print(B-A)

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

def f(a, b):
    if (b % a == 0):
        return a + b 
    else:
        return b - a 

Failing test case input:
19 101

Expected output:
82


Actual output:

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

def f(a, b):
    if (b % a == 0):
        return a + b 
    else:
        return b - a 
print(f(a[0], a[1]))

Problem: p03125
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(a - b)

Failing test case input:
19 111

Expected output:
92


Actual output:
-92


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Problem: p03125
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B=map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(A-B)

Failing test case input:
14 81

Expected output:
67


Actual output:
-67


Fixed submission (verdict: Accepted):
A,B=map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input().split(" ")
A = int(N[0])
B = int(N[1])

if B % A == 0:
    ans = B - A
else:
    ans = A + B

print(ans)

Failing test case input:
5 38

Expected output:
33


Actual output:
43


Fixed submission (verdict: Accepted):
N = input().split(" ")
A = int(N[0])
B = int(N[1])

if B % A == 0:
    ans = B + A
else:
    ans = B - A

print(ans)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
if B%A==1:
  print(A+B)
else:
  print(A-B)

Failing test case input:
19 101

Expected output:
82


Actual output:
-82


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split())
if A%B==0:
  print(A+B)
else:
  print(B-A) 

Failing test case input:
34 -2

Expected output:
-36


Actual output:
32


Fixed submission (verdict: Accepted):
A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

input = sys.stdin.readline


def main():
    a, b = map(int, input().split())
    print(a + b if a % b == 0 else b - a)


if __name__ == "__main__":
    main()


Failing test case input:
14 70

Expected output:
84


Actual output:
56


Fixed submission (verdict: Accepted):
import sys

input = sys.stdin.readline


def main():
    a, b = map(int, input().split())
    print(a + b if b % a == 0 else b - a)


if __name__ == "__main__":
    main()

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

c = sys.stdin.readline()
d = c.split()
A = int(d[0])
B = int(d[1])
if B % A == 0:
    print(str(B - A))
else:
    print(str(A - B))

Failing test case input:
14 81

Expected output:
67


Actual output:
-67


Fixed submission (verdict: Accepted):
import sys

c = sys.stdin.readline().split()
A = int(c[0])
B = int(c[1])
if B % A == 0:
    print(str(B + A))
else:
    print(str(B - A))

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int, input().split())
print(B/A)
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Failing test case input:
42 14

Expected output:
-28


Actual output:
0.3333333333333333
-28


Fixed submission (verdict: Accepted):
A,B = map(int, input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Problem: p03125
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())
if b / a == 0:
  print(a + b)
else:
  print(b - a)

Failing test case input:
010 40

Expected output:
50


Actual output:
30


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if b % a == 0:
  print(a + b)
else:
  print(b - a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split())
if A%B==0:
  print(B+A)
else:
  print(B-A)

Failing test case input:
2 182

Expected output:
184


Actual output:
180


Fixed submission (verdict: Accepted):
A,B=map(int,input().split())
if B%A==0:
  print(B+A)
else:
  print(B-A)
Problem: p03125
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b = map(int, input().split())

if a % b == 0:
  print(a + b)
else:
  print(b - a)
  

Failing test case input:
54 -1

Expected output:
-55


Actual output:
53


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
 
if b % a == 0:
  print(a + b)
else:
  print(b - a)

Problem: p03125
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b = map(int,input().split())

if b%a==0:
    print(a+b)
else:
    print(a-b)

Failing test case input:
34 -2

Expected output:
-36


Actual output:
36


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

if b%a==0:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if a%b==0:
    print(a+b)
else:
    print(b-a)

Failing test case input:
42 14

Expected output:
-28


Actual output:
56


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if b%a==0:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split());print(B-A if A%B!=0else A+B)

Failing test case input:
34 -2

Expected output:
-36


Actual output:
32


Fixed submission (verdict: Accepted):
A,B=map(int,input().split());print(B-A if B%A!=0else A+B)

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

print(a + b if b % a == 0 else a - b)

Failing test case input:
19 70

Expected output:
51


Actual output:
-51


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

print(a + b if b % a == 0 else b - a)

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


def solve():
    A, B = list(map(int, input().split()))
    
    if A%B == 0:
        print(A+B)
    else:
        print(B-A)

if __name__ == "__main__":
    solve()


Failing test case input:
14 70

Expected output:
84


Actual output:
56


Fixed submission (verdict: Accepted):


def solve():
    A, B = list(map(int, input().split()))
    
    if B%A == 0:
        print(A+B)
    else:
        print(B-A)

if __name__ == "__main__":
    solve()

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


def main():
    sp = [int(e) for e in input().split(" ")]
    a = sp[0]
    b = sp[1]
    if b%a == 0:
        print(a+b)
    else:
        print(a-b)

main()


Failing test case input:
34 -2

Expected output:
-36


Actual output:
36


Fixed submission (verdict: Accepted):


def main():
    sp = [int(e) for e in input().split(" ")]
    a = sp[0]
    b = sp[1]
    if b%a == 0:
        print(a+b)
    else:
        print(b-a)

main()

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split(" "))
if B % A == 0:
  print(A + B)
else:
  print(A - B)


Failing test case input:
6 55

Expected output:
49


Actual output:
-49


Fixed submission (verdict: Accepted):
A, B = map(int, input().split(" "))
if B % A == 0:
  print(A + B)
else:
  print(B - A)
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split(' '))
if b%a == 0:
    print(a+b)
else:
    print(a-b)

Failing test case input:
13 35

Expected output:
22


Actual output:
-22


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if b%a == 0:
    print(a+b)
else:
    print(b-a)

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

if a % b ==0:
	print(a + b)
else:
	print(b - a)

Failing test case input:
54 -1

Expected output:
-55


Actual output:
53


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

if b % a == 0:
	print(a + b)
else:
	print(b - a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if a % b == 0:
  print(a + b)
else:
  print(b-a)

Failing test case input:
34 -2

Expected output:
-36


Actual output:
32


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if b % a == 0:
  print(a + b)
else:
  print(b-a)

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

if B%A == 0:
  print(A+B)
else:
  print(A-B)

Failing test case input:
5 63

Expected output:
58


Actual output:
-58


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

if B%A == 0:
  print(A+B)
else:
  print(B-A)

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

if a % b == 0:
    print(a + b)
else:
    print(a - b)


Failing test case input:
9 32

Expected output:
23


Actual output:
-23


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

if b % a == 0:
    print(a + b)
else:
    print(b - a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
 
if b%a == 0:
  print(a+b)
elif b%a != 0:
  print(a-b)


Failing test case input:
19 111

Expected output:
92


Actual output:
-92


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
 
if b%a == 0:
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from collections import deque
input = sys.stdin.readline

A, B = map(int, input().split())
if B%A == 0:
    print(A+B)
else:
    print(A-B)

Failing test case input:
101 68

Expected output:
-33


Actual output:
33


Fixed submission (verdict: Accepted):
import sys
from collections import deque
input = sys.stdin.readline

A, B = map(int, input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Problem: p03125
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())
if b % a == 0:
  print(a + b)
else:
  print(a - b)

Failing test case input:
42 4

Expected output:
-38


Actual output:
38


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if b % a == 0:
  print(a + b)
else:
  print(b - a)
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
print(b-a if a%b else a+b)

Failing test case input:
54 -1

Expected output:
-55


Actual output:
53


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
print(b-a if b%a else a+b)

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

if (B % A) == 0:
  print(A + B)
else:
  print(A - B)


Failing test case input:
42 4

Expected output:
-38


Actual output:
38


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
 
if (B % A) == 0:
  print(A + B)
else:
  print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if b%a:
  print(a+b)
else:
  print(b-a)

Failing test case input:
10 111

Expected output:
101


Actual output:
121


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if b%a==0:
    print(b+a)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input_val = input().split()
A=int(input_val[0])
B=int(input_val[1])
if B%A==0:
  print(A+B)
else:
  print(A-B)

Failing test case input:
9 32

Expected output:
23


Actual output:
-23


Fixed submission (verdict: Accepted):
input_val = input().split()
A=int(input_val[0])
B=int(input_val[1])
if B%A==0:
  print(B+A)
else:
  print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if a%b==0:
    print(a+b)
else:
    print(b-a)

Failing test case input:
34 -2

Expected output:
-36


Actual output:
32


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if b%a==0:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if b%a==0:
  print(a+b)
else:
  print(a-b)

Failing test case input:
13 35

Expected output:
22


Actual output:
-22


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if b%a==0:
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
if A % B == 0:
    print(A+B)
else:
    print(B-A)

Failing test case input:
14 70

Expected output:
84


Actual output:
56


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

Problem: p03125
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A,B = map(int,input().split())

if(B%A == 0):
    print(A+B)
else:
    print(A-B)


Failing test case input:
19 110

Expected output:
91


Actual output:
-91


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

if(B%A == 0 and B/A > 0):
    print(A+B)
else:
    print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if a%b==0:
  print(a+b)
else:
  print(b-a)


Failing test case input:
4 28

Expected output:
32


Actual output:
24


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if b%a==0:
  print(a+b)
else:
  print(b-a)
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

if A % B == 0:
    print(A + B)
else:
    print(B - A)


Failing test case input:
4 28

Expected output:
32


Actual output:
24


Fixed submission (verdict: Accepted):

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

if B % A == 0:
    print(A + B)
else:
    print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=[int(i) for i in input().split()]

if a % b == 0:
	print(a + b)
else:
	print(b-a)

Failing test case input:
6 24

Expected output:
30


Actual output:
18


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

if b % a == 0:
	print(a + b)
else:
	print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=[int(i) for i in input().split()]
if b%a==0:
  print('a+b')
else:
  print('b-a')

Failing test case input:
4 28

Expected output:
32


Actual output:
a+b


Fixed submission (verdict: Accepted):
a,b=[int(i) for i in input().split()]
if b%a==0:
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int, input().split())
if B%A==0:
    print(A+B)
else:
    print(A-B)

Failing test case input:
19 110

Expected output:
91


Actual output:
-91


Fixed submission (verdict: Accepted):
A,B=map(int, input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if a%b==0:
  print(a+b)
else:
  print(a-b)

Failing test case input:
13 35

Expected output:
22


Actual output:
-22


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if b%a==0:
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=map(int,input().split())

if a%b==0:
  print(a+b)
else:
  print(b-a)


Failing test case input:
6 36

Expected output:
42


Actual output:
30


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

if b%a==0:
  print(a+b)
else:
  print(b-a)

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

if B % A == 0:
    print(A + B)
else:
    print(A - B)

Failing test case input:
3 37

Expected output:
34


Actual output:
-34


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

if B % A == 0:
    print(A + B)
else:
    print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
if (b%a) == 0:
    print(a+b)
else:
    print(a-b)

Failing test case input:
42 4

Expected output:
-38


Actual output:
38


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
if (b%a) == 0:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = list(map(int, input().split()))
print(N + K) if K % N == 0 else print(N - K) 

Failing test case input:
3 37

Expected output:
34


Actual output:
-34


Fixed submission (verdict: Accepted):
N, K = list(map(int, input().split()))
print(N + K) if K % N == 0 else print(K - N)
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(a - b)


Failing test case input:
54 2

Expected output:
-52


Actual output:
52


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split());a+b if b%a else a-b

Failing test case input:
42 4

Expected output:
-38


Actual output:

Fixed submission (verdict: Accepted):
a,b=map(int,input().split());print(b-a if b%a else b+a)

Problem: p03125
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b = list(map(int,input().split()))
print(a+b if b%a == 0 else a-b)

Failing test case input:
3 182

Expected output:
179


Actual output:
-179


Fixed submission (verdict: Accepted):
a,b = list(map(int,input().split()))
print(a+b if b%a == 0 else b-a)

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

if A % B ==0:
    print(A + B)
else:
    print(B - A)


Failing test case input:
34 -2

Expected output:
-36


Actual output:
32


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

if B % A ==0:
    print(A + B)
else:
    print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
if B % A == 0:
    print(A + B)
else:
    print(A - B)

Failing test case input:
6 61

Expected output:
55


Actual output:
-55


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
if B % A == 0:
    print(A + B)
else:
    print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a,b =map(int,input().split())
if (b/a).is_integer():
    print(a+b)
else:
    print(a-b)

Failing test case input:
5 57

Expected output:
52


Actual output:
-52


Fixed submission (verdict: Accepted):
a,b =map(int,input().split())
if int(b/a) == b/a:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = [int(s) for s in input().split(' ')]

if A % B == 0:
  print(A + B)
else:
  print(B - A)

Failing test case input:
54 2

Expected output:
-52


Actual output:
56


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

if B % A == 0:
  print(A + B)
else:
  print(B - A)

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

if (B%A == 0):
    print(A+B)
else:
    print(A-B)

Failing test case input:
6 55

Expected output:
49


Actual output:
-49


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
 
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(A-B)


Failing test case input:
8 28

Expected output:
20


Actual output:
-20


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)
Problem: p03125
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A,B = map(int,input().split())

if(B%A == 0 and B/A > 0):
    print(A+B)
else:
    print(A-B)


Failing test case input:
8 46

Expected output:
38


Actual output:
-38


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

if(B%A == 0 and B/A > 0):
    print(A+B)
else:
    print(B-A)

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

if b % a == 0:
  print(b - a)
else:
  print(b + a)
  

Failing test case input:
3 56

Expected output:
53


Actual output:
59


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

if b % a == 0:
  print(b +a)
else:
  print(b - a)

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

amari = B % A

if amari == 0:
    print(A + B)
else:
    print(A - B)

Failing test case input:
54 -1

Expected output:
-55


Actual output:
55


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

amari = B % A

if amari == 0:
    print(A + B)
else:
    print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
if B % A == 0:
    print(B%A)
else :
    print(B - A)

Failing test case input:
6 24

Expected output:
30


Actual output:
0


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
if B % A == 0:
    print(B+A)
else :
    print(B - A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = map(int,input().split())
if B % A ==0:
    print(A+B)
else:
    print(A-B)


Failing test case input:
10 73

Expected output:
63


Actual output:
-63


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())
if B % A ==0:
    print(A+B)
else:
    print(B-A)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(input().split())
b=int(a[0])
c=int(a[1])
if c%b==0:
  print(b+c)
else:
  print(b-c)

Failing test case input:
3 37

Expected output:
34


Actual output:
-34


Fixed submission (verdict: Accepted):
a=list(input().split())
b=int(a[0])
c=int(a[1])
if c%b==0:
  print(b+c)
else:
  print(c-b)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
s=b/a
if s == isinstance(s,int):
  print(a+b)
else:
  print(b-a)

Failing test case input:
4 28

Expected output:
32


Actual output:
24


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if b%a == 0:
  print(a+b)
else:
  print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
if a%b == 0:
    print(a+b)
else:
    print(b-a)

Failing test case input:
14 70

Expected output:
84


Actual output:
56


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
if b%a == 0:
    print(a+b)
else:
    print(b-a)
Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(a - b)

Failing test case input:
5 38

Expected output:
33


Actual output:
-33


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int()
b = int()

1 <= a <= b <=20

a,b=(int(x) for x in input().split())


if b % a == 0:
    print(a + b)
else :
    print(a - b)


Failing test case input:
19 111

Expected output:
92


Actual output:
-92


Fixed submission (verdict: Accepted):
a = int()
b = int()

1 <= a <= b <=20

a,b=(int(x) for x in input().split())


if b % a == 0:
    print(a + b)
else :
    print(b - a)

Problem: p03125
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    a, b = LI()
    if a % b == 0:
        print(a+b)
        return
    print(b-a)


main()



Failing test case input:
3 36

Expected output:
39


Actual output:
33


Fixed submission (verdict: Accepted):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    a, b = LI()
    if b % a == 0:
        print(a+b)
        return
    print(b-a)


main()

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    A, B = map(int, input().split())
    if A % B == 0:
        print(A+B)
    else:
        print(B-A)
if __name__ == "__main__":
    main()

Failing test case input:
3 36

Expected output:
39


Actual output:
33


Fixed submission (verdict: Accepted):
def main():
    A, B = map(int, input().split())
    if B % A == 0:
        print(A+B)
    else:
        print(B-A)
if __name__ == "__main__":
    main()
Problem: p03125
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b = map(int,input().split())

if a%b==0:
    print(a+b)
else:
    print(a-b)

Failing test case input:
13 70

Expected output:
57


Actual output:
-57


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

if b%a==0:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
list1 = [int(a) for a in input().split()]
list1_0 = list1[0]
list1_1 = list1[1]

if (list1_0 % list1_1) == 0:
    print(list1_0 + list1_1)
else:
    print(list1_1 - list1_0)


Failing test case input:
54 -1

Expected output:
-55


Actual output:
53


Fixed submission (verdict: Accepted):
list1 = [int(a) for a in input().split()]
list1_0 = list1[0] 
list1_1 = list1[1] 

if (list1_1 % list1_0) == 0:
    print(list1_0 + list1_1)
else:
    print(list1_1 - list1_0)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
if n % m == 0:
    print(n + m)
else:
    print(m - n)

Failing test case input:
010 40

Expected output:
50


Actual output:
30


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
if m % n == 0:
    print(n + m)
else:
    print(m - n)

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

input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

a, b = mi()
if a / b % 1 == 0:
    print(a+b)
else:
    print(b-a)

Failing test case input:
25 -1

Expected output:
-26


Actual output:
24


Fixed submission (verdict: Accepted):
from sys import stdin, exit

input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

a, b = mi()
if b / a % 1 == 0:
    print(a+b)
else:
    print(b-a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(a - b)


Failing test case input:
19 110

Expected output:
91


Actual output:
-91


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
if b % a == 0:
    print(b + a)
else:
    print(b - a)

Problem: p03125
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(a+b if a%b==0 else b-a)

Failing test case input:
34 -2

Expected output:
-36


Actual output:
32


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
print(a+b if b%a==0 else b-a)
Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
cnt = 0
for i in range(0, n-2):
    if s[i:i+3] == "ABC":
        cnt += 1
    print(i)
print(cnt)

Failing test case input:
19
OGIONSEVRFSFNETDHPF

Expected output:
0


Actual output:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
cnt = 0
for i in range(0, n-2):
    if s[i:i+3] == "ABC":
        cnt += 1
print(cnt)

Problem: p02812
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
S = input()

stackString = ""
resultCount = 0
for s in S:
    if stackString == "" and s == "A":
        stackString += "a"
    elif stackString == "a" and s == "B":
        stackString += "b"
    elif stackString == "ab" and s == "C":
        stackString = ""
        resultCount += 1
    else:
        stackString = ""
print(resultCount)

Failing test case input:
33
ACBACCBDBDCBAABCBDBBCACCCCCBABBBA

Expected output:
1


Actual output:
0


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

stackString = ""
resultCount = 0
for s in S:
    if stackString == "" and s == "A":
        stackString += "a"
    elif stackString == "a" and s == "B":
        stackString += "b"
    elif stackString == "ab" and s == "C":
        stackString = ""
        resultCount += 1
    else:
        if not(stackString == "a" and s == "A"):
            stackString = ""
print(resultCount)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input()); s = input() ; c = 0

for i in range(n):
    a = s[i-3:i]
    print(a)
    if a == 'ABC':
        c += 1
print(c)

Failing test case input:
10
DBCCBNBAZB

Expected output:
0


Actual output:



DBC
BCC
CCB
CBN
BNB
NBA
BAZ
0


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

for i in range(n-2):
    a = s[i:i+3]

    if a == 'ABC':
        c += 1
print(c)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
count = 0
for i in range(N - 3 + 1):
  if S[i:i+2] == "ABC":
    count += 1
print(count)

Failing test case input:
33
ABBAABCCCCCADBBDBBAAABCDBDBCCBBCA

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
count = 0
for i in range(0,N-2):
    if S[i:i+3] == "ABC": count += 1
print(count)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
ans = 0
for i in range(N - 2):
    if S[i] == "A" and [i + 1] == "B" and S[i + 2] == "C":
        ans += 1
print(ans)

Failing test case input:
33
ABBCABCCCBCACBACBCBAABCDBCBBCABCA

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
ans = 0
for i in range(N - 2):
    if S[i] == "A" and S[i + 1] == "B" and S[i + 2] == "C":
        ans += 1
print(ans)
Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

def main():
    N = int(input())
    S = input()

    cnt = 0
    for i in range(N-2):
        s = str(S[i:i+2])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()

Failing test case input:
33
BCBACBDBCBCBABBCBCABCACBABCBACBBA

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
import sys

def main():
    N = int(input())
    S = input()

    cnt = 0
    for i in range(N-2):
        s = str(S[i:i+3])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
_ = input()
s = input()

check = ['A', 'B', 'C']

count = 0
state = 0

for i in range(len(s)):
    c = s[i]
    if c != check[state]:
        state = 0
        continue
    
    state += 1
    if state == 3:
        count += 1
        state = 0

print(count)

Failing test case input:
33
ABBAABCCCCCADBBDBBAAABCDBDBCDBBCA

Expected output:
2


Actual output:
1


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

check = ['A', 'B', 'C']

count = 0
state = 0

for i in range(len(s)):
    c = s[i]
    if c != check[state]:
        if c == check[0]:
            state = 1
        else:
            state = 0
        continue
    
    state += 1
    if state == 3:
        count += 1
        state = 0

print(count)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
print(S.count("ABC"))

Failing test case input:
33
ABCCABCBABCCABACBCBBABCBCBCBCABCB

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
print(S.count("ABC"))

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
print(s.count("ABC"))

Failing test case input:
33
ABCCABCBABCCABACBCBBABCBCBCBCABCB

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
s = str(input())
print(s.count("ABC"))

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

ans = 0
count = 0
for i in range(len(S)):
  if count == 0:
    if S[i] == 'A':
      count = 1
  elif count == 1:
    if S[i] == 'B':
      count = 2
    else:
      count = 0
  else:
    if S[i] == 'C':
      ans += 1
    count = 0
      
print(ans)

Failing test case input:
33
ABBCABCCCBCACBACBCBAABCDCCBBCABCA

Expected output:
3


Actual output:
2


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

ans = 0
count = 0
for i in range(len(S)):
  if count == 0:
    if S[i] == 'A':
      count = 1
  elif count == 1:
    if S[i] == 'B':
      count = 2
    elif S[i] == 'A':
      count = 1
    else:
      count = 0
  else:
    if S[i] == 'C':
      ans += 1
      count = 0
    elif S[i] == 'A':
      count = 1      
    else:
      count = 0
      
print(ans)
Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=input()
s=input()
print(s.count('abc'))

Failing test case input:
33
ABCCABCBABCCABACBCBBABCBCBDBCABCB

Expected output:
5


Actual output:
0


Fixed submission (verdict: Accepted):
n=input()
s=input()
print(s.count('ABC'))

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

query = 'ABC'
ans = 0
i = 0 
while i<n:
  i = s.find(query,i)
  print(i)
  if i>=0:
    ans +=1
    i+=1
  else:
    break    

print(ans)    

Failing test case input:
33
ACBBCCBDBDCBAAABBDBBDACCCCCBAABBA

Expected output:
0


Actual output:
-1
0


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

query = 'ABC'
ans = 0
i = 0 
while i<n:
  i = s.find(query,i)  
  if i>=0:
    ans +=1
    i+=1
  else:
    break    

print(ans)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
_ = input()
s = input()

check = ['A', 'B', 'C']

count = 0
state = 0

for i in range(len(s)):
    c = s[i]
    if c != check[state]:
        state = 0
        if c != check[state]:
            state = 1
        continue
    
    state += 1
    if state == 3:
        count += 1
        state = 0

print(count)



Failing test case input:
33
ABBCABCCCBCACBACBCBAABCDBCBBCABCA

Expected output:
3


Actual output:
6


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

check = ['A', 'B', 'C']

count = 0
state = 0

for i in range(len(s)):
    c = s[i]
    if c != check[state]:
        if c == check[0]:
            state = 1
        else:
            state = 0
        continue
    
    state += 1
    if state == 3:
        count += 1
        state = 0

print(count)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
print(S.count('ABC'))

Failing test case input:
33
BCBACBDBCBCBABBCBCABCACBABCBACBBA

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
print(S.count('ABC'))

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = str(input())
c = 0
for i in range(n-2):
  if s[i] == "A":
    if s[1+1] == "B" and s[i+2] == "C":
      c += 1
print(c)

Failing test case input:
33
ACBACBBCBDCBAABCBCABCACCCCCBACBBA

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
s = str(input())
c = 0
for i in range(n-2):
  if s[i] == "A":
    if s[i+1] == "B" and s[i+2] == "C":
      c += 1
print(c)
Problem: p02812
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
s = list(input())
cnt=0
for i in range(n-2):
    print(s[i:i+3])
    if s[i:i+3] ==['A', 'B', 'C']:
        
        cnt+=1
print(cnt)

Failing test case input:
33
ABBAABCCCCDADBBDBBAAABCDCDBCDCBCA

Expected output:
2


Actual output:
['A', 'B', 'B']
['B', 'B', 'A']
['B', 'A', 'A']
['A', 'A', 'B']
['A', 'B', 'C']
['B', 'C', 'C']
['C', 'C', 'C']
['C', 'C', 'C']
['C', 'C', 'D']
['C', 'D', 'A']
['D', 'A', 'D']
['A', 'D', 'B']
['D', 'B', 'B']
['B', 'B', 'D']
['B', 'D', 'B']
['D', 'B', 'B']
['B', 'B', 'A']
['B', 'A', 'A']
['A', 'A', 'A']
['A', 'A', 'B']
['A', 'B', 'C']
['B', 'C', 'D']
['C', 'D', 'C']
['D', 'C', 'D']
['C', 'D', 'B']
['D', 'B', 'C']
['B', 'C', 'D']
['C', 'D', 'C']
['D', 'C', 'B']
['C', 'B', 'C']
['B', 'C', 'A']
2


Fixed submission (verdict: Accepted):
n=int(input())
s = list(input())
cnt=0
for i in range(n-2):
    
    if s[i:i+3] ==['A', 'B', 'C']:
        
        cnt+=1
print(cnt)

Problem: p02812
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
print(len(input().split("ABC")))

Failing test case input:
19
SEREUONEROEWONHFIFD

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n = input()
print(len(input().split("ABC")) - 1)

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

N=int(input())
S=str(input())

i=N-1
result=0


while True:
    if i-3<0:
        break
    if S[i]=='C' and S[i-1]=='B' and S[i-2]=='A' :
        result+=1
    i-=1

print(result) 

Failing test case input:
33
ABCCABCBABCCABACBCBBABCBCBCBCABDB

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):

N=int(input())
S=str(input())

i=N-1
result=0


while True:
    if i-2<0:
        break
    if S[i]=='C' and S[i-1]=='B' and S[i-2]=='A' :
        result+=1
    i-=1

print(result)
Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    n = int(input())
    s = input()

    prev = ''
    c = 0

    for i in s:
        if prev == '':
            if i == 'A':
                prev = 'A'
        elif prev == 'A':
            if i == 'A':
                pass
            elif i == 'B':
                prev = 'B'
            else:
                i == ''
        elif prev == 'B':
            if i == 'A':
                prev = 'A'
            elif i == 'C':
                c += 1
                prev = ''
            else:
                prev = ''

    print(c)


if __name__ == '__main__':
    main()


Failing test case input:
10
BDBAQBCBAY

Expected output:
0


Actual output:
1


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

    prev = ''
    c = 0

    for i in s:
        if prev == '':
            if i == 'A':
                prev = 'A'
        elif prev == 'A':
            if i == 'A':
                prev = 'A'
            elif i == 'B':
                prev = 'B'
            else:
                prev = ''
        elif prev == 'B':
            if i == 'A':
                prev = 'A'
            elif i == 'C':
                c += 1
                prev = ''
            else:
                prev = ''

    print(c)


if __name__ == '__main__':
    main()

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

ans = 0
for i in range(N-2):
  if S[i:i+2] == 'ABC': ans += 1
    
print(ans)

Failing test case input:
10
ZABCCB@CDQ

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
 
ans = 0
for i in range(N-2):
  if S[i:i+3] == 'ABC': ans += 1
    
print(ans)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
l=[]
count=0
for i in s:
    if i=='A':
        l.append('A')
    elif i=='B' and l==['A']:
        l.append('B')
    elif i=='C' and l==['A','B']:
        l=[]
        count+=1
    else:
        l=[]
print(count)

Failing test case input:
33
ACBACCBDBDCBAABCBCABCACCCCCBACBBA

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
l=[]
count=0
for i in s:
    if i=='A':
        l=['A']
    elif i=='B' and l==['A']:
        l.append('B')
    elif i=='C' and l==['A','B']:
        l=[]
        count+=1
    else:
        l=[]
print(count)

Problem: p02812
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
print(S.count("ABC"))

Failing test case input:
33
BCBACBDBCBCBABBCBCABCACBABCBACCBA

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N=input()
S=input()
print(S.count("ABC"))