Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))
 
position = 1
exp = [1]
count = 0
 
if n >= k:
  for i in range(k):
    position = a[position - 1]
  print(position)
else:
  for i in range(k):
    position = a[position - 1]
    count += 1
    if not position in exp:
      exp.append(position)
    else:
      break
  init = exp.index(position)
  res = (k - init) % (count - init)
  print(exp[init + res])

Fixed submission:
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))
 
position = 1
exp1 = [0] * n
exp1[0] = 1
exp = [1]
count = 0
 
if n >= k:
  for i in range(k):
    position = a[position - 1]
  print(position)
else:
  for i in range(k):
    position = a[position - 1]
    count += 1
    if exp1[position - 1] == 0:
      exp.append(position)
      exp1[position - 1] += 1
    else:
      break
  init = exp.index(position)
  res = (k - init) % (count - init)
  print(exp[init + res])

Buggy python submission (verdict: Runtime Error):
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))
 
position = 1
exp = [1]
count = 0
 
if n >= k:
  for i in range(k):
    position = a[position - 1]
  print(position)
else:
  for i in range(k):
    position = a[position - 1]
    count += 1
    if position in exp:
      exp.append(position)
    else:
      break
  init = exp.index(position)
  res = (k - init) % (count - init)
  print(exp[init + res])

Fixed submission:
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))
 
position = 1
exp1 = [0] * n
exp1[0] = 1
exp = [1]
count = 0
 
if n >= k:
  for i in range(k):
    position = a[position - 1]
  print(position)
else:
  for i in range(k):
    position = a[position - 1]
    count += 1
    if exp1[position - 1] == 0:
      exp.append(position)
      exp1[position - 1] += 1
    else:
      break
  init = exp.index(position)
  res = (k - init) % (count - init)
  print(exp[init + res])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))

position = 1
exp = [1]
count = 0

if n >= k:
  for i in range(k):
    position = a[position - 1]
  print(position)
else:
  for i in range(k):
    position = a[position - 1]
    count += 1
    if exp.count(position) == 0:
      exp.append(position)
    else:
      break
  init = exp.index(position)
  res = (k - init) % (count - init)
  print(exp[init + res])

Fixed submission:
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))
 
position = 1
exp1 = [0] * n
exp1[0] = 1
exp = [1]
count = 0
 
if n >= k:
  for i in range(k):
    position = a[position - 1]
  print(position)
else:
  for i in range(k):
    position = a[position - 1]
    count += 1
    if exp1[position - 1] == 0:
      exp.append(position)
      exp1[position - 1] += 1
    else:
      break
  init = exp.index(position)
  res = (k - init) % (count - init)
  print(exp[init + res])
Buggy python submission (verdict: Runtime Error):
n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = [0] * n

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    count[a[i] - 1] = 1
  if h[a[i] - 1] >= h[b[i] - 1]:
	count[b[i] - 1] = 1
      
print(count.count(0))

Fixed submission:
n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = [0] * n

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    count[a[i] - 1] = 1
  if h[a[i] - 1] >= h[b[i] - 1]:
    count[b[i] - 1] = 1
      
print(count.count(0))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = []

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    if count.count(a[i]) == 0:
      count.append(a[i])
  if h[a[i] - 1] >= h[b[i] - 1]:
    if count.count(b[i]) == 0:
      count.append(b[i])
      
print(n - len(count))

Fixed submission:
n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
  a0, b0 = list(map(int,input().split()))
  a.append(a0)
  b.append(b0)
  
count = [0] * n

for i in range(m):
  if h[a[i] - 1] <= h[b[i] - 1]:
    count[a[i] - 1] = 1
  if h[a[i] - 1] >= h[b[i] - 1]:
    count[b[i] - 1] = 1
      
print(count.count(0))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n):
  answer[a[i]] += 1
    
for i in range(n):
  print(answer[i])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n
 
for i in range(n):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n
 
for i in range(n):
  answer[a[i]] += 1
    
for i in range(n):
  print(answer[i])

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
 
for i in range(n):
	print(a.count(i + 1))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(int,input().split()))
 
for i in range(n):
	print(a.count(i + 1))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
 
for i in range(n):
	print(a.count(i + 1))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(int,input().split()))

for i in range(n):
	print(a.count(i + 1))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])
Buggy python submission (verdict: Runtime Error):
n = input()

for i in range(len(n)):
  if n[i] = '7':
    count += 1
    
if count > 0:
  print('Yes')
  
else:
  print('No')

Fixed submission:
n = input()
count = 0

for i in range(3):
  if n[i] == '7':
    count += 1
    
if count > 0:
  print('Yes')
  
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
 
k = int(input())
sum = 0
 
for a in range(k):
  for b in range(k):
    for c in range(k):
      sum += math.gcd(a + 1, math.gcd(b + 1, c + 1))
      
print(sum)

Fixed submission:
import math
 
k = int(input())
sum = 0
 
for a in range(k - 2):
  for b in range(a + 1, k - 1):
    for c in range(b + 1, k):
      sum += 6 * math.gcd(a + 1, math.gcd(b + 1, c + 1))
      
for a in range(k - 1):
  for b in range(a + 1, k):
    sum += 6 * math.gcd(a + 1, b + 1)
    
sum += k * (k + 1) // 2
      
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

answer = s.count('R') * s.count('G') * s.count('B')

for i in range(n - 2):
  j = 0
  while((i + 1) + (j - i) * 2 <= n):
    if s[i] != s[j] and s[j] != s[(i + 1) + (j - i) * 2] and s[i] != s[(i + 1) + (j - i) * 2]:
      answer -= 1
      j += 1

print(answer)

Fixed submission:
n = int(input())
s = input()
 
answer = s.count('R') * s.count('G') * s.count('B')

for i in range(n - 2):
  j = i + 1
  while((i + 1) + (j - i) * 2 <= n):
    if s[i] != s[j] and s[j] != s[i + (j - i) * 2] and s[i] != s[i + (j - i) * 2]:
      answer -= 1
    j += 1
 
print(answer)
Buggy python submission (verdict: Runtime Error):
k = input()
s = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(s[k - 1])

Fixed submission:
k = int(input())
s = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(s[k - 1])
Buggy python submission (verdict: Runtime Error):
h, w = list(map(int, input()))

if w % 2 == 0:
  print(h * 2 // 2)
else:
  if h % 2 == 0:
    print((w // 2 + w // 2 + 1) * h // 2)
  else:
    print((w // 2 + w // 2 + 1) * h // 2 + w // 2)

Fixed submission:
h, w = list(map(int, input().split()))
import sys

if w == 1 or h == 1:
  print('1')
  sys.exit()

if w % 2 == 0:
  print(h * w // 2)
else:
  if h % 2 == 0:
    print((w // 2 + w // 2 + 1) * h // 2)
  else:
    print((w // 2 + w // 2 + 1) * (h // 2) + w // 2 + 1)
Buggy python submission (verdict: Runtime Error):
a, b, c = list(map(int, input().split()))
import math

if math.sqrtl(a) + math.sqrtl(b) < math.sqrtl(c):
  print('Yes')
else:
  print('No')

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

if c - a - b > 0 and 4 * a * b < (c - a - b) ** 2:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()

count = len(s) / 2

if s == 'hi' * count:
  print('Yes')
else:
  print('No')

Fixed submission:
s = input()

count = len(s) // 2

if s == 'hi' * count:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
aa, bb, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = []
y = []
c = []
for i in range(m):
  x1, y1, c1 = list(map(int,input().split()))
  x.append(x1)
  y.append(y1)
  c.append(c1)

price = []
  
for i in range(m):
  price.append(a[x[i] - 1] + b[y[i] - 1] - c[i])
  
  
  
print(min(price, min(a) + min(b)))

Fixed submission:
aa, bb, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = []
y = []
c = []
for i in range(m):
  x1, y1, c1 = list(map(int,input().split()))
  x.append(x1)
  y.append(y1)
  c.append(c1)

price = []
  
for i in range(m):
  price.append(a[x[i] - 1] + b[y[i] - 1] - c[i])
  
  
  
print(min(min(price), min(a) + min(b)))

Buggy python submission (verdict: Time Limit Exceeded):
aa, bb, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = []
y = []
c = []
for i in range(m):
  x1, y1, c1 = list(map(int,input().split()))
  x.append(x1)
  y.append(y1)
  c.append(c1)

price = []
  
for i in range(aa):
  price1 = a[i] + min(b)
  price.append(price1)
  
for i in range(m):
  price.append(a[x[i] - 1] + b[y[i] - 1] - c[i])
  
print(min(price))

Fixed submission:
aa, bb, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = []
y = []
c = []
for i in range(m):
  x1, y1, c1 = list(map(int,input().split()))
  x.append(x1)
  y.append(y1)
  c.append(c1)

price = []
  
for i in range(m):
  price.append(a[x[i] - 1] + b[y[i] - 1] - c[i])
  
  
  
print(min(min(price), min(a) + min(b)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))
answer = 0

for i in range(N):
    if P[i] <= min(P[0: i + 1]):
        answer += 1
print(answer)


Fixed submission:
N = int(input())
P = list(map(int, input().split()))
answer = 0
minimum = P[0]

for i in range(N):
    if P[i] <= minimum:
        answer += 1
    minimum = min(P[i], minimum)
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))
answer = []

for i in range(N):
    if P[i] <= min(P[0: i + 1]):
        answer.append(i)
print(len(answer))

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
answer = 0
minimum = P[0]

for i in range(N):
    if P[i] <= minimum:
        answer += 1
    minimum = min(P[i], minimum)
print(answer)

Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))
answer = []
count = []

for i in range(N):
    if P[i] <= min(P[0, i + 1]):
        answer.append[i]
print(len(answer))

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
answer = 0
minimum = P[0]

for i in range(N):
    if P[i] <= minimum:
        answer += 1
    minimum = min(P[i], minimum)
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))
answer = []

for i in range(N):
    count = 0
    for j in range(i + 1):
        if P[i] <= P[j]:
            count += 1
    if count == i + 1:
        answer.append(i)
print(len(answer))


Fixed submission:
N = int(input())
P = list(map(int, input().split()))
answer = 0
minimum = P[0]

for i in range(N):
    if P[i] <= minimum:
        answer += 1
    minimum = min(P[i], minimum)
print(answer)

Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))
answer = []

for i in range(N):
    for j in range(i + 1):
        if P[i] <= P[j]:
            count += 1
    if count == i:
        answer.append(i)
print(answer.count())


Fixed submission:
N = int(input())
P = list(map(int, input().split()))
answer = 0
minimum = P[0]

for i in range(N):
    if P[i] <= minimum:
        answer += 1
    minimum = min(P[i], minimum)
print(answer)
Buggy python submission (verdict: Runtime Error):
x = int(input())
count = 0

from math import sqrt

while count == 0:
  k = 0
  for i in range(1, x):
    if x % i == 0:
      k += 1
  if k == 1:
    print(x)
    count = 1
  else:
    if x % 2 == 0:
	  x += 1
    else:
      x += 2

Fixed submission:
x = int(input())
count = 0

from math import sqrt

while count == 0:
  k = 0
  for i in range(1, x):
    if x % i == 0:
      k += 1
  if k == 1:
    print(x)
    count = 1
  else:
    if x % 2 == 0:
      x += 1
    else:
      x += 2

Buggy python submission (verdict: Runtime Error):
x = int(input())
count = 0

from math import sqrt

while count == 0:
	if x % 2 == 0:
      x += 1
	else:
      x += 2
    for i in range(1, round(sqrt(x)), 2):
      if x % i == 0:
        count = 1

Fixed submission:
x = int(input())
count = 0

from math import sqrt

while count == 0:
  k = 0
  for i in range(1, x):
    if x % i == 0:
      k += 1
  if k == 1:
    print(x)
    count = 1
  else:
    if x % 2 == 0:
      x += 1
    else:
      x += 2
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input().split()))

from math import gcd

print(A * B / gcd(A, B))

Fixed submission:
A, B = list(map(int, input().split()))
from fractions import gcd

print(A * B // gcd(A, B))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
brick = []
number = 1

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
brick = [0]
number = 1

import sys

if min(a) > 1:
  print('-1')
  sys.exit()

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
brick = list[]
number = 1

for i in range(N):
  if a[i] == number:
	brick.append(number)
    number += 1
print(N - max(brick))

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
brick = [0]
number = 1

import sys

if min(a) > 1:
  print('-1')
  sys.exit()

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
count = 0
number = 1

for i in range(N):
  if a[i] == number:
    for j in range(i):
      count += 1
      a.pop[number - 1]
    number += 1
print(count)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
brick = [0]
number = 1

import sys

if min(a) > 1:
  print('-1')
  sys.exit()

for i in range(N):
  if a[i] == number:
    brick.append(number)
    number += 1
print(N - max(brick))
Buggy python submission (verdict: Runtime Error):
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
else S == 'SUT':
    print('1')

Fixed submission:
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
else:
    print('1')

Buggy python submission (verdict: Runtime Error):
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
else S == 'SUT':
    print('1')

Fixed submission:
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'THU':
    print('3')
elif S == 'FRI':
    print('2')
else:
    print('1')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if N % 2 == 0 and S[0:N / 2] == S[N / 2 + 1:N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:round(N / 2)] == S[round(N / 2):N]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:N / 2] == S[N / 2 + 1:N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:round(N / 2)] == S[round(N / 2):N]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0, N / 2] == S[N / 2 + 1, N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:round(N / 2)] == S[round(N / 2):N]:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if N % 2 == 0 and S[0, N / 2] == S[N / 2 + 1, N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:round(N / 2)] == S[round(N / 2):N]:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if N % 2 == 0 and S[0, N / 2] = S[N / 2, N - 1]:
    print('Yes')
else:
    print('No')

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

if N % 2 == 0 and S[0:round(N / 2)] == S[round(N / 2):N]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A <= 9 and B <= 9:
  print(A * B)
else:
  print('-1')

Fixed submission:
A = list(map(int, input().split()))

if A[0] <= 9 and A[1] <= 9:
  print(A[0] * A[1])
else:
  print('-1')
Buggy python submission (verdict: Runtime Error):
N = int(input())

for i in range(9):
  for j in range(9):
    if N == i * j:
      print('Yes')
      return
print('No')

Fixed submission:
import sys

N = int(input())

for i in range(9):
  for j in range(9):
    if N == (i + 1) * (j + 1):
      print('Yes')
      sys.exit()
print('No')
Buggy python submission (verdict: Runtime Error):
import math

c = list(map(float, input().split()))
a = c[0]
b = c[1]
x = c[2]
if x <= a * a * b / 2.0:
  print(90.0 - math.atan((x / a * 2.0 / b) / b) * 180.0 / math.pi)
else:
  print(math.atan(((a * a * b - x) / a * 2.0 / a) / a) * 180.0 / math.pi)

Fixed submission:
import math

N = int(input())
a = N + 1
b = round(math.sqrt(N))

for i in range(b):
  j = i + 1
  if N % j == 0:
    if a > j + N / j:
      a = j + N / j
print(round(a) - 2)

Buggy python submission (verdict: Runtime Error):
import math
import sys

N = int(input())

for i in reversed(range(int(math.sqrt(N)))):
  if N % i == 0:
    print(i + N / i)
    sys.exit()

Fixed submission:
import math

N = int(input())
a = N + 1
b = round(math.sqrt(N))

for i in range(b):
  j = i + 1
  if N % j == 0:
    if a > j + N / j:
      a = j + N / j
print(round(a) - 2)
Buggy python submission (verdict: Runtime Error):
A = int(input(stdin))
B = int(input(stdin))
 
if(A > 2 * B):
  print(A - 2 * B)
else:
  print("0")

Fixed submission:
A, B = map(int,input().split())
 
if(A > 2 * B):
  print(A - 2 * B)
else:
  print("0")

Buggy python submission (verdict: Runtime Error):
int A = input(stdin)
int B = input(stdin)
 
if(A > 2 * B):
  print(A - 2 * B)
else:
  print("0")

Fixed submission:
A, B = map(int,input().split())
 
if(A > 2 * B):
  print(A - 2 * B)
else:
  print("0")

Buggy python submission (verdict: Runtime Error):
int A = input(stdin)
int B = input(stdin)

if(A > 2 * B):
  return A - 2 * B
else:
  return 0

Fixed submission:
A, B = map(int,input().split())
 
if(A > 2 * B):
  print(A - 2 * B)
else:
  print("0")
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = map(int, input().split())
sum = 0

for i in range(N):
  for j in range(i+1):
    sum += d(i) * d(j)
    
print(sum)

Fixed submission:
N = int(input())
d = list(map(int, input().split()))
s = 0

for i in range(N):
  for j in range(i+1):
    if i != j:
      s += d[i]* d[j]
    
print(s)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input().split())
d = S[0]

for i in range(1, N):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))

Fixed submission:
N = int(input())
S = input()
d = S[0]

for i in range(1, N):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input().split())
d = S[0]

for i in range(1, N-1):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))

Fixed submission:
N = int(input())
S = input()
d = S[0]

for i in range(1, N):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input().split()
d = S[0]

for i in range(1, N-1):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))

Fixed submission:
N = int(input())
S = input()
d = S[0]

for i in range(1, N):
  if S[i] != S[i-1]:
    d = d + S[i]
    
print(len(d))