qyliang/CodeNanoFix huggingface dataset:
Buggy code:
in = input()
str = list(in)

ca = str.count("A")
cb = str.count("B")

if ca == 3 or cb == 3:
  print("No")
else:
  print("Yes")


Fixed code:
s = input()
str = list(s)
 
ca = str.count("A")
cb = str.count("B")
 
if ca == 3 or cb == 3:
  print("No")
else:
  print("Yes")
Buggy code:
def main():
    s = input()
    if s != "AAA" or s != "BBB":
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Fixed code:
def main():
    s = input()
    if s != "AAA" and s != "BBB":
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
Buggy code:
a=input()
p1=a[0]
p2=a[1]
p3=a[3]

if p1==p2==p3:
  print("No")
else:
  print("Yes")

Fixed code:
a=input()
p1=a[-1]
p2=a[0]
p3=a[1]
 
if p1==p2==p3:
  print("No")
else:
  print("Yes")
Buggy code:
s = input()
if s == 'AAA' or 'BBB':
    ans = 'No'
else:
    ans = 'Yes'
print(ans)

Fixed code:
s=input()
if s=="AAA" or s=="BBB":
    print("No")
else:
    print("Yes")
Buggy code:



S = input()

if len(set(S)) == 1:
    print("Yes")
else:
    print("No")
    

Fixed code:
S=input()
if len(set(S))==1:
  print("No")
else:
  print("Yes")
Buggy code:
S = input()
if (S=="AAA")or(S=="BBB"):
    print("Yes")
else:
    print("No")

Fixed code:
S = input()
if (S=="AAA")or(S=="BBB"):
    print("No")
else:
    print("Yes")
Buggy code:
s = [i for i in input()]
s0 = s[0]
for j in s[1:]:
  if s0 != j:
    print("No")
    exit()
  s0 = j
print("Yes")

Fixed code:
s = [i for i in input()]
s0 = s[0]
for j in s[1:]:
  if s0 != j:
    print("Yes")
    exit()
  s0 = j
print("No")
Buggy code:
S=str(input())
if S==AAA or S==BBB:
    print('No')
else:
    print('Yes')

Fixed code:
S=input()
if S=='AAA'or S=='BBB':
  print('No')
else:
  print('Yes')
Buggy code:
a = str(input())
if a == "AAA"or"BBB":
  print("No")
else:
  print("Yes")

Fixed code:
a = str(input())
if a == "AAA" or a == "BBB":
  print("No")
else:
  print("Yes")
Buggy code:
s=input()
print("Yes" if s[0]==s[1]==s[2] else "No")

Fixed code:
s=input()
print("No" if s[0]==s[1]==s[2] else "Yes")
Buggy code:
s = input()
if s == 'AAA' or S === 'BBB':
  print('No')
else:
  print('Yes')

Fixed code:
s = input()
if s == 'AAA' or s == 'BBB':
  	print('No')
else:
    print('Yes')
Buggy code:
a = input()
if a='AAA' or a='BBB':
  print('No')
else:
  print('Yes')

Fixed code:
a = input()
if a=='AAA' or a=='BBB':
  print('No')
else:
  print('Yes')
Buggy code:
print('Yes' if set(input()) == 2 else 'No')

Fixed code:
print('Yes' if len(set(input())) == 2 else 'No')
Buggy code:
s=int(input())
if s[0] == s[1] and s[1] == s[2] and s[0] == s[2]:
  print('No')
else:
  print('Yes')


Fixed code:
s = input()

if s[0] == s[1] and s[1] == s[2]:
  print('No')
else:
  print('Yes')
Buggy code:
S = input()

print('No' if S == 'AAA' or 'BBB' else 'Yes')

Fixed code:
S=input()

if S=="AAA" or S=="BBB":
  print("No")
else:
  print("Yes")
Buggy code:
# import module
import sys
import math
import numpy as np

S = input()

if S.find(A) != -1 and S.find("B") != 0:
    print("Yes")
else:
    print("No")

Fixed code:
# import module
import sys
import math
import numpy as np

S = input()

if S.find("A") != -1 and S.find("B") != -1:
    print("Yes")
else:
    print("No")
Buggy code:
print("Yes" if len(set(input())) == 1 else "No")

Fixed code:
print("Yes" if len(set(input())) != 1 else "No")
Buggy code:
S = input()
if S[0]==S[1]==S[2]:
    print('Yes')
else:
    print('No')

Fixed code:
S = input()
if S[0]==S[1]==S[2]:
    print('No')
else:
    print('Yes')
Buggy code:
s = input()
if s == 'AAA'or 'BBB':
    print('No')
else :
    print('Yes')

Fixed code:
s = input()
if s == 'AAA'or  s =='BBB':
    print('No')
else :
    print('Yes')
Buggy code:
s = input()
if "A" and "B" in s:
  print("Yes")
else:
  print("No")

Fixed code:
s = input()
if "A" in s and "B" in s:
	print("Yes")
else:
	print("No")
Buggy code:
S=input()

if S[0] == S[1] == S[2]:
    print('Yes')
else :
    print('No')

Fixed code:
S =str(input())
if S[0]==S[1]==S[2]:
       print('No')
else:
       print('Yes')
Buggy code:
S = input()
print(S)
if S == "AAA" or S == "BBB" :
    print("No")
else :
    print("Yes")


Fixed code:
S=input()

if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')
Buggy code:
N, A, B = map(int,input().split())
ans = N//(A+B)
R = N%(A+B)
ans += min(R, A)
print(ans)

Fixed code:
N, A, B = map(int,input().split())
ans = (N//(A+B)) * A
R = N%(A+B)
ans += min(R, A)
print(ans)
Buggy code:
import math
a,b,c= input().split()
x,y,z=(int(a),int(b),int(c))
num_one_gr = y + z
num_gr = math.floor(x/num_one_gr)
amari = x - num_one_gr*num_gr
if amari <= y:
    total = y * num_gr + amari
else:
    total = y*(num_gr + 1)

Fixed code:
import math
a,b,c= input().split()
x,y,z=(int(a),int(b),int(c))
num_one_gr = y + z
num_gr = math.floor(x/num_one_gr)
amari = x - num_one_gr*num_gr
if amari <= y:
    total = y * num_gr + amari
else:
    total = y*(num_gr + 1)
print(total)
Buggy code:
N, A, B= map(int, input().split())
re += N//(A+B) *A
re += min(N%(A+B),A)
print(re)

Fixed code:
N, A, B = map(int, input().split())
print(A*(N//(A+B)) + min(A, N%(A+B)))
Buggy code:
# problem B
N,A,B = map(int,input().split())

syou = N // (A+B)
amari = N % (A+B)

ans = syou * A 
if amari >= A:
    ans += B
else:
    ans += amari
    
print(ans)

Fixed code:
# problem B
N,A,B = map(int,input().split())

syou = N // (A+B)
amari = N % (A+B)

ans = syou * A 
if amari >= A:
    ans += A
else:
    ans += amari
    
print(ans)
Buggy code:
n, a, b = input().split()
 
d = n // (a + b)
m = n % (a + b)
 
blue = a * d
if m >= a:
  blue = blue + a
else:
  blue = blue + m
  
print(blue)

Fixed code:
n, a, b = input().split()
n = int(n)
a = int(a)
b = int(b)
 
d = n // (a + b)
m = n % (a + b)
 
blue = a * d
if m >= a:
  blue = blue + a
else:
  blue = blue + m
  
print(blue)
Buggy code:
N,A,B = map(int,input().split())

if A == 0:
    print(0)
else:
    if N > A+B:
        a = N / (A+B)
        b = N % (A+B)
        if b > A:
            b = A
        print(a*A + b)
    else:
        if A > N:
            print(N)
        else:
            print(A)

Fixed code:
N,A,B = map(int,input().split())

if A == 0:
    print(0)
else:
    if N > A+B:
        a = N // (A+B)
        b = N % (A+B)
        if b > A:
            b = A
        print(a*A + b)
    else:
        if A > N:
            print(N)
        else:
            print(A)
Buggy code:
N, A, B = map(int,input().split())

SYO = N // (A+B)
AMARI = N % (A+B)
if AMARI < A:
    print(SYO*A+AMARI)
else:
    print(SYO*(A+1))

Fixed code:
N, A, B = map(int,input().split())

SYO = N // (A+B)
AMARI = N % (A+B)
if AMARI < A:
    print(SYO*A+AMARI)
else:
    print((SYO+1)*A)
Buggy code:
n, a, b = map(int, input().split())
print(a * (n // (a + b)) + min(a, n % (a + b))

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

print( n//(a+b)*a + min(n%(a+b),a) )
Buggy code:
N, A, B = map(int, input().split())
kaisu = N//(A+B)
print(kaisu)
n = N-((A+B)*kaisu)
if n >= A:
    print(A*(kaisu+1))
else:
    print(A*kaisu+n)

Fixed code:
N, A, B = map(int, input().split())
kaisu = N//(A+B)

n = N-((A+B)*kaisu)
if n >= A:
    print(A*(kaisu+1))
else:
    print(A*kaisu+n)
Buggy code:
a,b,c=map(int,input().split())
n = a // (b+c)
m = a - (b+c)*n
res = n*b
if b < m:
  res += m
else:
  res += b
print(res)

Fixed code:
a,b,c=map(int,input().split())
n = a // (b+c)
m = a - (b+c)*n
res = n*b
if m < b:
  res += m
else:
  res += b
print(res)
Buggy code:
N, B, R = map(int, input().split())

ans = (N // (B+R)) * B
print(ans)


rest = N % (B+R)

print(rest)

if rest < B:
  print(ans+rest)
else:
  print(ans+B)  

Fixed code:
N, B, R = map(int, input().split())

ans = (N // (B+R)) * B
rest = N % (B+R)

if rest <= B:
  print(ans+rest)
else:
  print(ans+B)
Buggy code:
# -*- coding: utf-8 -*-

n, a, b = map(int,input().split(' '))

if n < a:
    print(n)
else:
    ans = (n//(a+b))*a
    m = n%(a+b)
    print(ans, m)
    if m >= a:
        ans += a
    else:
        ans += m

    print(ans)

Fixed code:
# -*- coding: utf-8 -*-

n, a, b = map(int,input().split(' '))

if n <= a:
    print(n)
else:
    ans = (n//(a+b))*a
    m = n%(a+b)
    if m >= a:
        ans += a
    else:
        ans += m

    print(ans)
Buggy code:
n, a, b = map(int, input().split())
if a == 0:
  print(0)
else:
  print((n // (a + b)) * a + (n // (a + b)))

Fixed code:
n, a, b = map(int, input().split())
if a == 0:
  print(0)
else:
  if n % (a + b)<=a:
    print(n // (a + b) * a + n % (a + b))
  else:
    print(n // (a + b) * a + a)
Buggy code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))

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


if (a == 0):
    print (0)
    exit()

ans = n // (a+b) * 3

amari = n % (a+b)
if (amari <= a):
    ans += amari
else:
    ans +=a

print (ans)



Fixed code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))

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


if (a == 0):
    print (0)
    exit()

ans = n // (a+b) * a

amari = n % (a+b)
if (amari <= a):
    ans += amari
else:
    ans +=a

print (ans)
Buggy code:
N,A,B = map(int, input().split())

num_move = N // (A+B)
rest = N % (A+B)

if (rest >= A):
    result = A*num_move
else:
    result = A*(num_move-1)+rest

print(result)

Fixed code:
N,A,B = map(int, input().split())

num_move = N // (A+B)
rest = N % (A+B)

if (rest > A):
    result = A*(num_move+1)
else:
    result = A*num_move+rest

print(result)
Buggy code:
n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  print(extra)
  result = a*roop
  if extra >= a:
    result += a
  else:
    result += extra
print(result)

Fixed code:
n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  result = a*roop
  if extra >= a:
    result += a
  else:
    result += extra
print(result)
Buggy code:
def main():
    n, a, b = map(int, input().split())
    q, mod = divmod(n, (a+b))
    x = mod if mod < n else x = n
    print(q*a+x)

if __name__ == "__main__":
    main()


Fixed code:
def main():
    n, a, b = map(int, input().split())
    q, mod = divmod(n, (a+b))
    x = mod if mod < a else a
    print(q*a+x)

if __name__ == "__main__":
    main()
Buggy code:
info = [int(n) for n in input().split()]

group = info[1] + info[2]

a = info // group
b = info % group
if b > info[1]:
    b = info[1]


result = a * info[1] + b
print(result)

Fixed code:
info = [int(n) for n in input().split()]

group = info[1] + info[2]

a = info[0] // group
b = info[0] % group
if b > info[1]:
    b = info[1]


result = a * info[1] + b
print(result)
Buggy code:
n, a, b = map(int, input().split())
print(n//(a+b))*a+min((n%(a+b), a)

Fixed code:
n,a,b=map(int,input().split())
rem = n%(a+b)
print((n//(a+b))*a+min(rem,a))
Buggy code:
a,b,c=map(int,input().split())
if b==0:
  print(0)
else:
  print(a//(b+c)+a%(b+c))

Fixed code:
a,b,c=map(int,input().split())
if b==0:
  print(0)
else:
  print(b*(a//(b+c))+min(b,a%(b+c)))
Buggy code:
n, a, b = map(int, input().split())
ans = (n//(a+b))*(a/(a+b)) + min(n%(a+b), a)
print(ans)

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

ans=(n//(a+b))*a
ans+=min(n%(a+b),a)

print(ans)
Buggy code:
N,A,B=map(int,input().split())

elif N%(A+B)<=A:
    print(N//(A+B)*A+N%(A+B))
else:
    print(N//(A+B)*A+A)

Fixed code:
N,A,B=map(int,input().split())

if N%(A+B)<=A:
    print(N//(A+B)*A+N%(A+B))
else:
    print(N//(A+B)*A+A)
Buggy code:
N,A,B = map(int,input().split())
#n blue red
#8 3 4
#bbbrrrrb
#4
ans = 0
x = N // (A+B)
ans += (x * A)
N -= x * (A+B)
if N <= A:
  ans += N
else:
  ans += A


Fixed code:
N,A,B = map(int,input().split())
#n blue red
#8 3 4
#bbbrrrrb
#4
ans = 0
x = N // (A+B)
ans += (x * A)
N -= x * (A+B)
if N <= A:
  ans += N
else:
  ans += A
print(ans)
Buggy code:
N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<=A:
  print(B*x)
else:
  print(B*x+y-A)

Fixed code:
N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<=A:
  print(A*x+y)
else:
  print(A*(x+1))
Buggy code:
n,b,r = map(int,input().split())

loop = n/(b+r)
mod = n%(b+r)
extra = min([b,mod])

print(loop*b + extra)


Fixed code:
n,b,r = map(int,input().split())

loop = n//(b+r)
mod = n%(b+r)
extra = min([b,mod])

print(loop*b+extra)
Buggy code:
n,a,b = map(int,input().split())
ans = a*(n//(a+b)) + min(N%(a+b),a)
print(ans)

Fixed code:
n,a,b = map(int,input().split())
ans = a*(n//(a+b)) + min(n%(a+b),a)
print(ans)
Buggy code:
N,A,B=map(int, input().split())
len=A+B
print((N / len)* A + min(A, N % len))


Fixed code:
N, A, B = map(int, input().split())

print(A * (N // (A + B)) + min(A, N % (A + B)))
Buggy code:
n,a,b = map(int,input().split())

sum = n//(a+b)*a
res = n%(a*b)
sum += min(res,a)

print(sum)

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

sum = n//(a+b)*a
res = n%(a+b)
sum += min(res,a)

print(sum)
Buggy code:
if __name__ == '__main__':
    (n, a, b) = map(int, input().split())
    a = n//(a+b)
    m = min(n%(a+b), a)
    print(a+m)

Fixed code:
if __name__ == '__main__':
    (n, a, b) = map(int, input().split())
    ans = (n//(a+b)) * a
    m = min(n%(a+b), a)
    print(ans+m)
Buggy code:
import sys

read = sys.stdin.readline
T = read()
a, b, c = map(int, T.split())

temp = a // (b+c)
answer = temp * b
temp2 = a % (b+c)

if temp2 >= b:
    answer += b
else:
    answer += temp2

print(temp2) 



Fixed code:
import sys

read = sys.stdin.readline
T = read()
a, b, c = map(int, T.split())

temp = a // (b+c)
answer = temp * b
temp2 = a % (b+c)

if temp2 >= b:
    answer += b
else:
    answer += temp2

print(answer)
Buggy code:
N,A,B=input().split()
ANS=int(N)//(int(A)+int(B))
ANS=ANS*int(A)
if((int(N)%(int(A)+int(B))<=int(A)):
   ANS=ANS+(int(N)%(int(A)+int(B)))
else:
   ANS=ANS+int(A)
print(ANS)

Fixed code:
N,A,B=input().split()
ANS=int(N)//(int(A)+int(B))
ANS=ANS*int(A)
if(int(N)%(int(A)+int(B))<=int(A)):
   ANS=ANS+(int(N)%(int(A)+int(B)))
else:
   ANS=ANS+int(A)
print(ANS)
Buggy code:
n,a,b=list(map(int,input().split()))
if a==0:
  print(0)
if b==0:
  print(n)
  
sum=0
L=n//(a+b)
M=n%(a+b)

if a<=M:
  print(a*L+a)
else:
  print(a*L+M)


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

sum=0
L=n//(a+b)
M=n%(a+b)

if a<=M:
  print(a*L+a)
else:
  print(a*L+M)
Buggy code:
n,blue,red = map(int,input().split())

mod = n % (blue+red)
if mod <= blue:
    print(mod)
    print((blue*n)//(blue+red)+mod)
else:
    print(mod)
    print((blue*n)//(blue+red)+blue)


Fixed code:
n,blue,red = map(int,input().split())

mod = n % (blue+red)
if mod <= blue:
    print(blue*(n//(blue+red))+mod)
else:
    print(blue*(n//(blue+red))+blue)
Buggy code:
N, A, B = list(map(int, input().split()))
print('N:{}'.format(N), 'A:{}'.format(A), 'B:{}'.format(B))
#print(A*(N//(A+B)), min(A, N%(A+B)))
print(A*(N//(A+B)) + min(A, N%(A+B)))

Fixed code:
N, A, B = list(map(int, input().split()))
#print('N:{}'.format(N), 'A:{}'.format(A), 'B:{}'.format(B))
#print(A*(N//(A+B)), min(A, N%(A+B)))
print(A*(N//(A+B)) + min(A, N%(A+B)))
Buggy code:
n,a,b = map(int,input().split())
x = n/(a+b)
y =n%(a+b)
print(x*a+y)
    

Fixed code:
n,a,b = map(int,input().split())
x = n//(a+b)
y = n%(a+b)
print(x*a+min(y,a))
Buggy code:
import sys
import numpy as np
import math as mt

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, a, b = map(int, readline().split())

ans = a * (n//(a + b))
if n%(a+b) < a:
  ans += a-n%(a+b)
else:
  ans += a
print(ans)

    


Fixed code:
import sys
import numpy as np
import math as mt

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, a, b = map(int, readline().split())

ans = a * (n//(a + b))
if n%(a+b) < a:
  ans += n%(a+b)
else:
  ans += a
print(ans)
Buggy code:

n,a,b = map(int,input().split())
num = 0
num = n // (a+b)

if num % (a+b) <=a:
    print((num*a)+ (num % (a+b)))
else:
    print((num*a)+a)



Fixed code:

n,a,b = map(int,input().split())
num = 0
num = n // (a+b)

if n % (a+b) <= a:
    print((num*a)+ (n % (a+b)))
else:
    print((num*a)+a)
Buggy code:
# -*- coding: utf-8 -*-

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

q, mod = divmod(N, A + B)

print((A * q) + min(mod, A)))


Fixed code:
# -*- coding: utf-8 -*-

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

q, mod = divmod(N, A + B)

print((A * q) + min(mod, A))
Buggy code:
N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<A:
    print(x*A+y)
else:
    print(x*a+a)

Fixed code:
N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<A:
    print(x*A+y)
else:
    print(x*A+A)
Buggy code:
n,a,b=map(int,input().split())

p=a+b
c=n%p
d=n//p

if d<a:
  print(c*a+d)
else:
  print((c+1)*a)

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

p=a+b
c=n%p
d=n//p

if c<a:
  print(d*a+c)
else:
  print((d+1)*a)
Buggy code:
n,a,b = map(int, input().split())

shou = n // (a+b)
amari = n % (a+b)

print(shou * a + a) if amari >= a　else print(shou*a+amari)

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

shou = n // (a+b)
amari = n % (a+b)

if amari >= a:
    print(shou * a + a)

else: print(shou * a + amari)
Buggy code:
n,a,b=map(int,input().split())
a*(n//(a+b))+min(n%(a+b),a)

Fixed code:
n,a,b=map(int,input().split())
print(a*(n//(a+b))+min(n%(a+b),a))
Buggy code:
n, a, b = map(int, input().split(' '))

if a == 0:
  print('0')
else:
  base = (n//(a+b))*a
  
  n = n//(a+b)
  
  base += min(n, a)
  
  print(base)



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

if a == 0:
  print('0')
else:
  base = (n//(a+b))*a
  
  n = n%(a+b)
  
  base += min(n, a)
  
  print(base)
Buggy code:
n,a,b=map(int,input().split())
ans=0

se=n//(a+b)
n%=a+b
ans+=se*a + min(a,n)
prnit(ans)

Fixed code:
n,a,b=map(int,input().split())
ans=0

se=n//(a+b)
n%=a+b
ans+=se*a + min(a,n)
print(ans)
Buggy code:
n,a,b=map(int,input().split())

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

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

ans=n//(a+b)*a
rem=n%(a+b)
ans+=min(rem,a)
print(ans)
Buggy code:
import math
N,A,B = list(map(int,input().split()))
ans = math.ceil(A*(N/(A+B)))
if N%(A+B)>=A:
    ans+=A
else: ans+=N%(A+B)
print(ans) 

Fixed code:
import math
N,A,B = list(map(int,input().split()))
ans = A*(N//(A+B))
if N%(A+B)>=A:
    ans+=A
else: ans+=N%(A+B)
print(ans)
Buggy code:
import math
N, A, B = (int(x) for x in input().split(' '))
tmp = A * math.floor(N/(A+B))

if ( N % (A+B) ) > A:
  print(ans+A) 
else:
  print(ans+( N % (A+B)))
 

Fixed code:
import math
N, A, B = (int(x) for x in input().split(' '))
tmp = A * math.floor(N/(A+B))

if ( N % (A+B) ) > A:
  print(tmp+A) 
else:
  print(tmp+( N % (A+B)))
Buggy code:
n,a,b= map(int,input().split())

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

Fixed code:
n,a,b=map(int,input().split())
ans = a*(n//(a+b))
n %=(a+b)
print(ans+min(a,n))
Buggy code:
n, a, b = map(int, input().split())
if a == 0:
  print(0)
else:
  print( (n //(a+b))*a + max(a, n%(a+b)) )

Fixed code:
n, a, b = map(int, input().split())
if a == 0:
  print(0)
else:
  print( (n //(a+b))*a + min(a, n%(a+b)) )
Buggy code:
N, Blue, Red = map(int, input().split())

if(Blue >= N):
    print(N)
elif (Blue + Red) >= N or Blue == 0:
    print(Blue)
else:
    q = N // (Blue + Red)
    mod = N % (Blue + Red)
    if Blue > mod:
        print(q * Blue  + Blue)
    else:
        print(q * Blue + mod)

Fixed code:
N, Blue, Red = map(int, input().split())

if(Blue >= N):
    print(N)
elif (Blue + Red) >= N or Blue == 0:
    print(Blue)
else:
    q = N // (Blue + Red)
    mod = N % (Blue + Red)
    if Blue < mod:
        print(q * Blue  + Blue)
    else:
        print(q * Blue + mod)
Buggy code:
n, a, b = map(int, input().split())

b_count = n // (a+b) 
print('b_count', b_count)
if (n-(a+b)*b_count) <= a:
    print(n-b*b_count)
else:
    print(a*b_count + a)

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

b_count = n // (a+b) 
if (n-(a+b)*b_count) <= a:
    print(n-b*b_count)
else:
    print(a*b_count + a)
Buggy code:
n,a,b = list(map(int, input().split()))

if (a+b) == 0:
  print(0)
else:
  trial_num = n // (a + b)
  amari = n % (a + b)
  
  if a == 0:
    print(0)
  else:
    print(trial_num*a + a)


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

if (a+b) == 0:
  print(0)
else:
  trial_num = n // (a + b)
  amari = n % (a + b)
  
  if a == 0:
    print(0)
  else:
    if a <= amari:
      print(trial_num*a + a)
    else:
      print(trial_num*a + amari)
Buggy code:
N ,Blue,Red = map(int,input().split())

ans = N //(A+B) *A
rem = N % (A+B)
ans += min(rem,A)
print(ans)

Fixed code:
N ,A,B =  map(int,input().split())

ans = N //(A+B) *A
rem = N % (A+B)
ans += min(rem,A)
print(ans)
Buggy code:
S = Input()
N,A,B = S.split(' ')
N = int(N)
A = int(A)
B = int(B)
ans = N //(A+B) * A
left = N % (A+B)
if left > A:
    ans += A
else:
    ans += left
print(ans)

Fixed code:
S = input()
N,A,B = S.split(' ')
N = int(N)
A = int(A)
B = int(B)
ans = N //(A+B) * A
left = N % (A+B)
if left > A:
    ans += A
else:
    ans += left
print(ans)
Buggy code:
from sys import stdin

n,a,b=map(int,input().split())
ans=0
ans+=(n//(a+b))*a
n%=a+b
if n<=a:
    ans+=n
else:
    ans+=a
print(str(ans)+"\n)

Fixed code:
from sys import stdin

n,a,b=map(int,input().split())
ans=0
ans+=(n//(a+b))*a
n%=a+b
if n<=a:
    ans+=n
else:
    ans+=a
print(str(ans)+"\n")
Buggy code:
N,A,B=map(int,input().split())
d=int(N%(A+B))
ans = A*d+min(A,(N%(A+B)))
print(ans)

Fixed code:
N,A,B=map(int,input().split())
d=int(N//(A+B))
ans = A*d+min(A,(N%(A+B)))
print(ans)
Buggy code:
n,a,b=list(map(int,input().split()))

q=(a+b)//n
r=(a+b)%n

if r>a:
    r=a

print(q*a+r)

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

q=n//(a+b)
r=n%(a+b)

if r>a:
    r=a

print(q*a+r)
Buggy code:
n, a, b = [int(x) for x in input().split()]

if a == 0 and b == 0:
    print("0")
elif a >= n:
    print(n)
else:
    x = n // (a + b)
    if x == 0:
        print(a)
    else:
        if (n - b * x) <= a:
            print(n - b * x)
        else:
            print(a * x + a)


Fixed code:
n, a, b = [int(x) for x in input().split()]

if a == 0 and b == 0:
    print("0")
elif a >= n:
    print(n)
else:
    x = n // (a + b)
    if x == 0:
        print(a)
    else:
        if (n - ((a + b) * x)) >= a:
            print(a * x + a)
        else:
            print((a * x + (n - (a + b) * x)))
Buggy code:
n,a,b = map(int,input().split())
x=n//(a+b)
y=n - x*(a+b)
if y >= a
    y=a
print(a*y+x)

Fixed code:
n,a,b = map(int,input().split())
x=n//(a+b)
y=n - x*(a+b)
if y >= a:
  y=a
print(a*x+y)
Buggy code:
n, a, b = map(int, input().split())

if a==0:
    blue = 0

blue1 = a * n // (a+b)

n -= (a+b) * n // (a+b)
blue2 = min(n, a)

blue = blue1 + blue2
print(blue)

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

if a==0:
    blue = 0

else:
    brset = n // (a+b)
    blue1 = a * brset
    n -= (a+b) * brset
    blue2 = min(n, a)
    blue = blue1 + blue2

print(blue)
Buggy code:
n, a, b = map(int,input().split())
print((n//(a+b))*a+min([a,n//(a+b)]))


Fixed code:
n, a, b = map(int,input().split())
print((n//(a+b))*a+min([a,n%(a+b)]))
Buggy code:
N, A, B = [int(i) for i in input().split()]
ans = N // (A+B) * A
r = N // (A+B)
print(ans+min(r,A))

Fixed code:
N, A, B = [int(i) for i in input().split()]
ans = N // (A + B) * A
r = N % (A + B)
print(ans+min(r, A))
Buggy code:
n, a, b = map(int, input().split())

ans = n // (a+b) * n
tmp = n % (a+b)
ans += min(a, tmp)

print(ans)

Fixed code:
n, a, b = map(int, input().split())
x = n // (a + b)
ans = x * a + min(n % (a + b), a)
print(ans)
Buggy code:
N,A,B = map(int, input().split())

count = N//(A+B)
amari = N%(A+B)

if amari < A:
  c = amari
else:
  c = A
  
ans = A * x + c
print(ans)

Fixed code:
N,A,B = map(int, input().split())

count = N//(A+B)
amari = N%(A+B)

if amari < A:
  c = amari
else:
  c = A
  
ans = A * count + c
print(ans)
Buggy code:
A, B, N = map(int, input().split())

ans = 0
ans += N // (A + B) * A
ans += min(N % (A + B), A)

print(ans)

Fixed code:
N, A, B = map(int, input().split())

ans = 0
ans += N // (A + B) * A
ans += min(N % (A + B), A)
print(ans)
Buggy code:
n,a,b = map(int, input().split())

x = int(n/(a+b))
y = (a+b)%n
z = 0
if y <= a :
  z = y
else :
  z = a
  
print(x*a+z)


Fixed code:
n,a,b = map(int, input().split())
 
x = n//(a+b)
y = n%(a+b)
z = 0
if y <= a :
  z = y
else :
  z = a
  
print(x*a+z)