problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p02754 | u261082314 | 2,000 | 1,048,576 | 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? | ['nums = [int(e) for e in input().split()]\nn = nums[0]\na = nums[1]\nb = nums[2]\n22 3 4\nbbb4444bbb4444bbb4444b\nsum = a + b\niter = n // sum\namari = n % sum\nif amari >= b:\n\tprint(iter * a + (b))\nelse:\n print(iter * a + (amari))', 'nums = [int(e) for e in input().split()]\nn = nums[0]\na = nums[1]\nb = nums[2]\n\nsum1 = a + b\niter1 = n // sum1\namari = n % sum1\nif amari >= a:\n\tprint(iter1 * a + (a))\nelse:\n print(iter1 * a + (amari))'] | ['Runtime Error', 'Accepted'] | ['s753774239', 's347778931'] | [3064.0, 3060.0] | [17.0, 18.0] | [222, 199] |
p02754 | u263660661 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\n\nx = n // (a + b)\nans = a * a + min(a, n - (a + b)*x)\nprint(ans)\n', 'n, a, b = map(int, input().split())\n\nx = n // (a + b)\nans = a * x + min(a, n - (a + b) * x)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s491957457', 's167018845'] | [2940.0, 2940.0] | [17.0, 17.0] | [101, 102] |
p02754 | u265118937 | 2,000 | 1,048,576 | 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? | ['n, blue, red = map(int, input().split())\nball = blue + red\n\nif blue == 0:\n print(0)\nif n <= blue:\n print(n)\nif n <= ball:\n print(blue + (n - red))\n\n\n\nans = n / ball\nadditional = n % ball\nif additional == 0:\n print(ans * blue)\nelif additional <= blue:\n print(ans * blue + additional)\n', 'n, blue, red = map(int, input().split())\nball = blue + red\n\nif blue == 0:\n print(0)\nif n <= blue:\n print(n)\nif n <= ball:\n print(blue + (n - red))\n\nans = n / ball\nadditional = n % ball\nif additional == 0:\n print(ans * blue)\nelif additional <= blue:\n print(ans * blue + additional)\nelse:\n print(ans * blue + (additional - red))', 'n, blue, red = map(int, input().split())\nball = blue + red\n\nif blue == 0:\n print(0)\nif n <= blue:\n print(n)\nif n <= ball:\n print(blue + (n - red))\n\n\n\nans = n / ball\nadditional = n % ball\nif additional == 0:\n print(ans * blue)\nelif additional <= blue:\n print((ans -1) * blue + additional)\n', 'import sys\n\nn, blue, red = map(int, input().split())\nball = blue + red\n\nif blue == 0:\n print(0)\n sys.exit()\nif n <= blue or red == 0:\n print(n)\n sys.exit()\nif n <= ball:\n print(blue)\n sys.exit()\n\nans = n // ball\nadditional = n % ball\n\nif additional == 0:\n print(ans * blue)\nelif additional <= blue:\n print(ans * blue + additional)\nelse:\n print((ans + 1) * blue)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s015077273', 's052330056', 's475540972', 's025557152'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 17.0] | [394, 344, 399, 388] |
p02754 | u267029978 | 2,000 | 1,048,576 | 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? | ['N,A,B = map(int, input().split())\nroop = N//(A+B)\nprint(roop)\nremainder = N % (A+B) \nprint(remainder)\n\nif A==0:\n print(0)\nelif A>=N:\n print(N)\nelif N>A and N<=A+B:\n print(A)\nelif N>A and N>A+B and A>=remainder:\n out = roop * A + remainder\n print(out)\nelif N>A and N>A+B and A<remainder:\n out = roop * A + A\n print(out)\n ', 'N,A,B = map(int, input().split())\nroop = N//(A+B)\nremainder = N % (A+B) \n\nif A==0:\n print(0)\nelif A>=N:\n print(N)\nelif N>A and N<=A+B:\n print(A)\nelif N>A and N>A+B and A>=remainder:\n out = roop * A + remainder\n print(out)\nelif N>A and N>A+B and A<remainder:\n out = roop * A + A\n print(out)\n '] | ['Wrong Answer', 'Accepted'] | ['s369759929', 's393763243'] | [3064.0, 3060.0] | [17.0, 18.0] | [328, 299] |
p02754 | u268504600 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\nans = N // (A+B) * A\nrem = n % (A+B)\nans += min(rem, A)\nprint(ans)', 'N, A, B = map(int, input().split())\nans = N // (A+B) * A\nrem = N % (A+B)\nans += min(rem, A)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s736629252', 's825498528'] | [3316.0, 3316.0] | [19.0, 19.0] | [102, 102] |
p02754 | u268554510 | 2,000 | 1,048,576 | 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? | ['N,A,B = map(int,input().split())\nC = A+B\nD = C//N\nans = 0\nans+=D*A\nans+=min(N-D*C,A)\nprint(ans)', 'N,A,B = map(int,input().split())\nC = A+B\nD = N//C\nans = 0\nans+=D*A\nans+=min(N-D*C,A)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s426587184', 's192156693'] | [3060.0, 3060.0] | [17.0, 18.0] | [95, 95] |
p02754 | u268674745 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\nab = a + b\nsyou = ab // n\namari = ab % n\nprint(syou * a + min(amari, a))', 'n, a, b = map(int, input().split())\nab = a + b\nsyou = n // ab\namari = n % ab\nprint(syou * a + min(amari, a))'] | ['Wrong Answer', 'Accepted'] | ['s022382042', 's893309179'] | [2940.0, 2940.0] | [17.0, 17.0] | [108, 108] |
p02754 | u272682534 | 2,000 | 1,048,576 | 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? | ['import math\nN,A,B=map(int,input().split())\nif B==0:\n if A==0:\n print(0)\n else:\n print(N)\nelse:\n print (math.ceil(N//(A+B)*A))', 'import math\nN,A,B=map(int,input().split())\n\nd = N//(A+B)*A\nd+=min(A,N % (A+B))\n\nprint (d)'] | ['Wrong Answer', 'Accepted'] | ['s029449551', 's563497301'] | [3060.0, 2940.0] | [18.0, 17.0] | [148, 89] |
p02754 | u276686572 | 2,000 | 1,048,576 | 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? | ['n,b,r = map(int, input().split())\n\nt = n % (b + r)\n\nif t >= b: print(b)\nelse: print(t)\n \n', 'n,b,r = map(int, input().split())\n\nt = n % (b + r)\n\nif t >= b: print(b * int(n//(b+r)) + b)\nelse: print(b * int(n//(b+r)) + t)\n \n'] | ['Wrong Answer', 'Accepted'] | ['s973725849', 's923329747'] | [9088.0, 9160.0] | [26.0, 31.0] | [90, 130] |
p02754 | u277312083 | 2,000 | 1,048,576 | 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? | ['n,a,b=map(int,input().split())\nif 1<=n%(a+b) and n%(a+b)<=a:\n ans=(n/(a+b))*a+n%(a+b)\nelse:\n ans=(n/(a+b))*a\nprint(ans)', 'n, a, b = map(int, input().split())\nans = n // (a + b) * a + min(a, n % (a + b))\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s942028496', 's102040345'] | [3060.0, 2940.0] | [17.0, 19.0] | [121, 91] |
p02754 | u280853184 | 2,000 | 1,048,576 | 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? | ['import sys\nN,A,B=map(float,input().split())\nif A==0:\n print("0")\n sys.exit()\nelif B==0:\n print(N)\n sys.exit()\n\ntmp=(int(N/(A+B))*A)\ntmp_2=int(N-(N-int((N%(A+B)))))\nprint(tmp)\nprint(tmp_2)\nif (N%(A+B))==0:\n print(tmp)\nelse:\n print(tmp+tmp_2)', 'import sys\nN,A,B=map(float,input().split())\nif A==0:\n print("0")\n sys.exit()\nelif B==0:\n print(int(N))\n sys.exit()\nif N>=A:\n print(int(A))\n sys.exit()\nelif N<A:\n print(int(N))\n sys.exit()\n \nif N>=(A+B):\n tmp=(int(N/(A+B))*A)\n tmp_2=int(N%(A+B))\n if (N%(A+B))==0:\n print(int(tmp))\n else:\n print(int(tmp+tmp_2))\n', 'N, A, B = map(int, input().split())\n2 ans = N // (A + B) * A\n3 rem = N % (A + B)\n4 ans += min(rem, A)\n5 print(ans)\n', 'import sys\nN,A,B=map(float,input().split())\nif A==0:\n print("0")\n sys.exit()\nelif B==0:\n print(int(N))\n sys.exit()\n\nif N>=A:\n print(int(A))\n sys.exit()\nelif N<A:\n print(int(N))\n sys.exit()\n \nif N>=(A+B):\n tmp=(int(N/(A+B))*A)\n tmp_2=int(N%(A+B))\n if (N%(A+B))==0:\n print(int(tmp))\n else:\n print(int(tmp+tmp_2))\nelif N<(A+B):\n if N>=A:\n print(int(A))\n elif N<A:\n print(int(N))', 'N, A, B = map(int, input().split())\nans = N // (A + B) * A\nrem = N % (A + B)\nans += min(rem, A)\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s195559078', 's326426847', 's499359284', 's871072675', 's157945290'] | [3188.0, 3064.0, 2940.0, 3064.0, 2940.0] | [20.0, 18.0, 17.0, 17.0, 17.0] | [246, 329, 115, 402, 107] |
p02754 | u281334626 | 2,000 | 1,048,576 | 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? | ['N,A,B = map(int, input().split())\n\nnum_move = N // (A+B)\nrest = N % (A+B)\n\nif (rest > A):\n result = A*num_move\nelse:\n result = A*(num_move-1)+rest\n\nprint(result)', 'N,A,B = map(int, input().split())\n\nnum_move = N // (A+B)\nrest = N % (A+B)\n\nif (rest >= A):\n result = A*num_move\nelse:\n result = A*(num_move-1)+rest\n\nprint(result)', 'N,A,B = map(int, input().split())\n\nnum_move = N // (A+B)\nrest = N % (A+B)\n\nif (rest > A):\n result = A*(num_move+1)\nelse:\n result = A*num_move+rest\n\nprint(result)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s413310668', 's530715341', 's183814202'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [167, 168, 168] |
p02754 | u282652245 | 2,000 | 1,048,576 | 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? | ["\n\n\ndef main():\n NAB = list(map(int,input().split()))\n\n b = NAB[0]\n a = 0\n b = 0\n \n while b <= 0:\n b -= NAB[1]\n a += 1\n \n if b <= 0:\n break\n \n b -= NAB[2]\n b += 1\n \n if b < 0:\n print(NAB[1]*a - abs(b))\n else:\n print(NAB[1]*a)\n \n \n\n # if NAB[1] == 0:\n # b = 0\n # elif NAB[2] == 0:\n # b = NAB[1]\n # \n # elif NAB[0] < NAB[1]+NAB[2]:\n # if NAB[0] < NAB[1]:\n # b = NAB[0]\n # else:\n # b = NAB[1]\n # \n # else:\n # tm = NAB[0]//(NAB[1]+NAB[2])\n # amari = NAB[0] % (NAB[1]+NAB[2])\n # \n # # print(tm)\n # if NAB[1] < amari:\n # b = (tm*NAB[1])+ NAB[1]\n # else:\n # b = (tm*NAB[1])+ amari\n # \n # print(b)\n\n\n\n # cA = NAB[1]\n # cB = NAB[2]\n #\n \n #\n # if NAB[1] == 0:\n # break\n # if NAB[2] == 0:\n # b = NAB[1]\n # break\n #\n # if cA != 0:\n # b += 1\n # cA -= 1\n # elif cB != 0 and cA == 0:\n # cB -=1\n # else:\n # cA = NAB[1]\n # cB = NAB[2]\n #\n # b += 1\n # cA -= 1\n\n\n\n\nif __name__ == '__main__':\n main()", '\n\n\ndef main():\n NAB = list(map(int,input().split()))\n\n X = NAB[0]\n a = 0\n b = 0\n\n while X >= 0:\n X -= NAB[1]\n a += 1\n # print("go")\n\n if X <= 0:\n break\n\n X -= NAB[2]\n b += 1\n\n # print(a)\n # print(b)\n\n if b < 0:\n print(NAB[1]*a - abs(X))\n else:\n print(NAB[1]*a)\n\n\n\n # if NAB[1] == 0:\n # b = 0\n # elif NAB[2] == 0:\n # b = NAB[1]\n #\n # elif NAB[0] < NAB[1]+NAB[2]:\n # if NAB[0] < NAB[1]:\n # b = NAB[0]\n # else:\n # b = NAB[1]\n #\n # else:\n # tm = NAB[0]//(NAB[1]+NAB[2])\n # amari = NAB[0] % (NAB[1]+NAB[2])\n #\n # # print(tm)\n # if NAB[1] < amari:\n # b = (tm*NAB[1])+ NAB[1]\n # else:\n # b = (tm*NAB[1])+ amari\n #\n # print(b)\n\n\n\n # cA = NAB[1]\n # cB = NAB[2]\n #\n \n #\n # if NAB[1] == 0:\n # break\n # if NAB[2] == 0:\n # b = NAB[1]\n # break\n #\n # if cA != 0:\n # b += 1\n # cA -= 1\n # elif cB != 0 and cA == 0:\n # cB -=1\n # else:\n # cA = NAB[1]\n # cB = NAB[2]\n #\n # b += 1\n # cA -= 1\n\n\n\n\nif __name__ == \'__main__\':\n main()', '\n\n\ndef main():\n NAB = list(map(int,input().split()))\n\n # X = NAB[0]\n # a = 0\n # b = 0\n #\n # while X >= 0:\n # X -= NAB[1]\n # a += 1\n # # print("go")\n #\n # if X <= 0:\n # break\n #\n # X -= NAB[2]\n # b += 1\n #\n # # print(a)\n # # print(b)\n #\n # if b < 0:\n # print(NAB[1]*a - abs(X))\n # else:\n # print(NAB[1]*a)\n\n b = 0\n\n tm = NAB[0] // (NAB[1] + NAB[2])\n amari = NAB[0] % (NAB[1] + NAB[2])\n tm += min(amari,NAB[1])\n\n print(tm)\n\n # if NAB[1] == 0:\n # b = 0\n # elif NAB[2] == 0:\n # b = NAB[1]\n #\n # elif NAB[0] < NAB[1]+NAB[2]:\n # if NAB[0] < NAB[1]:\n # b = NAB[0]\n # else:\n # b = NAB[1]\n #\n # else:\n # tm = NAB[0]//(NAB[1]+NAB[2])\n # amari = NAB[0] % (NAB[1]+NAB[2])\n #\n # # print(tm)\n # if NAB[1] < amari:\n # b = (tm*NAB[1])+ NAB[1]\n # else:\n # b = (tm*NAB[1])+ amari\n\n # print(b)\n\n\n\n # cA = NAB[1]\n # cB = NAB[2]\n #\n \n #\n # if NAB[1] == 0:\n # break\n # if NAB[2] == 0:\n # b = NAB[1]\n # break\n #\n # if cA != 0:\n # b += 1\n # cA -= 1\n # elif cB != 0 and cA == 0:\n # cB -=1\n # else:\n # cA = NAB[1]\n # cB = NAB[2]\n #\n # b += 1\n # cA -= 1\n\n\n\n\nif __name__ == \'__main__\':\n main()', "\n\n\ndef main():\n NAB = list(map(int,input().split()))\n\n\n\n\n # tm = NAB[0] // (NAB[1] + NAB[2]) * NAB[1]\n # amari = NAB[0] % (NAB[1] + NAB[2])\n # tm += min(amari,NAB[1])\n #\n # print(tm)\n\n # b = 0\n #\n # tm = NAB[0]//(NAB[1]+NAB[2])\n # amari = NAB[0] % (NAB[1]+NAB[2])\n #\n # # print(tm)\n # if NAB[1] < amari:\n # b = (tm*NAB[1])+ NAB[1]\n # else:\n # b = (tm*NAB[1])+ amari\n #\n # print(b)\n\n\n b = 0\n # if NAB[1] == 0:\n # b = 0\n # elif NAB[2] == 0:\n # b = NAB[1]\n\n if NAB[0] < NAB[1]+NAB[2]:\n if NAB[0] < NAB[1]:\n b = NAB[0]\n else:\n b = NAB[1]\n\n else:\n tm = NAB[0]//(NAB[1]+NAB[2])\n amari = NAB[0] % (NAB[1]+NAB[2])\n\n # print(tm)\n if NAB[1] < amari:\n b = (tm*NAB[1])+ NAB[1]\n else:\n b = (tm*NAB[1])+ amari\n\n print(b)\n\n\n\n\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s585064311', 's806900835', 's809501941', 's286729491'] | [3064.0, 3064.0, 3060.0, 3064.0] | [17.0, 2104.0, 18.0, 18.0] | [1330, 1339, 1522, 936] |
p02754 | u283605799 | 2,000 | 1,048,576 | 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? | ["# -*- coding: utf-8 -*-\n\nimport sys\n\ndef prob_b(n, a, b):\n n, a, b = int(n), int(a), int(b)\n x = int(n / (a + b)) * a\n y = n % (a + b)\n print(x+y)\n\n\nif __name__ == '__main__':\n args = sys.argv\n n = args[1]\n a = args[2]\n b = args[3]\n prob_b(n,a,b)\n", "# -*- coding: utf-8 -*-\n\nimport sys\n\n\ndef prob_b(n, a, b):\n x = int(n / (a + b)) * a\n y = min(n % (a + b), a)\n print(x+y)\n\n\nif __name__ == '__main__':\n #args = sys.argv\n #n = args[1]\n #a = args[2]\n #b = args[3]\n n, a, b = map(int, input().split())\n prob_b(n,a,b)\n"] | ['Runtime Error', 'Accepted'] | ['s727784328', 's220997867'] | [2940.0, 2940.0] | [18.0, 18.0] | [274, 290] |
p02754 | u284363684 | 2,000 | 1,048,576 | 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? | ['# input \nN, A, B = map(int, input().split())\n\nif A == 0:\n print(0)\nelse:\n b_fl = True\n ans = 0\n while N > 0:\n if b_fl is True:\n ans += A\n N -= A\n if N < 0:\n ans -= N\n b_fl = False\n else:\n N -= B\n print(ans)', '# input\nN, A, B = map(int, input().split())\n\n\nif A == 0:\n print(0)\nelse:\n cnt = int(N / (A + B))\n amr = N % (A + B)\n ans = A * cnt\n if amr >= A:\n ans += A\n else:\n ans += amr\n \n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s959682708', 's583219630'] | [3060.0, 3060.0] | [2104.0, 18.0] | [305, 236] |
p02754 | u285265363 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\n\nans = int(N / (A + B))\n\nr = N % (A + B)\n\nans = ans + min(r, A)\n\nprint(ans)', '\nN, A, B = map(int, input().split())\n\nans = N / (A + B) * A\n\nr = N % (A + B)\n\nans = ans + min(r, A)\n\nprint(ans)', 'N, A, B = map(int, input().split())\n\nans = N // (A + B) * A\n\nr = N % (A + B)\n\nans = ans + min(r, A)\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s816561377', 's889898054', 's135601477'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [111, 111, 111] |
p02754 | u285497176 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\n \nl = ""\nflag = True\ncount = 0\nwhile True:\n if flag == True:\n for x in range(a):\n l += "b"\n flag = False\n else:\n for y in range(b):\n l += "r"\n flag = True\n\n if len(l) >= n:\n break\n \nfor c in l:\n if c == "b":\n count += 1\n\nprint(count)\n', 'N, A, B = map(int, input().split())\nans = N // (A + B) * A\nrem = N % (A + B)\nans += min(rem, A)\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s197953061', 's402720087'] | [19348.0, 2940.0] | [2105.0, 17.0] | [357, 108] |
p02754 | u288980918 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int,input()split())\ndiv=n//(a+b)\nmod=n%(a+b)\nprint(div*a+min(mod,a))', 'N,A,B=map(int,input().split())\ndiv=N//(A+B)\nmod=N%(A+B)\nprint(div*A+min(mod,A))'] | ['Runtime Error', 'Accepted'] | ['s649774177', 's124559213'] | [8852.0, 9012.0] | [26.0, 30.0] | [80, 79] |
p02754 | u290886932 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\nmul = N // (A + B)\nmod = N % (A + B)\nret = mul * A * min(mod, A)\nprint(ret)', 'N, A, B = map(int, input().split())\nmul = N // (A + B)\nmod = N % (A + B)\nret = mul * A + min(mod, A)\nprint(ret)'] | ['Wrong Answer', 'Accepted'] | ['s986458663', 's825696188'] | [2940.0, 2940.0] | [18.0, 19.0] | [111, 111] |
p02754 | u293523199 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\n\nc = N // (A + B)\nmod = N % (A + B)\n# print(c,mod)\n\nmod_A = mod // A \n# print(mod_A)\nprint(c * A + mod_A * A)', 'N, A, B = map(int, input().split())\n\nq, mod = divmod(N, A+B)\n# print(q,mod)\n\nif A == 0:\n print(0)\nelse:\n if mod > A:\n print(q * A + A)\n else:\n print(q * A + mod)'] | ['Runtime Error', 'Accepted'] | ['s118340652', 's814393620'] | [2940.0, 3060.0] | [17.0, 18.0] | [145, 184] |
p02754 | u297089927 | 2,000 | 1,048,576 | 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? | ['N,A,B=map(int,input().split())\nList=""\nwhile len(List) < N:\n List=List+"b"*A\n for j in range(B):\n List=List+"r"*B\nif len(List) >= N:\n ans=List[:N]\n print(ans.count("b"))\n', 'N,A,B=map(int,input().split())\nprint(N//(A+B)*A+min(A,N%(A+B)))'] | ['Runtime Error', 'Accepted'] | ['s406063625', 's856998639'] | [2940.0, 2940.0] | [18.0, 17.0] | [179, 63] |
p02754 | u303305161 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\nans = max (N - A, 0)\nprint(ans)', 'N, A, B = map(int, input().split())\nans = min (A, N)\nprint(ans)', 'N, A, B = map(int, input().split())\nans = N // (A + B) * A\nrem = N % (A + B)\nans = ans + min(A, rem)\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s288343648', 's821718599', 's373293177'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [67, 63, 111] |
p02754 | u304593245 | 2,000 | 1,048,576 | 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? | ['\nN, A, B = list(map(int, input().split()))\ni = 0\nb = 0\nr = 0\n\nc = N//(A+B)\nprint(c)\nd = N%(A+B)\nprint(d)\nif d <= A:\n b = c*A + d\nelse:\n b = (c+1)*A\nprint(b) \n', '\nN, A, B = list(map(int, input().split()))\ni = 0\nb = 0\nr = 0\n\nc = N//(A+B)\n#print(c)\nd = N%(A+B)\n#print(d)\nif d <= A:\n b = c*A + d\nelse:\n b = (c+1)*A\nprint(b) \n'] | ['Wrong Answer', 'Accepted'] | ['s874505242', 's103044267'] | [3060.0, 3060.0] | [18.0, 18.0] | [164, 166] |
p02754 | u306412379 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int, input().split())\nm1 = n // (a + b)\nm2 = n % (a + b)\nprint(m1,m2)\nif a ==0:\n print(0)\nelif a + b > n:\n print(a)\nelif a > n:\n print(n)\nelse:\n if m2 >= a:\n print(m1 * (a +1))\n else:\n print(m1 * a + m2)', 'n,a,b = map(int, input().split())\nm1 = n // (a + b)\nm2 = n % (a + b)\n\nif a ==0:\n print(0)\nelif a >= n:\n print(n)\nelif a + b >n:\n print(a)\n\nelse:\n if m2 >= a:\n print((m1 + 1) * a )\n else:\n print(m1 * a + m2)'] | ['Wrong Answer', 'Accepted'] | ['s825482190', 's016999248'] | [9184.0, 9188.0] | [27.0, 30.0] | [226, 217] |
p02754 | u309423187 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\n\n\nans = (n //(a + b)) * a\nif n % (a + b) < a:\n print(ans + (n % (a + b))\nelif n % (a + b) > a:\n print(ans + a)\n ', 'n, a, b = map(int, input().split())\n\n\nans = (n //(a + b)) * a\nif n % (a + b) < a:\n print(ans + (n % (a + b))\nelif n % (a + b) >= a:\n print(ans + a)\n \n', 'a, b, c = map(int, input().split())\n\nans1 = a // (b + c)\nans2 = min(ans1, b)\n\nif a % (b + c) == 0:\n print(ans1)\nelse:\n print(ans1 + ans2)', 'n, a, b = map(int, input().split())\n\n\nans = (n //(a + b)) * a\nif n % (a + b) <= a:\n print(ans + (n % (a + b))\nelif n % (a + b) >= a:\n print(ans + a)\n \n', 'n, a, b, = map(int, input().split())\n\nans = n // (a + b)\nres = min(a, n % (a + b))\n\nprint(ans * a + res)\n'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s037841794', 's039960656', 's094185014', 's220682406', 's219450720'] | [2940.0, 2940.0, 3060.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0, 17.0, 17.0] | [157, 159, 143, 160, 105] |
p02754 | u313291636 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int, input().split())\nt = n // (a + b)\n\nif n % (a + b):\n print(a * t)\nelse:\n if n - (a + b) * t >= a:\n print((a * t) + a)\n else:\n print((a * t) + (n - (a + b) * t))\n', 'n,a,b = map(int, input().split())\nt = n // (a + b)\n\nif n % (a + b):\n print(a * t)\nelse:\n if n - (a + b) * t >= a:\n print((a * t) + a)\n else:\n print((a * t) + (n - (t * n)))\n', 'n,a,b = map(int, input().split())\nt = n // (a + b)\n\nif t == 1:\n print(a * t)\nelse:\n if n - (a + b) * t >= a:\n print((a * t) + a)\n else:\n print((a * t) + (n - (t * n)))\n', 'n,a,b = map(int, input().split())\nt = n // (a + b)\n\nif t == 1:\n print(a * t)\nelse:\n if n - (t * n) >= a:\n print((a * t) + a)\n else:\n print((a * t) + (n - (t * n)))\n', 'n,a,b = map(int, input().split())\n\nx = n % (a + b)\ny = n // (a + b)\nans = a * y + min(x , a)\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s299288484', 's495806197', 's700728377', 's941047088', 's843823226'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0, 17.0, 17.0] | [200, 196, 191, 187, 104] |
p02754 | u313317027 | 2,000 | 1,048,576 | 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? | ['import sys\n\nN, A, B = map(int,input().split())\n\nans = 0\n\nif N < A:\n print("0")\n sys.exit()\n\nif N < A+B:\n print(N-A)\n sys.exit()\n\nprint((int)(B*(N/(A+B))) + (N%(A+B)-A))\n', 'import sys\n \nN, A, B = map(int,input().split())\n \nans = 0\n \nif N < A:\n print(N)\n sys.exit()\n \nif N < A+B:\n print(A)\n sys.exit()\n \nif N%(A+B) <A:\n print((A*(N//(A+B))) + (N%(A+B)))\nelse:\n print((A*(N//(A+B))) + A)'] | ['Wrong Answer', 'Accepted'] | ['s419451433', 's267130186'] | [2940.0, 3064.0] | [18.0, 19.0] | [173, 218] |
p02754 | u313370702 | 2,000 | 1,048,576 | 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? | ['# coding: utf-8\n\nN, A, B = map(int, input().split())\n\nans = 0\n\nif A == 0:\n ans = 0\nelif B == 0:\n ans = N\nelse:\n for n in range(10 ** 100):\n if n + 1 > N:\n break\n\n if ((n + 1) % (A + B)) <= A and ((n + 1) % (A + B)) != 0:\n print(n+1, A+B, A)\n ans += 1\n\nprint(ans)\n', '# coding: utf-8\n\nN, A, B = map(int, input().split())\n\nans = 0\n\nif A == 0:\n ans = 0\nelif B == 0:\n ans = N\nelse:\n for n in range(N):\n if n + 1 > N:\n break\n\n if ((n + 1) % (A + B)) <= A and ((n + 1) % (A + B)) != 0:\n print(n+1, A+B, A)\n ans += 1\n\nprint(ans)\n', '# coding: utf-8\n\nN, A, B = map(int, input().split())\n\nshou = N // (A + B)\namari = N % (A + B)\n\nans = A * shou\n\nif amari <= A:\n ans += amari\nelse:\n ans += A\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s822592822', 's861531569', 's236009715'] | [45428.0, 47092.0, 2940.0] | [2104.0, 2104.0, 18.0] | [344, 336, 199] |
p02754 | u319345083 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\n\nif a == 0:\n print(0)\nelif n <= a or b == 0:\n print(n)\nelif a < n and n <= a+b:\n print(a)\nelse:\n mul = n // (a+b)\n mod = n % (a+b) // a\n # print(mul, mod)\n print(mul*a + mod)\n', 'n, a, b = map(int, input().split())\nans = n // (a+b)*a\nrem = n % (a+b)\nans += min(rem, a)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s255434123', 's525703040'] | [2940.0, 2940.0] | [17.0, 17.0] | [232, 100] |
p02754 | u320763652 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int, input().split())\n\ntmp = int(n /(a+b))\namari = int(n %(a+b))\n\nprint(tmp*a)\n\nif amari >= a:\n print(tmp*a + a)\nelse:\n print(tmp*a + amari)', 'n,a,b = map(int, input().split())\n\ntmp = int(n /(a+b))\namari = int(n %(a+b))\n\nif amari >= a:\n print(tmp*a + a)\nelse:\n print(tmp*a + a-amari)', 'n,a,b = map(int, input().split())\n# n,a,b = map(int, "6 2 4".split())\n\ntmp = int(n /(a+b))\namari = int(n %(a+b))\n\nif amari >= a:\n print(tmp*a + a)\nelse:\n print(tmp*a + amari)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s689386531', 's906003525', 's349499826'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [158, 146, 180] |
p02754 | u325119213 | 2,000 | 1,048,576 | 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? | ["def actual(n, a, b):\n s = ''\n\n\tfor _ in range(10**100):\n s += '青' * a + '赤' * b\n\n if len(s) >= n:\n return s[:n].count('青')\n\nn, a, b = map(int, input().split())\nprint(actual(n, a, b))\n", 'def actual(n, a, b):\n n_op_least = n // (a + b)\n\n n_blue_least = a * n_op_least\n adjustment = min(n % (a + b), a)\n\n return n_blue_least + adjustment\n\nn, a, b = map(int, input().split())\nprint(actual(n, a, b))\n'] | ['Runtime Error', 'Accepted'] | ['s531597305', 's792099260'] | [2940.0, 2940.0] | [26.0, 18.0] | [217, 221] |
p02754 | u326552320 | 2,000 | 1,048,576 | 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? | ['#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tC\n# CreatedDate: 2020-03-07 21:21:27 +0900\n# LastModified: 2020-03-07 22:31:57 +0900\n#\n\n\n\n\ndef main():\n A,B = map(int,input().split())\n a_min = (A/0.08)\n a_max = (A+1)/0.08\n b_min = (B/0.1)\n b_max = (B+1)/0.1\n if a_min!=int(a_min):\n a_min = int(A/0.08)+1\n if b_min!=int(b_min):\n b_min = int(B/0.1)+1\n s_a = [i for i in range(int(a_min),int(a_max))]\n s_b = [i for i in range(int(b_min),int(b_max))]\n for common in s_a:\n if common in s_b:\n print(common)\n return\n print(-1)\n\n\nif __name__ == "__main__":\n main()\n', '#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tB\n# CreatedDate: 2020-08-30 14:36:32 +0900\n# LastModified: 2020-08-30 14:45:15 +0900\n#\n\n\nimport os\nimport sys\n# import numpy as np\n\n\n\ndef main():\n n, a, b = map(int, input().split())\n tmp = n - n // (a+b) * (a+b)\n ans = n//(a+b) * a\n if tmp <= a:\n print(ans+tmp)\n else:\n print(ans+a)\n\n\nif __name__ == "__main__":\n main()\n'] | ['Runtime Error', 'Accepted'] | ['s749160296', 's631896328'] | [3184.0, 9168.0] | [19.0, 27.0] | [649, 436] |
p02754 | u329675280 | 2,000 | 1,048,576 | 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? | ['n,a,b=map(int, input().split())\n\nballs= 0\nblue = 0\n\nfor i in range(10**18):\n if i % 2 == 0:\n balls = balls + a\n blue = blue + a\n else:\n balls = balls + b\n if balls > n:\n break\n\nprint(blue)', 'n,a,b=map(int, input().split())\n\nballs= 0\nblue = 0\n\nfor i in range(10**18):\n if i % 2 == 0:\n balls = balls + a\n blue = blue + a\n else:\n balls = balls + b\n if balls >= n:\n break\n\nprint(blue)', 'n,a,b=map(int, input().split())\n\nballs= 0\nblue = 0\n\ntime = n // (a+b)\ntmp = n % (a+b)\nif tmp < a:\n blue = time*a + tmp\nelse:\n blue = (time+1)*a\n\nprint(blue)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s554778525', 's912865098', 's788922086'] | [2940.0, 3060.0, 3060.0] | [2108.0, 2104.0, 17.0] | [203, 204, 158] |
p02754 | u332926534 | 2,000 | 1,048,576 | 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? | ['N, Blue, Red = map(int, input().split())\n\nif(Blue >= N):\n print(N)\nelif (Blue + Red) >= N or Blue == 0:\n print(Blue)\nelse:\n q = N // (Blue + Red)\n mod = N % (Blue + Red)\n if Blue > mod:\n print(q * Blue + Blue)\n else:\n print(q * Blue + mod)', 'N, Blue, Red = map(int, input().split())\n\nif(Blue >= N):\n print(N)\nelif (Blue + Red) >= N or Blue == 0:\n print(Blue)\nelse:\n q = N // (Blue + Red)\n mod = N % (Blue + Red)\n if Blue < mod:\n print(q * Blue + Blue)\n else:\n print(q * Blue + mod)'] | ['Wrong Answer', 'Accepted'] | ['s057433548', 's871900102'] | [3060.0, 3060.0] | [18.0, 17.0] | [272, 272] |
p02754 | u333731247 | 2,000 | 1,048,576 | 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? | ['if A==0:\n print(0)\nelif A!=0 and N>(A+B):\n print(num_A*A+int(sur/(A+B)))\nelif A!=0 and N<=(A+B) and N>=A:\n print(A)\nelif A!=0 and N<=(A+B) and N<A:\n print(N)', 'N,A,B=map(int,input().split())\n\nnum_A=int(N/(A+B))\nsur=int(N-(A+B)*num_A)\n\nif A==0:\n print(0)\nelif A!=0 and N>(A+B) and sur>=A:\n print(num_A*A+A)\nelif A!=0 and N>(A+B) and sur<A:\n print(num_A*A+sur)\nelif A!=0 and N<=(A+B) and N>=A:\n print(A)\nelif A!=0 and N<=(A+B) and N<A:\n print(N)'] | ['Runtime Error', 'Accepted'] | ['s765082678', 's211224165'] | [3060.0, 3064.0] | [18.0, 17.0] | [169, 298] |
p02754 | u335664637 | 2,000 | 1,048,576 | 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? | ["a=input().split()\nN,A,B=int(a[0]),int(a[1]),int(a[2])\nst_a='b'*A\nst_b='r'*B\nd=st_a+st_b\ne=A+B\nif(e==0):\n print(0)\nelse:\n num=int(N/e)+2\n b=d*num\n print(b)\n c=b[0:N]\n print(c)\n print(c.count('b'))", 'a=input().split()\nN,A,B=int(a[0]),int(a[1]),int(a[2])\nb=N/(A+B)\nans=int(A*b)\nif(N-b*(A+B)<=A):\n ans=ans+N-b*(A+B)\nprint(int(ans))', 'a=input().split()\nN,A,B=int(a[0]),int(a[1]),int(a[2])\nb=int(N/(A+B))\nans=int(A*b)\nif(N-b*(A+B)<=A):\n ans=ans+N-b*(A+B)\nelse:\n ans+=A\nprint(int(ans))\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s290314658', 's326990740', 's669693954'] | [3064.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [202, 132, 155] |
p02754 | u340494803 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\nprint(n//(a+b))*a+min((n%(a+b), a)', 'n, a, b = map(int, input().split())\nprint((n//(a+b))*a+min(n%(a+b), a))'] | ['Runtime Error', 'Accepted'] | ['s588589620', 's492352987'] | [2940.0, 2940.0] | [17.0, 17.0] | [70, 71] |
p02754 | u341543478 | 2,000 | 1,048,576 | 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? | ['n, blue, red = list(map(int, input().split()))\n\nif blue == 0:\n print(0)\n exit()\n\nif n <= blue:\n print(n)\n exit()\n\nif n <= blue + red:\n print(blue)\n exit()\n\ntemp = n // (blue + red)\ncnt = temp * blue\nprint(cnt)', 'n, blue, red = list(map(int, input().split()))\n\nif blue == 0:\n print(0)\n exit()\n\nif n <= blue:\n print(n)\n exit()\n\nif n <= blue + red:\n print(blue)\n exit()\n\nq = n // (blue + red)\nr = n % (blue + red)\n\ncnt = q * blue\n\nwhile True:\n if r >= blue:\n cnt += blue\n r -= blue\n if r <= red:\n break\n elif r > red:\n r -= red\n else:\n cnt += r\n break\n\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s254307913', 's071699983'] | [3064.0, 3064.0] | [17.0, 17.0] | [227, 436] |
p02754 | u344959959 | 2,000 | 1,048,576 | 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? | ['from collections import Counter\na,b,c = map(int,input().split())\nd = ""\ne = ("1"*b + "0"*c)*a\nf = d[:a]\ng = Counter(f)\nprint(g["1"])\n', 'a,b,c = map(int,(input().split()))\nd = (a//(b+c))*b + min((a%(b+c)),b)\nprint(d)\n'] | ['Runtime Error', 'Accepted'] | ['s584148426', 's151371510'] | [9376.0, 8948.0] | [30.0, 29.0] | [133, 80] |
p02754 | u345132740 | 2,000 | 1,048,576 | 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? | ['N,A,B=input().split()\nANS=int(N)//(int(A)+int(B))\nANS=ANS*int(A)\nif((int(N)%(int(A)+int(B))<=int(A)):\n ANS=ANS+(int(N)%(int(A)+int(B)))\nelse:\n ANS=ANS+int(A)\nprint(ANS)', 'N,A,B=input().split()\nANS=int(N)//(int(A)+int(B))\nANS=ANS*int(A)\nif(int(N)%(int(A)+int(B))<=int(A)):\n ANS=ANS+(int(N)%(int(A)+int(B)))\nelse:\n ANS=ANS+int(A)\nprint(ANS)'] | ['Runtime Error', 'Accepted'] | ['s139531297', 's971852310'] | [2940.0, 3060.0] | [17.0, 17.0] | [172, 171] |
p02754 | u345483150 | 2,000 | 1,048,576 | 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? | ['n,a,b=map(int,input().split())\nif n<=a:\n print(n)\nif n<=a+b:\n print(a)\nelse:\n if n%(a+b)<=a:\n print(a*(n//(a+b)))\n else:\n print(a*(n//(a+b))+a)', 'n,a,b=map(int,input().split())\nif n<=a+b:\n print(n)\nelse:\n if n%(a+b)<=a:\n print(a*(n//(a+b)))\n else:\n print(a*(n//(a+b))+a)', 'n,a,b=map(int,input().split())\nif a==0 and b==0:\n print(0)\n exit()\nif n<=a:\n print(n)\nelif n<=a+b:\n print(a)\nelse:\n if n%(a+b)<=a:\n print(a*(n//(a+b))+n%(a+b))\n else:\n print(a*(n//(a+b))+a)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s005225625', 's210350681', 's912098608'] | [3060.0, 3064.0, 3064.0] | [17.0, 18.0, 18.0] | [155, 133, 221] |
p02754 | u349863397 | 2,000 | 1,048,576 | 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? | ["from sys import stdin, stdout\nimport math\nfrom itertools import permutations, combinations\nfrom collections import defaultdict\nimport bisect\nimport heapq as hq\n\ndef main():\n try:\n n,a,b=In()\n temp=a+b\n n=n//temp\n print(n*a)\n except:\n pass\ndef add(a, b, c):\n res = a + b;\n if (res >= c):return res - c;\n else:return res;\ndef mod(a, b, c):\n res = a * b\n if (res >= c):return res % c\n else:return res\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\ndef lcm(a, b):\n w = a // gcd(a, b)\n return w * b\ndef expo(a, b):\n x, y = 1, a\n while (b > 0):\n if (b & 1):\n x = x * y\n y = y * y\n b >>= 1\n return x\ndef power(a, b, m):\n x, y = 1,\n while (b > 0):\n if (b & 1):x = mod(x, y, m)\n y = mod(y, y, m)\n b >>= 1\n return x\ndef L():\n return list(map(int, stdin.readline().split()))\ndef In():\n return map(int, stdin.readline().split())\ndef I():\n return int(stdin.readline())\nP = 1000000007\n\n\nif __name__ == '__main__':\n main()\n\n\n", "from sys import stdin, stdout\nimport math\nfrom itertools import permutations, combinations\nfrom collections import defaultdict\nimport bisect\nimport heapq as hq\n\ndef main():\n try:\n n,a,b=In()\n temp=a+b\n t=n//temp\n t=(a*t)\n n=n%temp\n if n<=a and n>0:\n t+=(n)\n elif n>a:\n t+=(a)\n print(t)\n except:\n pass\ndef add(a, b, c):\n res = a + b;\n if (res >= c):return res - c;\n else:return res;\ndef mod(a, b, c):\n res = a * b\n if (res >= c):return res % c\n else:return res\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\ndef lcm(a, b):\n w = a // gcd(a, b)\n return w * b\ndef expo(a, b):\n x, y = 1, a\n while (b > 0):\n if (b & 1):\n x = x * y\n y = y * y\n b >>= 1\n return x\ndef power(a, b, m):\n x, y = 1,\n while (b > 0):\n if (b & 1):x = mod(x, y, m)\n y = mod(y, y, m)\n b >>= 1\n return x\ndef L():\n return list(map(int, stdin.readline().split()))\ndef In():\n return map(int, stdin.readline().split())\ndef I():\n return int(stdin.readline())\nP = 1000000007\n\n\nif __name__ == '__main__':\n main()\n\n\n"] | ['Wrong Answer', 'Accepted'] | ['s191100355', 's657760111'] | [3444.0, 3424.0] | [86.0, 22.0] | [1076, 1188] |
p02754 | u350093546 | 2,000 | 1,048,576 | 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? | ['n,a,b=map(int,input().split())\nx=n//(a+b)\ny=n%(a+b)\nprint((x*b)+(y-a))', 'n,a,b=map(int,input().split())\nx=n//(a+b)\ny=n%(a+b)\n\nif y<=a:\n print(x*b)\nelse:\n z=(x*b)+(y-a)\n print z\n', 'n,a,b=map(int,input().split())\nx=(n//(a+b))*a\ny=min(a,n%(a+b))\nprint(x+y)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s280869931', 's892475734', 's083453090'] | [2940.0, 2940.0, 3064.0] | [18.0, 17.0, 17.0] | [70, 107, 73] |
p02754 | u353919145 | 2,000 | 1,048,576 | 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? | ["S = input()\nlist_num = S.split(' ')\nlist_num = map(int, list_num)\nN, A, B = list_num[0], list_num[1], list_num[2]\n\nif A+B>N:\n print(N-A-B)\nelif A+B=N:\n print(A)", 'N,A,B= input().split()\nif int(N)%(int(A)+int(B))>=int(A):\n ans=int(N)//(int(A)+int(B))*int(A)+int(A)\n print(ans)\nelse:\n ans=int(N)//(int(A)+int(B))*int(A)+int(N)%(int(A)+int(B))\n print(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s683595622', 's073198010'] | [2940.0, 3060.0] | [17.0, 17.0] | [162, 203] |
p02754 | u357230322 | 2,000 | 1,048,576 | 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? | ['x=n//(a+b)\nif (a+b)*x<=a:\n t=n-x*(a+b)\nelse:\n t=a\nprint(a*x+t)', 'n,a,b=map(int,input().split())\nx=n//(a+b)\nif (a+b)*x<=a:\n t=n-x*(a+b)\nelse:\n t=a\nprint(a*x+t)\n', 'n,a,b=map(int,input().split())\nx=n//(a+b)\nif n-(a+b)*x<=a:\n t=n-x*(a+b)\nelse:\n t=a\nprint(a*x+t)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s175448668', 's469800218', 's564390987'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [64, 96, 98] |
p02754 | u357751375 | 2,000 | 1,048,576 | 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? | ['n,b,r = map(int,input().split())\n\nif b == 0:\n print(0)\nelif r == 0:\n print(n)\nelse:\n d = b + r\n c = d // n * b\n if d % n == 0:\n print(c)\n else:\n if d % n < b:\n print(c + (d % n))\n else:\n print(c + b)', 'n,a,b = map(int,input().split())\nab = a + b\nm = n // ab\nn %= ab\nprint(m*a+min(n,a))'] | ['Wrong Answer', 'Accepted'] | ['s877469263', 's866932859'] | [3060.0, 9116.0] | [17.0, 28.0] | [260, 83] |
p02754 | u357949405 | 2,000 | 1,048,576 | 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? | ['N, A, B = int(input())\n\nprint(N//(A+B)*B + max(N%(A+B)-A, 0))\n', 'N, A, B = map(int, input().split())\n\nif A==B==0:\n print(0)\nelse:\n print(N//(A+B)*A + min(N%(A+B), A))\n'] | ['Runtime Error', 'Accepted'] | ['s319787417', 's741065224'] | [2940.0, 2940.0] | [20.0, 20.0] | [62, 108] |
p02754 | u358747500 | 2,000 | 1,048,576 | 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? | ['balls=map(int,input().split())\nprint((n//(a+b))*a+min(a,n%(a+b)))', 'n,a,b=map(int,input().split())\nprint((n//(a+b))*a+min(a,n%(a+b)))'] | ['Runtime Error', 'Accepted'] | ['s573896109', 's916480941'] | [2940.0, 2940.0] | [18.0, 18.0] | [65, 65] |
p02754 | u362744027 | 2,000 | 1,048,576 | 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? | ['N,A,B = input().split()\nN = long long (N)\nA = int(A)\nB = int(B)\nrep = (int)(N/(A+B))\n\nnumb = min(N%(A+B),A) + rep*A\n\nprint(numb)', 'N,A,B = input().split()\nN = int (N)\nA = int(A)\nB = int(B)\nrep = (int)(N/(A+B))\n\nnumb = min(N%(A+B),A) + rep*A\n\nprint(numb)'] | ['Runtime Error', 'Accepted'] | ['s742350403', 's949108204'] | [2940.0, 3060.0] | [17.0, 17.0] | [128, 122] |
p02754 | u363237465 | 2,000 | 1,048,576 | 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? | ['N, A, B = input().split()\nq, mod = divmod(N, A+B)\n\nif mod > A:\n print((q+1)*A)\nelse :\n print(q*A+mod)', 'N, A, B = map(int, input().split())\nq, mod = divmod(N, A+B)\nif mod >= A:\n\tprint(q*A+A)\nelse: \n\tprint(q*A+mod)'] | ['Runtime Error', 'Accepted'] | ['s656454081', 's964469155'] | [2940.0, 2940.0] | [17.0, 17.0] | [103, 109] |
p02754 | u363892646 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\nx = 0\nwhile(n > a):\n x += a\n n -= a\n if (n > b):\n n -= b\nif(n - a > 0):\n x += n - a\nelse:\n x += -(a - n)\nprint(x)', 'n, a, b = map(int, input().split())\nprint(n // (a + b) * a + min(a, n % (a + b)))'] | ['Wrong Answer', 'Accepted'] | ['s274237533', 's388944989'] | [3064.0, 2940.0] | [2104.0, 17.0] | [171, 81] |
p02754 | u366369712 | 2,000 | 1,048,576 | 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? | ['n = int(input("N>"))\na = int(input("A>"))\nb = int(input("B>"))\n\nif a>0:\n if n-n//(a+b)*(a+b)>a:\n print(n//(a+b)*a+a)\n else:\n print(n//(a+b)*a+n-n//(a+b)*(a+b))\nelse:\n print(0)\n', 'a = int(input("A>"))\nb = int(input("B>"))\nn = int(input("N>"))\n\nif a>0:\n if n-n//(a+b)*(a+b)>a:\n print(n//(a+b)*a+a)\n else:\n print(n//(a+b)*a+n-n//(a+b)*(a+b))\nelse:\n print(0)\n', 'n,a, b = map(int, input().split()) \nif a>0:\n if n-n//(a+b)*(a+b)>a:\n print(n//(a+b)*a+a)\n else:\n print(n//(a+b)*a+n-n//(a+b)*(a+b))\nelse:\n print(0)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s394178162', 's419364085', 's924692889'] | [3060.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0] | [199, 199, 171] |
p02754 | u366928732 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\nk = N % (A+B)\nn = N / (A+B)\n\nif n < A:\n print(n+k*A)\nelse:\n print(A+k*A)', 'N, A, B = map(int, input().split())\nn = N % (A+B)\nk = N // (A+B)\n\nif n < A:\n print(n+k*A)\nelse:\n print(A+k*A)'] | ['Wrong Answer', 'Accepted'] | ['s014532957', 's699698955'] | [2940.0, 3316.0] | [17.0, 21.0] | [110, 111] |
p02754 | u366963613 | 2,000 | 1,048,576 | 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? | ['# -*- coding: utf-8 -*-\nN, A, B = map(int, input().split())\n\n\n\ni = 0\nwhile (N - i * (A + B)) > 0:\n i += 1\ni -= 1\ntmp = i * A\nif (N - tmp) > A:\n tmp2 = A\nelse:\n tmp2 = N - tmp\n\nprint(tmp + tmp2)\n', '# -*- coding: utf-8 -*-\nN, A, B = map(int, input().split())\n\n\n\ni = 0\nnum_loop = int(N / (A+B))\ntmp = num_loop * A\n\nmod = N % ((A+B))\n\nif mod > A:\n tmp2 = A\nelse:\n tmp2 = mod\n\nprint(tmp + tmp2)\n'] | ['Wrong Answer', 'Accepted'] | ['s449703908', 's605305534'] | [3060.0, 3064.0] | [2104.0, 17.0] | [228, 224] |
p02754 | u368348632 | 2,000 | 1,048,576 | 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? | ['info = [int(n) for n in input().split()]\n\ngroup = info[1] + info[2]\n\na = info // group\nb = info % group\nif b > info[1]:\n b = info[1]\n\n\nresult = a * info[1] + b\nprint(result)', 'info = [int(n) for n in input().split()]\n\ngroup = info[1] + info[2]\n\na = info[0] // group\nb = info[0] % group\nif b > info[1]:\n b = info[1]\n\n\nresult = a * info[1] + b\nprint(result)'] | ['Runtime Error', 'Accepted'] | ['s865270425', 's556894224'] | [3060.0, 3060.0] | [17.0, 18.0] | [176, 182] |
p02754 | u368563078 | 2,000 | 1,048,576 | 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? | ["inputarray = input().split(' ')\nN = int(inputarray[0])\nA = int(inputarray[1])\nB = int(inputarray[2])\nblue = 'b'\nred = 'r'\nballcolumn = ''\nfor i in range(10**100):\n ballcolumn+=blue*A\n ballcolumn+=red*B\ntargetstring = ballcolumn[:N]\nprint(targetstring.count('b'))", "inputarray = input().split(' ')\nN = int(inputarray[0])\nA = int(inputarray[1])\nB = int(inputarray[2])\nblue = 'b'\nred = 'r'\namari = N % (A+B)\nif A >= amari: \n countnum = N // (A+B) * A +amari\nelse:\n countnum = N // (A+B) * A +A\nprint(countnum)"] | ['Runtime Error', 'Accepted'] | ['s200710407', 's114571983'] | [2075156.0, 3064.0] | [2235.0, 18.0] | [268, 247] |
p02754 | u370721525 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\n\ncnt = 0\nans = 0\nwhile cnt+A < N:\n cnt += A+B\n ans += A\n \nif A == 0:\n ans = 0\n \nprint(ans)', 'N, A, B = map(int, input().split())\n\nadd = min((N%(A+B)), A)\nans = (N//(A+B)) * A + add\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s581530461', 's733000620'] | [2940.0, 2940.0] | [2104.0, 18.0] | [131, 99] |
p02754 | u372670441 | 2,000 | 1,048,576 | 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? | ['N,A,B=map(int,input().split())\nif A==0 or B==0:\n\tprint("0")\nelif(N%(A+B))<B:\n\tprint(int((A*(N/(A+B)+N%(A+B)))))\nelse:\n\tprint(int(((A*(N/(A+B))))))', 'N,A,B=map(int,input().split())\nd=int(N//(A+B))\nans = A*d+min(A,(N%(A+B)))\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s567749334', 's283635738'] | [3060.0, 2940.0] | [18.0, 17.0] | [146, 84] |
p02754 | u374784428 | 2,000 | 1,048,576 | 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? | [' N, A, B = map(int, input().split())\n ans = N // (A + B) * A\n rem = N % (A + B)\n ans += min(rem, A)\n print(ans)\n', 'n,a,b = map(int,input().split())\nans = n//(a+b)*a\nrem = n%(a+b)\nans +=(rem,a)\nprint(ans)', 'n,a,b = map(int,input().split())\nans = n // (a+b) * a\nrem = n % (a+b)\nans += min(rem,a)\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s370978361', 's735506457', 's533313854'] | [2940.0, 3060.0, 3064.0] | [17.0, 19.0, 19.0] | [112, 88, 98] |
p02754 | u374829922 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\nif amari >= a:\n times = times + 1\n\nprint(times * a)', 'n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\nif amari > a:\n print(times * a + amari)\nelse:\n print(times * a )\n ', 'n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\nif amari >= a:\n print(times * a + amari)\nelif amari != 0:\n print(times * a + a)\nelse :\n print(times * a)', 'n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\nif amari >= a:\n print(times * a + amari)\nelif:\n print(times * a + a)\n ', 'n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\nif amari >= a:\n print(times * a + amari)\nelse:\n print(times * a )\n ', 'n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\nif amari >= a:\n print(times * a + amari)\nelse:\n print(times * a + a)', 'n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\nif amari >= a:\n times + 1\n\nprint(times * a)', 'n,a,b = map(int, input().split())\n\nsum_num = a + b\ntimes = n // sum_num\namari = n % sum_num\n\nans = times * a\nif amari <= a:\n ans += amari\nelse :\n ans += a\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s060596449', 's137352020', 's155028220', 's240444546', 's431760313', 's574875412', 's596938555', 's385232108'] | [2940.0, 2940.0, 3060.0, 2940.0, 2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 20.0, 18.0, 17.0, 17.0, 18.0, 17.0, 17.0] | [146, 167, 205, 171, 168, 166, 138, 172] |
p02754 | u374841433 | 2,000 | 1,048,576 | 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? | ['n,a,b=input().split()\ntry:\n loop=n//(a+b)\nexcept:\n loop=0\ntry:\n remainder=n%(a+b)\nexcept:\n remainder=0\nprint(loop*a+min(reminder,a)', 'n,a,b=[int(v) for v in input().split()]\ntry:\n loop=n//(a+b)\nexcept:\n loop=0\ntry:\n remainder=n%(a+b)\nexcept:\n remainder=0\nprint(loop*a+min(remainder,a))'] | ['Runtime Error', 'Accepted'] | ['s096011518', 's346980714'] | [3068.0, 2940.0] | [17.0, 17.0] | [143, 163] |
p02754 | u382639013 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\n\na = "b"*A\nb = "r"*B\n\nl = ""\nfor i in range(1,int(N/(A+B)+1)+1):\n if N - len(l) > (A+B):\n l = l + a + b\n elif N - len(l) < (A):\n l = l + a[1:(N - len(l)+1)]\n\nl[0:N].count("b")', 'N, A, B = map(int, input().split())\n\nn = N // (A + B)\nmod = N % (A + B)\n \nif mod >= A:\n print(A * n + A)\nelse:\n print(A * n + mod)'] | ['Runtime Error', 'Accepted'] | ['s848528272', 's510244615'] | [21736.0, 2940.0] | [2104.0, 17.0] | [232, 136] |
p02754 | u383508661 | 2,000 | 1,048,576 | 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? | ['for i in range(10**100):\n total+=B\n b+=1\n if total>N:\n break\n total+=R\n if total>N:\n break\nif B==0:\n print(0)\n\nelse:\n print(B*b-(total-N))', 'N,B,R=map(int,input().split())\nb=0\ni=int(N/(B+R))\ntari=N-(i*(B+R))\n\nb+=B*i\nif tari >= B:\n b+=B\nelse:\n b+=tari\n\nprint(b)'] | ['Runtime Error', 'Accepted'] | ['s049757827', 's413431669'] | [2940.0, 3060.0] | [17.0, 20.0] | [173, 125] |
p02754 | u385309449 | 2,000 | 1,048,576 | 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? | ['\nusing namespace std;\nint main(){\n int n,a,b;\n cin>>n>>a>>b;\n int ans=0;\n ans=(n/(a+b))*a+min(a,n%(a+b));\n cout<<ans<<endl;\n return 0;\n}', 'n,a,b = map(int,input().split())\ncnt = n//(a+b)\nif n%(a+b) - a >=0:\n cnt2 = a\nelse:\n cnt2 = n%(a+b)\nprint(a*cnt+cnt2)'] | ['Runtime Error', 'Accepted'] | ['s979928333', 's589343029'] | [2940.0, 2940.0] | [17.0, 17.0] | [160, 119] |
p02754 | u393512980 | 2,000 | 1,048,576 | 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? | ['import sys\nsys.setrecursionlimit(1000000)\ninput = sys.stdin.readline\nfrom bisect import *\nfrom collections import *\nfrom heapq import *\nINF = 500000\nmod = 10**9+7\n\nN, A, B = map(int, input().split())\nC = A+B\nx = N//C\nprint(x*A+max(N-x*C, A))\n', 'import sys\nsys.setrecursionlimit(1000000)\ninput = sys.stdin.readline\nfrom bisect import *\nfrom collections import *\nfrom heapq import *\nINF = 500000\nmod = 10**9+7\n\nN, A, B = map(int, input().split())\nC = A+B\nx = N//C\nprint(x*A+min(N-x*C, A))\n'] | ['Wrong Answer', 'Accepted'] | ['s237564653', 's579130082'] | [3316.0, 3316.0] | [22.0, 23.0] | [242, 242] |
p02754 | u394731058 | 2,000 | 1,048,576 | 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? | ['n,b,r = map(int, input().split())\ns = n // (b+r)\na = n % (b+r)\nans = s * b\nans += min(a, b)\nprint({}.format(ans))', 'n,b,r = map(int, input().split())\nif b == 0:\n print(0)\nelse:\n s = n // (b + r)\n a = n % (b + r)\n print(s+a)', 'n,b,r = map(int, input().split())\ns = n // (b+r)\na = n % (b+r)\nans = s * b\nans += min(a, b)\nprint("{}".format(ans))\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s012446214', 's309963803', 's356835707'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0] | [113, 111, 116] |
p02754 | u399973890 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\nprint(N, A, B)\nx = N//(A+B)\nr = N - (A+B)*x\nif r >= A:\n add = A\nelse:\n add = r\n\nprint(x*A + add)', 'N, A, B = map(int, input().split())\nx = N//(A+B)\nr = N - (A+B)*x\nif r >= A:\n add = A\nelse:\n add = r\n\nprint(x*A + add)'] | ['Wrong Answer', 'Accepted'] | ['s868724384', 's553682985'] | [2940.0, 2940.0] | [17.0, 18.0] | [138, 123] |
p02754 | u401452016 | 2,000 | 1,048,576 | 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? | ['#ABC158B\nimport sys\nn, blue, red = map(int, sys.stdin.readline().split())\nprint(n,blue,red)\n\nif n<=blue:\n print(blue)', '#ABC158B\nimport sys\nn,blue,red = map(int, sys.stdin.readline().split())\n\ntotal = blue + red\nsyo = n // total\namari = n % total\nif n <= blue:\n print(n)\nelif n <= total:\n print(blue)\nelif amari<=blue:\n print(syo*blue + amari)\nelif amari >blue:\n print(syo*blue + blue)'] | ['Wrong Answer', 'Accepted'] | ['s445813911', 's986440858'] | [2940.0, 3060.0] | [17.0, 17.0] | [120, 277] |
p02754 | u406546804 | 2,000 | 1,048,576 | 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? | [',a,b=map(int, input().split())\n\nx=int(n/(a+b))\nif x*(a+b)+a <= n:\n\tprint(a*(x+1))\nelse:\n\tprint(n-b*x)', 'n,a,b=map(int, input().split())\n\nx=int(n/(a+b))\nif x*(a+b)+a <= n:\n\tprint(a*(x+1))\nelse:\n\tprint(n-b*x)\n'] | ['Runtime Error', 'Accepted'] | ['s386833753', 's669713787'] | [2940.0, 3064.0] | [17.0, 17.0] | [101, 103] |
p02754 | u407891541 | 2,000 | 1,048,576 | 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? | ['import numpy as np\n \nNAB=np.array(input().split(" "),dtype=np.int32)\n \nN=NAB[0]\nA=NAB[1]\nB=NAB[2]\n \ndiv=int(N/(A+B))\nmod=N%(A+B)\n \nblue=0\nif(mod<=A):\n blue=mod\nelse:\n blue=A\n \nprint(A*div+blue)\nimport numpy as np\n\nNAB=np.array(input().split(" "),dtype=np.int32)\n\nN=NAB[0]\nA=NAB[1]\nB=NAB[2]\n\ndiv=int(N/(A+B))\nmod=N%(A+B)\n\nblue=0\nif(mod<A):\n blue=mod\nelse:\n blue=A\n\nprint(A*div+blue)\n提出情報\n提出日時\t2020-03-07 21:19:42\n問題', 'import numpy as np\n\nNAB=np.array(input().split(" "),dtype=np.int64)\n\nN=NAB[0]\nA=NAB[1]\nB=NAB[2]\n\ndiv=int(N//(A+B))\nmod=N%(A+B)\n\nblue=0\nif(mod<=A):\n blue=mod\nelse:\n blue=A\n\nprint(A*div+blue)'] | ['Runtime Error', 'Accepted'] | ['s913055534', 's778191843'] | [3064.0, 21392.0] | [18.0, 292.0] | [446, 195] |
p02754 | u408375121 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\nm = N // (A + B)\nr = N % (A + B)\nif r <= B:\n ans = m * B + r\nelse:\n ans = m * B + B\nprint(ans)', 'N, A, B = map(int, input().split())\nm = N // (A + B)\nr = N % (A + B)\nif r <= A:\n ans = m * A + r\nelse:\n ans = m * A + A\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s596598064', 's329187309'] | [2940.0, 2940.0] | [17.0, 18.0] | [132, 133] |
p02754 | u409224432 | 2,000 | 1,048,576 | 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? | ['a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ni = int(N/(A+B))\n\ncut = N - (A+B)*i\n\nif N < A:\n Blue_Ball_Num = N\nelif N < A+B:\n Blue_Ball_Num = A\nelif cut > A:\n Blue_Ball_Num = A*(i+1)\nelse:\n Blue_Ball_Num = A*i + (N - (A+B)*i)', 'a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ncount = 0\ni = 0\n\nwhile 1:\n count = count + A + B\n i += 1\n if count > N:\n break\n\ncut = N - (A+B)*(i-1)\n\nif cut > A:\n Blue_Ball_Num = A*i\nelse:\n Blue_Ball_Num = A*i + ((A+B)*i - N)\n \nprint(Blue_Ball_Num)', 'a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ncount = 0\ni = 0\n\nwhile 1:\n count = count + A + B\n i += 1\n if count > N:\n break\n\ncut = N - (A+B)*(i-1)\n\nif cut > A:\n Blue_Ball_Num = A*i\nelse:\n Blue_Ball_Num = A*i + ((A+B)*i - N)\n \nprint(Blue_Ball_Num)', 'a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ni = int(N/(A+B))\nprint(i)\n\ncut = N - (A+B)*i\n\nif N < A:\n Blue_Ball_Num = N\nelif N < A+B:\n Blue_Ball_Num = A\nelif cut > A:\n Blue_Ball_Num = A*(i+1)\nelse:\n Blue_Ball_Num = A*i + (N - (A+B)*i)', 'a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ni = int(N/(A+B))\n\ncut = N - (A+B)*(i-1)\n\nif cut > A:\n Blue_Ball_Num = A*i\nelse:\n Blue_Ball_Num = A*i + ((A+B)*i - N)\n \nprint(Blue_Ball_Num)', 'a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ncount = 0\ni = 0\n\ni = int(N/(A+B)) + 1\n\ncut = N - (A+B)*(i-1)\n\nif cut > A:\n Blue_Ball_Num = A*i\nelse:\n Blue_Ball_Num = A*i + ((A+B)*i - N)\n \nprint(Blue_Ball_Num)', 'N = input()\nA = input()\nB = input()\n\nN = int(N)\nA = int(A)\nB = int(B)\n\ncount = 0\ni = 0\n\nwhile 1:\n count = count + A + B\n i += 1\n if count > N:\n break\n\ncut = N - (A+B)*(i-1)\nprint(cut)\n\nif cut > A:\n Blue_Ball_Num = A*i\nelse:\n Blue_Ball_Num = A*i + ((A+B)*i - N)\n \nprint(Blue_Ball_Num)', 'a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ni = int(N/(A+B))\n\ncut = N - (A+B)*i\nif n < A:\n Blue_Ball_Num = N\nelif N < A+B:\n Blue_Ball_Num = A\nelif cut > A:\n Blue_Ball_Num = A*i\nelse:\n Blue_Ball_Num = A*i + (N - (A+B)*i)\n \nprint(Blue_Ball_Num)', 'a = input().split()\n\nN = int(a[0])\nA = int(a[1])\nB = int(a[2])\n\ni = int(N/(A+B))\n\ncut = N - (A+B)*i\n\nif N < A:\n Blue_Ball_Num = N\nelif N < A+B:\n Blue_Ball_Num = A\nelif cut > A:\n Blue_Ball_Num = A*(i+1)\nelse:\n Blue_Ball_Num = A*i + (N - (A+B)*i)\n \nprint(Blue_Ball_Num)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s096958181', 's295049578', 's381110431', 's461038288', 's651292646', 's837305317', 's973960265', 's984175949', 's090243255'] | [3064.0, 3064.0, 3064.0, 3188.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 2104.0, 2104.0, 19.0, 17.0, 17.0, 17.0, 18.0, 17.0] | [248, 274, 274, 257, 206, 227, 292, 267, 272] |
p02754 | u410026319 | 2,000 | 1,048,576 | 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? | ['n,b,r = map(int,input().split())\n\nloop = n/(b+r)\nmod = n%(b+r)\nextra = min([b,mod])\n\nprint(loop*b + extra)\n', 'n,b,r = map(int,input().split())\n\nloop = n/(b+r)\nmod = n%(b+r)\nextra = b\n\nif mod < b:\n extra = mod\n\nprint(loop*b + extra)', 'n,b,r = map(int,input().split())\n\nloop = (b+r)/n\nmod = (b+r)%n\nextra = min([b,mod])\n\nprint(loop*b + extra)\n', 'n,b,r = map(int,input().split())\n\nloop = n//(b+r)\nmod = n%(b+r)\nextra = min([b,mod])\n\nprint(loop*b+extra)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s242085863', 's721871070', 's857130174', 's603605803'] | [2940.0, 2940.0, 3064.0, 2940.0] | [18.0, 18.0, 18.0, 17.0] | [107, 122, 107, 105] |
p02754 | u411858517 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split())\n\npattern = N // (A + B)\n\nans += A * pattern\nans += min(N - (A + B) * pattern, A)\n\nprint(ans)', 'N, A, B = map(int, input().split())\n\npattern = N // (A + B)\n\nans = 0\nans += A * pattern\nans += min(N - (A + B) * pattern, A)\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s030404328', 's338994225'] | [2940.0, 3064.0] | [17.0, 17.0] | [128, 137] |
p02754 | u414050834 | 2,000 | 1,048,576 | 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? | ["N,A,B=map(int,input().split())\nballb=[]\nballr=[]\nballb.append('b')\nballb2=ballb*A\nballr.append('r')\nballr2=ballr*B\nball=(ballb2+ballr2)*(10**100)\ncount=0\nfor i in range(N):\n if ball[i]=='b':\n count += 1\n else:\n count=count\nprint(count)", "N=int(input())\nA=int(input())\nB=int(input())\nballb=[]\nballr=[]\nballb.append('b')\nballb2=ballb*A\nballr.append('r')\nballr2=ballr*B\nball=(ballb2+ballr2)*N\ncount=0\nfor i in range(N):\n if ball[i]=='b':\n count += 1\nprint(count)\n", "N,A,B=map(int,input().split())\nballb=[]\nballr=[]\nballb.append('b')\nballb=ballb*A\nballr.append('r')\nballr=ballr*B\nball=(ballb+ballr)*(10**18)\ncount=0\nfor i in range(N):\n if ball[i]=='b':\n count=count+1\nprint(count)", "N,A,B=map(int,input().split())\nballb=[]\nballr=[]\nballb.append('b')\nballb2=ballb*A\nballr.append('r')\nballr2=ballr*B\nball=(ballb2+ballr2)*(10**100)\ncount=0\nfor i in range(N):\n if ball[i]=='b':\n count += 1\nprint(count)\n", "N,A,B=map(int,input().split())\nballb=[]\nballr=[]\nballb.append('b')\nballb=ballb*A\nballr.append('r')\nballr=ballr*B\nball=(ballb+ballr)*(10**18)\ncount=0\nfor i in range(N):\n if ball[i]=='b':\n count+=1\nprint(count)", 'N,A,B=map(int,input().split())\na=N//(A+B)*A\nc=N%(A+B)\nb=min(A,c)\nprint(a+b)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s018834544', 's069917718', 's121328908', 's274416975', 's959390847', 's120367550'] | [3064.0, 3060.0, 3064.0, 3060.0, 3188.0, 2940.0] | [18.0, 17.0, 17.0, 18.0, 19.0, 18.0] | [255, 232, 223, 226, 218, 75] |
p02754 | u423137719 | 2,000 | 1,048,576 | 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? | ["N,A,B = input().split()\n\nif int(A) == 0:\n print('0')\nelse:\n k = int(A) + int(N)%int(A)\n print(str(A))", "N,A,B = input().split()\n\nif int(A) == 0:\n print('0')\nelse:\n k = (int(N)//(int(A)+int(B))) * int(A) + int(N)%int(A)\n print(str(A))", "N,A,B = input().split()\n\nif int(A) == 0:\n print('0')\nelse:\n k = int(A) + int(N)%int(A)\n print(str(A))", "N,A,B = input().split()\n\nif int(A) == 0:\n print('0')\nelse:\n k = (int(N)//(int(A)+int(B))) * int(A) \n if int(N)%(int(A) + int(B)) >= int(A):\n k = k + int(A)\n else:\n k = k + int(N)%(int(A) + int(B))\n print(str(k))"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s239869839', 's482757685', 's956041665', 's867643038'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 18.0, 17.0, 17.0] | [110, 138, 110, 240] |
p02754 | u424467986 | 2,000 | 1,048,576 | 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? | ["import math\nN, A, B = (int(x) for x in input().split(' '))\ntmp = A * math.floor(N/(A+B))\n\nif ( N % (A+B) ) > A:\n print(ans+A) \nelse:\n print(ans+( N % (A+B)))\n ", "import math\nN, A, B = (int(x) for x in input().split(' '))\ntmp = A * math.floor(N/(A+B))\n\nif ( N % (A+B) ) > A:\n print(tmp+A) \nelse:\n print(tmp+( N % (A+B)))\n "] | ['Runtime Error', 'Accepted'] | ['s308785168', 's028390067'] | [2940.0, 2940.0] | [18.0, 19.0] | [161, 161] |
p02754 | u425236751 | 2,000 | 1,048,576 | 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? | ['n,a,b =map(int,input().split())\nc = a+b\n\nsum1 = n/c\nl = n%c\nif a>l:\n sum2 = l\nelse:\n sum2 = a\n \nprint(sum1+sum2)', 'n,a,b =map(int,input().split())\nc = a+b\n\nans = (n//c)*a\nl = n%c\nif a>l:\n ans += l\nelse:\n ans += a\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s276023949', 's499126518'] | [3064.0, 2940.0] | [19.0, 17.0] | [115, 113] |
p02754 | u426534693 | 2,000 | 1,048,576 | 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? | ["S = input()\nN = int(S[0])\nA = int(S[1])\nB = int(S[2])\n\n \nb_count = 0\nfor i in range(0, N):\n #print('i')\n #print(i)\n if i % (A+B) < A:\n #print(b_count)\n b_count = b_count + 1\nprint(b_count)", "N = int(input())\nA = int(input())\nB = int(input())\n\n \nb_count = 0\nfor i in range(0, N):\n #print('i')\n #print(i)\n if i % (A+B) < A:\n #print(b_count)\n b_count = b_count + 1\nprint(b_count)", 'N, A, B = input()\n\nb_count = 0\nfor i in len(N):\n if i % (A+B) < A:\n b_count = b_count + 1\nprint(b_count)', "S = input()\nN = int(S.split(' ')[0])\nA = int(S.split(' ')[1])\nB = int(S.split(' ')[2])\n \nb_count = (N // (A+B)) * A\nrem = N % (A+B)\nb_count = b_count + min(rem, A)\nprint(b_count)"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s158566606', 's884091992', 's956130910', 's530605962'] | [3060.0, 2940.0, 3064.0, 3188.0] | [17.0, 18.0, 17.0, 19.0] | [208, 205, 108, 178] |
p02754 | u427984570 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int,input().split())\nx = n//(a+b)\ny = n%(a+b)\nprint(x*n + min(y,a))\n', 'n,a,b = map(int,input().split())\nx = n//(a+b)\ny = n%(a+b)\nprint(x*n + min(n,y))', 'n,a,b = map(int,input().split())\nx = n//(a+b)\ny = n%(a+b)\nprint(x*a + min(y,a))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s725280135', 's810162510', 's027406596'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [80, 79, 80] |
p02754 | u432253045 | 2,000 | 1,048,576 | 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? | ["n,a,b = [int(x) for x in input().split(' ')]\n\nif a >= n:\n print(n)\n\nelse:\n print(min(a, (n-b)))", "import math\n\nn,a,b = [int(x) for x in input().split(' ')]\n\nif a == 0:\n print(0)\n\nelif a >= n:\n print(n)\n\nelse:\n num_a = (n // (a+b)) * a\n left_repeated = (n % (a+b))\n print(num_a + min(left_repeated, a))\n"] | ['Wrong Answer', 'Accepted'] | ['s245516414', 's825599415'] | [2940.0, 3060.0] | [17.0, 18.0] | [101, 219] |
p02754 | u432453907 | 2,000 | 1,048,576 | 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? | ['N,A,B = map(int,input().split())\n\nif N > A:\n print(A)\nelse:\n print(N)', 'n,a,b=map(int,input().split())\nk=n//(a+b)\nmod=n%(a+b)\nans=a*k\nif mod >=a:\n ans +=a\nelse:\n ans +=mod\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s173905567', 's767567306'] | [2940.0, 9108.0] | [18.0, 28.0] | [75, 116] |
p02754 | u434296044 | 2,000 | 1,048,576 | 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? | ['n,a,b=map(int,input(),split())\nans=N/(A+B)\nr=N%(A+B)\nans+=min(r,A)\n\nprint(ans)', 'n,a,b=map(int,input(),split())\nans=N//(A+B)*A\nr=N%(A+B)\nans+=min(r,A)\n\nprint(ans)\n\n', 'N,b,r=map(int,input().split())\nball,x,y=0,0,0\nans=0\n\nball=b+r\nx=N%ball\ny=N//ball\n\nans+=y*b\n\nif x>b:\n ans+=b\nelse:\n ans+=x\n\n\nprint(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s121554976', 's766962550', 's494376507'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 18.0] | [78, 83, 141] |
p02754 | u434311880 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int,input().split())\na = list()\na = ["b"]*A + ["r"]*B\nimport math\nn = math.ceil(N//(A+B))\nfor i in range(n):\n a = a + a\ndel a[N:]\nprint(n)\nprint(a)\nprint(a.count("b"))\n', 'N, A, B = map(int,input().split())\n\nimport math\nn = math.ceil(N//(A+B))\nmod = N % (A+B)\nb = n*A\nif mod <= A:\n b += mod\nelse:\n b += A\n\nprint(b)\n'] | ['Runtime Error', 'Accepted'] | ['s659217296', 's243324581'] | [3060.0, 3064.0] | [2115.0, 18.0] | [185, 149] |
p02754 | u435593586 | 2,000 | 1,048,576 | 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? | ["n, a, b = map(int, input().split())\nres = ''\n\nif a == 0:\n print(0)\nelif b == 0:\n print(n)\nelse:\n while len(res) < n:\n res += 'b'*a\n res += 'r'*b\n\n res = res[:n]\n print(res)\n print(res.count('b'))", 'n, a, b = map(int, input().split())\nperiod = a+b\ntimes = n//period\nk = n%period\nn = a if k >a else k\nprint(times*a + n)'] | ['Runtime Error', 'Accepted'] | ['s897881555', 's793003291'] | [1886996.0, 2940.0] | [2249.0, 17.0] | [211, 120] |
p02754 | u440161695 | 2,000 | 1,048,576 | 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? | ['N,B,R=map(int,input().split())\nif B==0:\n print(0)\n exit()\nans=B×N//(R+B)\nif N%(R+B)>=B:\n print(ans+B)\nelse:\n print(ans+B-N%(R+B))', 'N,B,R=map(int,input().split())\n\ns,t=divmod(N,(R+B))\nprint((s*B)+min(t,B))'] | ['Runtime Error', 'Accepted'] | ['s032887969', 's986624729'] | [2940.0, 2940.0] | [17.0, 17.0] | [134, 121] |
p02754 | u446371873 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int,input().split())\nans = int(n / (a + b))\nrem = n % (a + b)\nprint(ans * a + rem - b)', 'n,a,b = map(int,input().split())\nans = int(n / (a + b))\nrem = n % (a + b)\nif rem > a:\n print(ans * a + a)\nelse:\n print(ans * a + rem)'] | ['Wrong Answer', 'Accepted'] | ['s582708385', 's348502403'] | [2940.0, 2940.0] | [17.0, 17.0] | [98, 139] |
p02754 | u450147945 | 2,000 | 1,048,576 | 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? | ['N, A, B = input().split()\nN = int(N)\nA = int(A)\nB = int(B)\n\ncnt=0\nans=0\n\nwhile cnt<N:\n if cnt%(A+B)<A:\n cnt+=1\n ans+=1\n else:\n cnt+=1', 'N, A, B = input().split()\nN = int(N)\nA = int(A)\nB = int(B)\nans=0\n\nif N%(A+B)<=A:\n ans = N//(A+B) * A + N%(A+B)\nelse:\n ans = N//(A+B) * A + A\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s110618917', 's302304129'] | [3060.0, 3064.0] | [2108.0, 19.0] | [160, 158] |
p02754 | u453623947 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int,input().split())\n\nans = (N//(A+B)) + min(N%(A+B),A)\n\nprint(ans)', 'N, A, B = map(int,input().split())\nans = A*(N//(A+B)) + min(N%(A+B),A)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s958258089', 's186221384'] | [2940.0, 2940.0] | [17.0, 17.0] | [81, 82] |
p02754 | u457601965 | 2,000 | 1,048,576 | 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? | ['import sys\nimport numpy as np\nimport math as mt\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn, a, b = map(int, readline().split())\n\nans = a * (n//(a + b))\nif n%(a+b) < a:\n ans += a-n%(a+b)\nelse:\n ans += a\nprint(ans)\n\n \n', 'import sys\nimport numpy as np\nimport math as mt\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn, a, b = map(int, readline().split())\n\nans = a * (n//(a + b))\nif n%(a+b) < a:\n ans += n%(a+b)\nelse:\n ans += a\nprint(ans)\n\n \n'] | ['Wrong Answer', 'Accepted'] | ['s349561875', 's329777931'] | [26380.0, 27076.0] | [119.0, 125.0] | [287, 285] |
p02754 | u457901067 | 2,000 | 1,048,576 | 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? | ['N,A,B = list(map(int, input().split()))\n\nS = A+B\nans = S // N\nres = S % N\nans += min(A,res)\n\nprint(ans)', 'N,A,B = list(map(int, input().split()))\n\nS = A+B\nans = (S // N) * A\nres = S % N\nans += min(A,res)\n\nprint(ans)\n', 'N,A,B = list(map(int, input().split()))\n\nS = A+B\nans = (N // S) * A\nres = N % S\nans += min(A,res)\n\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s269417549', 's726175104', 's741850515'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [103, 110, 110] |
p02754 | u459752408 | 2,000 | 1,048,576 | 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? | ['N,A,B = map(int,input().split())\ncount = 0\nBs = "b"*A\nRs = "r"*B\nballset = Bs+Rs\n#print(Bs)\n#print(Rs)\nn = (N//len(ballset)+1)\n#print(len(ballset))\n#print(n)\nallball = ballset*n\nprint(allball)\nprint(allball[:N].count("b"))\n', 'N,A,B = map(int,input().split())\ncount = 0\na = N//(A+B)\n#print(a)\ncount += a*A\n#print(count)\nb = N%(A+B)\nif b > A:\n count +=A\nelse:\n count +=b\nprint(count)\n'] | ['Runtime Error', 'Accepted'] | ['s627355227', 's133281896'] | [3060.0, 2940.0] | [19.0, 17.0] | [223, 158] |
p02754 | u468972478 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\ns = ""\nwhlie len(s) < n:\n s += "b" * a + "r" * b\nprint(s[:n+1].count("b"))\n ', 'n, a, b = map(int, input().split())\ns = n // (a + b)\nt = n % (a + b)\nprint(s * a + min(t, a))'] | ['Runtime Error', 'Accepted'] | ['s689685162', 's755336389'] | [8944.0, 9076.0] | [24.0, 28.0] | [116, 93] |
p02754 | u472696272 | 2,000 | 1,048,576 | 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? | ['n,a,b = map(int, input().split())\n\ng = a + b\nif n%g<=a: print(int(g*a+n%g))\nelse: print(int((g+1)*a))', 'n,a,b = map(int,input().split())\nn_group = n//(a+b)\nremain = n%(a+b)\nif remain<=a:\n print(n_group*a+remain)\nelse:\n print((n_group+1)*a)\n'] | ['Wrong Answer', 'Accepted'] | ['s755192346', 's227005269'] | [2940.0, 2940.0] | [17.0, 17.0] | [101, 138] |
p02754 | u479835943 | 2,000 | 1,048,576 | 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? | ['n, a, b = [int(i) for i in input().split()]\nanswer, amari = divmod(n, a+b)\nanswer *= a\nprint(answer + max(a, amari))', 'n, a, b = [int(i) for i in input().split()]\nprint(n//(a+b)*a + min(a, n%(a+b)))'] | ['Wrong Answer', 'Accepted'] | ['s056836044', 's988402764'] | [3188.0, 2940.0] | [21.0, 18.0] | [116, 79] |
p02754 | u483896240 | 2,000 | 1,048,576 | 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? | ["# -*- coding: utf-8 -*-\n\nn, a, b = map(int,input().split(' '))\n\nif n >= a:\n print(a)\nelse:\n print(n)\n", "# -*- coding: utf-8 -*-\n\nn, a, b = map(int,input().split(' '))\n\nif n < a:\n print(n)\nelse:\n ans = (n//(a+b))*a\n m = n%(a+b)\n print(ans, m)\n if m >= a:\n ans += a\n else:\n ans += m\n\n print(ans)", "# -*- coding: utf-8 -*-\n\nn, a, b = map(int,input().split(' '))\n\nif n <= a:\n print(n)\nelse:\n ans = (n//(a+b))*a\n m = n%(a+b)\n if m >= a:\n ans += a\n else:\n ans += m\n\n print(ans)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s300815556', 's386651708', 's517234602'] | [2940.0, 3060.0, 2940.0] | [17.0, 18.0, 17.0] | [107, 224, 207] |
p02754 | u484052148 | 2,000 | 1,048,576 | 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? | ['n, a, b = map(int, input().split())\nans = (n//(a+b))*(a/(a+b)) + min(n%(a+b), a)\nprint(ans)', 'n, a, b = map(int, input().split())\nans = n//(a+b) + n%(a+b)\nprint(ans)', 'n, a, b = map(int, input().split())\ns = a+b\nans = (n//s)*a + min(n%s, a)\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s359430856', 's778875205', 's551139634'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [91, 71, 83] |
p02754 | u485319545 | 2,000 | 1,048,576 | 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? | ["import sys\nfrom collections import Counter\n\n\ninput = sys.stdin.readline\n\nN,A,B =map(int,input().split()) \n\nblue = 'b'*A\nred= 'r'*B\n\nands =red+blue\nalls = ands * (N//(A+B) + 1)\nalls = alls[:N]\nc = Counter(alls)\nprint(c['b'])\n", "N,A,B =map(int,input().split()) \n\n# import collections\n\n# blues = 'b' * A\n# reds = 'r' * B\n\n# set_balls = blues + reds\n\n# all_balls = set_balls * ( N // ( A + B ) + 1 )\n\n# balls_N = all_balls[:N]\n\n# c = collections.Counter(balls_N)\n# print(c['b'])\n\np = N//(A+B)\n\nif N - p*(A+B) < A:\n print(A*p + N - p*(A+B) )\nelse:\n print(A*p+A)"] | ['Runtime Error', 'Accepted'] | ['s469170896', 's851930630'] | [3316.0, 3060.0] | [20.0, 18.0] | [255, 335] |
p02754 | u485716382 | 2,000 | 1,048,576 | 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? | ['N, A, B = map(int, input().split(" "))\n\n\nballs = \'\'\nfor i in range(2*N):\n balls += \'b\'*A + \'r\'*B\nballs = balls[0:N]\nprint(balls)\nprint(balls.count(\'b\'))', 'def main():\n N, A, B = map(int, input().split(" "))\n if (A + B) == 0:\n print(0)\n return\n amari = N % (A+B)\n kaisuu = N // (A+B)\n print(kaisuu*A+min(amari, A))\nmain()\n'] | ['Runtime Error', 'Accepted'] | ['s216692451', 's903074486'] | [2004752.0, 2940.0] | [2249.0, 17.0] | [155, 195] |
p02754 | u486209657 | 2,000 | 1,048,576 | 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? | ['N,A,B=map(int,input().split())\nblue=[1]*A\nred=[-1]*B\nball=(blue+red)*N\nX=ball[0:N]\nprint(X)\nprint(X.count(1))', 'N,A,B=map(int,input().split())\n\nimport numpy as np\nblue=np.array([1]*A)\nred=np.array([-1]*B)\nball=np.array(list(np.concatenate([blue,red]))*N)\nprint(ball)\nprint(np.count_nonzero(ball[0:N]==1))', 'N,A,B=map(int,input().split())\n\nimport numpy as np\nball=np.array([])\nblue=np.array([1]*A)\nred=np.array([-1]*B)\nwhile len(ball)<N:\n ball=np.concatenate([ball, blue, red])\nprint(np.count_nonzero(ball==1))', 'N,A,B=map(int,input().split())\n\nr=N//(A+B)*A\ns=N%(A+B)\n\nx=r+min(A,s)\nprint(x)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s472569641', 's913772605', 's932823035', 's598888251'] | [9184.0, 27176.0, 54144.0, 9016.0] | [28.0, 234.0, 2207.0, 28.0] | [109, 192, 205, 77] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.