Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8

n, q = map(int, raw_input().split())
s = raw_input()
def f(a, b):
    return s[a-1:b].count("AC")
for i in range(q):
    a, b = map(int, raw_input().split())
    print(f(a, b))


Fixed submission:
#coding: utf-8
import bisect

n, q = map(int, raw_input().split())
s = raw_input()
i_list = []
i = -1
while True:
    i = s.find("AC", i+1)
    if(i == -1): break
    i_list.append(i)
for i in range(q):
    a, b = map(int, raw_input().split())
    a = bisect.bisect_left(i_list, a-1)
    b = bisect.bisect_left(i_list, b-1)
    print(b-a)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8

n, q = map(int, raw_input().split())
s = raw_input()
for i in range(q):
    a, b = map(int, raw_input().split())
    print(s[a-1:b].count("AC"))


Fixed submission:
#coding: utf-8
import bisect

n, q = map(int, raw_input().split())
s = raw_input()
i_list = []
i = -1
while True:
    i = s.find("AC", i+1)
    if(i == -1): break
    i_list.append(i)
for i in range(q):
    a, b = map(int, raw_input().split())
    a = bisect.bisect_left(i_list, a-1)
    b = bisect.bisect_left(i_list, b-1)
    print(b-a)
Buggy python submission (verdict: Runtime Error):

#coding: utf-8
import numpy as np
import math
from functools import reduce

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

y = np.asarray(list(map(int,input().split())))
y -= x

print(reduce(math.gcd, y))


Fixed submission:

#coding: utf-8
import numpy as np
from functools import reduce

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

y = np.asarray(list(map(int,input().split())))
y -= x
y = map(abs,y)

print(reduce(gcd, y))

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
import numpy as np
import fraction
from functools import reduce

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

y = np.asarray(list(map(int,input().split())))
y -= x

print(reduce(fraction.gcd, y))



Fixed submission:

#coding: utf-8
import numpy as np
from functools import reduce

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

y = np.asarray(list(map(int,input().split())))
y -= x
y = map(abs,y)

print(reduce(gcd, y))
Buggy python submission (verdict: Runtime Error):
#coding: utf-8

a = int(raw_input())
b = int(raw_input())

print (a-1)*(b-1)



Fixed submission:
#coding: utf-8

a,b = map(int,raw_input().split())

print (a-1)*(b-1)
Buggy python submission (verdict: Runtime Error):
s=input()

le=0
i=0
while(i<len(s)):
    l=0
    while(s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T'):
        l+=1
        i+=1

    if(l>le):
        le=l
    l=0
    i+=1
print(le)

Fixed submission:
s=input()

le=0

i=0
while(i<len(s)):
    l=0
    while(i<len(s) and (s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T')):
        l+=1
        i+=1

    if(l>le):
        le=l
    l=0
    i+=1
print(le)
Buggy python submission (verdict: Runtime Error):
print(n / 3)


Fixed submission:
n = int(input())
print(int(n / 3))
Buggy python submission (verdict: Runtime Error):
import sys 

line = sys.stdin
line = line.strip()
start = line[0]
end = line[-1]
print('%s%d%s'%(start, len(line) - 2, end))
  

Fixed submission:
import sys 

line = sys.stdin.read()
line = line.strip()
start = line[0]
end = line[-1]
print('%s%d%s'%(start, len(line) - 2, end))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import datetime
 
i = stdin.readline().strip()
d = map(int, i.split("/"))
print("Heisei" if d <= (2019,4,30) else "TBD")


Fixed submission:
from sys import stdin
 
i = stdin.readline().strip()
d = tuple(map(int, i.split("/")))
print("Heisei" if d <= (2019,4,30) else "TBD")

Buggy python submission (verdict: Runtime Error):
from sys import stdin
import datetime

i = stdin.readline().strip()
d = datetime.date.fromisoformat("-".join(i.split("/")))
print("Heisei" if d < datetime.date.fromisoformat("2019-04-30") else "TBD")


Fixed submission:
from sys import stdin
 
i = stdin.readline().strip()
d = tuple(map(int, i.split("/")))
print("Heisei" if d <= (2019,4,30) else "TBD")

Buggy python submission (verdict: Runtime Error):
from sys import stdin

i = stdin.readline().strip()
d = datetime.date.fromisoformat("-".join(i.split("/")))
print("Heisei" if d < datetime.date.fromisoformat("2019-04-30") else "TBD")

Fixed submission:
from sys import stdin
 
i = stdin.readline().strip()
d = tuple(map(int, i.split("/")))
print("Heisei" if d <= (2019,4,30) else "TBD")

Buggy python submission (verdict: Runtime Error):
import pandas as pd
from sys import stdin

d = pd.to_datetime( stdin.readline().strip() )
print("TBD" if (d > pd.to_datetime("2019/4/30")) else "Heisei")


Fixed submission:
from sys import stdin
 
i = stdin.readline().strip()
d = tuple(map(int, i.split("/")))
print("Heisei" if d <= (2019,4,30) else "TBD")

Buggy python submission (verdict: Runtime Error):
INF = int(1e18)

def compute():
    from sys import stdin
    A, B, Q = list(map(int, stdin.readline().split()))
    s = sorted(int(stdin.readline().split()[0]) for _ in range(A))
    t = sorted(int(stdin.readline().split()[0]) for _ in range(B))

    from bisect import bisect_left
    for _ in range(Q):
        x = int(stdin.readline().split()[0])

        i1 = bisect_left(s, x)
        i1 = i1 if i1 < A else i1-1
        i2 = i1-1 if (i1>0) and s[i1]!=x else i1

        res = INF
        for y in set((s[i1], s[i2])):
            j1 = bisect_left(t, y)
            j1 = j1 if (j1 < B) else j1-1
            j2 = j1-1 if (j1 > 0) and t[j1]!=y else j1
            for z in set((t[j1],t[j2])):
                # print(x, y, z)
                res = min(res, abs(x-y) + abs(y-z), abs(x-z) + abs(z-y))

        print(res)


if __name__ == "__main__":
    compute()


Fixed submission:
from sys import stdin
 
i = stdin.readline().strip()
d = tuple(map(int, i.split("/")))
print("Heisei" if d <= (2019,4,30) else "TBD")

Buggy python submission (verdict: Runtime Error):
import pandas as pd
from sys import stdin

d = pd.to_datetime( stdin.readline().strip() )
print("TBD" if (d.gt(pd.to_datetime("2019/4/30"))) else "Heisei")


Fixed submission:
from sys import stdin
 
i = stdin.readline().strip()
d = tuple(map(int, i.split("/")))
print("Heisei" if d <= (2019,4,30) else "TBD")
Buggy python submission (verdict: Runtime Error):
from math import gcd

def solve(): 
  N = int(input().strip())
  o = 0
  for i in map(int, input().split()):
    o = gcd(o,i)
  print(o)

if __name__=="__main__":
  solve()


Fixed submission:
def solve():
  def gcd(x, y):
   while(y): 
       x, y = y, x % y 
   return x

  N = int(input().strip())
  o = 0
  for i in map(int, input().split()):
    o = gcd(i,o)
  print(o)

if __name__=="__main__":
  solve()

Buggy python submission (verdict: Runtime Error):
from math import gcd

N = int(input().strip())
o = 0
for i in map(int, input().split()):
	o = gcd(o,i)
print(o)


Fixed submission:
def solve():
  def gcd(x, y):
   while(y): 
       x, y = y, x % y 
   return x

  N = int(input().strip())
  o = 0
  for i in map(int, input().split()):
    o = gcd(i,o)
  print(o)

if __name__=="__main__":
  solve()
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = input().split(" ")
c = [10 ** 7 for i in range(N)]
c[0] = 0
c[1] = abs(int(H[0])-int(H[1]))
for i in range(N-2):
  c[i+2] = min(c[i]+abs(H[i]-H[i+2]),c[i+1]+abs(H[i+1]-H[i+2]))
print(c[len(c)-1])

Fixed submission:
N = int(input())
H = input().split(" ")
c = [10 ** 7 for i in range(N)]
c[0] = 0
c[1] = abs(int(H[0])-int(H[1]))
for i in range(N-2):
  c[i+2] = min(c[i]+abs(int(H[i])-int(H[i+2])),c[i+1]+abs(int(H[i+1])-int(H[i+2])))
print(c[len(c)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = input().split(" ")
c = [10 ** 7 for i in range(N)]
c[0] = 0
c[1] = abs(int(h[0])-int(h[1]))
for i in range(N-2):
  c[i+2] = min(c[i]+abs(H[i]-H[i+2]),c[i+1]+abs(H[i+1]-H[i+2])
print(c[-1])

Fixed submission:
N = int(input())
H = input().split(" ")
c = [10 ** 7 for i in range(N)]
c[0] = 0
c[1] = abs(int(H[0])-int(H[1]))
for i in range(N-2):
  c[i+2] = min(c[i]+abs(int(H[i])-int(H[i+2])),c[i+1]+abs(int(H[i+1])-int(H[i+2])))
print(c[len(c)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = input().split(" ")
height = 0
dp = [[0 for i in range(10`**4)] for n in range(N)]
def rec(n,h,cost):
  if n == N:
    return cost
  elif dp[n][h] != 0:
    return dp[n][h]
  else:
    dp[n][h] = min(rec(n+1,H[h+1],cost + abs(h-H[h+1])),rec(n+2,H[h+2],cost + abs(h-H[h+2])))
	return dp[n][h]
print(rec(0,H[0],0))

Fixed submission:
N = int(input())
H = input().split(" ")
c = [10 ** 7 for i in range(N)]
c[0] = 0
c[1] = abs(int(H[0])-int(H[1]))
for i in range(N-2):
  c[i+2] = min(c[i]+abs(int(H[i])-int(H[i+2])),c[i+1]+abs(int(H[i+1])-int(H[i+2])))
print(c[len(c)-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
pow = 1
for i in range(1,N+1):
        pow = pow*i10**9+7
print(pow)

Fixed submission:
N = int(input())
pow = 1
num = 10**9+7
for i in range(1,N+1):
        pow = pow*i%num
print(pow%num)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
pow = 1
for i in range(1,N+1):
        pow = pow*i
num = 10**9+7
print(pow%num)

Fixed submission:
N = int(input())
pow = 1
num = 10**9+7
for i in range(1,N+1):
        pow = pow*i%num
print(pow%num)
Buggy python submission (verdict: Runtime Error):
seven = 0
five = 0

A,B,C = map(int,input().split())
if A == 7:
    seven += 1
elif A == 5:
    five += 1
if B == 7:
    seven += 1
elif B == 5:
    five += 1
if C == 7:
    seven += 1
elif C == 5:
    five += 1
    
if seven == 1 or five == 2:
    print("YES")
else:
    print("NO")

Fixed submission:
seven = 0
five = 0

A,B,C = map(int,input().split())
if A == 7:
    seven += 1
elif A == 5:
    five += 1
if B == 7:
    seven += 1
elif B == 5:
    five += 1
if C == 7:
    seven += 1
elif C == 5:
    five += 1
    
if seven == 1 or five == 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
print(min([S[:i].count('W') + S[i+1:].count('E') for i in range(N)]))


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

def f(S):
  count = {'W': 0, 'E': 0}
  yield count['W'], count['E']
  for c in S:
    count[c] += 1
    yield count['W'], count['E']

count = list(f(S))
print(min([count[i-1][0] + count[-1][1] - count[i][1] for i in range(1, N+1)]))
Buggy python submission (verdict: Runtime Error):
import numpy as np
 
H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)])

for i in range(H):
  for j in range(W):
    if S[i, j] == '#':
      if np.sum(np.concatenate(S[i-1:i, j], S[i, j-1:j], S[i+1:i, j], S[i, j+1:j]) == '#') == 0:
        print('No')
        break
else:
  print('Yes')

Fixed submission:
import numpy as np
import itertools
 
H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)])

def f(H, W, S):
  for i, j in itertools.product(range(H), range(W)):
    if S[i, j] == '#':
      if np.sum(np.concatenate([S[i-1:i, j], S[i, j-1:j], S[i+1:i+2, j], S[i, j+1:j+2]]) == '#') == 0:
        return False
  return True

if f(H, W, S):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

import itertools
print(len([c for c in set(map(tuple, itertools.chain.from_iterable(itertools.combinations(itertools.chain(itertools.repeat(500, A), itertools.repeat(100, B), itertools.repeat(50, C)), r) for r in range(A + B + C + 1)))) if sum(c) == X]))

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

import itertools
print(len([total for total in map(sum, itertools.product(
    [500 * i for i in range(A + 1)],
    [100 * i for i in range(B + 1)],
    [50 * i for i in range(C + 1)],
)) if total == X]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
 
count = 0
while True:
  A, mod = zip([divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count += 1
print(count)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
count = 0
while True:
  A, mod = zip(*[divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

count = 0
while True:
  A, mod = zip([divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count += 1
print(count)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
count = 0
while True:
  A, mod = zip(*[divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

count = 0
while True:
  A, mod = zip([divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count++
print(count)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
count = 0
while True:
  A, mod = zip(*[divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import numpy as np

H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)])

for i in range(H):
  for j in range(W):
    if S[i, j] == '.':
      S[i, j] = dict(zip(*np.unique(S[max(i-1, 0):i+2, max(j-1, 0):j+2], return_counts=True)))['#']
for s in S:
  print(''.join(s))

Fixed submission:
import numpy as np
from collections import defaultdict
 
H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)])
 
for i in range(H):
  for j in range(W):
    if S[i, j] == '.':
      d = defaultdict(int)
      S[i, j] = np.sum(S[max(i-1, 0):i+2, max(j-1, 0):j+2] == '#')
for s in S:
  print(''.join(s))
Buggy python submission (verdict: Runtime Error):
import numpy as np

A, B, C, D = map(int, input().split())
x = zip(*sorted(zip([A, B, C, D], [1, -1, 1, -1])))
if x[1][1] == 1:
  print(x[2][0] - x[1][0])
else:
  print(0)


Fixed submission:
import numpy as np

A, B, C, D = map(int, input().split())
x, y = zip(*sorted(zip([A, B, C, D], [1, -1, 1, -1])))
z = np.diff(x)[np.cumsum(y)[:-1] == 2]
print(z[0] if len(z) == 1 else 0)

Buggy python submission (verdict: Runtime Error):
import numpy as np

A, B, C, D = map(int, input().split())
x, y = zip(*sorted(zip([A, B, C, D], [1, -1, 1, -1])))
print(np.diff(x)[np.cumsum(y)[:-1] == 2][0])

Fixed submission:
import numpy as np

A, B, C, D = map(int, input().split())
x, y = zip(*sorted(zip([A, B, C, D], [1, -1, 1, -1])))
z = np.diff(x)[np.cumsum(y)[:-1] == 2]
print(z[0] if len(z) == 1 else 0)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]

s = [1]
while True:
  a = A[s[-1] - 1]
  if a in s:
    print(-1)
    break
  if a == 2:
    print(len(s))
    break
  s.append(a)


Fixed submission:
import itertools

N = int(input())
A = [int(input()) for _ in range(N)]

a = 1
for i, _ in enumerate(range(N), 1):
  a = A[a - 1]
  if a == 2:
    break
if a == 2:
  print(i)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
import functools

N = int(input())
print(functools.reduce(lambda x, y: x * y % 1000000007, range(2, N+1)))


Fixed submission:
import functools

N = int(input())
print(functools.reduce(lambda x, y: x * y % 1000000007, range(1, N+1)))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

K, S = map(int, input().split())

print(sum([1 for xyz in itertools.product(range(K + 1), repeat=3) if sum(xyz) == S]))


Fixed submission:
K, S = map(int, input().split())

def f():
  if K * 3 >= S:
    for x in range(min(K, S), -1, -1):
      if K * 2 >= S - x:
        for y in range(min(K, S - x), -1, -1):
          if K >= S - x - y:
            yield 1

print(sum(list(f())))
Buggy python submission (verdict: Runtime Error):
S = input()
if (len(S) > 0) and (len(S.replace('eraser', '').replace('erase', '').replace('dreamer', '').replace('dream', '')) == 0):
print('YES')
else:
print('NO')


Fixed submission:
S = input()
if len(S) == 0:
  print('NO')
else:
  if len(S.replace('eraser', '').replace('erase', '').replace('dreamer', '').replace('dream', '')) == 0:
    print('YES')
  else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
S = input()
if len(S) > 0 and len(S.replace('eraser', '').replace('erase', '').replace('dreamer', '').replace('dream', '')) == 0:
print('YES')
else:
print('NO')


Fixed submission:
S = input()
if len(S) == 0:
  print('NO')
else:
  if len(S.replace('eraser', '').replace('erase', '').replace('dreamer', '').replace('dream', '')) == 0:
    print('YES')
  else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input().split(' ')
b = []
for i in xrange(n):
    b.append(a[i])
    b = b[::-1]
print(' '.join(b))

Fixed submission:
n = int(input())
a = input().split(' ')
b = []
inds = [0] * n

for i in range(int(n/2)):
    inds[i] = n-2*i
    inds[n-1-i] = n-2*i-1
if n % 2 == 1:
    inds[int(n/2)] = n-2*int(n/2)

for i, ind in enumerate(inds):
    print(a[ind-1], end="")
    if i != n-1:
        print(' ', end="")
print('')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split(' ')
b = []
for i in range(n):
    b.append(a[i])
    b = b[::-1]
print(' '.join(b))

Fixed submission:
n = int(input())
a = input().split(' ')
b = []
inds = [0] * n

for i in range(int(n/2)):
    inds[i] = n-2*i
    inds[n-1-i] = n-2*i-1
if n % 2 == 1:
    inds[int(n/2)] = n-2*int(n/2)

for i, ind in enumerate(inds):
    print(a[ind-1], end="")
    if i != n-1:
        print(' ', end="")
print('')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
i = 1
count = 0

while True:
    i = a[i-1]
    count += 1
    if i == 1:
        print(-1)
        break
    elif i == 2:
        print(count)
        break

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
i = 1
count = 0

while True:
    i = a[i-1]
    count += 1
    if i == 1 or count == n+1:
        print(-1)
        break
    elif i == 2:
        print(count)
        break
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
K = int(input())
subs = []
for i in range(0, len(s)):
    for j in range(i+1, len(s)+1):
        if i == j:
            subs.append(s[i])
        else:
            subs.append(s[i:j])
subs = list(set(subs))
subs.sort()
print(subs[K-1])


Fixed submission:
s = input()
K = int(input())
subs = []
for i in range(0, len(s)):
    for j in range(i+1, i+K+1):
        if i == j:
            subs.append(s[i])
        else:
            subs.append(s[i:j])
subs = list(set(subs))
subs.sort()
print(subs[K-1])
Buggy python submission (verdict: Time Limit Exceeded):
import copy


def sumPrice(N, B):
    sum = 0
    for i in range(1, N):
        sum += abs(B[i] - B[i - 1])
    sum += abs(B[N-1] - B[0])
    return sum


N = int(input())
A = []
A = [int(i) for i in input().split()]
A.insert(0, 0)
for i in range(1, N + 1):
    B = copy.deepcopy(A)
    del B[i]
    print(sumPrice(N, B))


Fixed submission:
import copy

"""
def sumPrice(N, B):
    sum = 0
    for i in range(1, N):
        sum += abs(B[i] - B[i - 1])
    sum += abs(B[N-1] - B[0])
    return sum


N = int(input())
A = []
A = [int(i) for i in input().split()]
A.insert(0, 0)
for i in range(1, N + 1):
    B = copy.deepcopy(A)
    del B[i]
    print(sumPrice(N, B))
"""
N = int(input())
A = []
A = [int(i) for i in input().split()]
A.insert(0, 0)
A.insert(N+1, 0)

defSumPrice = 0
for i in range(1, N + 2):
    defSumPrice += abs(A[i - 1] - A[i])

for i in range(1, N + 1):  # A[i] に行かない
    sumPrice = 0
    if (A[i - 1] < A[i] and A[i+1] < A[i])or(A[i - 1] > A[i] and A[i+1] > A[i]):
        if abs(A[i] - A[i - 1]) > abs(A[i] - A[i + 1]):
            sumPrice = defSumPrice - 2 * abs(A[i] - A[i + 1])
        else:
            sumPrice = defSumPrice-2*abs(A[i]-A[i-1])
    else:
        sumPrice = defSumPrice
    print(sumPrice)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(raw_input())
a=map(int,raw_input().split())
b=[]
for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.insert(0, a[i])
if n%2==1:
    b.reverse()
c=map(str,b)
print ' '.join(c)

Fixed submission:
n=int(raw_input())
a=map(int,raw_input().split())

for i in range((n+1)/2):
    print a[n-2*i-1],
for i in range(n/2):
    print a[i*2+n%2],
print ''

Buggy python submission (verdict: Time Limit Exceeded):
n=int(raw_input())
a=map(int,raw_input().split())
b=[]
for i in range(n):
    b.append(a[i])
    b.reverse()
c=map(str,b)
print ' '.join(c)

Fixed submission:
n=int(raw_input())
a=map(int,raw_input().split())

for i in range((n+1)/2):
    print a[n-2*i-1],
for i in range(n/2):
    print a[i*2+n%2],
print ''
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
a=int(a)
b=int(b)
if a>0:
    print("positive")
elif a ==0 or b==0:
   print(0)
elif a  <0 and b>0:
    print(0)
elif (b-a)%2==0:
    print('negative')
else:
    print("positibe")

Fixed submission:
a, b = map(int,input().split())
if a <= 0 <= b:
    print("Zero")
elif a > 0:
    print("Positive")
elif (b-a) % 2 == 0:
    print("Negative")
else:
    print("Positive")
Buggy python submission (verdict: Runtime Error):
l = int(input())
edge = []
for i in range(1, 19):
    edge.append((i, i + 1, 1 << (i - 1)))
    edge.append((i, i + 1, 0))
sm = 0
for i in range(19, 0, -1):
    v = 1 << (i - 1)
    while l >= v:
        edge.append((i, 20, sm))
        sm += v
        l -= v
print(20, len(edge))
for x, y, z in edge:
    print(x, y, z)

Fixed submission:
n, k = map(int, input().split())
ans = (n // k) ** 3
if (k & 1) == 0:
    ans += ((n + k // 2) // k) ** 3
print(ans)
Buggy python submission (verdict: Runtime Error):
def Ask(x):
    return sum(int(c) for c in str(x))

def Check(x, y):
    return x * Ask(y) > y * Ask(x)

k = int(input())
no = st = 1
for i in range(k):
    print(no)
    if (Check(no + st, no + st * 10)): st *= 10
    no += st

Fixed submission:
n, k = map(int, input().split())
print((n - 2) // (k - 1) + 1)

Buggy python submission (verdict: Runtime Error):
def Ask(x):
    ans = 0
    while (x):
        ans += x % 10
        x //= 10
    return ans

def Check(x, y):
    return x * Ask(y) > y * Ask(x)


k = int(input())
no = st = 1
while (k):
    k -= 1
    print(no)
    if (Check(no + st, no + st * 10)): st *= 10
    no += st

Fixed submission:
n, k = map(int, input().split())
print((n - 2) // (k - 1) + 1)
Buggy python submission (verdict: Runtime Error):
from math import gcd
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = a[0]
for x in a:
    g = gcd(g, x)
print(("IMPOSSIBLE", "POSSIBLE")[int(k <= max(a) and k % g == 0)])


Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

n, k = map(int, input().split())
a = list(map(int, input().split()))
g = a[0]
for x in a:
    g = gcd(g, x)
print(("IMPOSSIBLE", "POSSIBLE")[k <= max(a) and k % g == 0])

Buggy python submission (verdict: Runtime Error):
from math import gcd
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = 0
for x in a:
    g = gcd(g, x)
print(("IMPOSSIBLE", "POSSIBLE")[k <= max(a) and k % g == 0])

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

n, k = map(int, input().split())
a = list(map(int, input().split()))
g = a[0]
for x in a:
    g = gcd(g, x)
print(("IMPOSSIBLE", "POSSIBLE")[k <= max(a) and k % g == 0])

Buggy python submission (verdict: Runtime Error):
from math import gcd
n, k = map(int, input().split())
a = list(map(int, input().split()))
g = 0
for x in a:
    g = gcd(g, x)
print(k <= max(a) and k % g == 0 and "POSSIBLE" or "IMPOSSIBLE")

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

n, k = map(int, input().split())
a = list(map(int, input().split()))
g = a[0]
for x in a:
    g = gcd(g, x)
print(("IMPOSSIBLE", "POSSIBLE")[k <= max(a) and k % g == 0])