Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
from io import StringIO
import unittest
import numpy as np


def resolve():
    N = int(input())
    L = [list(map(int, input().split())) for i in range(N)]
    L.sort(key=lambda v: v[1])
    A_sum = 0
    for a, b in L:
        A_sum += a
        if (b < A_sum):
            print("No")
            return
    print("Yes")
resolve()

Fixed submission:
import sys
from io import StringIO
import unittest
import numpy as np


def resolve():
    N = int(input())
    L = [list(map(int, input().split())) for i in range(N)]
    L.sort(key=lambda v: v[1])
    A_sum = 0
    for a, b in L:
        A_sum += a
        if (b < A_sum):
            print("No")
            return
    print("Yes")
resolve()
Buggy python submission (verdict: Runtime Error):
r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)


Fixed submission:
import bisect
import numpy as np
import scipy as sp
from sys import stdin

n, k = map(int, input().split())
print(n - k + 1)

Buggy python submission (verdict: Runtime Error):
import bisect
import numpy as np
import scipy as sp
from sys import stdin

r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)


Fixed submission:
import bisect
import numpy as np
import scipy as sp
from sys import stdin

n, k = map(int, input().split())
print(n - k + 1)

Buggy python submission (verdict: Runtime Error):
import bisect
import numpy as np
import scipy as sp
from sys import stdin

r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
        	break
        if total % b == 0:
            count += 1

print(count)


Fixed submission:
import bisect
import numpy as np
import scipy as sp
from sys import stdin

n, k = map(int, input().split())
print(n - k + 1)

Buggy python submission (verdict: Runtime Error):
import bisect
import numpy as np
import scipy as sp
from sys import stdin

r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
        	break
        if total % b == 0:
            count += 1

print(count)


Fixed submission:
import bisect
import numpy as np
import scipy as sp
from sys import stdin

n, k = map(int, input().split())
print(n - k + 1)
Buggy python submission (verdict: Runtime Error):
import bisect
import numpy as np
import scipy as sp
from sys import stdin

r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)


Fixed submission:


r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import numpy as np
import scipy as sp
from sys import stdin

r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)


Fixed submission:


r, g, b, n = map(int, input().split())
count = 0

for i in range(n + 1):
    for j in range(n + 1):
        total = n - r * i - g * j
        if total < 0:
            break
        if total % b == 0:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [None] + list(map(int, input().split('')))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k == 2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])

Fixed submission:
n = int(input())
h = [None] + list(map(int, input().split()))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k == 2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [None] + list(map(int, input().split('')))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k ==2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])

Fixed submission:
n = int(input())
h = [None] + list(map(int, input().split()))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k == 2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [None] + list(map(int, input().split('')))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k ==2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[i])

Fixed submission:
n = int(input())
h = [None] + list(map(int, input().split()))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k == 2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [None] + list(map(int, input().split('')))

dp = [None for _ in range(n+1)]
for i in range(1,n+1):
  if i == 1:
    dp[i] = 0
  elif i ==2:
    dp[i] = abs(h[2] - h[1])
  else:
    dp[i] = min(
      dp[i-1] + abs(h[k] - h[k-1]),
      dp[i-2] + abs(h[k] - h[k-2])
    )
print(dp[i])

Fixed submission:
n = int(input())
h = [None] + list(map(int, input().split()))

dp = [None for _ in range(n+1)]
for k in range(1,n+1):
  if k == 1:
    dp[k] = 0
  elif k == 2:
    dp[k] = abs(h[2] - h[1])
  else:
    dp[k] = min(
      dp[k-1] + abs(h[k] - h[k-1]),
      dp[k-2] + abs(h[k] - h[k-2])
    )
print(dp[k])
Buggy python submission (verdict: Runtime Error):
mport sys
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    sys.exit()
print("NG")

Fixed submission:
import sys
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    sys.exit(0)
print("NG")

Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input()split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    exit()
print("No")

Fixed submission:
import sys
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    sys.exit(0)
print("NG")
Buggy python submission (verdict: Runtime Error):
 a,b,c,d = map(int,input().split())
while(a>0 or c>0):
  c-=b
  a-=d
if a<=0 and c>0:
  print("No")
elif c<=0 and a>0: 
  print("Yes")
elif a<=0 and c<=0:
  print("Yes")

Fixed submission:
import math
a,b,c,d = map(int,input().split())
x=c/b
y=a/d
x=math.ceil(x)
y=math.ceil(y)
if x<=y:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
i = int(input())
l = 2*i*math.pi
print(l)

Fixed submission:
i = int(input())
l = 2*i*3.141592
print(l)
Buggy python submission (verdict: Time Limit Exceeded):
import math
K = int(input())
a = 0
for i in range(1,K+1):
  for j in range(1,K+1):
    for h in range(1,K+1):
      l = math.gcd(j,h)
      m = math.gcd(i,l)
      a += m
print(a)

Fixed submission:
import math
K = int(input())
a = 0
for i in range(1,K+1):
  for j in range(1,K+1):
    m = math.gcd(i,j)
    for h in range(1,K+1):
      l = math.gcd(h,m)
      a += l
print(a)
Buggy python submission (verdict: Runtime Error):
S = input().split()
if S[2]==S[3] and S[4]==[5]:
  print("Yes")
else:
  print("No")

Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
P=[int(i) for i in input().split()]
x=P[0]
a=1
if N==1:
    print(a)
else:
    for i in range(1,N):
        if x>P[i]:
            x=P[i]
            a+=1
        else:
    print(a)

Fixed submission:
N=int(input())
P=[int(i) for i in input().split()]
x=P[0]
a=1
if N==1:
    print(a)
else:
    for i in range(1,N):
        if x>P[i]:
            x=P[i]
            a+=1
    print(a)
Buggy python submission (verdict: Runtime Error):
l=list(map(int(input().strip().split()))
       print(str(l[3]+ " " +l[1]+" "+l[2]))

Fixed submission:
a = list(map(int,input().strip().split()))
print (a[2],a[0],a[1])
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())

a = (B//K) - (A//K)

if A==B:
    if A % K = 0:
        print("OK")

    else:
        print("NG")

else:
    if a==0:
        print("NG")
    
    else:
        print("OK")

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

a = (B//K)*K - A

if a < 0:
    print("NG")

else:
    print("OK")

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

a = (B//K) - (A//K)

if A==B:
    if A % K = 0:
        print("OK")

    else:
        print("NG")

if a==0:
    print("NG")

else:
    print("OK")

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

a = (B//K)*K - A

if a < 0:
    print("NG")

else:
    print("OK")
Buggy python submission (verdict: Runtime Error):
N,M,A_i=(int,input().split())
A=0
for i in range(M):
    A+=A_i
if N<A:
    print("-1")

else:
    print(N-A)


Fixed submission:
N,M=map(int,input().split())
A_i=list(map(int,input().split()))
A=0
for i in range(M):
    A+=A_i[i]
    
if N<A:
    print("-1")

else:
    print(N-A)

Buggy python submission (verdict: Runtime Error):
N,M,A_i=(int(x) for x in input().split())
A=0
for i in range(M):
    A+=A_i
if N<A:
    print("-1")

else:
    print(N-A)

Fixed submission:
N,M=map(int,input().split())
A_i=list(map(int,input().split()))
A=0
for i in range(M):
    A+=A_i[i]
    
if N<A:
    print("-1")

else:
    print(N-A)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_i = list(map(int,input().split()))

for i in range(N):
    print(A_i.count(i+1))

Fixed submission:
N = int(input())
A_i = list(map(int,input().split()))
cnt = [0]*N

for i in range(N-1):
    cnt[A_i[i]-1]+=1

for i in range(N):
    print(cnt[i])
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
cnt = [0]*(N-K+2)

cnt_all = 0
mod = 1000000007

for i in range(K,N+2):
    cnt[i] = i*N - i*(i-1) + 1

for i in range(N-K+2):
    cnt_all += cnt[i]

print(cnt_all % mod)


Fixed submission:
N,K = map(int,input().split())
cnt = [0]*(N-K+2)

cnt_all = 0
mod = 1000000007

for i in range(K,N+2):
    cnt[i-K] = i*N - i*(i-1) + 1

for i in range(N-K+2):
    cnt_all += cnt[i]

print(cnt_all % mod)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
cnt = [0]*(N-K+2)

cnt_all = 0
mod = 1000000007

for i in range(K,N+2):
    cnt[i] = (i+1)*N - i^2

for i in range(N-K+2):
    cnt_all += cnt[i]

print(cnt_all % mod)

Fixed submission:
N,K = map(int,input().split())
cnt = [0]*(N-K+2)

cnt_all = 0
mod = 1000000007

for i in range(K,N+2):
    cnt[i-K] = i*N - i*(i-1) + 1

for i in range(N-K+2):
    cnt_all += cnt[i]

print(cnt_all % mod)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
cnt = [0]*(N-K+2)

cnt_all = 0
mod = 1000000007

for i in range(K,N+2):
    cnt[i] = (i+1)*(N-i)

for i in range(N-K+2):
    cnt_all += cnt[i]

print(cnt_all % mod)


Fixed submission:
N,K = map(int,input().split())
cnt = [0]*(N-K+2)

cnt_all = 0
mod = 1000000007

for i in range(K,N+2):
    cnt[i-K] = i*N - i*(i-1) + 1

for i in range(N-K+2):
    cnt_all += cnt[i]

print(cnt_all % mod)
Buggy python submission (verdict: Runtime Error):
N=int(imput())
for i in range(3):
    if (N%10)==7:
        break
    N=N//10
if N!=0:
    print("yes")
else:
    print("No")


Fixed submission:
N=int(input())
for i in range(3):
    if (N%10)==7:
        break
    N=N//10
if N!=0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
hs = list(map(int, input().split()))
ans = [1]*n
for i in range(m):
    road = list(map(int, input().split()))
    if hs[road[0]-1] <= hs[road[1]-1]:
        ans[road[0]-1] = 0
    if hs[road[0]-1] >= hs[road[1]-1]:
        ans[road[1]-1] = 0
print(ans.count(0))


Fixed submission:
s = input()
if s == "ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
x , y, z = map(int,input().split())
print(z + ' ' + x + ' ' + y)

Fixed submission:
x, y, z = map(str,input().split())
print(z + ' ' + x + ' ' + y)
Buggy python submission (verdict: Runtime Error):
k, n = map(int, input().split())
list_a = list(map(int, input().split()))
 
x = 0
longest = 0
for a in list_a:
  if a - x > longest:
    longest = a - x
    x = a - x
if longest < a[0] + (k - a[n-1]):
  longest = a[0] + (k - a[n-1])
print(k-longest)

Fixed submission:
k, n = map(int, input().split())
list_a = list(map(int, input().split()))
 
x = 0
longest = 0
for a in list_a:
  if a - x > longest:
    longest = a - x
  x = a
if longest < list_a[0] + (k - list_a[n-1]):
  longest = list_a[0] + (k - list_a[n-1])
print(k-longest)

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

x = 0
longest = 0
for a in list_a:
  if a - x > longest:
    longest = a - x
    x = a - x
if longest < a[0] + (k - a[n-1]):
  longest = a[0] + (k - a[n-1]):
print(k-longest)

Fixed submission:
k, n = map(int, input().split())
list_a = list(map(int, input().split()))
 
x = 0
longest = 0
for a in list_a:
  if a - x > longest:
    longest = a - x
  x = a
if longest < list_a[0] + (k - list_a[n-1]):
  longest = list_a[0] + (k - list_a[n-1])
print(k-longest)
Buggy python submission (verdict: Runtime Error):
l = int(input())
print(pow(1/3,3)

Fixed submission:
l = int(input())
print(pow(l/3,3))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

if n == m:
  print('Yes'):
else:
  print('No')

Fixed submission:
n, m = map(int, input().split())
 
if n == m:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for _ in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
print(str(a) + ' ' + str(b))

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

if a > k:
  print(str(a-k) + ' ' + str(b))
elif a <= k and a+b > k:
  print(str(0) +  ' ' + str(a + b -k))
else:
  print('0 0')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = list(input())

s[k-1] = s[k-1].lower()
print('',join(s))

Fixed submission:
n, k = map(int, input().split())
s = list(input())
 
s[k-1] = s[k-1].lower()
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
n = int(input())
list = list(map(int, input().split()))
for i in range(len(list)-1):
  copy_list = list.copy()
  copy_list.pop(i)
  copy_list.sort()
  print(copy_list[int(n/2-1)])

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

if x >= a and x <= a + b:
  print('YES')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
n = int(input())
list = list(map(int, input().split()))
for i in range(len(list)):
  copy_list = list.copy()
  copy_list.pop(i)
  copy_list.sort()
  print(copy_list[int(n/2)-1])


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

if x >= a and x <= a + b:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
ipt = [int(input()) for i in range(5)]

minnum = 1000

for i, con in enumerate(ipt):
    if con % 10 != 0:
        if minnum > con % 10:
            minnum = con % 10
            minidx = i

print(sum([int((con+9)/10)*10 if i != minidx and con%10 != 0 else con for i,con in enumerate(ipt)]))

Fixed submission:
ipt = [int(input()) for i in range(5)]

minnum = 1000
minidx = 6
for i, con in enumerate(ipt):
    if con % 10 != 0:
        if minnum > con % 10:
            minnum = con % 10
            minidx = i

print(sum([int((con+9)/10)*10 if i != minidx and con%10 != 0 else con for i,con in enumerate(ipt)]))
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())
h,w = map(int,input().split())

print((H*W + h*w) - (H*w + Wh))

Fixed submission:
H,W = map(int,input().split())
h,w = map(int,input().split())

print((H*W + h*w) - (H*w + W*h))
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
for _ in range(Q):
	l, r = map(int, input().split())
	print(S.count("AC", l - 1, r))


Fixed submission:
N, Q = map(int, input().split())
S = input()
li = [0 for _ in range(N + 1)]
for i in range(N):
	li[i + 1] = li[i] + (1 if S[i:i+2] == 'AC' else 0)
for _ in range(Q):
	l, r = map(int, input().split())
	print(li[r - 1] - li[l - 1])
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

input()

print(gcd_list(list(map(int, input().split()))))


Fixed submission:
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

input()

print(gcd_list(list(map(int, input().split()))))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

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

input()
l = list(map(int, input().split()))
m = reduce(lcm, l, 1) - 1

ans = 0
for i in range(len(l)):
	ans += m % l[i]

print(ans)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
print(sum(l) - n)

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

input()
l = list(map(int, input().split()))
m = np.lcm.reduce(l) - 1

ans = 0
for i in range(len(l)):
	ans += m % l[i]

print(ans)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
print(sum(l) - n)
Buggy python submission (verdict: Runtime Error):
N, M, X = map(int, input().split(' '))
gates = [int(input()) for i in range(M)]

can = [len([i for i in gates if i > X]), len([i for i in gates if i < X])]

print(min(can))

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

c1 = len([i for i in gates if i < X])
can = [c1, M - c1]

print(min(can))
Buggy python submission (verdict: Time Limit Exceeded):
from statistics import median

N = int(input())
data = list(map(int, input().split(' ')))

for i in range(len(data)):
    temp = [x for j,x in enumerate(data) if j != i]
    print(median(temp))

Fixed submission:
N = int(input())
data = list(map(int, input().split(' ')))
sorteddata = sorted(data)

c1 = sorteddata[N // 2]
c2 = sorteddata[N // 2 - 1]

for i in range(N):
    if (data[i] < c1):
        print(c1)
    else:
        print(c2)
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left

N = int(input())
data = list(map(int, input().split(' ')))
sorteddata = sorted(data)

def takeClosest(myList, myNumber):
    pos = bisect_left(myList, myNumber)
    if pos == 0:
        return myList[0]
    if pos == len(myList):
        return myList[-1]
    before = myList[pos - 1]
    after = myList[pos]
    if after - myNumber < myNumber - before:
       return after
    else:
       return before

ans = takeClosest(sorteddata, sorteddata[-1] / 2)
print(sorteddata[-1] + ' ' + ans)

Fixed submission:
from bisect import bisect_left

N = int(input())
data = list(map(int, input().split(' ')))
sorteddata = sorted(data)

def takeClosest(myList, myNumber):
    pos = bisect_left(myList, myNumber)
    if pos == 0:
        return myList[0]
    if pos == len(myList):
        return myList[-1]
    before = myList[pos - 1]
    after = myList[pos]
    if after - myNumber < myNumber - before:
       return after
    else:
       return before

ans = takeClosest(sorteddata, sorteddata[-1] / 2)
print(str(sorteddata[-1]) + ' ' + str(ans))
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split(' '))

lst = [i for i in range(A, B + 1)]

if len(lst) < 2 * K:
    for item in lst:
        print(item)
else:
    for item in lst[:K]:
        print(item)
    for item in lst[-K:]:
        print(item)


Fixed submission:
A, B, K = map(int, input().split(' '))

if (B - A + 1) < 2 * K:
    for i in range(A, B + 1):
        print(i)
else:
    for i in range(A, A + K):
        print(i)
    for i in range(B - K + 1, B + 1):
        print(i)
Buggy python submission (verdict: Runtime Error):
s = char(input())
if s=="ABC":
    print("ARC")
else:
    print("ABC")

Fixed submission:
s = input()
if s=="ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = map(int,input().split())
for i in range(a,b+1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")

Fixed submission:
k = int(input())
a,b = map(int,input().split())
han = False
for i in range(a,b+1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")

Buggy python submission (verdict: Runtime Error):
k = input()
a,b = map(int,input().split())
han = False
for i in range(a,b,1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")

Fixed submission:
k = int(input())
a,b = map(int,input().split())
han = False
for i in range(a,b+1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")

Buggy python submission (verdict: Runtime Error):
k = input()
a,b = map(int,input().split())
for i in range(a,b,1):
    if (i%k) == 0:
        han = True
if han == True:
    print("OK")
else:
    print("No")

Fixed submission:
k = int(input())
a,b = map(int,input().split())
han = False
for i in range(a,b+1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")

Buggy python submission (verdict: Runtime Error):
k = input()
a,b = map(int,input().split())
for i in range(a,b,1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("No")

Fixed submission:
k = int(input())
a,b = map(int,input().split())
han = False
for i in range(a,b+1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(0,m+1):
    n-=a[i]
if n<=0:
    print(-1)
else:
    print(n)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(0,m):
    n-=a[i]
if n<0:
    print(-1)
else:
    print(n)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
for i in range(0,m):
    num=int(input())
    a.append(num)
    n-=a[i]
if n<=0:
    print(-1)
else:
    print(n)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(0,m):
    n-=a[i]
if n<0:
    print(-1)
else:
    print(n)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
for i in range(0,m):
    a[i] = input()
    n-=a[i]
if n<=0:
    print(-1)
else:
    print(n)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(0,m):
    n-=a[i]
if n<0:
    print(-1)
else:
    print(n)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
for i in range(0,m):
    a[i] = input()
    n-=a[i]
if n<=0:
    print(-1)
else:
    print(n)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(0,m):
    n-=a[i]
if n<0:
    print(-1)
else:
    print(n)