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

Fixed submission:
N=input()
s=str(N)
s1=s[-1]
s2=s[-2]
s3=s[-3]
if s1 == '7':
    print('Yes')
elif s2 == '7':
    print('Yes')
elif s3=='7':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=input()
i = 3
j = 5
k = 15
total3 = 0
total5 = 0
total15 = 0
while i<=N:
  total3 += i
  i = i + 3
while j<=N:
  total5 += j
  j = j + 5
while k<=N:
  total15 += k
  k = k + 15
N_sum = (1 + N) * N / 2

ans = N_sum - i - j + k

print(ans)

Buggy submission (verdict: Runtime Error):
N=input()
s=str(N)
s1=s[-1]
s2=s[-2]
s3=s[-3]
if s1=='7':
    print('Yes')
    elif s2=='7':
          print('Yes')
        elif s3=='7':
              print('Yes')
            else:
                print('No')

Buggy submission (verdict: Runtime Error):
N=input()
s=str(N)
s1=s[-1]
s2=s[-2]
s3=s[-3]
if s1==7:
    print('Yes')
    elif s2==7:
          print('Yes')
        elif s3==7:
              print('Yes')
            else:
                print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N=input()
#値を入力
s=str(N)
s1=s[-1]
s2=s[-2]
s3=s[-3]
if s1==7:
  print('Yes')
  elif s2==7:
    print('Yes')
    elif s3==7:
      print('Yes')
      else:
        print('No')
Problem p02712 (python)

Fixed submission:
N = int(input())
print (N*(N+1)//2 - 3*(N//3)*((N//3)+1)//2 - 5*(N//5)*((N//5)+1)//2 + 15*(N//15)*((N//15)+1)//2)

Buggy submission (verdict: Runtime Error):
N = int(input())
print (N*(N+1)//2 - 3*(N//3)((N//3)+1)//2 - 5*(N//5)((N//5)+1)//2 + 15*(N//15)((N//15)+1)//2)

Buggy submission (verdict: Runtime Error):
N = int(input())
print (N(N+1)//2 - 3*(N//3)((N//3)+1)//2 - 5*(N//5)((N//5)+1)//2 + 15*(N//15)((N//15)+1)//2)

Buggy submission (verdict: Runtime Error):

N = int(input())
print (N(N+1)//2 - 3*(N//3)((N//3)+1)/2 - 5*(N//5)((N//5)+1)/2 + 15*(N//15)((N//15)+1)/2)
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):
S=input()
if S[2]=S[3] and S[4] = S[5]:
    print ('Yes')
else:
    print('No')
Problem p02725 (python)

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

A_length_max = K-A[N-1]+A[0]
for i in range (N-1): #0, 1, 2, ...N-2
    A_length_max=max(A_length_max, A[i+1]-A[i])
print(K-A_length_max)

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

for i in range (N-2):
    A_length=list(A[i+1]-A[i])
A_length.append = [K-(A[N-1]-A[0])]
print(K-(max(A_length)))

Buggy submission (verdict: Runtime Error):

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

A_sorted=sorted(A)

if sorted_A[N-1]-sorted_A[0] <K/2:
    print(sorted_A[N-1]-sorted_A[0])

else:
    for i in range (0, N-1):
        if A[i] > K/2:
            A[i]=A[i]-K
        else:
            A[i]=A[i]

    a=A_sorted[N-1]-A_sorted[0]
    b=K-a

    print(min(a, b))

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

for i range (0, N-1):
    if A[i] > K/2:
        A[i]=A[i]-K
    else:
        A[i]=A[i]

A_sorted=sorted(A)

print(A_sorted[N-1]-A_sorted[0])

Buggy submission (verdict: Runtime Error):

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

for i range (0, N-1):
    if A[i] > K/2:
        A[i]=K-A[i]
    else:
        A[i]=A[i]

A_sorted=sorted(A)

print(A_sorted[N-1]-A_sorted[0])
Problem p02766 (python)

Fixed submission:
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    else: 
        return str(n%b)
N, K=map(int, input().split())
x = base10to(N,K)
print(len(x))

Buggy submission (verdict: Runtime Error):
def base10to(n, b):
　  if (int(n/b)):
　　    return base10to(int(n/b), b) + str(n%b)
    else: 
        return str(n%b)
N, K=map(int, input().split())
x = base10to(N,K)
print(len(x))

Buggy submission (verdict: Runtime Error):
def base10to(n, b):
　  if (int(n/b)):
　　    return base10to(int(n/b), b) + str(n%b)
    return str(n%b)
N, K=map(int, input().split())
x = base10to(N,K)
print(len(x))

Buggy submission (verdict: Runtime Error):
def base10to(n, b):
　  if (int(n/b)):
　　    return base10to(int(n/b), b) + str(n%b)
    return str(n%b)
N, K=map(int, input().split())
print(len(base10to(N,K)))
Problem p02970 (python)

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

a = d * 2 + 1

b=n/a
b = int(b)
c=n%a
if c>0:
    b = b + 1
    
print(b)

Buggy submission (verdict: Runtime Error):
,d = map(int,input().split())

a = d * 2 + 1

b=n/a
b = int(b)
c=n%a
if c>0:
    b = b + 1
    
print(b)
Problem p03013 (python)

Fixed submission:
def fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b
    
N, M = map(int, input().split())
a = [-1]
for i in range(M):
    a.append(int(input()))
    
for i in range(M-1):
    if a[i+1] == (a[i] + 1):
        print(0)
        exit()
    
combi = 1

for i in range(len(a)-1):
    dis = a[i+1] - a[i]
    #print(dis)
    combi *= fib(dis)
    #print(a[i])
    
dis = N+1 - a[-1]
#print(dis)
combi *= fib(dis)

print(combi % 1000000007)

Buggy submission (verdict: Runtime Error):
import sys
import sympy as sym

def fib(n):
    x = sym.symbols('x',nonnegative=True,integer=True)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1)) #一般項の式
    result=Fib.subs(x,n)
    result=result.evalf()
    return int(result)


N, M = map(int, input().split())
a = [-1]
for i in range(M):
    a.append(int(input()))
    
for i in range(M-1):
    if a[i+1] == (a[i] + 1):
        print(0)
        exit()
    
combi = 1

for i in range(len(a)-1):
    dis = a[i+1] - a[i]
    combi *= fib(dis)
    
dis = N+1 - a[-1]
combi *= fib(dis)

print(combi % 1000000007)
Problem p02711 (python)

Fixed submission:
def check(n):
	while n > 0:
		if n%10 == 7:
			return "Yes"
		n = int(n/10)
	return "No"

no = int(input())
print(check(no))

Buggy submission (verdict: Runtime Error):
no = input()
c = false
while no > 0:
  if no%10 == 7:
    c = true
if c == true:
  print("Yes")
else :
  print("No")
Problem p02711 (python)

Fixed submission:
a=input()
q = -1
if a[0]=='7':
    q =1
elif a[1]=='7':
    q = 1
elif a[2]=='7':
    q = 1

if q > 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())

def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]

R_index = my_index_multi(s,'R')
G_index = my_index_multi(s,'G')
B_index = my_index_multi(s,'B')

for i in range(len(R_index)):
    R_index[i] += 1
for j in range(len(G_index)):
    G_index[j] += 1
for k in range(len(B_index)):
    B_index[k] += 1

count = 0
for i in range(len(R_index)):
    for j in range(len(G_index)):
        for k in range(len(B_index)):
            li = [R_index[i],G_index[j],B_index[k]]
            li.sort()
            if (li[1]*2 != li[0]+li[2]):
                count = count +1

#print(R_index)
#print(G_index)
#print(B_index)
print(count)
Problem p02757 (python)

Fixed submission:
import numpy as np

def a():
  n, p = list(map(int, input().split()))
  num = [int(s) for s in input()]
  
  if(p==2 or p==5):
    count=0
    for i in range(1,n+1):
      if(num[-i]%p == 0):
        count += n-i+1
    print(count)
    return
  
  counts = np.zeros(p)
  tmp = 0
  tens = 1
  for i in range(1,n+1):
    tmp = (tens*num[-i] + tmp) % p
    counts[tmp] += 1
    tens = (tens*10)%p
  ret = int(counts[0] + sum(counts*(counts-1)//2))
  print(ret)
  return
a()

Buggy submission (verdict: Runtime Error):
n, p = list(map(int, input().split()))
s = input()

count = 0
res = [s[i:j] for i in range(n) for j in range(i+1, n+1)] 

for ss in res:
  if(int(ss) % p == 0):
      count += 1
print(count)
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, B)

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A,B)
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Buggy submission (verdict: Runtime Error):
ndef gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Buggy submission (verdict: Runtime Error):
num, bricks, count, smash = int(input()), [int(x) for x in input().split(" ")], 1, 0
for x in bricks:
    if count == x: count += 1
    else: smash += 1
print(smash if smash != len(bricks) else 0 if len(bricks) == 1 else -1)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))
Problem p02711 (python)

Fixed submission:
x=input()
a=x[0]
b=x[1]
c=x[2]
if a=="7":
  print("Yes")
elif b=="7":
  print("Yes")
elif c=="7":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x=input()
a=x[0]
b=x[1]
c=x[2]
if a=="7":
  print("Yes")
  break
elif b=="7":
  print("Yes")
  break
elif c=="7":
  print("Yes")
  break
else:
  print("No")
Problem p02712 (python)

Fixed submission:
import math

x=int(input())
s=math.floor(x/3)
f=math.floor(x/5)
sf=math.floor(x/15)
sum=math.floor(x*(x+1)/2)

s_sum=math.floor(3*s*(s+1)/2)
f_sum=math.floor(5*f*(f+1)/2)
sf_sum=math.floor(15*sf*(sf+1)/2)

fl=sum-(s_sum+f_sum-sf_sum)
print(math.floor(fl))

Buggy submission (verdict: Runtime Error):
import math

x=int256(input())
s=math.floor(x/3)
f=math.floor(x/5)
sf=math.floor(x/15)

s_sum=math.floor(3*s*(s+1)/2)
f_sum=math.floor(5*f*(f+1)/2)
sf_sum=math.floor(15*sf*(sf+1)/2)

sum=s_sum+f_sum-sf_sum
print(math.floor(sum))
Problem p02762 (python)

Fixed submission:
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * (n)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

n,m,k=map(int,input().split())
friends_cand = UnionFind(n)
not_cand = [0 for i in range(n)]

for i in range(m):
    a,b = map(int, input().split())
    a, b = a-1, b-1
    friends_cand.union(a,b)
    not_cand[a] +=1
    not_cand[b] +=1
for i in range(k):
    c,d = map(int, input().split())
    c, d = c-1, d-1
    if friends_cand.find(c) == friends_cand.find(d):
        not_cand[c] +=1
        not_cand[d] +=1

size = [0 for i in range(n)]
for i in range(n):
    size[friends_cand.find(i)]+=1

ans = []
for i in range(n):
    ans.append(size[friends_cand.find(i)] - not_cand[i] - 1)
print(*ans)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
tree = [[] for i in range(N)]
block  = [[] for i in range(N)]
frends_cand = [set() for i in range(N)]

for i in range(M):
    a,b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
        
for i in range(K):
    a,b = map(int, input().split())
    block[a-1].append(b-1)
    block[b-1].append(a-1)

not_visited = set([i for i in range(N)])

visited = set()
def dfs(now):
    global visited
    visited.add(now)
    if  len(tree[now]) ==0:
        return print(now)
    else:
        next_tree  = set(tree[now]) - visited#有向であればtree[now]でok
        for i in next_tree:
            dfs(i)

while len(not_visited) !=0:
    visited = set()
    next_start = not_visited.pop()
    dfs(next_start)
    not_visited = not_visited - visited
    for i in visited:
        frends_cand[i] = visited

ans = ""        
for index, cand in enumerate(frends_cand):
    friend_cand = cand - set(block[index]) - set(tree[index])
    ans +=str(len(friend_cand)-1) + ' '
print(ans.strip())
Problem p02833 (python)

Fixed submission:
N = input()
if len(N) <= 1:
  print(0)
  exit()
if int(N[-1]) %2 == 0:
    ans = int(N[:-1])
    N = int(N[:-1])
    k = 1
    while k != 0:
        k = N // 5
        N = k
        ans += k
    print(ans)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = input()
if int(N[-1]) %2 == 0:
    ans = int(N[:-1])
    N = int(N[:-1])
    k = 1
    while k != 0:
        k = N // 5
        N = k
        ans += k
    print(ans)
else:
    print(0)
Problem p02711 (python)

Fixed submission:
nums = [int(i) for i in list(input())]
for i in nums:
  if  i == 7:
    print("Yes")
    break
else:
  print("No")

Buggy submission (verdict: Runtime Error):
num = map(int,input().split())
for i in num:
  if num[i] == 7:
    break
    print("Yes")
else:
  print("No")
Problem p02753 (python)

Fixed submission:
s = input()
if s[0] == s[1] and s[1] == s[2]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s = input().split()
if s[0] == s[1] and s[1] == s[2]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s = input().split()
if s[0] == s[1] and s[1] == s[2]:
  print('No'):
else:
  print('Yes')
Problem p02711 (python)

Fixed submission:
x = input()
if '7' in x :
    print('Yes')
else :
    print('No')

Buggy submission (verdict: Runtime Error):
x = input()
if '7' in x :
	print(Yes)
else :
	print(No)
Problem p02711 (python)

Fixed submission:
S=input()
if '7' in S:
  print('Yes')
else:
  print( 'No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S=input()
if 7 in S:
  print('Yes')
else:
  print( 'No')
Problem p02773 (python)

Fixed submission:
from collections import defaultdict
from collections import OrderedDict
N = int(input())
ans = dict()
for _ in range(N):
    k = str(input())
    if k in ans:
        ans[k]+=1
    else:
        ans.update({k:1})
groupedByValue = defaultdict(list)
for key, value in sorted(ans.items()):
    groupedByValue[value].append(key)
l = groupedByValue[max(groupedByValue)]
for i in l:
    print(i)

Buggy submission (verdict: Runtime Error):
n = input()
a = input().split("")
b = list(set([x for x in a if a.count(x) > 1]))

for i in b:
    print(i)

Buggy submission (verdict: Runtime Error):
n = input()
a = input().split("")
b = list(set([x for x in a if a.count(x) > 2]))

for i in b:
  print(i)
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Buggy submission (verdict: Runtime Error):
def check(a, b):
  return b if a == 0 else check(b%a, a)
n = [int(i) for i in input().split(" ")]
print(int(n[0]*n[1]/check(n[0], n[1])))*
Problem p02833 (python)

Fixed submission:
N = int(input())
l = len(str(N))
if N < 2:
    print(0)
elif N % 2 == 1:
    print(0)
else:
    ans = 0
 
    for i in range(1, 2*l):
        tmp = 0
        ans += (N // 10**i)
        tmp += (N // (10 * (5**i)))
        tmp -= N // (10 * (10**i))
        ans += max(tmp, 0)
 
    print(ans)

Buggy submission (verdict: Runtime Error):

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int res = factorial(n);
        String str = Integer.toString(res);
        StringBuilder rev = new StringBuilder(str);
        String s = rev.reverse().toString();
        String[] st = s.split("");
        int count = 0;
        for (int i=0; i<st.length; i++){
            if (st[i].contains("0")) {
                count += 1;
            } else {
                break;
            }
        }
        System.out.println(count);

    }

    public static int factorial(int a){
        return (a<2)?1:a*factorial(a-2);
    }
}

Buggy submission (verdict: Runtime Error):

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int res = factorial(n);
        String str = Integer.toString(res);
        StringBuilder rev = new StringBuilder(str);
        String s = rev.reverse().toString();
        String[] st = s.split("");
        int count = 0;
        for (int i=0; i<st.length; i++){
            if (st[i].contains("0")) {
                count += 1;
            } else {
                break;
            }
        }
        System.out.println(s);
        System.out.println(count);

    }

    public static int factorial(int a){
        int res = 0;
        if (a<2) {
            res = 1;
        } else {
            res = a*factorial(a-2);
        }
        return res;
    }
}
Problem p02712 (python)

Fixed submission:
n=int(input())
l=[]
sum=0
for i in range(1,n+1):
         if i%3!=0 and i%5!=0:
                    l.append(i)
                    sum+=i
print(sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[]
sum=0
for i in range(1,n+1):
         if  i%3==0 and i%5 ==0:
                    l.apoend("FizzBuzz")
         elif i%3==0 and i%5!=0:
                    l.append("Fizz")
         elif i%5==0 and i%3!=0:
                    l.append("Buzz")
         else:
                    l.append(i)
                    sum+=i
print(sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[]
sum=0
for i in range(1,n+1):
         if  i%3==0 and i%5 ==0:
                    l.apoend("FizzBuzz")
         elif i%3==0 and i%5!=0:
                    l.append("Fizz")
         elif i%5==0 and i%3!=0:
                    l.append("Buzz")
         elif i%3!=0 and i%5!=0:
                    l.append(i)
                    sum+=i
print(sum)
Problem p02711 (python)

Fixed submission:
N = input ()
a = "No"
for n in N:
  if n == "7":
    a = "Yes"
print (a)

Buggy submission (verdict: Runtime Error):
    N = input()
    a = "No"
    for n in N:
      if n == "7":
        a = "Yes"
    print (a)

Buggy submission (verdict: Runtime Error):
N = input
a = "No"
for n in N:
  if n == "7":
    a = "Yes"
print (a)
Problem p02729 (python)

Fixed submission:
import math
def com(a):
    if a == 0 or a == 1:
        return 0
    elif a == 2:
        return 1
    else:
        return math.factorial(a)/2/math.factorial(a-2)
A = list(map(int, input().split()))
result  = int(com(A[0])+com(A[1]))
print (result)

Buggy submission (verdict: Runtime Error):
import math
A = list(map(int, input().split()))
result  = math.factorial(A[0])/2/math.factorial(A[0]-2)+math.factorial(A[1])/2/math.factorial(A[1]-2)
print (result)
Problem p02711 (python)

Fixed submission:
a, b, c = input()

if a == '7' or b == '7' or c == '7':
  print('Yes')
else:
  print('No')

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

if n[0] == '7':
  print('Yes')
elif n[1] == '7':
  ptint('Yes')
elif n[2] == '7':
  print('Yes')
else:
  print('No')

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

if '7' in n:
  print('Yes')
else:
  ptint('No')

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

if '7' in n:
  print('Yes')
else:
  ptint('No')
Problem p02753 (python)

Fixed submission:
S=input()
list=[]
ans=['*', '*', '*']
for s in S:list+="*" if s==S[0] else s

if list==ans :
    print('No')
else :
    print('Yes')

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

list_a=[]
for i in range(a):
    list_a+="a"
list_b=[]
for i in range(b):
    list_a+="b"

list=[]
for i in range(10**100):
    if len(list)>=n:
        break
    else:
        if i%2==0:
            list+=list_a
        else:
            list+=list_b
ans=0
for i in range(n):
    if list[i]=="a":
        ans+=1
    else:
        ()
print(ans)

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

list_a=[]
for i in range(a):
    list_a+="a"
list_b=[]
for i in range(b):
    list_a+="b"

list=[]
for i in range(10**100):
    if len(list)>=n:
        break
    else:
        if i%2==0:
            list+=list_a
        else:
            list+=list_b
ans=0
for i in range(n):
    if list[i]=="a":
        ans+=1
    else:
        ()
print(*list)
print(ans)

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

list_a=[]
for i in range(a):
    list_a+="a"
list_b=[]
for i in range(b):
    list_a+="b"

list=[]
for i in range(10**100):
    if len(list)>=n:
        break
    else:
        if i%2==0:
            list+=list_a
        else:
            list+=list_b
ans=0
for i in range(n):
    if list[i]=="a":
        ans+=1
    else:
        ()
print(*list)
print(ans)
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
a_l=n//(a+b)
b_l=n%(a+b)
if b_l > a : b_l = a
print(a_l*a+b_l)

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

list_a="a"*a
list_b="b"*b
if a==0:
    print(0)
    sys.exit()
a_l=int(n/(a+b))
b_l=n%(a+b)
if b_l > a : b_l =a
print(a_l*a+b_l)

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

list_a="a"*a
list_b="b"*b
a_l=int(n/(a+b))
b_l=n%(a+b)
if b_l > a : b_l =a
print(a_l*a+b_l)

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

list_a="a"*a
list_b="b"*b

list=[]
for i in range(10**100):
    if len(list)>=n:
        break
    else:
        if i%2==0:
            list+=list_a
        else:
            list+=list_b

ans=0
for i in range(n):
    if list[i]=="a":
        ans+=1
    else:
        ()
print(ans)

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

list_a="a"*a
list_b="b"*b

list=[]
for i in range(10**100):
    if len(list)>=n:
        break
    else:
        if i%2==0:
            list+=list_a
        else:
            list+=list_b
ans=0
for i in range(n):
    if list[i]=="a":
        ans+=1
    else:
        ()

print(ans)
Problem p02897 (python)

Fixed submission:
n = int(input())
if n == 1:
  print(1/1)
elif n%2 == 0:
  print(n/2/n)
else:
  print((((n-1)/2)+1)/n)

Buggy submission (verdict: Runtime Error):
n = input()
if n = 1:
  print(1/1)
elif n%2 == 0:
  print(n/2/n):
elif n%2 != 0:
  print(((n-1)/2)/n)
Problem p02951 (python)

Fixed submission:
a, b, c = map(int, input().split())
if b + c > a:
  print(c-(a-b))
elif b + c <= a:
  print(0)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if b + c > a:
  print(c-(a-b))
elif b + c =< a:
  print(0)
Problem p02933 (python)

Fixed submission:
a=int(input())
s=input()

if a>=3200:
  print(s)
else:
  print("red")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=input().split(" ")
A=[int(i) for i in A]
A.sort()

def act(A):
  if len(A)%2==0:
    A_=[]
    for i in range(int(len(A)/2)):
      A_.append((A[2*i]+A[2*i+1])/2)
    return A_
  
  elif len(A)%2==1:
    A_=[]
    for i in range(int((len(A)-1)/2)):
      A_.append((A[2*i]+A[2*i+1])/2)
    A_.append(A[len(A)-1])
    return A_
    
    
while len(A)>1:
  A=act(A)

print(A[0])
Problem p02990 (python)

Fixed submission:
N,K=map(int,input().split())
mod=10**9+7

C=[[1]*(i+1) for i in range(N+1)]
for i in range(2,N+1):
  for j in range(1,i):
    C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod

for i in range(1,K+1):
  if N-K+1<i:
    print(0)
  else:
    print((C[N-K+1][i]*C[K-1][i-1])%mod)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
mod=10**9+7

C=[[1]*(i+1) for i in range(N+1)]
for i in range(2,N+1):
  for j in range(1,i):
    C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod

for i in range(1,K+1):
  print((C[N-K+1][i]*C[K-1][i-1])%mod)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
mod=10**9+7

C=[[1]*(i+1) for i in range(N)]
for i in range(2,N):
  for j in range(1,i):
    C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod

for i in range(1,K+1):
  print((C[N-K+1][i]*C[K-1][i-1])%mod)