Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02754 (python)

Fixed submission:
import sys

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

Count_Blue = 0
if 1<=N<=10**18 and A > 0 and B >= 0 and \
   0< A + B <= 10**18:
    Add_Blue = 1 * A
    Add_Both = Add_Blue + 1 * B

    q = N // Add_Both
    mod = N % Add_Both
    if mod < Add_Blue:
        Count_Blue = (q *Add_Blue) + mod
    else:
        Count_Blue = (q * Add_Blue) + Add_Blue
    print(Count_Blue)
elif A == 0:
    print(Count_Blue)

Buggy submission (verdict: Runtime Error):
import sys

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

Result = ''

Count_Blue = 0
if 1<=N<=10**18 and A >= 0 and B >= 0 and \
   0< A + B <= 10**18:
    for Count in range(1,10**100+1):
        if len(Result) < N:
            Mod = Count % 2
            if Mod==1:
                for i in range(A):
                    if len(Result) < N:
                        Result = Result + 'B'
                        Count_Blue += 1
            elif Mod==0:
                Result = Result + 'R' * B
        else:
            print(Count_Blue)
            sys.exit()
Problem p02831 (python)

Fixed submission:
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
A,B=MI()
 
print(lcm(A,B))

Buggy submission (verdict: Runtime Error):
import sys
import math
from collections import Counter
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

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

A,B=MI()

print(lcm(A,B))
Problem p02847 (python)

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)
elif S == 'SAT':
    print(1)

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

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

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

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

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

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

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

if S = 'SUN':
    print(7)
else if S = 'MON':
    print(1)
else if S = 'TUE':
    print(2)
else if S = 'WED':
    print(3)
else if S = 'THS':
    print(4)
else if S = 'FRI':
    print(5)
else if S = 'SAT':
    print(6)
Problem p02723 (python)

Fixed submission:
a=list(input())
if a[2]==a[3] and a[4]==a[5]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=list(input())
if a[2]==a[3] and a[4]==a[5]:
  print('Yes')
else:
  prin('No')
Problem p02948 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import heapq

N, M = map(int, input().split())
Wlist = []
for i in range(N):
    A, B = map(int, input().split())
    Wlist.append([A,B])
Wlist.sort(key=lambda x:x[0])

h = []
Ans = 0
Index = 0
for day in range(1,M+1):
    while Index < N:
        if Wlist[Index][0] <= day:
            heapq.heappush(h, -Wlist[Index][1])
            Index += 1
        else:
            break
    if len(h):
        Ans += -heapq.heappop(h)

print(Ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import heapq

N, M = map(int, input().split())
Wlist = []
for i in range(N):
    A, B = map(int, input().split())
    Wlist.append([A,B])
Wlist.sort(key=lambda x:x[0])

h = []
Ans = 0
Index = 0
for day in range(1,M+1):
    while Index < N:
        if Wlist[Index][0] <= day:
            heapq.heappush(h, -Wlist[Index][1])
            Index += 1
        else:
            break
    Ans += -heapq.heappop(h)

print(Ans)
Problem p02723 (python)

Fixed submission:
s = list(str(input()))
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x = int(input())
ans = x//500 * 1000
ans += (x%500)//5*5
print(ans)
Problem p02831 (python)

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

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

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

print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())

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

print(lcm(a,b))
Problem p02833 (python)

Fixed submission:
n = int(input())
if n%2:
    print(0)
else:
    tmp = 5
    ans = 0
    n //= 2
    while tmp <= n:
        ans += n//tmp
        tmp *= 5
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%2:
    print(0)
else:
    tmp = 5
    ans = 0
    n //= 2
    while tmp < n:
        ans += n//tmp
        tmp *= 5
print(ans)

Buggy submission (verdict: Runtime Error):
n = str(input())
tmp = len(n)
bai = 1
if int(n)%2:
    print(0)
else:
    ans = 0
    for i in range(1,tmp):
        if i == 1:
            ans += int(n[-1-i]) * bai
        elif i == 2:
            bai = 12
            ans += int(n[-1 - i]) * bai
        elif i == 3:
            bai = 124
            ans += int(n[-1 - i]) * bai
        elif i < 18:
            bai *= 10
            bai += 9
            ans += int(n[-1 - i]) * bai
        else:
            ans = 124999999999999995
print(ans)
Problem p02912 (python)

Fixed submission:
import sys
input = sys.stdin.readline
import heapq as hp

n,m = map(int,input().split())
a = list(map(lambda x: int(x)*(-1),input().split()))
hp.heapify(a)
tmp = 0

for i in range(m):
  tmp = hp.heappop(a)
  hp.heappush(a,(-tmp//2)*(-1))
#
print(-sum(a))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
j = 0
for i in range(m):
  a[j] //= 2
  if a[0] > a[j]:
    j = 0
    a.sort(reverse=True)
  elif a[j] < a[j+1]:
    j += 1
print(sum(a))
Problem p03038 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from operator import itemgetter

N,M = map(int,readline().split())
A = list(map(int,readline().split()))
m = map(int,read().split())
BC = list(zip(m,m))

BC.sort(key = itemgetter(1),reverse=True)

BC.append((N,-1))

change = []
for b,c in BC:
    change += [c] * b
    if len(change) > N:
        break

A += change
A.sort()
answer = sum(A[-N:])
print(answer)

Buggy submission (verdict: Runtime Error):
import sys
import heapq as hq
input = sys.stdin.readline

n,m = map(int,input().split())
a = list(map(int,input().split()))
b = [0] * m

for i in range(m):
    b[i] = list(map(int,input().split()))

ans = 0
for i in range(n):
  a[i] = -a[i]

for i in b:
  a += i[1] * i[0]

hq.heapify(a)

for i in range(n):
  ans -= hq.heappop(a)
print(ans)
Problem p02688 (python)

Fixed submission:
import collections
N , K= map(int, input().split())
c = 0
A =[]
for ia in range(K):
    d = int(input())
    A.extend(list(map(int, input().split())))

sa = collections.Counter(A)
sss = len(sa)
print(N-sss)

Buggy submission (verdict: Runtime Error):
N , K= map(int, input().split())
d = int(input())
A = list(map(int,input().split()))
dk = [int(input()) for ia in range(K)]
Ak = list(map(int, input().split()))

print(N - d)
Problem p02711 (python)

Fixed submission:
N = int(input())
listN = sorted(str(N))
if listN.count("7") >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
str(N)
listN = sorted(N)
if listN.count("7") >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
str(N)
listN = sorted(N)
if listN.count(7) >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
str(n)
listN = sorted(N)
if listN.count("7") >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
str(n)
listN = sorted(N)
if listN.count(7) >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
listN = sorted(N)
if listN.count(7) >= 1:
    print("Yes")
else:
    print("No")
Problem p02712 (python)

Fixed submission:
N = int(input())
S = 0
for i in range(N):
    if (i+1)%3 == 0 and (i+1)%5==0 or (i+1)%3 ==0 or (1+i)%5 ==0 :
        continue
    else:
        S = S+1+i

print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = 0
for i in range(N):
    if i+1%3 and i+1%5 or i+1%3 or i+1%5:
        break
    else:
        global S = S+1+i
Problem p02948 (python)

Fixed submission:
import heapq
N,M=map(int,input().split())
x={}
for i in range(M+1):
    x[i]=[]
for i in range(N):
    a,b=map(int,input().split())
    if a>M:
        continue
    x[a].append(-b)
y=[]
an=0
for i in range(M+1):
    for n in x[i]:
        heapq.heappush(y,n)
    try:
        an-=heapq.heappop(y)
    except:
        pass
print(an)

Buggy submission (verdict: Runtime Error):
import heapq
N,M=map(int,input().split())
x={}
for i in range(M+1):
    x[i]=[]
for i in range(N):
    if i >=M:
        continue
    a,b=map(int,input().split())
    x[a].append(-b)
y=[]
an=0
for i in range(M+1):
    for n in x[i]:
        heapq.heappush(y,n)
    try:
        an-=heapq.heappop(y)
    except:
        pass
print(an)

Buggy submission (verdict: Runtime Error):
import heapq
N,M=map(int,input().split())
x={}
for i in range(M+1):
    x[i]=[]
for i in range(N):
    if i <=M:
        continue
    a,b=map(int,input().split())
    x[a].append(-b)
y=[]
an=0
for i in range(M+1):
    for n in x[i]:
        heapq.heappush(y,n)
    try:
        an-=heapq.heappop(y)
    except:
        pass
print(an)

Buggy submission (verdict: Runtime Error):
import heapq
N,M=map(int,input().split())
x={}
for i in range(M+1):
    x[i]=[]
for i in range(N):
    a,b=map(int,input().split())
    x[a].append(-b)
y=[]
an=0
for i in range(M+1):
    for n in x[i]:
        heapq.heappush(y,n)
    try:
        an-=heapq.heappop(y)
    except:
        pass
print(an)

Buggy submission (verdict: Runtime Error):
import heapq
N,M=map(int,input().split())
x={}
for i in range(M+1):
    x[i]=[]
for i in range(N):
    a,b=map(int,input().split())
    x[a].append(-b)
y=heapq.heapify([])
an=0
for i in range(M+1):
    for n in x[i]:
        heapq.heappush(y,n)
    try:
        an-=heapq.heappop(y)
    except:
        pass
print(an)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
x=[]
an=0
for i in range(M+1):
    x.insert(i,[])
for i in range(N):
    a,b=map(int,input().split())
    if a<=M:
        x[a].append(b)
y=[]
while n in <=M+1:
    y+=x[n]
    try:
        n=y.count(max(y))
        an+=n*max(y)
        for z in range(n)
            y.remove(max(y))
        n+=1
    except:
        continue
print(an)
Problem p02682 (python)

Fixed submission:
A,B,C,K = map(int,input().split())
if A >= K:
    print(K)
elif (A+B)>=K:
    print(A)
else:
    print(A*2+B-K)

Buggy submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())
if K <= A:
    print(K)
elif K <= A+B:
    print(A)
else:
    print(2A+B-K)
Problem p02916 (python)

Fixed submission:
N = int(input())
l_a = list(map(int,input().split()))
l_b = list(map(int,input().split()))
l_c = list(map(int,input().split()))
all = sum(l_b)
for i in range (N-1):
    if l_a[i+1] - l_a[i] == 1:
        all +=l_c[l_a[i]-1]
print(all)

Buggy submission (verdict: Runtime Error):
N = int(input())
l_a = list(map(int,input().split()))
l_b = list(map(int,input().split()))
l_c = list(map(int,input().split()))
all = sum(l_b)çß
for i in range (N-1):
    if l_a[i+1] - l_a[i] == 1:
        all +=l_c[l_a[i]-1]
print(all)
Problem p02987 (python)

Fixed submission:
S = list(input())
if len(S) == 4 and (S.count(S[1])) == 2  and len(set(S))==2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
def nCr(n,r):
    com = 1
    for i in range (1,r+1):
        com =com*(n+1-i)//i
    return com
N,K = map(int,input().split())
mod = (10**2)+7
for i in range(1,K+1):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%mod)

Buggy submission (verdict: Runtime Error):
def nCr(n,r):
    com = 1
    for i in range (1,r+1):
        com =com*(n+1-i)//i
    return com
N,K = map(int,input().split())
print(nCr(N,K))
for i in range(1,K+1):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%(10**9+7))

Buggy submission (verdict: Runtime Error):
S = list(input())
if len(S) == 4 and (S.count(S[1])) == 2  and len(set(s))==2:
    print('Yes')
else:
    print('No')
Problem p02990 (python)

Fixed submission:
def nCr(n,r):
    com = 1
    for i in range (1,r+1):
        com =com*(n+1-i)//i
    return com
N,K = map(int,input().split())
mod = (10**9)+7
for i in range(1,K+1):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%mod)

Buggy submission (verdict: Runtime Error):
def nCr(n,r):
    nk = 1
    nrk = 1
    rk = 1
    for i in range (n):
        nk *= i + 1
    for i in range (n-r):
        nrk *= i + 1
    for i in range (r):
        rk *= i + 1
    return int(nk/(nrk*rk))
 
N,K = map(int,input().split())
mod =(10**9)+7
for i in range(K):
    com1 = nCr(N - K + 1, i+1)
    com2 = nCr(K-1,i)
    print((com1*com2)%mod)

Buggy submission (verdict: Runtime Error):
def nCr(n,r):
    nk = 1
    nrk = 1
    rk = 1
    for i in range (n):
        nk *= i + 1
    for i in range (n-r):
        nrk *= i + 1
    for i in range (r):
        rk *= i + 1
    return int(nk/(nrk*rk))

N,K = map(int,input().split())
for i in range(1,K+1):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%(10**9+7))

Buggy submission (verdict: Runtime Error):
def nCr(n,r):
    nk = 1
    nrk = 1
    rk = 1
    for i in range (n):
        nk *= i + 1
    for i in range (n-r):
        nrk *= i + 1
    for i in range (r):
        rk *= i + 1
    return int(nk/(nrk*rk))

N,K = map(int,input().split())
for i in range(1,K):
    com1 = nCr(N - K + 1, i)
    com2 = nCr(K-1,i-1)
    print((com1*com2)%(10**9+7))

Buggy submission (verdict: Runtime Error):
def nCr(n,r):
    nk = 1
    nrk = 1
    rk = 1
    for i in range (n):
        nk *= i + 1
    for i in range (n-r):
        nrk *= i + 1
    for i in range (r):
        rk *= i + 1
    return int(nk/(nrk*rk))

N,K = map(int,input().split())
for i in range(K):
    com1 = nCr(N - K + 1, i+1)
    com2 = nCr(K-1,i)
    print((com1*com2)%(10**9+7))
Problem p03013 (python)

Fixed submission:
N,M = map(int,input().split())
bro = [int(input()) for i in range(M)]
mod = 10**9 + 7
dp = [0]*(N+1)
dp[0] = 1
if len(bro) >= 1 and bro[0] != 1:
    dp[1] = 1
elif len(bro) >= 1:
    del bro[0]
elif len(bro) == 0:
    dp[1] = 1
for i in range(2,N+1):
    if len(bro) == 0:
        dp[i]= (dp[i-1] + dp[i-2]) % mod
    elif bro[0] == i:
        del bro[0]
        continue
    else:
        dp[i]= (dp[i-1] + dp[i-2]) % mod
print(dp[-1] % mod)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
bro = [int(input()) for i in range(M)]
mod = 10**9 + 7
dp = [0]*(N+1)
dp[0] = 1
if bro[0] != 1:
    dp[1] = 1
else:
    del bro[0]
for i in range(2,N+1):
    if len(bro) == 0:
        dp[i]= (dp[i-1] + dp[i-2]) % mod
    elif bro[0] == i:
        del bro[0]
        continue
    else:
        dp[i]= (dp[i-1] + dp[i-2]) % mod
print(dp[-1] % mod)
Problem p03307 (python)

Fixed submission:
N = int(input())
if N % 2 ==0:
  print(N)
else:
  print(2*N)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
list_ai = list(map(int,input().split()))
a1 = np.array(list_ai)-np.arange(1,N+1)
median1 = int(np.floor(np.median(a1)))
ans = np.sum(np.abs(a1-median1))
print(ans)
Problem p02970 (python)

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

if N[0]%(2*N[1]+1)==0:
 S=int(N[0]/(2*N[1]+1))
else:
 S=int(N[0]/(2*N[1]+1))+1
    
print(S)

Buggy submission (verdict: Runtime Error):
import collections
import numpy as np
from matplotlib import pyplot



N=list(map(int,input().split()))
#A=list(map(int,input().split()))

if N[0]%(2*N[1]+1)==0:
 S=int(N[0]/(2*N[1]+1))
else:
 S=int(N[0]/(2*N[1]+1))+1
    
print(S)
Problem p02753 (python)

Fixed submission:
s = input()
if ('A' in s) and ('B' in s):
  print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
for i in range(10000):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    print(i)
    exit()
print(=1)
Problem p02682 (python)

Fixed submission:
A,B,C,K = map(int,input().split(' '))
out = 0
if A>K:
  print(K)
else:
  out += A
  K -= A
  if B > K:
    print(out)
  else:
    K -= B
    out -= K
    print(out)

Buggy submission (verdict: Runtime Error):
A,B,C,K = int(input().split(' '))
out = 0
if A>K:
  print(K)
else:
  out += A
  K -= A
  if B > K:
    print(out)
  else:
    K -= B
    out -= K
    print(out)
Problem p02831 (python)

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

if (a<b):
  tmp = a
  a = b;
  b = tmp

r = a % b
while(r!=0):
  a = b
  b = r
  r = a % b

print(int(x/b))

Buggy submission (verdict: Runtime Error):
import math
x,y=input().split()
x=int(x)
y=int(y)
 
def lcm(x, y):
    return (x * y)/math.gcd(x, y)
 
print(lcm(x, y))

Buggy submission (verdict: Runtime Error):
x,y=input().split()
x=int(x)
y=int(y)

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

print(lcm(x, y))

Buggy submission (verdict: Runtime Error):
import math
x,y=input().split()
x=int(x)
y=int(y)

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

print(lcm(x, y))
Problem p02859 (python)

Fixed submission:
r=int(input())
R=r*r
print(R)

Buggy submission (verdict: Runtime Error):
r=int(input())
R-r*r
print(R)

Buggy submission (verdict: Runtime Error):
r=input()
R=r*r
print(R)
Problem p02859 (python)

Fixed submission:
r = int(input().strip())
print(r * r)

Buggy submission (verdict: Runtime Error):
r = int(input().split())
print(r * r)
Problem p03127 (python)

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


N = int(input())

A = list(map(int, input().split()))
a = A[0]
for i in range(1, len(A)):
    a = gcd(a, A[i])

print(a)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

A = list(map(int, input().split()))
a = A[0]
for i in range(1, len(A)):
    a = math.gcd(a, A[i])

print(a)
Problem p02693 (python)

Fixed submission:
K = int(input())
A, B = map(int,input().split())
number = A
count = 0
while(1):
 if(number%K == 0):
  count +=1
 number += 1  
 if(number > B):
  if(count >0):
    print("OK")
  else:
    print("NG")
  break;

Buggy submission (verdict: Runtime Error):
A, B, N = map(int,input().split())
if(B-A < N) :
 cal = int((A*N)/B) - A*int(N/B)
 print(cal)
else 
 max = 0
 i=N
 while(1):
  cal = int((A*i)/B) - A*int(i/B)
  if(cal > max):
   max =cal
  i += -1
  if(i < 0):
   print(max)
   break;
Problem p02723 (python)

Fixed submission:
S = input()
if(S[2] == S[3] and S[4]==S[5] ):
	print("Yes")
else :
	print("No")

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int,input().split()) 
P = [list(map(int,input().split())) for i in range(3)]
Red = sorted(P[0], reverse=True)
Green = sorted(P[1], reverse=True)
Trans = sorted(P[2], reverse=True)

pre_max = sum(Red[:X]) + sum(Green[:Y])
Red = Red[:X]
Green = Green[:Y]
for i in range (C):
  maxo = pre_max
  if (Trans[i] > Red[-1+i]):
    maxo= pre_max + Trans[i] - Red[-1+i]
for i in range (C):
  if (Trans[i] > Green[-1+i]):
    maxo = pre_max + Trans[i] - Green[-1+i]
    
print(maxo)
Problem p02754 (python)

Fixed submission:
N,b,r = map(int,input().split())
if(b == 0 and r == 0):
  print(0)
elif (b ==0):
  print(0)
else :
  sets = N//(b+r)
  surplus = N%(b+r)
  if(surplus - b > 0):
    residue = b
  elif(surplus - b < 0):
    residue = surplus  
  Number_of_Blue = sets * b + residue
  print(Number_of_Blue)

Buggy submission (verdict: Runtime Error):
N,b,r = input().split()
if(b==0 and r == 0):
  print(0)
else :
  sets = N/(b+r)
  surplus = N%(b+r)
  Numbe_of_Blue = sets * b + b
  print(Numbe_of_Blue

Buggy submission (verdict: Runtime Error):
N,b,r = input().split()
if(b==0 and r == 0):
  print(0)
else :
  set = N/(b+r)
  surplus = N%(b+r)
  Numbe_of_Blue = set * b + b
  print(Numbe_of_Blue)
Problem p02659 (python)

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

A = int(A)
B = int(''.join(B.split('.')))
print(A*B//100)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int, input().split())
print(int(math.floor(a*b)))
Problem p02682 (python)

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

if k <= a:
  print(k)
elif a <= k <= a+b:
  print(a)
else:
  print(a - (k - (a+b)))

Buggy submission (verdict: Runtime Error):
a,b,c,k = map(int, input().split())

if k <= a:
  print(k)
elif a < k <= a+b:
  print(a):
else:
  print(a - (k - (a+b)))
Problem p02754 (python)

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

print((n//(a+b))*a + min(n%(a+b), a))

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

k = n//(a+b) + 1
L = ["b"]*a +["r"]*b
L = L*k
print(L[0:n].count("b"))

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

k = n//(a+b) + 
L = ["b"]*a +["r"]*b
L = L*k
print(L[0:n+1].count("b"))
Problem p02831 (python)

Fixed submission:
import fractions
a,b = map(int, input().split())
k = fractions.gcd(a,b)
print(a * b // k)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int, input().split())
print(a * b // math.gcd(a,b))
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
if n % 2 != 0:
  print("No")
else:
  T = s[0:n//2]
  if T + T == s:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
t = s[0:n//2]
if s = t+t:
  print("Yes")
else:
  print("No")
Problem p02935 (python)

Fixed submission:
n = int(input())
V = list(map(int, input().split()))
V.sort()
V.reverse()

if len(V) == 2:
  print((V[0]+V[1])/2)
else:
  ans = 0
  for i in range(n-1):
    ans += V[i]/(2**(i+1))
  ans += V[n-1]/(2**(n-1))
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
V = list(map(int, input().split()))
V.sort()
V.reverse()

if len(V) == 2:
  print(V[0]+V[1])/2
else:
  ans = 0
  for i in range(n-1):
    ans += V[i]/(2**(i+1))
  ans += V[n-1]/(2**(n-1))
  print(ans)