Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
ex_t, ex_x, ex_y = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-ex_x) + abs(y-ex_y) <= abs(t-ex_t) and t%2 = (x+y)%2:
        count += 1
    ex_t, ex_x, ex_y = t, x, y
print("Yes" if count == N else "No")

Fixed submission:
N = int(input())
ex_t, ex_x, ex_y = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-ex_x) + abs(y-ex_y) <= abs(t-ex_t) and t%2 == (x+y)%2:
        count += 1
    ex_t, ex_x, ex_y = t, x, y
print("Yes" if count == N else "No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
ex_t, ex_x, ex_y = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-ex_x) + abs(y-ex_y) <= abs(t-ex_t) and t%2 = (x+y)%2:
        count += 1
    ex_t, ex_x, ex_y = t, x, y
print('Yes' if count == N else 'No')

Fixed submission:
N = int(input())
ex_t, ex_x, ex_y = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-ex_x) + abs(y-ex_y) <= abs(t-ex_t) and t%2 == (x+y)%2:
        count += 1
    ex_t, ex_x, ex_y = t, x, y
print("Yes" if count == N else "No")
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
sum = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        sum += num
print(sum)

Fixed submission:
N, A, B = map(int, input().split())
res = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        res += num
print(res)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
sum = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        sum += 1
print(sum)

Fixed submission:
N, A, B = map(int, input().split())
res = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        res += num
print(res)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int(input().split()))
sum = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        sum += 1
print(sum)

Fixed submission:
N, A, B = map(int, input().split())
res = 0
for num in range(N + 1):
    if A <= sum([int(x) for x in str(num)]) <= B:
        res += num
print(res)
Buggy python submission (verdict: Runtime Error):
a = input()
print(a.count(1))

Fixed submission:
a = input()
print(a.count("1"))
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = [int(input()) for i in range(N)]
index = 0
count = 0
for j in range(N):
    index = l[index]
    count += 1
    if index == 2:
        print(count)
        exit()
print(-1)

Fixed submission:
N = int(input())
l = [int(input()) for i in range(N)]
index = 0
count = 0
for j in range(N):
    index = l[index] - 1
    count += 1
    if index == 1:
        print(count)
        exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
import fractions

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(fractions.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

X = int(input())

if is_prime(X):
    print(X)
    exit()
if X % 2 == 0:
    X += 1
while (1):
    if is_prime(X):
        print(X)
        break
    X += 2

Fixed submission:
def sqrt(x):
    return x ** (.5)

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

X = int(input())

if is_prime(X):
    print(X)
    exit()
if X % 2 == 0:
    X += 1
while (1):
    if is_prime(X):
        print(X)
        break
    X += 2
Buggy python submission (verdict: Runtime Error):
import fractions

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

print((x * y) // fractions.gcd(x, y))

Fixed submission:
import fractions

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

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

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(A, B))

Fixed submission:
import fractions

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

print((A * B) // fractions.gcd(A, B))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input())

while True:
    count = 0
    for i in range(len(S) - 1):
        if S[i] == S[i + 1]:
            S.pop(i)
            count += 1
            break
    if count == 0:
        break

print(len(S))

Fixed submission:
import itertools

N = int(input())
S = list(input())

print(len([k for k, v in itertools.groupby(S)]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [list(map(int,input().split())) for i in range(n)]


a = p[0]
b = 0
ans  = 0
tf = 1

for j in range(n):
  if sum(p[j]) // 2 *2 ==sum(p[j]):
    ans += 1
  else:
    ans = 0
  if ans ==3:
    tf = 0
    print("Yes")
    break
    
if tf == 1:
  print("No")

Fixed submission:
s = input()
 
if s[-1] == "s":
  print(s + "es")
else:
  print(s + "s")

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

if s[-1] = "s":
  print(s + "es")
else:
  print(s + "s")

Fixed submission:
s = input()
 
if s[-1] == "s":
  print(s + "es")
else:
  print(s + "s")
Buggy python submission (verdict: Runtime Error):
s = str(input())

if s = "ABC":
  print("ARC")
else:
  print("ABC")

Fixed submission:
s = str(input())

if s == "ABC":
  print("ARC")
else:
  print("ABC")
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())

aoki = c
takahashi = a

for i in range(101):
  if takahashi - d > 0: 
    if aoki - b =< 0: #高橋勝ち
      print("Yes")
      break
    else: #戦闘続く
      takahashi = takahashi - d
      aoki = aoki - c
      continue
  else: #高橋負け
    print("No")
    break

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

aoki = c
takahashi = a

for i in range(101):
  if aoki - b > 0: #高橋の攻撃
    if takahashi - d <= 0: #青木の攻撃で高橋負け
      print("No")
      break
    else: #戦闘続く
      takahashi = takahashi - d
      aoki = aoki - b
      continue
  else: #高橋勝ち
    print("Yes")
    break
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())

newn = abs(n-k)

while n > newn:
  n = newn
  newn = abs(n-k)
else:
  print(n)

Fixed submission:
n,k = map(int,input().split())
a = n % k
b = k - a
print(min(a,b))
Buggy python submission (verdict: Runtime Error):
M, N = map(int,input().split())

if M == 1 or N == 1:
  print(1)
  break
  if M * N % 2 == 1:
    print(M * N // 2 + 1)
  elif M*  N % 2 == 0:
    print(M * N // 2)


Fixed submission:
M, N = map(int,input().split())

if M == 1 or N == 1:
  print(1)
elif M * N % 2 == 1:
    print(M * N // 2 + 1)
elif M*  N % 2 == 0:
    print(M * N // 2)

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

if M*N % 2 == 1:
  print(M*N // 2 + 1)
elif M*N % 2 == 0:
  print(M*N // 2)
else M == 1 or N == 1:
  print(0)

Fixed submission:
M, N = map(int,input().split())

if M == 1 or N == 1:
  print(1)
elif M * N % 2 == 1:
    print(M * N // 2 + 1)
elif M*  N % 2 == 0:
    print(M * N // 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N % 2 == 1
print(N // 2 + 1)
else 
print(N // 2)

Fixed submission:
N = int(input())

if N % 2 == 1:
	print(N // 2 + 1)
else:
	print(N // 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')


Fixed submission:
input_int = input()

if input_int <= 100 and input_int >= 1:
	print(int(input_int) * int(input_int))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input().split() for i in range(N)]
T = S[0:N / 2 - 1]

if N >= 1 and N <=100:
	def S.islower():
	if True and T + T in s:
    	print('Yes')
    else:
  		print('No')

Fixed submission:
input_int = input()

if input_int <= 100 and input_int >= 1:
	print(int(input_int) * int(input_int))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input().split() for i in range(N)]
T = S[0:N / 2 - 1]
 
if N >= 1 and N <=100:
	def S.islower():
	if True and T + T in s:
    	print('Yes')
    else:
  		print('No')

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

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')

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

if N >= 1 and N <=100:
	def S.islower():
	if True:
      T = S[0:N / 2 - 1]
    else:
 
if (T + T in s):
  print('Yes')
else:
  print('No')

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

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input().split() for i in range(N)]

if N >= 1 and N <=100:
	def S.islower():
	if True:
      T = S[0:N / 2 - 1]
    else:

if (T + T in s):
  print('Yes')
else:
  print('No')


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

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input().split() for i in range(N)]

if N >= 1 and N <=100:
	def S.islower():
	if True:
      T = S[0:N / 2 - 1]
    else:

if (T + T in s):
  print('Yes')
else:
  print('No')


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

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')

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

T = S[0:N / 2 - 1]

if (T + T in s):
 print('Yes')
  
else:
 print('No')


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

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')

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

T = S[0:N / 2 - 1]

if (T + T in s):
 print('Yes')
  
else:
 print('No')

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

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
list = []

for i in range(n+1): #nまでの数字について扱うよ
  for j in range(n): #それぞれの数字が割り切れなくなるまで割るよ
    if j % 2 != 1:
      j = j % 2
      cnt += 1
      continue
    else:
      list.append(j)
      
print(list.index(max(list))

Fixed submission:
n = int(input())
list = [2**i for i in range(7)]

ans = 1

for k in list:
  if k <= n:
    ans = k
    if ans == 64:
      print(ans)
      break
    else:
      continue
  else:
    print(ans)
    break
Buggy python submission (verdict: Runtime Error):
s = list(str(input()))

s_rev = list(reversed(s))
n = len(s_rev)

for i in range(len(s_rev)):
  del s_rev[0]
    if len(s_rev) % 2 == 1:
      continue
    elif s[0:len(s_rev) // 2] != s[len(s_rev) // 2:len(s_rev)]:
      continue  
    elif len(s_rev) != 0:
      print(len(s_rev))
    

Fixed submission:
s = list(str(input()))

s_rev = list(reversed(s))
n = len(s_rev)

for i in range(n):
  del s_rev[0]
  if len(s_rev) % 2 == 1:
    continue
  elif s[0:len(s_rev)// 2] != s[(len(s_rev) // 2):len(s_rev)]:
    continue  
  elif len(s_rev) != 0:
    print(len(s_rev))
    break
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
s = str(input())

passed = []

for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and passed.count("b") < B:
    passed.append(s[i])
    print("Yes")
  else:
    print("No")

Fixed submission:
N, A, B = map(int, input().split())
s = str(input())

passed = []
count = 0
for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and count < B:
    passed.append(s[i])
    count += 1
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
s = str(input())

passed = []

for i in range(N):
  if s[i] == "c":
    print("No")
  elif s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and passed.count("b") < B:
    passed.append(s[i])
    print("Yes")
  else:
    print("No")
    

Fixed submission:
N, A, B = map(int, input().split())
s = str(input())

passed = []
count = 0
for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and count < B:
    passed.append(s[i])
    count += 1
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
s = str(input())

passed = []

for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and passed.count("b") < B:
    passed.append(s[i])
    print("Yes")
  else:
    print("No")

Fixed submission:
N, A, B = map(int, input().split())
s = str(input())

passed = []
count = 0
for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and count < B:
    passed.append(s[i])
    count += 1
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
s = str(input())

passed = []

for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and passed.count("b") < B:
    passed.append(s[i])
    print("Yes")
  else:
    print("No")

Fixed submission:
N, A, B = map(int, input().split())
s = str(input())

passed = []
count = 0
for i in range(N):
  if s[i] == "a" and len(passed) < A + B:
    passed.append(s[i])
    print("Yes")
  elif s[i] == "b" and len(passed) < A + B and count < B:
    passed.append(s[i])
    count += 1
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
counter=0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(n-i*k,n+1):
            if((i*j+k)==n):
                counter=counter+1
print(counter)

Fixed submission:
str1=input()
if(str1[len(str1)-1]=='s'):
    print(str1+'es')
else:
    print(str1+'s')
Buggy python submission (verdict: Runtime Error):
n=int(input())
counter=0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n-i*k):
            if((i*j+k)==n):
                counter=counter+1
print(counter)

Fixed submission:
n=int(input())
counter=0
for i in range(1,n+1):
    counter=counter+(n-1)//i
print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
counter=0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            if((i*j+k)==n):
                counter=counter+1
print(counter)

Fixed submission:
n=int(input())
counter=0
for i in range(1,n+1):
    counter=counter+(n-1)//i
print(counter)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)d
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*d)
list1.sort()
print(list1[3])

Fixed submission:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*d)
list1.sort()
print(list1[3])

Buggy python submission (verdict: Runtime Error):
a,b,c,d=int(input().split())
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*c)
list1.sort()
print(list1[3])

Fixed submission:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*d)
list1.sort()
print(list1[3])

Buggy python submission (verdict: Runtime Error):
a,b,c,d=int(input())
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*c)
list1.sort()
print(list1[3])

Fixed submission:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*d)
list1.sort()
print(list1[3])
Buggy python submission (verdict: Runtime Error):
import sympy
N = int(input())

count = 0
for i in range(1,N):
    count += len(sympy.divisors(N-i))
print(count)


Fixed submission:
S = input()

if S[-1] == "s" :
    print(S + "es")
else :
    print(S + "s")
Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())

count = 0
for i in range(1,N):
    count += len(make_divisors(N-i))
print(count)

Fixed submission:
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
print(ans)

Buggy python submission (verdict: Runtime Error):
import sympy
N = int(input())
count = 0
for i in range(1,N):
    count += len(sympy.divisors(N-i))
print(count)

Fixed submission:
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

if a < 0 and b < 0 :
    if c <= 0 :
        print(a*c)
    else :
        print(b*c)
elif a < 0 and b == 0:
    if c <= 0:
        print(a*c)
    else :
        print(b*c)
elif a < 0 and b > 0 :
    if d<=0 :
        print(a*c)
    else :
     if a * c < b * d :
        print(b*d)
    else :
        print(a*c)
elif a==0 and b > 0:
    if d <= 0:
        print(0)
    else :
        print(b*d)
elif a > 0 and b > 0:
    if d <= 0:
        print(a*d)
    else :
        print(b*d)

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

print(max([a*c,a*d,b*c,b*d]))
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
A = len(T)  
for i in range(len(S)):
    diff = 0
    for j in range(len(T)):
        if T[j] != S[i + j]:
            diff = diff +1;
    A = min(A,diff)
print(A)

Fixed submission:
s = input()
t = input()
ls = []
for i in range(len(s) - len(t) + 1):
    ls.append(s[i:i+len(t)])
now = 0
minimum = len(t)
for i in range(len(ls)):
    now = 0
    for j in range(len(t)):
        if t[j] == ls[i][j]:
            now += 1
    if len(t) - now < minimum:
        minimum = len(t) - now
print(minimum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(e) for e in input().split()]
sum = 0
asum = 0
for i in A :
    asum = asum + i*i
    for j in A:
        sum = sum + i*j
sum = ((sum - asum)/2)%1000000007

print(int(sum))

Fixed submission:
N = int(input())
A = [int(e) for e in input().split()]

S = [0]
sum =0
for i in range(0, N):
    S.append(S[i] + A[i])
for i in range(N):
    sum = sum + (S[i+1]-A[i]) * A[i]
print(sum%1000000007)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
min = 0
for i in range(N):
    if(i > 0) :
        if np.max(A[:i]) - A[i] > 0:
            min = min + np.max(A[:i]) - A[i]
print(min)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
min = 0
for i in range(N):
    if i == 0:
        max = A[i]
    else :
        if max > A[i] :
            min = min + max - A[i]
        else :
            max = A[i]   
print(min)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
min = 0
for i in range(N):
    if(i > 0) :
        if np.max(A[:i]) - A[i] > 0:
            min = min + np.max(A[:i]) - A[i]
print(min)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
min = 0
for i in range(N):
    if i == 0:
        max = A[i]
    else :
        if max > A[i] :
            min = min + max - A[i]
        else :
            max = A[i]   
print(min)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
min = 0
for i in range(N):
    if max(A[:i],default=0) - A[i] > 0:
        min = min + max(A[:i],default=0) - A[i]
print(min)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
min = 0
for i in range(N):
    if i == 0:
        max = A[i]
    else :
        if max > A[i] :
            min = min + max - A[i]
        else :
            max = A[i]   
print(min)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
min = 0
M = [0] * N
for i in range(N) :
    for j in range(i):
        if M[i] > A[i]- A[j] :
            M[i] = A[i]- A[j]
    min = min + abs(M[i])
print(min)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
min = 0
for i in range(N):
    if i == 0:
        max = A[i]
    else :
        if max > A[i] :
            min = min + max - A[i]
        else :
            max = A[i]   
print(min)
Buggy python submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
X = abs(X)

if X <= K * D :
  if abs(X % D -D) < X % D :
    answer = abs(X % D -D)
  else :
    answer = X % D
else :
  answer = X - K * D
  

Fixed submission:
S = list(input())
count = 0
max_count =0
for i in S :
    if(i=='R'):
        count = count + 1
    else :
        if(max_count < count) :
            max_count = count
            count = 0
if(max_count < count) :
    max_count = count

print(max_count)

Buggy python submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
answer = X
while K > 0 :
    if X > 0 :
        X = X - D
    else :
        X = X + D

    K = K - 1        
    if answer > abs(X) :
        answer = abs(X)  

print(answer)

Fixed submission:
S = list(input())
count = 0
max_count =0
for i in S :
    if(i=='R'):
        count = count + 1
    else :
        if(max_count < count) :
            max_count = count
            count = 0
if(max_count < count) :
    max_count = count

print(max_count)

Buggy python submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
answer = X
while K > 0 :
  if X > 0 :
    X = X - D
  else :
    X = X + D
  K = K - 1        
  if answer > abs(X) :
    answer = abs(X)  
print(answer)

Fixed submission:
S = list(input())
count = 0
max_count =0
for i in S :
    if(i=='R'):
        count = count + 1
    else :
        if(max_count < count) :
            max_count = count
            count = 0
if(max_count < count) :
    max_count = count

print(max_count)
Buggy python submission (verdict: Runtime Error):
K = int(input())

t=7
for i in K:
    if t % K == 0 :
        print(i+1)
        break
    t= 10 * t + 7
else :
    print(-1)

Fixed submission:
x = int(input())

if x >= 30 :
  print("Yes")
else :
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
 
N,D = map(int, input().split())
count = 0
for i in range(0, N):
  x[i] = list(int(input()))
  if D >= math.sqrt(x[i][0]**2 + x[i][1]**2):
    count = count + 1
 
print(count)

Fixed submission:
import math
 
N,D = map(int, input().split())
count = 0
for i in range(0, N):
  x = list(map(int, input().split()))
  if D >= math.sqrt(x[0]**2 + x[1]**2):
    count = count + 1
 
print(count)

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

N,D = map(int, input().split())
count = 0
for i in range(0, N):
  x[i] = list(int(input()))
  if D >= math.sqrt(x[i][0]**2 + x[i][1]**2):
    count += 1

print(count)
              

Fixed submission:
import math
 
N,D = map(int, input().split())
count = 0
for i in range(0, N):
  x = list(map(int, input().split()))
  if D >= math.sqrt(x[0]**2 + x[1]**2):
    count = count + 1
 
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

t=7
for i in range(K):
    if t % K == 0 :
        print(i+1)
        break
    t = 10 * t + 7

else :
    print(-1)
        

Fixed submission:
K = int(input())

t = 7
for i in range(K):
    if t % K == 0:
        print(i + 1)
        break
    t = (t * 10 + 7) % K
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
X = int(input())
if(X => 30):
  print('True')
else:
  print('False')

Fixed submission:
X = int(input())
if(X >= 30):
    print('Yes')
else:
    print('No')