TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N=input()
A=input()
B=input()
a=str(A+B)
b=str(N/a)
c=str(N%a)
if c<A:
  print(str(b*A+c))
else:
  print(str(b*A+A))


N=input()
A=input()
B=input()
a=A+B
b=str(N/a)
c=str(N%a)
if c<A:
  print(b*A+c)
else:
  print(b*A+A)


N=input()
A=input()
B=input()
a=A+B
b=N/a
c=N%a
if c<A:
  print(b*A+c)
else:
  print(b*A+A)

N=input()
A=input()
B=input()
a=int(A+B)
b=int(N/a)
c=int(N%a)
if c<A:
  print(int(b*A+c))
else:
  print(int(b*A+A))


N=int(input())
A=int(input())
B=int(input())
a=int(A+B)
b=int(N/a)
c=int(N%a)
if c<A:
  print(int(b*A+c))
else:
  print(int(b*A+A))

  

N,A,B=(int(x) for x in input().split())
a=int(A+B)
b=int(N/a)
c=int(N%a)
if c<A:
  print(int(b*A+c))
else:
  print(int(b*A+A))

  

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,a,b=map(int,input().split())
c=N//(a+b)
d=N%(a+b)
if d<=a:
  print(c*b+d)
else:
  print(c*b+a)


N,a,b=map(int,input().split())
c=N//(a+b)
d=N%(a+b)
if d<=a:
  print(c*a+d)
else:
  print(c*a+a)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
# N
num = int(input())
# A
greenNum = int(input())
# B
redNum = int(input())

# output
totalGreen = 0
while (num > 0):
  if (num <= greenNum):
    totalGreen += num
    num = 0
  else:
    totalGreen += greenNum
    num -= (greenNum + redNum)
    
print(totalGreen)

# N, A, B
num, greenNum, redNum = map(lambda x: int(x), input().split(' '))

numSet = num // (greenNum+redNum)
remain = num % (greenNum+redNum)
numRest = remain if (remain < greenNum) else greenNum

totalGreen = numSet * greenNum + numRest

print(totalGreen)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b = [int(i) for i in input().split()]
if n%(a+b)>a or n%(a+b)==0:
  print(a)
else:
  print(n%(a+b))

n,a,b = [int(i) for i in input().split()]
d=int(n/(a+b))
r=n%(a+b)
if r==0:
  print(d*a)
elif r>a:
  print(d*a+a)
else:
  print(d*a+r)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b=map(int,input().split())
ans=0

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

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

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


Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,b,r = map(int, input().split())		# 5 7 2

ans = (n//(b+r)) + min(n%(b+r),b)

print(ans)



n,b,r = map(int, input().split())		# 5 7 2

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

print(ans)



Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b = map(int, input().split())

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
from math import floor

N = int(input())
A = int(input())
B = int(input())

steps = floor(N / (A + B))
cap = steps * (A + B)
blue_balls = steps * A + min([N - cap, A])
print(blue_balls)

from math import floor

inp = input()
N, A, B = [int(x) for x in inp.split(" ")]

steps = floor(N / (A + B))
cap = steps * (A + B)
blue_balls = steps * A + min([N - cap, A])
print(blue_balls)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int, input().split())
if a + b == n:
  print(a)
elif a == 0:
  print(0)
elif (n - b) >= a:
  print(a)
else:
  print(n - b)

n, a, b=map(int,input().split())
count = (n // (a + b))*a
if n % (a + b) >= a:
  count += a
else:
  count += n % (a + b)
print(count)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = [int(i) for i in input().split()]

S = N//(A+B)*A

S = S+(N%S,A)
print(S)

N, A, B = [int(i) for i in input().split()]
S = A+B
c = (N//S)*A
 
c += min(N%S,A)
print(c)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
line = input()
n, a, b = line.split(" ")
n = int(n)
a = int(a)
b = int(b)

i = 0
i = int(n / (a + b)) + 1
print(i)
if ((a + b)*i) - n <= b:
    print(a * i)
else:
    num1 = ((a + b)* i) - n
    num2 = a * i
    num3 = num1 - b
    print(num2 - num3)

line = input()
n, a, b = line.split(" ")
n = int(n)
a = int(a)
b = int(b)

num = 0
i = 0
i = int(n / (a + b)) + 1
if ((a + b)*i) - n <= b:
    print(a * i)
else:
    num1 = ((a + b)* i) - n
    num2 = a * i
    num3 = num1 - b
    print(num2 - num3)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
a, b = map(int, input().split())

n = int(input())

s = n // (a + b)
m = n % (a + b)

if a > m:
    print(a * s + m)
else:
    print(a * s + a)

import math

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

n = int(input())

s = math.floor(n // (a + b))
m = n % (a + b)

if a > m:
    print(a * s + m)
else:
    print(a * s + a)

import math

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

n = int(input())

s = math.floor(n / (a + b))
m = n % (a + b)

if a > m:
    print(a * s + m)
else:
    print(a * s + a)

a, b = map(int, input().split())
n = int(input())
print(a * (n // (a + b))+ min(n % (a + b), a))

a, b = map(int, input().split())
n = int(input())
print(n // (a + b) + min(n % (a + b), a))

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

n = int(input())

s = n // (a + b)
m = n % (a + b)

if a > m:
    print(a * s + a)
else:
    print(a * s + m)

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
a=list(input())

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

ALL=A+B

cnt=0
num=N
while True:
        num = num - ALL
        if num > 0:
                cnt += 1
        else:
                break

if ALL - num > A:
        ans = A * cnt + A
else:
        ans = A * cnt + ALL - num

print(ans)

N, A, B = [int(x) for x in input().strip().split()]

Times = N // (A + B)
rest = N - Times * (A + B)

if rest < A:
        ans = A * Times + rest
else:
        ans = A * Times + A

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b = map(int,input().split(" "))
count = 0
c = a + b
if c > n:
    print(min(n,a))
else:
    count += a * (n // c)
    d = n % c
        count += min(a,d)
print(count)

n,a,b = map(int,input().split(" "))
count = 0
c = a + b
count += a * (n // c)
d = n % c
count += min(a,d)
print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int,input().split())

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


ans = q*A+int(min(x,A))
#print(type(ans))
print(ans

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

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


ans = q*A+int(min(x,A))
#print(type(ans))
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B=map(int,input().split())

cnt_blue = 0

pre_loop_cnt = N // (A+B)
totol_pre_A = sum([A] * pre_loop_cnt)
totol_pre_B = sum([B] * pre_loop_cnt)

total_tmp = totol_pre_A + totol_pre_B
total_tmp += A
if N <= total_tmp:
    cnt_blue = N -  totol_pre_B
else:
    cnt_blue = totol_pre_A + A

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

cnt_blue = 0

# try:
pre_loop_cnt = N // (A+B)
totol_pre_A = sum([A] * pre_loop_cnt)
totol_pre_B = sum([B] * pre_loop_cnt)

total_tmp = totol_pre_A + totol_pre_B
total_tmp += A
if N <= total_tmp:
    cnt_blue = N -  totol_pre_B
else:
    cnt_blue = totol_pre_A + A
# print(cnt_blue)
# except:
#     print(0)

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

cnt_blue = 0

pre_loop_cnt = N // (A+B)
totol_pre_A = sum([A] * pre_loop_cnt)
totol_pre_B = sum([B] * pre_loop_cnt)

total_tmp = totol_pre_A + totol_pre_B
total_tmp += A
if N <= total_tmp:
    cnt_blue = N -  totol_pre_B
else:
    cnt_blue = totol_pre_A + A

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

cnt_blue = 0
total_tmp = 0

try:
    pre_cnt = N // (A+B)
    total_tmp = pre_cnt * (A+B)
    total_tmp += A
    if N <= total_tmp:
        cnt_blue = N -  (pre_cnt * B)
    else:
        cnt_blue = (pre_cnt * A) + A
    print(cnt_blue)
except Exception as e:
    print(0)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int,input().split())

if a != 0:
  answer = n // (a+b)
  remainder = n % (a+b)
  print(answer*a) + min(a, remainder)
else:
  print(0)

n, a, b = map(int,input().split())
 
if a != 0:
  answer = n // (a+b)
  remainder = n % (a+b)
  print((answer*a) + min(a, remainder))
else:
  print(0)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b = map(int,input().split())
x = n // (a+b)
y = m - (a+b)*x
if a == 0:
  print(0)
elif y < a + 1:
  print (x * a + y)
else:
  print (x*a + a)

n,a,b = map(int,input().split())
x = n // (a+b)
y = n - (a+b)*x
if a == 0:
  print(0)
elif y < a + 1:
  print (x * a + y)
else:
  print (x*a + a)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n, a, b = i2()

if a == 0:
    print(0)
elif b == 0:
    print(n)
else:
    cnt = n // (a+b)
    c = n % (a+b)
    print(cnt,c)
    if c <= a:
        print(a*cnt+c)
    else:
        print(a*cnt+c-(c-a))

import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n, a, b = i2()
if a == 0 and b == 0:
    print(0):
elif a == 0:
    print(0)
elif b == 0:
    print(n)
else:
    cnt = n // (a+b)
    c = n%(a+b)
    if c <= a:
        print(a*cnt+c)
    else:
        print(a*cnt+c-b)

import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n, a, b = i2()

if a == 0:
    print(0)
elif b == 0:
    print(n)
else:
    cnt = n // (a+b)
    c = n % (a+b)
    if c <= a:
        print(a*cnt+c)
    else:
        print(a*cnt+c-(c-a))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b=map(int,input().split())
p=n%(a+b)
x=(n-p)//(a+b)
res=x*a
y=a if p>=a else p
res+=y
print(y)

n,a,b=map(int,input().split())
p=n%(a+b)
x=(n-p)//(a+b)
res=x*a
y=a if p>=a else p
res+=y
print(res)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
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)


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)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B = map(int,input().split())
S = 0
for i in range(2*N):
  if i%2 == 0:
    S += A
    if S >= N:
      ans = (i-1)/2*A + N - (i-1)/2*(A+B)
      break
  else:
    S += B
    if S >= N:
      ans = i/2 * A
      break
print(ans)

N,A,B = map(int,input().split())
S = 0
for i in range(2*N):
  if i%2 == 0:
    S += A
  else:
    S += B:
  if S >= N:
    if i%2 == 0:
      ans = (i-1)/2*A + N - (i-1)/2*(A+B)
    else:
      ans = i/2 * A
    break
print(ans)

n, a,b = map(int, input().split())
ans = n//(a+b)*a
rem = n%(a+b)
ans+=min(a,rem)
print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
import math
a, b = map(int, input().split())
a = math.ceil(a / 0.08)
b = math.ceil(b / 0.1)
tmp_a = set([i for i in range(a, a+13)])
tmp_b = set([i for i in range(b, b+10)])
if len(tmp_a & tmp_b) == 0:
    print(-1)
else:
    print(min(tmp_a & tmp_b))

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

div, mod = divmod(n, a + b)

print(div * a + min(a, mod))

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int,input().split())

loop = N//(A+B)

remain = N - loop*(A+B)

if remain <= A:
    remain = remain
else:
    remain = A

print("loop=",loop)
print("remain=",remain)

print(loop*A+remain)

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

loop = N//(A+B)

remain = min(N - loop*(A+B),A)

print(loop*A+remain)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int, input().split())
if A == :
  print(0)
else:
  print(N) if A > N else print(A if N < (A + B) else N - B)

N, A, B = map(int, input().split())
if A == 0:
  print(0)
elif A > N or B == 0:
  print(N)
else:
  M = N // (A + B)
  print(M)
  if N - M * (A + B) > A:
    print(A * M + A)
  else:
    print(N - M * B)

N, A, B = map(int, input().split())
if A == 0:
  print(0)
elif A > N or B == 0:
  print(N)
else:
  M = N // (A + B)
  if N - M * (A + B) > A:
    print(A * M + A)
  else:
    print(N - M * B)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int, input().split().rstrip())
k = n // (a + b)
r = n % (a + b)
print(k * a + min(r, a))


n, a, b = map(int, input().rstrip().split())
k = n // (a + b)
r = n % (a + b)
print(k * a + min(r, a))


Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B = map(int,input().split())
ab = A+B

qaws = ""
c = 0
while(N >= c):
  qaws = qaws + "B"*A
  qaws = qaws + "R"*B
  c += 1
print(qaws)
print(qaws[:N].count("B"))

N,A,B = map(int,input().split())
qaws = ""
while(N > len(qaws)):
  qaws += ("B"*A)
  qaws += ("R"*B)
print(qaws[:N].count("B")

n,a,b=map(int,input().split())
ans = n//(a+b)*a
r = n%(a+b)
print(min(r,a)+ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
import sys
import math

str = input() 
print(str)
print(str.split(' '))

ary = str.split(' ')
N = int(ary[0])
B = int(ary[1])
R = int(ary[2])

if(B == 0):
  print(B)
  sys.exit()

a = N % (B+R)
ret = math.floor(N / (B+R))*B + (a if a < B else B)
print(ret)  


import sys
import math

str = input() 
#print(str)
#print(str.split(' '))

ary = str.split(' ')
N = int(ary[0])
B = int(ary[1])
R = int(ary[2])

if(B == 0):
  print(B)
  sys.exit()

a = N % (B+R)
ret = math.floor(N / (B+R))*B + (a if a < B else B)
print(ret)  
  

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int, input().split())
print(N//(A+B)+min(N%(A+B), A))

N, A, B = map(int, input().split())
print((N//(A+B))*A+min(N%(A+B), A))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
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)

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

b_count = n // (a+b) 
print('b_count', b_count)
print('answer',n-b*b_count)

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)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B = map(int,input().split())

b = 0
r = 0

if A >= N:
    print(A)
elif A == 0 and B == 0:
    print(0)
else:
    C = A * (N // (A+B) )
    D = N % (A+B) 
    print(D)
    if D <= A:
        print(C+D)
    else:
        print(C+A)

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

b = 0
r = 0

if A >= N:
    print(N)
else:
    C = A * (N // (A+B) )
    D = N % (A+B) 
    if D <= A:
        print(C+D)
    else:
        print(C+A)



Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)
---------------------------
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp

n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
a,b=map(int,input().split())
r=-1
for i in range(1001):
    if i*8//100==a and i*10//100==b:
        r=i
        break
print(r)

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B=map(int,input().split())
a=[]
while len(a) < N:
    for i in range(A):
        a.append("x")
    for j in range(B):
        a.append("y")
        break
ans=a[:N]
print(ans.count("x"))




N,A,B=map(int,input().split())
a=[]
for i in range(A):
    a.append("x")
for j in range(B):
    a.append("y")
    if len(a) >= N:
        ans=a[:N]
        print(ans.count("x"))
        exit()
       





N,A,B=map(int,input().split())
K=N//(A+B)
print(K*A+min(A,N%(A+B)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
    n, a, b = na()
    
    if a == 0 and b == 0 || a == 0:
        print(0)
        return

    if n <= a:
        print(n)
        return
      
    AB = a + b
    if n <= AB:
        print(min(n, a))
        return 
    
    x = int(n / AB)
    print(x * a + n - (x * AB))

if __name__ == '__main__':
    main()


import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
    n, a, b = na()
    
    if (a == 0 and b == 0) or a == 0:
        print(0)
        return

    if n <= a:
        print(n)
        return
      
    AB = a + b
    if n <= AB:
        print(min(n, a))
        return 
    
    x = int(n / AB)

    print(x * a + min(n - (x * AB), a))

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int,input().split())
tot = a + b
bcnt = (n // tot) * b
n -= (n // tot) * tot
bcnt += min(n,b)
print(bcnt)


n, a, b = map(int,input().split())
tot = a + b
bcnt = (n // tot) * a
n -= (n // tot) * tot
bcnt += min(n,a)
print(bcnt)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int, input().split(' '))
print(int(min(n-n//(a+b),a))+int((n//(a+b))*a))

n, a, b = map(int, input().split(' '))
print(min(int(n%(a+b)),a)+int((n//(a+b)1)*a))

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b=map(int,input().split())
s=a+b
if n%s==0:
    print(int(n/s)*a)
else:
    if n%s>=a:
        print(int(n//s+1)*a)
    else:
        print(int(n//s+)*a+n%s)

n,a,b=map(int,input().split())
s=a+b
if n%s==0:
    print(int(n/s)*a)
else:
    if n%s>=a:
        print(int(n//s+1)*a)
    else:
        print(int(n//s)*a+n%s)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b = map(int, input().split())

t = []

if n < (a+b):
    print(a)
else:
    if n % (a+b) > 0:
        print(n//(a+b)*a+a)
    else:
        print(n//(a+b)*a)


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

t = []
i = 0
if n <= a+b:
    print(a)
else:
    while len(t) > n:
        t = "b"*a +"r"*b
        i += 1
    s = t[:n]
    print(s.count("b"))

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

t = n%(a+b)

if n < a:
    print(n)
else:
    if a > t > 0:
        print(n//(a+b)*a+t)
    elif t >= a:
        print(n//(a+b)*a+a)
    else:
        print(n//(a+b)*a)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
    n,a,b=map(int,input().split())
    answer=n//(a+b)*a+min(n%(a+b),a)
    print(answer)

a = input().split()
a = list(map(int,a))
(n,m,k)=a
answer = n // (m + k) * m + min(n % (m + k), m)
print(answer)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B=input().split()
N=int(N)
A=int(A)
B=int(B)
C=A+B
if (0<C<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue=("a"*A+"b"*B)*(10**18)
    number=queue.count("a",0,N)
    print(number)

N,A,B=map(int,input().split())
C=A+B
if (0<C<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    queue=("a"*A+"b"*B)*(10**100)
    number=queue.count("a",0,N)
    print(number)

N,A,B=map(int,input().split())
if (0<A+B<=10**18)and(0<N<=10**18)and(A>=0)and(B>=0):
    if N%(A+B)<=A:
        c=(N//(A+B))*A+N%(A+B)
        print(c)
    else:
        d=(N//(A+B))*A+A
        print(d)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a b = map(int, input().split())
ans = n// (a + b)
rem = n % (a + b)
ans += min(rem, A)
prnit(ans)

n , a, b = map(int, input().split())
ans = n//(a + b) * a
rem = n % (a + b)
ans += min(rem, a)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B=map(int,input().split())
r=1
S=set()
while r<= 10**100:
	S='b'*A + str(S) +'r'*B
	if len(S)>10**18:
		S = S[1,10**18]
	r=r+1
print(S[1,N],count('b'))

N,A,B =int(input())
r = 1
S=string()
while r<=10**100:
	S='b'*B+ S+ 'r'*A
    r += 1


print(S[1:N].count(b))

n,a,b=map(int,input().split())
q,mod=divmod(n,(a+b))
if mod>a:
  mod=a
print(q*a+mod)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N,A,B=[int(s) for s in input().split()]
C=A+B
Q=N//C
R=N%C
if R<=A:
  print(Q*A+C)
else:
  print((Q+1)*A)

N,A,B=[int(s) for s in input().split()]
C=A+B
Q=N//C
R=N%C
if R<=A:
  print(Q*A+R)
else:
  print((Q+1)*A)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b=map(int,input().split())
a*(n//(a+b))+min(n%(a+b),a)

n,a,b=map(int,input().split())
print(a*(n//(a+b))+min(n%(a+b),a))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int, input().split())
print(a * (n // (a + b)) + min(a, n % (a + b))

n, a, b = map(int, input().split())
if a >= n:
    print(n)
elif n - (n // (a + b)) <= a:
    print(n // (a + b) * a + (n - (n // (a + b))))
else:
    print(n // (a + b) * a + a)

n,a,b=map(int,input().split())
print(a*(n//(a+b))+min(a,n%(a+b)))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b=input().split()
cicle=int(n/(a+b))
res=n-cicle*(a+b)
if res>a:
  ans=cicle*a+a
else:
  ans=cicle*a+res
print(ans)

n,a,b=(int(x) for x in input().split())
cycle=int(n/(a+b))
res=n-cycle*(a+b)
if res>a:
  ans=cycle*a+a
else:
  ans=cycle*a+res
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = map(int, input().split())
an = N // (A+B) * A
rem = N % (A+B)
an += min(rem,A)
print(ans)

N, A, B = map(int, input().split())
an = N // (A+B) * A
rem = N % (A+B)
an += min(rem,A)
print(an)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
N, A, B = [int(i) for i in input().strip().split()]
if A < N:
  print(A)
else:
  q, r = divmod(N, A+B)
  print(A*q + r)


N, A, B = [int(i) for i in input().strip().split()]
q, r = divmod(N, A+B)
if r <= A:
  print(A*q + r)
else:
  print(A*q + A)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, a, b = map(int, input().split())

t = n//(a+b)

if t == 0 and n < a:
    c += n
    print(c)
elif t == 0 and n >= a:
    c += a
    print(a)
elif t > 0:
    c += t * a
    r = n%(a+b)
    if r == 0:
        print(c)
    elif r < a:
        c += r 
        print(c)
    elif r > a:
        c += a
        print(c)


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

c =0
r = n%(a+b)
if r < 1: 
    print(a)
elif r >= 1:
    t = r//(a+b)
    c += t*a
    tr = r%(a+b)
    if tr < a:
        c += tr
        print(c)
    elif tr > a:
        c += a 
        print(c)
    



n, a, b = map(int, input().split())
print(a*(n//(a+b))+min(n%(a+b), a))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
def numberofblues(N,A,B): 
    
    if A==0:
        return 0
    elif N<=A:
         return N
    else:
        k=N//(A+B)
        l=N-A-k*(A+B)
        if l<=B:
            return A+k*A
        else:
            return A+k*A+l-B
   
N,A,B=map(int, input().split())
print(numberofblues(N,A,B))

def numberofblues(N,A,B): 
    
    if A==0:
        return 0
    elif N<=A:
         return N
    else:
        k=(N-A)//(A+B)
        l=N-A-k*(A+B)
        if l<=B:
            return A+k*A
        else:
            return A+k*A+l-B
   
N,A,B=map(int, input().split())
print(numberofblues(N,A,B))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n, b, r = map(int, input().split())

br = b + r

a = n / br
a_ = n % br

print(a * b + (b if a_ >= b else a_))

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

br = b + r

a = int(n / br)
a_ = n % br

print(a * b + (b if a_ >= b else a_))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has many red balls and blue balls. Now, he will place them in a row.  Initially, there is no ball placed.  Takahashi, who is very patient, will do the following operation 10^{100} times:    * Place A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.  How many blue balls will be there among the first N balls in the row of balls made this way?

Submission attempts (in order):
n,a,b=map(int,input().split())
lis=""
ans=0
for i in range(n):
 for b in range(a):
  ans+=1
 for r in range(b+1):
print(ans)

n,a,b=map(int,input().split())
lis=""
ans=0
for i in range(n):
 for b in range(a):
  lis+='b'
  ans+=1
 for r in range(b+1):
  lis+='r'
print(ans)

n,a,b=map(int,input().split())
lis=""
ans=0
for i in range(n):
 for b in range(a):
  lis+='b'
  ans+=1
 for r in range(b+1):
  lis+='r'
print(ans)

n,a,b=map(int,input().split())
ans=0
for i in range(n):
 for b in range(a):
  ans+=1
print(ans)

n,a,b=map(int,input().split())
ans=n/(a+b)
 if n%(a+b)>=a:
    ans+=a
 else:
    ans+=n%(a+b)
print(ans)

n,a,b=map(int,input().split())
lis=[]
for i in range(n):
 for b in range(a):
  lis.append('b')
 for r in range(b+1):
  lis.append('r')
print(lis.count('b'))

n,a,b=map(int,input().split())
lis=""
for i in range(n):
 for b in range(a):
  lis+='b'
 for r in range(b+1):
  lis+='r'
print(lis.count('b'))

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted