ZhenlongDai/ACPR huggingface dataset:
Buggy program (verdict: Wrong Answer):
x,y = map(int,input().split())
if x * y == 1:
    print(1000000)
elif x*y == 2:
    print(500000)
elif x == 2 and y == 2:
    print(400000)
elif x*y == 3:
    print(400000)
elif x == 1 or y == 1:
    print(300000)
elif x == 2 and y == 3:
    print(300000)
elif x == 3 and y == 2:
    print(300000)
elif x == 3 or y == 3:
    print(100000)
else:
    print(0)

Failing test case input:
2 122

Expected output:
200000


Actual output:
0


Fixed program (verdict: Accepted):
x,y = map(int,input().split())
if x * y == 1:
    print(1000000)
elif x*y == 2:
    print(500000)
elif x == 2 and y == 2:
    print(400000)
elif x*y == 3:
    print(400000)
elif x == 1 or y == 1:
    print(300000)
elif x == 2 and y == 3:
    print(300000)
elif x == 3 and y == 2:
    print(300000)
elif x == 3 and y == 3:
    print(200000)
elif x ==2 or y == 2:
    print(200000)
    
elif x == 3 or y == 3:
    print(100000)
else:
    print(0)

Diff:
 x,y = map(int,input().split())
 if x * y == 1:
     print(1000000)
 elif x*y == 2:
     print(500000)
 elif x == 2 and y == 2:
     print(400000)
 elif x*y == 3:
     print(400000)
 elif x == 1 or y == 1:
     print(300000)
 elif x == 2 and y == 3:
     print(300000)
 elif x == 3 and y == 2:
     print(300000)
+elif x == 3 and y == 3:
+    print(200000)
+elif x ==2 or y == 2:
+    print(200000)
+    
 elif x == 3 or y == 3:
     print(100000)
 else:
     print(0)
Buggy program (verdict: Wrong Answer):

n=int(input())
a=list(map(int,input().split()))
sa=[a[0] for i in range(n)]
for i in range(1,n):
    sa[i]=sa[i-1]+a[i]
mm=float("INF")
for i in range(n):
    mm=min(mm,abs(sa[i]-(sa[n-1]-sa[i])))
print(int(mm))

Failing test case input:
2
-42 1

Expected output:
43


Actual output:
41


Fixed program (verdict: Accepted):

n=int(input())
a=list(map(int,input().split()))
sa=[a[0] for i in range(n)]
for i in range(1,n):
    sa[i]=sa[i-1]+a[i]
mm=float("INF")
for i in range(n-1):
    mm=min(mm,abs(sa[i]-(sa[n-1]-sa[i])))
print(int(mm))

Diff:
 
 n=int(input())
 a=list(map(int,input().split()))
 sa=[a[0] for i in range(n)]
 for i in range(1,n):
     sa[i]=sa[i-1]+a[i]
 mm=float("INF")
-for i in range(n):
+for i in range(n-1):
     mm=min(mm,abs(sa[i]-(sa[n-1]-sa[i])))
 print(int(mm))
Buggy program (verdict: Wrong Answer):
n= int(input())
mod=10**9+7
a= [int(x ) for x in input().split()]
b= a[:]

s=0
for i in range(n-2,-1,-1):
    b[i]=b[i+1]+b[i]

for i in range(n):
    s += (b[i]-a[i])*a[i]


Failing test case input:
4
3646424 64145 903 6247

Expected output:
436075051


Actual output:

Fixed program (verdict: Accepted):
n= int(input())
mod=10**9+7
a= [int(x ) for x in input().split()]
b= a[:]

s=0
for i in range(n-2,-1,-1):
    b[i]=b[i+1]+b[i]
for i in range(n):
    s += (b[i]-a[i])*a[i]
print(s%mod)

Diff:
 n= int(input())
 mod=10**9+7
 a= [int(x ) for x in input().split()]
 b= a[:]
 
 s=0
 for i in range(n-2,-1,-1):
     b[i]=b[i+1]+b[i]
-
 for i in range(n):
     s += (b[i]-a[i])*a[i]
-
+print(s%mod)
Buggy program (verdict: Wrong Answer):
N,A,B = map(int,input().split())

answer = 0
if A * N >= B:
	answer = B
else:
	answer = A
print(answer)

Failing test case input:
14 -8 0

Expected output:
-112


Actual output:
-8


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

answer = 0
if A * N >= B:
	answer = B
else:
	answer = A * N
print(answer)

Diff:
 N,A,B = map(int,input().split())
 
 answer = 0
 if A * N >= B:
 	answer = B
 else:
-	answer = A
+	answer = A * N
 print(answer)
Buggy program (verdict: Wrong Answer):
N = int(input())
arr = [0]*100
for num in range(1,N):
  arr[int(str(num)[0]+str(num)[-1])] += 1
print(sum([arr[int(str(i)+str(j))]*arr[int(str(j)+str(i))] for i in range(10) for j in range(10)]))

Failing test case input:
1292

Expected output:
16754


Actual output:
16732


Fixed program (verdict: Accepted):
N = int(input())
arr = [0]*100
for num in range(1,N+1):
  arr[int(str(num)[0]+str(num)[-1])] += 1
print(sum([arr[i*10+j]*arr[j*10+i]  for i in range(10) for j in range(10)]))

Diff:
 N = int(input())
 arr = [0]*100
-for num in range(1,N):
+for num in range(1,N+1):
   arr[int(str(num)[0]+str(num)[-1])] += 1
-print(sum([arr[int(str(i)+str(j))]*arr[int(str(j)+str(i))] for i in range(10) for j in range(10)]))
+print(sum([arr[i*10+j]*arr[j*10+i]  for i in range(10) for j in range(10)]))
Buggy program (verdict: Wrong Answer):
N = int(input())
s_list = [input() for _ in range(int(N))]
import math
ok = {}
count = 0
for s in s_list:
    s = ''.join(sorted(s))
    if s in ok:
        ok[s] += 1 
    else:
        ok[s] = 1

for val in ok:
    prev = (ok[val] - 1)
    if prev != 0:
        count += math.floor(ok[val] * prev / prev)

Failing test case input:
5
abaaaaaaaa
oweplustno
aaaaaaaaba
twoplusone
aaaaaaaaba

Expected output:
4


Actual output:

Fixed program (verdict: Accepted):
N = int(input())
s_list = [input() for _ in range(int(N))]
import math
ok = {}
count = 0
for s in s_list:
    s = ''.join(sorted(s))
    if s in ok:
        ok[s] += 1 
    else:
        ok[s] = 1

for val in ok:
    prev = (ok[val] - 1)
    if prev != 0:
        count += math.floor(ok[val] * prev / 2)
print(count)

Diff:
 N = int(input())
 s_list = [input() for _ in range(int(N))]
 import math
 ok = {}
 count = 0
 for s in s_list:
     s = ''.join(sorted(s))
     if s in ok:
         ok[s] += 1 
     else:
         ok[s] = 1
 
 for val in ok:
     prev = (ok[val] - 1)
     if prev != 0:
-        count += math.floor(ok[val] * prev / prev)
+        count += math.floor(ok[val] * prev / 2)
+print(count)
Buggy program (verdict: Wrong Answer):
N=int(input())
A=[int(x) for x in input().split()]
start=0
for i in A:
  if (start+1)==i:
    start+=1
print(len(A)-start)

Failing test case input:
3
0 2 -3

Expected output:
-1


Actual output:
3


Fixed program (verdict: Accepted):
N=int(input())
A=[int(x) for x in input().split()]
start=0
for i in A:
  if (start+1)==i:
    start+=1
if start!=0:
  print(len(A)-start)
else:
  print(-1)

Diff:
 N=int(input())
 A=[int(x) for x in input().split()]
 start=0
 for i in A:
   if (start+1)==i:
     start+=1
-print(len(A)-start)
+if start!=0:
+  print(len(A)-start)
+else:
+  print(-1)
Buggy program (verdict: Wrong Answer):
N, M=map(int, input().split())
lst=[list(map(int, input().split())) for _ in range(M)]
maxL, minR=-1, N
for L, R in lst:
  L, R=L-1, R-1
  maxL=max(maxL, L)
  minR=min(minR, R)
if minR>maxL:
  print(minR-maxL+1)
else:
  print(0)

Failing test case input:
10 1
6 6
5 7
10 8

Expected output:
1


Actual output:
0


Fixed program (verdict: Accepted):
N, M=map(int, input().split())
lst=[list(map(int, input().split())) for _ in range(M)]
maxL, minR=-1, N
for L, R in lst:
  L, R=L-1, R-1
  maxL=max(maxL, L)
  minR=min(minR, R)
if minR>=maxL:
  print(minR-maxL+1)
else:
  print(0)

Diff:
 N, M=map(int, input().split())
 lst=[list(map(int, input().split())) for _ in range(M)]
 maxL, minR=-1, N
 for L, R in lst:
   L, R=L-1, R-1
   maxL=max(maxL, L)
   minR=min(minR, R)
-if minR>maxL:
+if minR>=maxL:
   print(minR-maxL+1)
 else:
   print(0)
Buggy program (verdict: Wrong Answer):
n = int(input())
lis = []
for i in range(n):
    s,p = map(str,input().split())
    lis.append([s,100 - int(p)])
liss = lis.copy()
lis.sort()
print(liss)
for i in range(n):
    print(liss.index(lis[i]) + 1)

Failing test case input:
6
khkrbbsvoa 12
dvqoor -1
knz_` 20
zaoak 18
wmdosl -2
kbaqnvtail 1

Expected output:
2
6
1
3
5
4


Actual output:
[['khkrbbsvoa', 88], ['dvqoor', 101], ['knz_`', 80], ['zaoak', 82], ['wmdosl', 102], ['kbaqnvtail', 99]]
2
6
1
3
5
4


Fixed program (verdict: Accepted):
n = int(input())
lis = []
for i in range(n):
    s,p = map(str,input().split())
    lis.append([s,100 - int(p)])
liss = lis.copy()
lis.sort()
for i in range(n):
    print(liss.index(lis[i]) + 1)

Diff:
 n = int(input())
 lis = []
 for i in range(n):
     s,p = map(str,input().split())
     lis.append([s,100 - int(p)])
 liss = lis.copy()
 lis.sort()
-print(liss)
 for i in range(n):
     print(liss.index(lis[i]) + 1)
Buggy program (verdict: Wrong Answer):
w=input()
flag=True
for i in str(w):
  if str(w).count(i)==2:
    continue
  else:
    flag=False
print("Yes" if flag==True else "No")


Failing test case input:
abaccaba

Expected output:
Yes

Actual output:
No


Fixed program (verdict: Accepted):
w=input()
flag=True
for i in str(w):
  if int(str(w).count(i))%2==0:
    continue
  else:
    flag=False
print("Yes" if flag==True else "No")


Diff:
 w=input()
 flag=True
 for i in str(w):
-  if str(w).count(i)==2:
+  if int(str(w).count(i))%2==0:
     continue
   else:
     flag=False
 print("Yes" if flag==True else "No")
Buggy program (verdict: Wrong Answer):
N = int(input())
a = [int(i) for i in input().split()]
s_sort = sorted(a, reverse=True)
score = 0
for i in range(1, 3*N, 2):
    score += s_sort[i]
print(score)

Failing test case input:
10
1100000000 0000100100 1100100011 0100001000 1000101001 1000001000 1010100000 1010001100 1000100000 1010100000 1000101110 1010000000 1000110000 1000011000 1011000000 1101100010 0100110000 0001100101 1000000000 1001000111 1000000011 1000110001 0010000110 1100000001 1001000100 1000011000 1100001001 1000001000 1000000000 1110000100

Expected output:
10322524333


Actual output:
12432735543


Fixed program (verdict: Accepted):
N = int(input())
a = [int(i) for i in input().split()]
s_sort = sorted(a, reverse=True)
score = 0
for i in range(1, 2*N, 2):
    score += s_sort[i]
print(score)

Diff:
 N = int(input())
 a = [int(i) for i in input().split()]
 s_sort = sorted(a, reverse=True)
 score = 0
-for i in range(1, 3*N, 2):
+for i in range(1, 2*N, 2):
     score += s_sort[i]
 print(score)
Buggy program (verdict: Wrong Answer):
import collections
n = int(input())
k = []
result=[]
for i in range(n):
    a = input()
    k.append(a)
ans = collections.Counter(k)
for i in range(1,n):
    if k[i-1][-1] == k[i][0] and ans.most_common()[0][1] == 1:
        result.append("1")
    else:
        result.append("0")
print(result)
aim = collections.Counter(result)
print(aim.most_common()[0][1])
if aim.most_common()[0][1] != n-1 or aim.most_common()[0][0] =='0':
    print('No')
else:
    print('Yes')

Failing test case input:
9
basic
c
pcp
php
python
nadesico
ocaml
lua
assembly

Expected output:
No


Actual output:
['1', '0', '1', '1', '1', '1', '1', '1']
7
No


Fixed program (verdict: Accepted):
import collections
n = int(input())
k = []
result=[]
for i in range(n):
    a = input()
    k.append(a)
ans = collections.Counter(k)
for i in range(1,n):
    if k[i-1][-1] == k[i][0] and ans.most_common()[0][1] == 1:
        result.append("1")
    else:
        result.append("0")
aim = collections.Counter(result)
if aim.most_common()[0][1] != n-1 or aim.most_common()[0][0] =='0':
    print('No')
else:
    print('Yes')


Diff:
 import collections
 n = int(input())
 k = []
 result=[]
 for i in range(n):
     a = input()
     k.append(a)
 ans = collections.Counter(k)
 for i in range(1,n):
     if k[i-1][-1] == k[i][0] and ans.most_common()[0][1] == 1:
         result.append("1")
     else:
         result.append("0")
-print(result)
 aim = collections.Counter(result)
-print(aim.most_common()[0][1])
 if aim.most_common()[0][1] != n-1 or aim.most_common()[0][0] =='0':
     print('No')
 else:
     print('Yes')
+
Buggy program (verdict: Wrong Answer):
n = int(input())
a = input().split()
a = [int(i) for i in a]
 
candidate = a[n:len(a)+1]
print(sum([candidate[i] for i in range(0, 2*n, 2)]))

Failing test case input:
2
0 7 8 5 1 5

Expected output:
12


Actual output:
9


Fixed program (verdict: Accepted):
n = int(input())
a = input().split()
a = [int(i) for i in a]
a = sorted(a)
 
candidate = a[n:len(a)+1]
print(sum([candidate[i] for i in range(0, 2*n, 2)]))

Diff:
 n = int(input())
 a = input().split()
 a = [int(i) for i in a]
+a = sorted(a)
  
 candidate = a[n:len(a)+1]
 print(sum([candidate[i] for i in range(0, 2*n, 2)]))
Buggy program (verdict: Wrong Answer):
a = int(input())
b = list(map(int, input().split()))
b.sort()
c = 0
for i in range(a-1):
    c += b[i]
if b[-1] < c:
    print("YES")
else:
    print("NO")


Failing test case input:
10
1 0 10 10 16 17 34 110 11 3

Expected output:
No


Actual output:
NO


Fixed program (verdict: Accepted):
a = int(input())
b = list(map(int, input().split()))
b.sort()
c = 0
for i in range(a-1):
    c += b[i]
if b[a-1] < c:
    print("Yes")
else:
    print("No")


Diff:
 a = int(input())
 b = list(map(int, input().split()))
 b.sort()
 c = 0
 for i in range(a-1):
     c += b[i]
-if b[-1] < c:
-    print("YES")
+if b[a-1] < c:
+    print("Yes")
 else:
-    print("NO")
+    print("No")
Buggy program (verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
used = [False for i in range(N)]
ans = 0
for i in range(len(A)):
    if i + 1 == A[A[i] - 1] and not used[i] and not used[A[i] - 1]:
        ans += 1
        used[i] = True
        used[A[A[i] - 1]] = True
print(ans)

Failing test case input:
5
5 4 5 2 1

Expected output:
2


Actual output:
1


Fixed program (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
used = [False for i in range(N)]
ans = 0
for i in range(len(A)):
    if i + 1 == A[A[i] - 1] and not used[i] and not used[A[i] - 1]:
        ans += 1
        used[i] = True
        used[A[i] - 1] = True
print(ans)

Diff:
 N = int(input())
 A = list(map(int, input().split()))
 used = [False for i in range(N)]
 ans = 0
 for i in range(len(A)):
     if i + 1 == A[A[i] - 1] and not used[i] and not used[A[i] - 1]:
         ans += 1
         used[i] = True
-        used[A[A[i] - 1]] = True
+        used[A[i] - 1] = True
 print(ans)
Buggy program (verdict: Wrong Answer):
n, x = map(int, input().split())
l = list(map(int, input().split()))
t = 0

for i in range(len(l)):
    t += l[i]
    if x < t:
        print(i + 1)
        break


Failing test case input:
4 9
4 2 0 3

Expected output:
5


Actual output:

Fixed program (verdict: Accepted):
n, x = map(int, input().split())
l = list(map(int, input().split()))
t = 0
c = 0

for i in range(len(l)):
    t += l[i]
    if x < t:
        print(i + 1)
        c += 1
        break

if c == 0:
    print(n + 1)


Diff:
 n, x = map(int, input().split())
 l = list(map(int, input().split()))
 t = 0
+c = 0
 
 for i in range(len(l)):
     t += l[i]
     if x < t:
         print(i + 1)
+        c += 1
         break
 
+if c == 0:
+    print(n + 1)
+
Buggy program (verdict: Wrong Answer):
x, y = map(int,input().split())

if x == y:
  ans = x * 2
if x > y:
  ans = 2*x - 1
else:
  ans = 2*y - 1

print(ans)

Failing test case input:
-11 -11

Expected output:
-22


Actual output:
-23


Fixed program (verdict: Accepted):
x, y = map(int,input().split())

if x == y:
  ans = x * 2
elif x > y:
  ans = 2*x - 1
else:
  ans = 2*y - 1

print(ans)

Diff:
 x, y = map(int,input().split())
 
 if x == y:
   ans = x * 2
-if x > y:
+elif x > y:
   ans = 2*x - 1
 else:
   ans = 2*y - 1
 
 print(ans)
Buggy program (verdict: Wrong Answer):
S=input()
if "SSS" in S:
    print("3")
elif "SS" in S:
    print("2")
elif "S" in S:
    print("1")
else:
    print("0")

Failing test case input:
SSR

Expected output:
1


Actual output:
2


Fixed program (verdict: Accepted):
S=input()
if "RRR" in S:
    print("3")
elif "RR" in S:
    print("2")
elif "R" in S:
    print("1")
else:
    print("0")

Diff:
 S=input()
-if "SSS" in S:
+if "RRR" in S:
     print("3")
-elif "SS" in S:
+elif "RR" in S:
     print("2")
-elif "S" in S:
+elif "R" in S:
     print("1")
 else:
     print("0")
Buggy program (verdict: Wrong Answer):
N=int(input())

print(0.5*N*(N+1))

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed program (verdict: Accepted):
N=int(input())

print(int(0.5*N*(N+1)))

Diff:
 N=int(input())
 
-print(0.5*N*(N+1))
+print(int(0.5*N*(N+1)))
Buggy program (verdict: Wrong Answer):
n,k=map(int,input().split())
ans=1
f=0
while ans < n-1:
    ans*=k
    f+=1
print(f)

Failing test case input:
0010001 10

Expected output:
5


Actual output:
4


Fixed program (verdict: Accepted):
n,k=map(int,input().split())
ans=1
f=0
while ans < n+1:
    ans*=k
    f+=1
print(f)

Diff:
 n,k=map(int,input().split())
 ans=1
 f=0
-while ans < n-1:
+while ans < n+1:
     ans*=k
     f+=1
 print(f)
Buggy program (verdict: Wrong Answer):
n, m = map(int, input().split())
relations = [[] for _ in range(n)]

for i in range(m):
    s, t = map(int, input().split())
    if s > t:
        s, t = t, s
    relations[s] += [t]
friend_id = [None] * n
for s, t in enumerate(relations):
    if t:
        queue = [s]
        while len(queue):
            k = queue.pop()
            friend_id[k] = s
            queue += relations[k]
            relations[k] = []

q = int(input())
for i in range(q):
    s, t = map(int, input().split())
    print('yes' if friend_id[s] != None and friend_id[s] == friend_id[t] else'no')

Failing test case input:
16 9
0 1
0 2
6 4
5 7
5 2
3 7
6 13
7 8
8 9
3
0 1
5 9
1 3

Expected output:
yes
yes
yes


Actual output:
yes
yes
no


Fixed program (verdict: Accepted):
n, m = map(int, input().split())
relations = [[] for _ in range(n)]

for i in range(m):
    s, t = map(int, input().split())
    relations[s] += [t]
    relations[t] += [s]
friend_id = [None] * n
for s, t in enumerate(relations):
    if t:
        queue = [s]
        while len(queue):
            k = queue.pop()
            friend_id[k] = s
            queue += relations[k]
            relations[k] = []

q = int(input())
for i in range(q):
    s, t = map(int, input().split())
    print('yes' if friend_id[s] != None and friend_id[s] == friend_id[t] else'no')

Diff:
 n, m = map(int, input().split())
 relations = [[] for _ in range(n)]
 
 for i in range(m):
     s, t = map(int, input().split())
-    if s > t:
-        s, t = t, s
     relations[s] += [t]
+    relations[t] += [s]
 friend_id = [None] * n
 for s, t in enumerate(relations):
     if t:
         queue = [s]
         while len(queue):
             k = queue.pop()
             friend_id[k] = s
             queue += relations[k]
             relations[k] = []
 
 q = int(input())
 for i in range(q):
     s, t = map(int, input().split())
     print('yes' if friend_id[s] != None and friend_id[s] == friend_id[t] else'no')
Buggy program (verdict: Wrong Answer):
s=input()
x=s.find('A')
y=s.find('Z')
print(y-x+1)

Failing test case input:
ZCAAZ

Expected output:
3


Actual output:
-1


Fixed program (verdict: Accepted):
s=input()
x=s.find('A')
y=s.rfind('Z')
print(y-x+1)

Diff:
 s=input()
 x=s.find('A')
-y=s.find('Z')
+y=s.rfind('Z')
 print(y-x+1)
Buggy program (verdict: Wrong Answer):
N,M=map(int,input().split())
gate=[input() for __ in range(M)]
s,e=map(int,gate[0].split())
for n in gate:
    pre_s,pre_e=map(int,n.split())
    s=(s if s>pre_s else pre_s)
    e=(e if e<pre_e else pre_e)

print(e+1-s)


Failing test case input:
10 3
3 2
4 7
6 11

Expected output:
0


Actual output:
-3


Fixed program (verdict: Accepted):
N,M=map(int,input().split())
gate=[input() for __ in range(M)]
s,e=map(int,gate[0].split())
for n in gate:
    pre_s,pre_e=map(int,n.split())
    s=(s if s>pre_s else pre_s)
    e=(e if e<pre_e else pre_e)

print(e+1-s if e>=s else 0)


Diff:
 N,M=map(int,input().split())
 gate=[input() for __ in range(M)]
 s,e=map(int,gate[0].split())
 for n in gate:
     pre_s,pre_e=map(int,n.split())
     s=(s if s>pre_s else pre_s)
     e=(e if e<pre_e else pre_e)
 
-print(e+1-s)
+print(e+1-s if e>=s else 0)
Buggy program (verdict: Wrong Answer):
A,B,C,D = map(int,input().split())

s = min(B-C,D-C)

if s <= 0:
    s = 0

print(s)

Failing test case input:
1 6 -1 4

Expected output:
3


Actual output:
5


Fixed program (verdict: Accepted):
A,B,C,D = map(int,input().split())

s = min(B,D)-max(A,C)

if s <= 0:
    s = 0

print(s)

Diff:
 A,B,C,D = map(int,input().split())
 
-s = min(B-C,D-C)
+s = min(B,D)-max(A,C)
 
 if s <= 0:
     s = 0
 
 print(s)
Buggy program (verdict: Wrong Answer):
px = list(map(int, input().split()))
pxs = [x for x in input()]
for i in pxs:
  print(i)
  print(i)


Failing test case input:
9 20
.....***....***.....
....*...*..*...*....
...*.....**.....*...
...*.....*......*...
....*.....*....*....
.....**..*../**.....
.......*.*..*.......
........**.*........
.........**......../

Expected output:
.....***....***.....
.....***....***.....
....*...*..*...*....
....*...*..*...*....
...*.....**.....*...
...*.....**.....*...
...*.....*......*...
...*.....*......*...
....*.....*....*....
....*.....*....*....
.....**..*../**.....
.....**..*../**.....
.......*.*..*.......
.......*.*..*.......
........**.*........
........**.*........
.........**......../
.........**......../


Actual output:
.
.
.
.
.
.
.
.
.
.
*
*
*
*
*
*
.
.
.
.
.
.
.
.
*
*
*
*
*
*
.
.
.
.
.
.
.
.
.
.


Fixed program (verdict: Accepted):
px = list(map(int, input().split()))
pxs = [input() for i in range(px[0])]
for i in pxs:
  print(i)
  print(i)


Diff:
 px = list(map(int, input().split()))
-pxs = [x for x in input()]
+pxs = [input() for i in range(px[0])]
 for i in pxs:
   print(i)
   print(i)
Buggy program (verdict: Wrong Answer):
A, B = map(int, input().split())
S = input().split('-')
if A == len(S[0]):
    print("Yes")
else:
    print("No")


Failing test case input:
1 0
,--

Expected output:
No


Actual output:
Yes


Fixed program (verdict: Accepted):
A, B = map(int, input().split())
S = input().split('-')
if A == len(S[0]) and len(S)==2:
    print("Yes")
else:
    print("No")


Diff:
 A, B = map(int, input().split())
 S = input().split('-')
-if A == len(S[0]):
+if A == len(S[0]) and len(S)==2:
     print("Yes")
 else:
     print("No")
Buggy program (verdict: Wrong Answer):
n = int(input())
l = list(map(int, input().split()))
l.sort()
cnt = 0
for i in l[:n - 1]:
    cnt += 1
    
if cnt > l[n - 1]:
    print("Yes")
else:
    print("No")
    

Failing test case input:
4
6 6 1 0

Expected output:
Yes


Actual output:
No


Fixed program (verdict: Accepted):
n = int(input())
l = list(map(int, input().split()))
l.sort()
cnt = 0
for i in l[:n - 1]:
    cnt += i
    
if cnt > l[n - 1]:
    print("Yes")
else:
    print("No")

Diff:
 n = int(input())
 l = list(map(int, input().split()))
 l.sort()
 cnt = 0
 for i in l[:n - 1]:
-    cnt += 1
+    cnt += i
     
 if cnt > l[n - 1]:
     print("Yes")
 else:
     print("No")
-
Buggy program (verdict: Wrong Answer):
A, B = map(int, input().split())

ans = 0

for i in range(2):
  if B > A:
    ans += B
  else:
    ans += A
 
print(ans)

Failing test case input:
-6 69

Expected output:
137


Actual output:
138


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

ans = 0

for i in range(2):
  if B > A:
    ans += B
    B -= 1
  else:
    ans += A
    A -= 1
 
print(ans)

Diff:
 A, B = map(int, input().split())
 
 ans = 0
 
 for i in range(2):
   if B > A:
     ans += B
+    B -= 1
   else:
     ans += A
+    A -= 1
  
 print(ans)
Buggy program (verdict: Wrong Answer):
month = [31, 30, 29, 30, 31, 30, 31, 31, 30, 31, 30, 31]
day = ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday']
while True:
    m, d = map(int, input().split())
    if m == 0:
        break
    print(day[(sum(month[:m - 1]) + d) % 7])

Failing test case input:
6 2
1 8
0 0

Expected output:
Wednesday
Thursday


Actual output:
Tuesday
Thursday


Fixed program (verdict: Accepted):
month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30]
day = ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday']
while True:
    m, d = map(int, input().split())
    if m == 0:
        break
    print(day[(sum(month[:m - 1]) + d) % 7])

Diff:
-month = [31, 30, 29, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+month = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30]
 day = ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday']
 while True:
     m, d = map(int, input().split())
     if m == 0:
         break
     print(day[(sum(month[:m - 1]) + d) % 7])
Buggy program (verdict: Wrong Answer):
from collections import Counter
def main():
    n=int(input())
    L=[0]*n
    for i in range(n):
        L[i] = int(input())
    print(sum(s*(s%2) for s in Counter(L).values()))
main()

Failing test case input:
4
0
0
4
0

Expected output:
2


Actual output:
4


Fixed program (verdict: Accepted):
from collections import Counter
def main():
    n=int(input())
    L=[0]*n
    for i in range(n):
        L[i] = int(input())
    print(sum(s%2 for s in Counter(L).values()))
main()

Diff:
 from collections import Counter
 def main():
     n=int(input())
     L=[0]*n
     for i in range(n):
         L[i] = int(input())
-    print(sum(s*(s%2) for s in Counter(L).values()))
+    print(sum(s%2 for s in Counter(L).values()))
 main()
Buggy program (verdict: Wrong Answer):
A,B,C=map(int,input().split())
p=3
if A==B:
  p=p-1
if A==C:
  p=p-1
print(p)

Failing test case input:
53 1 1

Expected output:
2


Actual output:
3


Fixed program (verdict: Accepted):
A,B,C=map(int,input().split())
p=3
if A==B:
  p=p-1
if A==C:
  p=p-1
if B==C and p==3:
  print(2)
else:
  print(p)

Diff:
 A,B,C=map(int,input().split())
 p=3
 if A==B:
   p=p-1
 if A==C:
   p=p-1
-print(p)
+if B==C and p==3:
+  print(2)
+else:
+  print(p)
Buggy program (verdict: Wrong Answer):
aa, bb = list(map(int, input().split()))
if aa>bb:
    print(2*aa+1)
elif aa<bb:
    print(2*bb+1)
else:
    print(2*aa)

Failing test case input:
-6 69

Expected output:
137


Actual output:
139


Fixed program (verdict: Accepted):
aa, bb = list(map(int, input().split()))
if aa>bb:
    print(2*aa-1)
elif aa<bb:
    print(2*bb-1)
else:
    print(2*aa)

Diff:
 aa, bb = list(map(int, input().split()))
 if aa>bb:
-    print(2*aa+1)
+    print(2*aa-1)
 elif aa<bb:
-    print(2*bb+1)
+    print(2*bb-1)
 else:
     print(2*aa)
Buggy program (verdict: Wrong Answer):
n, c, k = map(int, input().split())
t = []
for _ in range(n):
    t.append(int(input()))
ans = 0
time_cnt = 0
mem_cnt = 1
t.sort()
for i in range(n - 1):
    time_cnt += t[i + 1] - t[i]
    mem_cnt += 1
    
    if time_cnt > k or mem_cnt > c:
        time_cnt = 0
        mem_cnt = 0
        ans += 1
if mem_cnt == 0:
    ans += 1
elif mem_cnt > 0:
    ans += 1
print(ans)



Failing test case input:
6 1 3
7
6
2
13
17
5

Expected output:
6


Actual output:
5


Fixed program (verdict: Accepted):
n, c, k = map(int, input().split())
t = []
for _ in range(n):
    t.append(int(input()))
ans = 0
time_cnt = 0
mem_cnt = 1
t.sort()
for i in range(n - 1):
    time_cnt += t[i + 1] - t[i]
    mem_cnt += 1
    
    if time_cnt > k or mem_cnt > c:
        time_cnt = 0
        mem_cnt = 1
        ans += 1
if mem_cnt == 0:
    ans += 1
elif mem_cnt > 0:
    ans += 1
print(ans)



Diff:
 n, c, k = map(int, input().split())
 t = []
 for _ in range(n):
     t.append(int(input()))
 ans = 0
 time_cnt = 0
 mem_cnt = 1
 t.sort()
 for i in range(n - 1):
     time_cnt += t[i + 1] - t[i]
     mem_cnt += 1
     
     if time_cnt > k or mem_cnt > c:
         time_cnt = 0
-        mem_cnt = 0
+        mem_cnt = 1
         ans += 1
 if mem_cnt == 0:
     ans += 1
 elif mem_cnt > 0:
     ans += 1
 print(ans)
Buggy program (verdict: Wrong Answer):
n = int(input())
p = list(map(int, input().split()))
count = 0
r = p[0]
for i in range(1, n+1):
    s = min(r, p[i-1])
    if (s == p[i-1]):
        count += 1
print(count)

Failing test case input:
5
3 2 5 0 3

Expected output:
3


Actual output:
4


Fixed program (verdict: Accepted):
n = int(input())
p = list(map(int, input().split()))
count = 0
s = p[0]
for i in range(1, n+1):
    s = min(s, p[i-1])
    if (s == p[i-1]):
        count += 1
print(count)

Diff:
 n = int(input())
 p = list(map(int, input().split()))
 count = 0
-r = p[0]
+s = p[0]
 for i in range(1, n+1):
-    s = min(r, p[i-1])
+    s = min(s, p[i-1])
     if (s == p[i-1]):
         count += 1
 print(count)
Buggy program (verdict: Wrong Answer):
k=int(input())
cnt=1
flag=True
if k%2==0:
    print(-1)
else:
    keta=10
    tmp=0
    while cnt<=10**6:
        tmp+=pow(keta,cnt-1,k)*7
        if tmp%k==0:
            print(cnt)
            flag=False
            break
        cnt+=1
if flag:
    print(-1)

Failing test case input:
1803846

Expected output:
-1


Actual output:
-1
-1


Fixed program (verdict: Accepted):
k=int(input())
cnt=1
flag=True
if k%2==0:
    flag=False
    print(-1)
else:
    keta=10
    tmp=0
    while cnt<=10**6:
        tmp+=pow(keta,cnt-1,k)*7
        if tmp%k==0:
            print(cnt)
            flag=False
            break
        cnt+=1
if flag:
    print(-1)

Diff:
 k=int(input())
 cnt=1
 flag=True
 if k%2==0:
+    flag=False
     print(-1)
 else:
     keta=10
     tmp=0
     while cnt<=10**6:
         tmp+=pow(keta,cnt-1,k)*7
         if tmp%k==0:
             print(cnt)
             flag=False
             break
         cnt+=1
 if flag:
     print(-1)
Buggy program (verdict: Wrong Answer):
a,b = map(float,input().split())
p = list(map(int,input().split()))

t = 10000
for i in range(101,0,-1):
    if i not in p:
        if abs(a-i)<= t:
            ans = i
            t = abs(a-i)
        
print(ans)


Failing test case input:
0 2
4 7 10 8 2

Expected output:
0


Actual output:
1


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

t = 10000
for i in range(103,-1,-1):
    if i not in p:
        if abs(a-i)<= t:
            ans = i
            t = abs(a-i)
        
print(ans)


Diff:
 a,b = map(float,input().split())
 p = list(map(int,input().split()))
 
 t = 10000
-for i in range(101,0,-1):
+for i in range(103,-1,-1):
     if i not in p:
         if abs(a-i)<= t:
             ans = i
             t = abs(a-i)
         
 print(ans)
Buggy program (verdict: Wrong Answer):
n,a,b = map(int,input().split())

if a>=b:
    print(n*b)
else:
    print(n*a)

Failing test case input:
-96 4 1

Expected output:
-384


Actual output:
-96


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

if n*a>=b:
    print(b)
else:
    print(n*a)

Diff:
 n,a,b = map(int,input().split())
 
-if a>=b:
-    print(n*b)
+if n*a>=b:
+    print(b)
 else:
     print(n*a)
Buggy program (verdict: Wrong Answer):
S=list(input())
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)

Failing test case input:
ASSA

Expected output:
Yes

Actual output:
No


Fixed program (verdict: Accepted):
S=list(input())
S.sort()
ans = "No"
if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
  ans = "Yes"
print(ans)

Diff:
 S=list(input())
+S.sort()
 ans = "No"
 if(S[0] == S[1]) and (S[1] != S[2]) and (S[2] == S[3]):
   ans = "Yes"
 print(ans)
Buggy program (verdict: Wrong Answer):
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
if a+e==b+d:
  if b+f==c+e:
    if d+h==e+g:
      if e+i==f+h:
        print('Yes')
print('No')

Failing test case input:
1 0 1
2 1 2
1 0 1

Expected output:
Yes

Actual output:
Yes
No


Fixed program (verdict: Accepted):
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
if a+e==b+d:
  if b+f==c+e:
    if d+h==e+g:
      if e+i==f+h:
        print('Yes')
        exit()
print('No')

Diff:
 a,b,c=map(int,input().split())
 d,e,f=map(int,input().split())
 g,h,i=map(int,input().split())
 if a+e==b+d:
   if b+f==c+e:
     if d+h==e+g:
       if e+i==f+h:
         print('Yes')
+        exit()
 print('No')
Buggy program (verdict: Wrong Answer):
N, P = map(int, input().split())
A = map(int, input().split())

n_even = len(list(filter(lambda x: x % 2 == 0, A)))
n_odd = N - n_even
ans = 2 ** max(0, n_odd - 1) * 2 ** n_even
if P == 0 and n_odd == 0:
    print(0)
else:
    print(ans)


Failing test case input:
1 1
42

Expected output:
0


Actual output:
2


Fixed program (verdict: Accepted):
N, P = map(int, input().split())
A = map(int, input().split())

n_even = len(list(filter(lambda x: x % 2 == 0, A)))
n_odd = N - n_even
ans = (2 ** max(0, n_odd - 1)) * (2 ** n_even)
if P == 1 and n_odd == 0:
    print(0)
else:
    print(ans)




Diff:
 N, P = map(int, input().split())
 A = map(int, input().split())
 
 n_even = len(list(filter(lambda x: x % 2 == 0, A)))
 n_odd = N - n_even
-ans = 2 ** max(0, n_odd - 1) * 2 ** n_even
-if P == 0 and n_odd == 0:
+ans = (2 ** max(0, n_odd - 1)) * (2 ** n_even)
+if P == 1 and n_odd == 0:
     print(0)
 else:
     print(ans)
 
+
+
Buggy program (verdict: Wrong Answer):
from collections import defaultdict

n = int(input())
A = list(map(int, input().split()))
B = [0] * (n)
C = [0] * (n)
kouho = defaultdict(int)
ans = 0
for i in range(n):
    ans += kouho[abs(A[i] - (i + 1))]
    kouho[A[i] + (i + 1)] += 1

print(ans)


Failing test case input:
32
3 1 4 1 5 9 4 9 5 3 5 8 9 7 13 3 2 3 8 4 6 2 6 4 3 3 3 3 2 7 2 5

Expected output:
25


Actual output:
26


Fixed program (verdict: Accepted):
from collections import defaultdict

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

kouho = defaultdict(int)
ans = 0
for i in range(n):
    kouho[A[i] + (i + 1)] += 1
    ans += kouho[(i + 1) - A[i]]

print(ans)


Diff:
 from collections import defaultdict
 
 n = int(input())
 A = list(map(int, input().split()))
-B = [0] * (n)
-C = [0] * (n)
+
 kouho = defaultdict(int)
 ans = 0
 for i in range(n):
-    ans += kouho[abs(A[i] - (i + 1))]
     kouho[A[i] + (i + 1)] += 1
+    ans += kouho[(i + 1) - A[i]]
 
 print(ans)
Buggy program (verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
B = [[] for i in range(N)]
ans = [0]*N
for k, a in enumerate(A):
    a = a - 1
    B[a].append(k)


S = 0
for b in B:
    lenb = len(b)
    if lenb >= 1:
        S += lenb * (lenb-1) / 2

for i, b in enumerate(B):
    for j, k in enumerate(b):
        ans[k] = int(S - (len(b) - 1))
print(ans)

Failing test case input:
8
2 2 0 5 1 0 4 1

Expected output:
2
2
2
3
2
2
3
2


Actual output:
[2, 2, 2, 3, 2, 2, 3, 2]


Fixed program (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
B = [[] for i in range(N)]
ans = [0]*N
for k, a in enumerate(A):
    a = a - 1
    B[a].append(k)


S = 0
for b in B:
    lenb = len(b)
    if lenb >= 1:
        S += lenb * (lenb-1) / 2

for i, b in enumerate(B):
    for j, k in enumerate(b):
        ans[k] = int(S - (len(b) - 1))
for i in ans:
    print(i)

Diff:
 N = int(input())
 A = list(map(int, input().split()))
 B = [[] for i in range(N)]
 ans = [0]*N
 for k, a in enumerate(A):
     a = a - 1
     B[a].append(k)
 
 
 S = 0
 for b in B:
     lenb = len(b)
     if lenb >= 1:
         S += lenb * (lenb-1) / 2
 
 for i, b in enumerate(B):
     for j, k in enumerate(b):
         ans[k] = int(S - (len(b) - 1))
-print(ans)
+for i in ans:
+    print(i)
Buggy program (verdict: Wrong Answer):
N = int(input())
count=0
for i in range(1,N+1):
    if len(str(i))==1:
        count+=1
print(count)

Failing test case input:
289

Expected output:
199


Actual output:
9


Fixed program (verdict: Accepted):
N = int(input())
count=0
for i in range(1,N+1):
    if len(str(i))%2==1:
        count+=1
print(count)

Diff:
 N = int(input())
 count=0
 for i in range(1,N+1):
-    if len(str(i))==1:
+    if len(str(i))%2==1:
         count+=1
 print(count)
Buggy program (verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    sum_score = m + f
    if m != -1 and f != -1:
        if sum_score >= 80:
            print("A")
        elif 65 <= sum_score < 80:
            print("B")
        elif 50 <= sum_score < 65:
            print("C")
        elif 30 <= sum_score < 50:
            if r >= 50:
                print("C")
            else:
                print("D")
        else:
            print("D")
    else:
        if m == -1 and f == -1 and r == -1:
                break
        else:
            print("F")



Failing test case input:
40 10 -1
16 30 -1
0 4 -1
-1 -1 -1

Expected output:
C
D
F


Actual output:
C
D
D


Fixed program (verdict: Accepted):
while True:
    m, f, r = map(int, input().split())
    sum_score = m + f
    if m != -1 and f != -1:
        if sum_score >= 80:
            print("A")
        elif 65 <= sum_score < 80:
            print("B")
        elif 50 <= sum_score < 65:
            print("C")
        elif 30 <= sum_score < 50:
            if r >= 50:
                print("C")
            else:
                print("D")
        else:
            print("F")
    else:
        if m == -1 and f == -1 and r == -1:
                break
        else:
            print("F")



Diff:
 while True:
     m, f, r = map(int, input().split())
     sum_score = m + f
     if m != -1 and f != -1:
         if sum_score >= 80:
             print("A")
         elif 65 <= sum_score < 80:
             print("B")
         elif 50 <= sum_score < 65:
             print("C")
         elif 30 <= sum_score < 50:
             if r >= 50:
                 print("C")
             else:
                 print("D")
         else:
-            print("D")
+            print("F")
     else:
         if m == -1 and f == -1 and r == -1:
                 break
         else:
             print("F")
Buggy program (verdict: Wrong Answer):
a, b, c = map(int, input().split())
print(min(abs(a-b)+abs(a-c),abs(b-a)+(b-c),abs(c-a)+abs(c-b)))

Failing test case input:
-5 0 52

Expected output:
57


Actual output:
-47


Fixed program (verdict: Accepted):
a, b, c = map(int, input().split())
print(min(abs(a-b)+abs(b-c),abs(b-c)+abs(c-a),abs(c-a)+abs(a-b)))

Diff:
 a, b, c = map(int, input().split())
-print(min(abs(a-b)+abs(a-c),abs(b-a)+(b-c),abs(c-a)+abs(c-b)))
+print(min(abs(a-b)+abs(b-c),abs(b-c)+abs(c-a),abs(c-a)+abs(a-b)))
Buggy program (verdict: Wrong Answer):
input = input()
 
list = input.split(" ")
a = list[0]
b = list[1]
c = list[2]

print(a)
print(b)
print(c)
 
amari = (int(a) - int(b))

if amari > int(c):
  result = 0
else:
  print(int(c) - amari)

Failing test case input:
-11 1 5

Expected output:
17


Actual output:
-11
1
5
17


Fixed program (verdict: Accepted):
input = input()
 
list = input.split(" ")
a = list[0]
b = list[1]
c = list[2]
 
amari = (int(a) - int(b))

if amari > int(c):
  result = 0
  print(0)
else:
  print(int(c) - amari)

Diff:
 input = input()
  
 list = input.split(" ")
 a = list[0]
 b = list[1]
 c = list[2]
-
-print(a)
-print(b)
-print(c)
  
 amari = (int(a) - int(b))
 
 if amari > int(c):
   result = 0
+  print(0)
 else:
   print(int(c) - amari)
Buggy program (verdict: Wrong Answer):
a,b,k = map(int,input().split())
data = range(a,b+1)
b_a = b-a
if b_a <= k*2:
  for num in data:
    print(num)
else:
  min_k = data[:k]
  max_k = data[-k:]
  for num in min_k:
    print(num)
  for num in max_k:
    print(num)

Failing test case input:
3 23 010

Expected output:
3
4
5
6
7
8
9
10
11
12
14
15
16
17
18
19
20
21
22
23


Actual output:
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23


Fixed program (verdict: Accepted):
a,b,k = map(int,input().split())
data = range(a,b+1)
b_a = b-a
if b_a < k*2:
  for num in data:
    print(num)
else:
  min_k = data[:k]
  max_k = data[-k:]
  for num in min_k:
    print(num)
  for num in max_k:
    print(num)

Diff:
 a,b,k = map(int,input().split())
 data = range(a,b+1)
 b_a = b-a
-if b_a <= k*2:
+if b_a < k*2:
   for num in data:
     print(num)
 else:
   min_k = data[:k]
   max_k = data[-k:]
   for num in min_k:
     print(num)
   for num in max_k:
     print(num)
Buggy program (verdict: Wrong Answer):
input()
S = input()
k = int(input())
for s in S:
  print(s if s==S[k-1] else "*")

Failing test case input:
9
abuiebtmn
4

Expected output:
***i*****


Actual output:
*
*
*
i
*
*
*
*
*


Fixed program (verdict: Accepted):
input()
S = input()
k = int(input())
for s in S:
  print(s if s==S[k-1] else "*",end="")

Diff:
 input()
 S = input()
 k = int(input())
 for s in S:
-  print(s if s==S[k-1] else "*")
+  print(s if s==S[k-1] else "*",end="")
Buggy program (verdict: Wrong Answer):
_,a,b=map(int,input().split())
print('YNEOS'[(a*10+b)%4>1::2])


Failing test case input:
0 18 1

Expected output:
NO


Actual output:
YES


Fixed program (verdict: Accepted):
_,a,b=map(int,input().split())
print('YNEOS'[(a*10+b)%4>0::2])


Diff:
 _,a,b=map(int,input().split())
-print('YNEOS'[(a*10+b)%4>1::2])
+print('YNEOS'[(a*10+b)%4>0::2])
Buggy program (verdict: Wrong Answer):
n,m = map(int,input().split())
l = 0
r = n
for i in range(m):
  ll,rr = map(int,input().split())
  l = max(l,ll)
  r = min(r,rr)
print(r-l+1)

Failing test case input:
10 3
3 2
4 7
9 14

Expected output:
0


Actual output:
-6


Fixed program (verdict: Accepted):
n,m = map(int,input().split())
l = 0
r = n
for i in range(m):
  ll,rr = map(int,input().split())
  l = max(l,ll)
  r = min(r,rr)
if r-l+1 >= 0:
  print(r-l+1)
else:
  print(0)

Diff:
 n,m = map(int,input().split())
 l = 0
 r = n
 for i in range(m):
   ll,rr = map(int,input().split())
   l = max(l,ll)
   r = min(r,rr)
-print(r-l+1)
+if r-l+1 >= 0:
+  print(r-l+1)
+else:
+  print(0)
Buggy program (verdict: Wrong Answer):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    a, b, c = map(int, input().split())
    if ~a&1 and ~b&1 and ~c&1:
        print(0)
    else:
        print(min(a * b, b * c, c * a))
resolve()

Failing test case input:
1 3 10

Expected output:
0


Actual output:
3


Fixed program (verdict: Accepted):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    a, b, c = map(int, input().split())
    if ~a&1 or ~b&1 or ~c&1:
        print(0)
    else:
        print(min(a * b, b * c, c * a))
resolve()

Diff:
 import sys
 INF = 1 << 60
 MOD = 10**9 + 7 
 sys.setrecursionlimit(2147483647)
 input = lambda:sys.stdin.readline().rstrip()
 def resolve():
     a, b, c = map(int, input().split())
-    if ~a&1 and ~b&1 and ~c&1:
+    if ~a&1 or ~b&1 or ~c&1:
         print(0)
     else:
         print(min(a * b, b * c, c * a))
 resolve()
Buggy program (verdict: Wrong Answer):
n = int(input())
t = 0
for n in range(n):
    if (n % 3) != 0:
        if (n % 5) != 0:
            t += n
print(t)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed program (verdict: Accepted):
n = int(input())
t = 0
for n in range(1, n + 1):
    if (n % 3) != 0:
        if (n % 5) != 0:
            t += n
print(t)

Diff:
 n = int(input())
 t = 0
-for n in range(n):
+for n in range(1, n + 1):
     if (n % 3) != 0:
         if (n % 5) != 0:
             t += n
 print(t)
Buggy program (verdict: Wrong Answer):
data = input()
for i in range(0x61,0x7b):
    print("%c : %d"  %(i,data.count(chr(i))))


Failing test case input:
ifoV vh ^ dn+r

Expected output:
a : 0
b : 0
c : 0
d : 1
e : 0
f : 1
g : 0
h : 1
i : 1
j : 0
k : 0
l : 0
m : 0
n : 1
o : 1
p : 0
q : 0
r : 1
s : 0
t : 0
u : 0
v : 2
w : 0
x : 0
y : 0
z : 0


Actual output:
a : 0
b : 0
c : 0
d : 1
e : 0
f : 1
g : 0
h : 1
i : 1
j : 0
k : 0
l : 0
m : 0
n : 1
o : 1
p : 0
q : 0
r : 1
s : 0
t : 0
u : 0
v : 1
w : 0
x : 0
y : 0
z : 0


Fixed program (verdict: Accepted):
import sys

data = sys.stdin.read()
for i in range(0x61,0x7b):
    print("%c : %d"  %(i,data.lower().count(chr(i))))


Diff:
-data = input()
+import sys
+
+data = sys.stdin.read()
 for i in range(0x61,0x7b):
-    print("%c : %d"  %(i,data.count(chr(i))))
+    print("%c : %d"  %(i,data.lower().count(chr(i))))
Buggy program (verdict: Wrong Answer):
a, x, c = input().split()
print("{} {} {}".format(a, x[0], c))

Failing test case input:
AtCocer Y Cpnteqt

Expected output:
AYC


Actual output:
AtCocer Y Cpnteqt


Fixed program (verdict: Accepted):
a, x, c = input().split()
print("{}{}{}".format(a[0], x[0], c[0]))


Diff:
 a, x, c = input().split()
-print("{} {} {}".format(a, x[0], c))
+print("{}{}{}".format(a[0], x[0], c[0]))
+
Buggy program (verdict: Wrong Answer):
from collections import defaultdict
n,m=map(int,input().split())
d=defaultdict(list)
for s in range(m):
  a,b=map(int,input().split())
  d[a].append(b)
  d[b].append(a)
for k,v in d.items():
  print(len(v))

Failing test case input:
8 0
1 2
2 3
1 4

Expected output:
0
0
0
0
0
0
0
0


Actual output:

Fixed program (verdict: Accepted):
from collections import defaultdict
n,m=map(int,input().split())
d=defaultdict(list)
for s in range(m):
  a,b=map(int,input().split())
  d[a].append(b)
  d[b].append(a)
for s in range(1,n+1):
  print(len(d[s]))

Diff:
 from collections import defaultdict
 n,m=map(int,input().split())
 d=defaultdict(list)
 for s in range(m):
   a,b=map(int,input().split())
   d[a].append(b)
   d[b].append(a)
-for k,v in d.items():
-  print(len(v))
+for s in range(1,n+1):
+  print(len(d[s]))
Buggy program (verdict: Wrong Answer):
from statistics import median
N = int(input())
A = list(map(int, input().split()))
B = list()
sad = 0

for i in range(N):
  B.append(A[i]-i)

b = median(B)

for i in range(N):
  sad = sad + abs(A[i] - (b+i))

print(int(sad))
print(median(A))

Failing test case input:
7
177 -1 -3 -2 3 0 3

Expected output:
189


Actual output:
189
0


Fixed program (verdict: Accepted):
from statistics import median
N = int(input())
A = list(map(int, input().split()))
B = list()
sad = 0

for i in range(N):
  B.append(A[i]-i)

b = median(B)

for i in range(N):
  sad = sad + abs(A[i] - (b+i))

print(int(sad))

Diff:
 from statistics import median
 N = int(input())
 A = list(map(int, input().split()))
 B = list()
 sad = 0
 
 for i in range(N):
   B.append(A[i]-i)
 
 b = median(B)
 
 for i in range(N):
   sad = sad + abs(A[i] - (b+i))
 
 print(int(sad))
-print(median(A))
Buggy program (verdict: Wrong Answer):
a,b,c,k = map(int, input().split())
if a > k:
  print(k)
else:
  k -= a + b
if k <= 0:
  print(a)
else:
  print(a-k)

Failing test case input:
4 2 1 2

Expected output:
2


Actual output:
2
2


Fixed program (verdict: Accepted):
a,b,c,k = map(int, input().split())
if a >= k:
  print(k)
else:
  k -= a + b
  if k <= 0:
    print(a)
  else:
    print(a-k)

Diff:
 a,b,c,k = map(int, input().split())
-if a > k:
+if a >= k:
   print(k)
 else:
   k -= a + b
-if k <= 0:
-  print(a)
-else:
-  print(a-k)
+  if k <= 0:
+    print(a)
+  else:
+    print(a-k)
Buggy program (verdict: Wrong Answer):
x,y = map(int,input().split())

ave = (x + y) / 2

if int(ave - int(ave) * 10) == 0:
  print(int(ave))
  exit()
print("IMPOSSIBLE")

Failing test case input:
2770031 5298487

Expected output:
4034259


Actual output:
IMPOSSIBLE


Fixed program (verdict: Accepted):
x,y = map(int,input().split())

ave = abs(x + y) / 2

if int((ave - int(ave)) * 10) == 0:
  print(int(ave))
  exit()
print("IMPOSSIBLE")

Diff:
 x,y = map(int,input().split())
 
-ave = (x + y) / 2
+ave = abs(x + y) / 2
 
-if int(ave - int(ave) * 10) == 0:
+if int((ave - int(ave)) * 10) == 0:
   print(int(ave))
   exit()
 print("IMPOSSIBLE")
Buggy program (verdict: Wrong Answer):
S = input()
T = input()

found = []
for i in range(len(S) - len(T) + 1):
    for cs,ct in zip(S[i:],T):
        if cs != '?' and cs != ct:
            break
    else:
        found.append(i)

if not found:
    print('UNRESTORABLE')
    exit()

ans = 'z' * 51
for i in found:
    tmp = S[:i] + T + S[i+len(T):]
    
print(tmp)


Failing test case input:
>q???d?>
_ba

Expected output:
>q_bada>


Actual output:
>q_bad?>


Fixed program (verdict: Accepted):
S = input()
T = input()

found = []
for i in range(len(S) - len(T) + 1):
    for cs,ct in zip(S[i:],T):
        if cs != '?' and cs != ct:
            break
    else:
        found.append(i)

if not found:
    print('UNRESTORABLE')
    exit()

ans = 'z' * 51
for i in found:
    tmp = S[:i] + T + S[i+len(T):]
    ans = min(ans, tmp.replace('?', 'a'))
print(ans)


Diff:
 S = input()
 T = input()
 
 found = []
 for i in range(len(S) - len(T) + 1):
     for cs,ct in zip(S[i:],T):
         if cs != '?' and cs != ct:
             break
     else:
         found.append(i)
 
 if not found:
     print('UNRESTORABLE')
     exit()
 
 ans = 'z' * 51
 for i in found:
     tmp = S[:i] + T + S[i+len(T):]
-    
-print(tmp)
+    ans = min(ans, tmp.replace('?', 'a'))
+print(ans)
Buggy program (verdict: Wrong Answer):
a,b,c = map(int,input().split())
if a<c<b:
    print("Yes")
    exit()
elif b<a<c:
    print("Yes")
    exit()
else:
    print("No")


Failing test case input:
-1 -2 3

Expected output:
No


Actual output:
Yes


Fixed program (verdict: Accepted):
a,b,c = map(int,input().split())
if a<c<b:
    print("Yes")
    exit()
elif b<c<a:
    print("Yes")
    exit()
else:
    print("No")


Diff:
 a,b,c = map(int,input().split())
 if a<c<b:
     print("Yes")
     exit()
-elif b<a<c:
+elif b<c<a:
     print("Yes")
     exit()
 else:
     print("No")