buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <stdio.h> int main() { long long int n, a, b; scanf("%lld%lld%lld", &n, &a, &b); printf("%lld\n", n / (a + b) + (n % (a + b) < a ? n % (a + b) : a)); return 0; }
#include <stdio.h> int main() { long long int n, a, b; scanf("%lld%lld%lld", &n, &a, &b); printf("%lld\n", n / (a + b) * a + (n % (a + b) < a ? n % (a + b) : a)); return 0; }
[["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 22]]
0
74
#include <bits/stdc++.h> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; if (a == 0) cout << 0 << endl; else { long long result = n / (a + b) * a; result += n % (a + b) % a; cout << result << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; if (a == 0) cout << 0 << endl; else { long long result = n / (a + b) * a; result += min(n % (a + b), a); cout << result << endl; } }
[["+", 0, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
75
N,A,B=map(int, input().split()) a=(N//(A+B))*A b=N%(A+B) if b >= B: a+=A else: a+=b print(a)
N,A,B=map(int, input().split()) a=(N//(A+B))*A b=N%(A+B) if b >= A: a+=A else: a+=b print(a)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
57
N, A, B = map(int, input().split()) q, mod = divmod(N, A + B) print(q * A + mod) if mod <= A else print(q * A + (mod - B))
N, A, B = map(int, input().split()) q, mod = divmod(N, A + B) print(q * A + mod) if mod <= A else print(q * A + A)
[["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 31, 22], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 17, 33], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 12, 22], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 41, 0, 652, 3, 4, 0, 657, 12, 22]]
5
55
n,a,b = map(int,input().split()) num = 0 num = n // (a+b) if n % (a+b) <= a: print((n*a)+ (n % (a+b))) else: print((n*a)+a)
n,a,b = map(int,input().split()) num = 0 num = n // (a+b) if n % (a+b) <= a: print((num*a)+ (n % (a+b))) else: print((num*a)+a)
[["-", 3, 4, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 31, 22]]
5
71
n, a, b = map(int, input().split()) print(n//(a+b) * (a+1)) if n%(a+b)>=a else print(n//(a+b) * a + (n%(a+b)))
n, a, b = map(int, input().split()) print(n//(a+b) * a + a) if n%(a+b)>=a else print(n//(a+b) * a + (n%(a+b)))
[["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 12, 612], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 41, 0, 652, 3, 4, 0, 657, 12, 22]]
5
67
import sys n, a, b = map(int, sys.stdin.readline().split()) balls = n * a // (a+b) if n % (a+b) <= a: balls += n % (a+b) else: balls += a print(balls)
import sys n, a, b = map(int, sys.stdin.readline().split()) balls = n // (a+b) * a if n % (a+b) <= a: balls += n % (a+b) else: balls += a print(balls)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
64
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower) using namespace std; using ll = long long; int main() { ll n, a, b, c, bc; cin >> n >> a >> b; c = n % (a + b); bc = n * a / (a + b); if (c >= a) { bc += a; } el...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower) using namespace std; using ll = long long; int main() { ll n, a, b, c, bc; cin >> n >> a >> b; c = n % (a + b); // bc = a / (a+b); bc = a * (n / (a + b)); if (c >= a...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 22], ["+", 12, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
101
N,A,B = map(int,input().split(sep=" ")) print((N//(A+B)*A)+N%(A+B))
N,A,B = map(int,input().split(sep=" ")) print((N//(A+B)*A)+ min(N%(A+B),A))
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22]]
5
45
n, a, b = map(int, input().split()) ans = n //(a+b) * a rem = n % (a+b) #ans += min(rem, a) ans += rem print(ans)
n, a, b = map(int, input().split()) ans = n //(a+b) * a rem = n % (a+b) ans += min(rem, a) #ans += rem print(ans)
[["+", 0, 656, 0, 1, 0, 677, 12, 652, 63, 22], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 25]]
5
46
#!/usr/bin/env python3 N, A, B = map(int, input().split()) print((N//(A+B))*A + (N%(A+B)))
#!/usr/bin/env python3 N, A, B = map(int, input().split()) print((N//(A+B))*A + min(A, (N%(A+B))))
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21], ["+", 0, 657, 12, 652, 3, 4, 0, 23, 0, 24], ["+", 3, 4, 0, 23, 0, 657, 12, 23, 0, 25]]
5
43
#include <bits/stdc++.h> using namespace std; int main(void) { long long N, A, B; cin >> N >> A >> B; long long count = N / (A + B); cout << A * count + N % (A + B) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { long long N, A, B; cin >> N >> A >> B; long long count = N / (A + B); cout << A * count + min(A, N % (A + B)) << endl; return 0; }
[["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
60
#include <iostream> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long sets = n / (a + b); long long amaris = n % (a + b) > b ? b : n % (a + b); long long sum = a * sets + amaris; cout << sum << endl; return 0; }
#include <iostream> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long sets = n / (a + b); long long amaris = n % (a + b) > a ? a : n % (a + b); long long sum = a * sets + amaris; cout << sum << endl; return 0; }
[["-", 0, 43, 49, 50, 51, 41, 15, 16, 12, 22], ["+", 0, 43, 49, 50, 51, 41, 15, 16, 12, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 41, 64, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 41, 64, 22]]
1
83
#include <bits/stdc++.h> using namespace std; int main() { int n, a, b; cin >> n >> a >> b; if (a == 0 && b == 0) { cout << 0 << endl; } else { int x, y, z; x = n / (a + b) * a; y = n % (a + b); if (y > a) { z = a; } else if (y <= a) { z = y; } cout << x + y << endl;...
#include <bits/stdc++.h> using namespace std; int main() { long n, a, b; cin >> n >> a >> b; if (a == 0 && b == 0) { cout << 0 << endl; } else { long x, y, z; x = n / (a + b) * a; y = n % (a + b); if (y > a) { z = a; } else if (y <= a) { z = y; } cout << x + z << end...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 57, 75, 76, 0, 9, 0, 43, 39, 40], ["+", 75, 76, 0, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
110
n, a, b = map(int, input().split()) print(a * (n // (a + b)) + (n % (a + b)))
n, a, b = map(int, input().split()) print(a * (n // (a + b)) + min(a, n % (a + b)))
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21]]
5
42
n,a,b = map(int,input().split()) c = a + b ans = n//c*b + min(n%c,b) print(ans)
n,a,b = map(int,input().split()) c = a + b ans = n//c*a + min(n%c,a) print(ans)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["-", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22]]
5
43
N,A,B = list(map(int,input().split())) q = N//(A + B) r = N%(A + B) ans = q*A + r print(ans)
N,A,B = list(map(int,input().split())) q = N//(A + B) r = N%(A + B) ans = q*A + min(r,A) print(ans)
[["+", 0, 1, 0, 662, 12, 657, 12, 652, 63, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 25]]
5
50
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { long long n, a, b; cin >> n >> a >> b; cout << a * n / (a + b) + min(n % (a + b), a) << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { long long n, a, b; cin >> n >> a >> b; cout << n / (a + b) * a + min(n % (a + b), a) << endl; }
[["-", 31, 16, 12, 16, 31, 16, 31, 16, 31, 22], ["-", 31, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22]]
1
63
#include <algorithm> #include <iostream> #include <numeric> #include <string> #include <vector> //#include <stdio.h> //#include <stack> //#include <queue> //#include <cstdio> #include <cmath> #include <fstream> #include <iterator> #include <map> //#include <list> #include <iomanip> //#include <stdlib.h> //#include <cct...
#include <algorithm> #include <iostream> #include <numeric> #include <string> #include <vector> //#include <stdio.h> //#include <stack> //#include <queue> //#include <cstdio> #include <cmath> #include <fstream> #include <iterator> #include <map> //#include <list> #include <iomanip> //#include <stdlib.h> //#include <cct...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
1,070
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.ti...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.ti...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22]]
1
136
N, A, B = map(int, input().split()) r = N//(A+B) print(r*A+min(B, N-r*(A+B)))
N, A, B = map(int, input().split()) r = N//(A+B) print(r*A+min(A, N-r*(A+B)))
[["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22]]
5
48
n,a,b = list(map(int,input().split())) cnt = 0 c = n//(a+b) d = n%(a+b) if d <= a: cnt = c+d else: cnt = c+a print(cnt)
n,a,b = list(map(int,input().split())) cnt = 0 c = n//(a+b) d = n%(a+b) if d <= a: cnt = a*c+d else: cnt = a*c+a print(cnt)
[["+", 0, 1, 0, 662, 12, 657, 31, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48]]
5
63
/// Bismillahir Rahmanir Rahim // Author: Tanvir Hussain // ICE,NSTU #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; const long long MOD = 1000000007; #define SET(x) memset(x, 0, sizeof(x)) #define SET2d(x, m, n) m...
/// Bismillahir Rahmanir Rahim // Author: Tanvir Hussain // ICE,NSTU #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; const long long MOD = 1000000007; #define SET(x) memset(x, 0, sizeof(x)) #define SET2d(x, m, n) m...
[["+", 64, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]]
1
604
N,A,B =map(int,input().split()) num=N//(A+B) num2=N-num*(A+B) if num > A: print(num*A+A) else: print(num*A+num2)
N,A,B =map(int,input().split()) num=N//(A+B) num2=N-num*(A+B) if num2 > A: print(num*A+A) else: print(num*A+num2)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
61
#include <bits/stdc++.h> #include <cassert> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; const long long MOD = 1000000007; const long long INF = 1LL << 60; const int INT_INF = 1000000000; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int mai...
#include <bits/stdc++.h> #include <cassert> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; const long long MOD = 1000000007; const long long INF = 1LL << 60; const int INT_INF = 1000000000; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int mai...
[["-", 0, 11, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 22]]
1
173
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(a) (a).begin(), (...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(a) (a).begin(), (...
[["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["-", 0, 16, 31, 16, 12, 16, 12, 23, 0, 24], ["-", 31, 16, 12, 16, 12, 23, 0, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
354
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; cout << (n / (a + b)) * a + (n % (a + b)) / a << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; cout << (n / (a + b)) * a + min((n % (a + b)), a) << endl; return 0; }
[["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["-", 0, 16, 31, 16, 12, 16, 12, 16, 17, 85], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]]
1
63
#include <iostream> using namespace std; int main(int argc, char *argv[]) { long long N, A, B; cin >> N >> A >> B; if (A == 0 && B == 0) { cout << 0 << endl; return 0; } long long n = N / (A + B); long long e = N - n * (A + B); cout << n * A + e << endl; return 0; }
#include <iostream> using namespace std; int main(int argc, char *argv[]) { long long N, A, B; cin >> N >> A >> B; if (A == 0 && B == 0) { cout << 0 << endl; return 0; } long long n = N / (A + B); long long e = min(N - n * (A + B), A); cout << n * A + e << endl; return 0; }
[["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]]
1
96
n, a, b = map(int, input().split()) if n%(a+b) < 3: print(n//(a+b)*a+n%(a+b)) else: print(n//(a+b)*a+a)
n, a, b = map(int, input().split()) if n%(a+b) < a: print(n//(a+b)*a+n%(a+b)) else: print(n//(a+b)*a+a)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
65
n, a, b = map(int, input().split()) ab = a + b syou = ab // n amari = ab % n print(syou * a + min(amari, a))
n, a, b = map(int, input().split()) ab = a + b syou = n // ab amari = n % ab print(syou * a + min(amari, a))
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109]]
5
46
N,A,B=[int(s) for s in input().split()] C=A+B Q=N//C R=N%C if R<=A: print(Q*A+C) else: print((Q+1)*A)
N,A,B=[int(s) for s in input().split()] C=A+B Q=N//C R=N%C if R<=A: print(Q*A+R) else: print((Q+1)*A)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
62
#include <bits/stdc++.h> #define ALL(v) v.begin(), v.end() #define ALLG(v) v.begin(), v.end(), greater<int>() typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) ll GCD(ll x, ll y) { return y ? GCD(y, x % y) : x; } ll LCM(ll x, ll y) { return x * y / GCD(x, y); } ll GetDigit(ll num) { ll digit ...
#include <bits/stdc++.h> #define ALL(v) v.begin(), v.end() #define ALLG(v) v.begin(), v.end(), greater<int>() typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) ll GCD(ll x, ll y) { return y ? GCD(y, x % y) : x; } ll LCM(ll x, ll y) { return x * y / GCD(x, y); } ll GetDigit(ll num) { ll digit ...
[["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
178
n, a, b = map(int, input().split()) x = n // (a + b) ans = a * a + min(a, n - (a + b)*x) print(ans)
n,a,b = map(int, input().split()) x = n // (a + b) ans = a * x + min(a,n - (a + b) * x) print(ans)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22]]
5
51
#include <bits/stdc++.h> using namespace std; long long n, a, b; int main() { cin >> n >> a >> b; cout << (n / (a + b)) * a + (n % (a + b) > b ? b : n % (a + b)); }
#include <bits/stdc++.h> using namespace std; long long n, a, b; int main() { cin >> n >> a >> b; cout << (n / (a + b)) * a + (n % (a + b) > a ? a : n % (a + b)); }
[["-", 12, 16, 12, 23, 0, 41, 15, 16, 12, 22], ["+", 12, 16, 12, 23, 0, 41, 15, 16, 12, 22], ["-", 0, 16, 12, 16, 12, 23, 0, 41, 64, 22], ["+", 0, 16, 12, 16, 12, 23, 0, 41, 64, 22]]
1
64
#include <iostream> #include <string> using namespace std; typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; ll c = a + b; ll dev = n / c; int mod = n % c <= a ? a : n % c; cout << dev * a + mod; return 0; }
#include <iostream> #include <string> using namespace std; typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; ll c = a + b; ll dev = n / c; ll mod = n % c <= a ? n % c : a; cout << dev * a + mod; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 43, 49, 50, 51, 41, 64, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 41, 0, 102], ["+", 8, 9, 0, 43, 49, 50, 51, 41, 0, 102], ["+", 8, 9, 0, 43, 49, 50, 51, 41, 75, 22]]
1
74
N,A,B=map(int, input().split()) s=N//(A+B) NA=N%(A+B) if(A!=0): if(NA<A): sA=0 sAG=NA else: sA=1 sAG=0 else: sA=0 print(s*A+sA*A+sAG)
N,A,B=map(int, input().split()) s=N//(A+B) NA=N%(A+B) if(A!=0): if(NA<A): sA=0 sAG=NA else: sA=1 sAG=0 else: sA=0 sAG=0 print(s*A+sA*A+sAG)
[["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
81
#include <stdio.h> int main(void) { long long n, a, b; int count = 0; scanf("%lld %lld %lld", &n, &a, &b); count += (n / (a + b)) * a; n = n % (a + b); if (n > a) { count += a; } else count += n; printf("%lld\n", count); return 0; }
#include <stdio.h> int main(void) { long long n, a, b; long long count = 0; scanf("%lld %lld %lld", &n, &a, &b); count += (n / (a + b)) * a; n = n % (a + b); if (n > a) { count += a; } else count += n; printf("%lld\n", count); return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
92
N,A,B = map(int,input().split()) ans = (N//(A+B))*A ans += N%(A+B) print(ans)
N,A,B = map(int,input().split()) ans = (N//(A+B))*A ans += min(N%(A+B),A) print(ans)
[["+", 0, 656, 0, 1, 0, 677, 12, 652, 63, 22], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 22]]
5
44
N, A, B = map(int, input().split()) combo = A + B num_of_combo = N // combo remaining = N - combo * num_of_combo print(num_of_combo * A + remaining)
N, A, B = map(int, input().split()) combo = A + B num_of_combo = N // combo remaining = N - combo * num_of_combo print(num_of_combo * A + min(remaining, A))
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25]]
5
43
#!/usr/bin/env python3 import sys # import math # import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s) # from collections import deque # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popl...
#!/usr/bin/env python3 import sys # import math # import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s) # from collections import deque # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popl...
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25]]
5
226
def main(): NAB = list(map(int,input().split())) # X = NAB[0] # a = 0 # b = 0 # # while X >= 0: # X -= NAB[1] # a += 1 # # print("go") # # if X <= 0: # break # # X -= NAB[2] # b += 1 # # # print(a) # # print(b) ...
def main(): NAB = list(map(int,input().split())) # X = NAB[0] # a = 0 # b = 0 # # while X >= 0: # X -= NAB[1] # a += 1 # # print("go") # # if X <= 0: # break # # X -= NAB[2] # b += 1 # # # print(a) # # print(b) ...
[["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 12, 206, 51, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 206, 0, 70], ["+", 0, 1, 0, 662, 12, 657, 12, 206, 206, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 206, 0, 73]]
5
151
#include "bits/stdc++.h" using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long a; long long n; long long b; n = N / (A + B); a = N % (A + B); if (a >= (A + B)) b = A; else b = a; long long sum = n * A + b; cout << sum << endl; }
#include "bits/stdc++.h" using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long a; long long n; long long b; n = N / (A + B); a = N % (A + B); if (a >= A) b = A; else b = a; long long sum = n * A + b; cout << sum << endl; }
[["-", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 15, 339, 51, 16, 12, 23, 0, 16, 17, 72], ["-", 15, 339, 51, 16, 12, 23, 0, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25]]
1
97
from sys import stdin N,A,B = list(map(int,stdin.readline().strip().split())) C=A+B ans=A*(N//C) if N%C>A: ans+=N%C-B else:ans+=N%C print(ans)
from sys import stdin N,A,B = list(map(int,stdin.readline().strip().split())) C=A+B ans=A*(N//C) if N%C>A: ans+=A else:ans+=N%C print(ans)
[["-", 0, 1, 0, 677, 12, 657, 31, 657, 31, 22], ["-", 0, 1, 0, 677, 12, 657, 31, 657, 17, 109], ["-", 0, 1, 0, 677, 12, 657, 31, 657, 12, 22], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 17, 33], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 12, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 22]]
5
70
#設定 import sys input = sys.stdin.buffer.readline #ライブラリインポート from collections import defaultdict con = 10 ** 9 + 7 #入力受け取り def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, A, B = getlist() ans = int(N // (A + B)) * A + N % (A + B) print(ans) if __name__ == '__main__': main()
#設定 import sys input = sys.stdin.buffer.readline #ライブラリインポート from collections import defaultdict con = 10 ** 9 + 7 #入力受け取り def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, A, B = getlist() ans = int(N // (A + B)) * A + min(N % (A + B), A) print(ans) if __name__ == '__main__': main()
[["+", 0, 1, 0, 662, 12, 657, 12, 652, 63, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22]]
5
97
#include <bits/stdc++.h> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long c = a + b; long long ans = a * n / c; ans += min(n % c, a); cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long c = a + b; long long ans = a * (n / c); ans += min(n % c, a); cout << ans << endl; return 0; }
[["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 25]]
1
66
n,a,b = map(int, input().split()) tmp = int(n /(a+b)) amari = int(n %(a+b)) if amari >= a: print(tmp*a + a) else: print(tmp*a + a-amari)
n,a,b = map(int, input().split()) # n,a,b = map(int, "6 2 4".split()) tmp = int(n /(a+b)) amari = int(n %(a+b)) if amari >= a: print(tmp*a + a) else: print(tmp*a + amari)
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]]
5
67
#include <bits/stdc++.h> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long s; if (A == 0) { s = 0; } else if (N % (A + B) < B) { s = N % (A + B); } else { s = A; } cout << A * (N / (A + B)) + s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long s; if (A == 0) { s = 0; } else if (N % (A + B) < A) { s = N % (A + B); } else { s = A; } cout << A * (N / (A + B)) + s << endl; }
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 12, 22]]
1
94
N, A ,B =map(int,input().split()) print(N//(A+B)*A+min(N%(A+B),B))
N, A ,B =map(int,input().split()) print(N//(A+B)*A+min(N%(A+B),A))
[["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22]]
5
43
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <string> #include <unordered_map> //hash map #include <utility> #include <vector> #define rep(i, a, n) for (int(i) = (a); (i) < (n); (i)++) #define rrep(i, a, n) for (int(i) = (a); (i...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <string> #include <unordered_map> //hash map #include <utility> #include <vector> #define rep(i, a, n) for (int(i) = (a); (i) < (n); (i)++) #define rrep(i, a, n) for (int(i) = (a); (i...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
207
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n, a, b = map(int, readline().split()) if n <= a + b: print(a) else: ans = n // (a + b) * a if n % (a + b) < a: ans += n % (a + b) else: ans...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n, a, b = map(int, readline().split()) if n <= a + b: print(min(n, a)) else: ans = n // (a + b) * a if n % (a + b) < a: ans += n % (a + b) else: ...
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
108
N, A, B = map(int, input().split()) C = N%(A+B) if C> A: print(A*N//(A+B)+A) else: print(A*N//(A+B)+C)
N, A, B = map(int, input().split()) C = N%(A+B) if C> A: print(A*(N//(A+B))+A) else: print(A*(N//(A+B))+C)
[["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 31, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
62
N,A,B = list(map(int, input().split())) S = A+B ans = (S // N) * A res = S % N ans += min(A,res) print(ans)
N,A,B = list(map(int, input().split())) S = A+B ans = (N // S) * A res = N % S ans += min(A,res) print(ans)
[["-", 0, 662, 12, 657, 31, 23, 0, 657, 31, 22], ["-", 0, 662, 12, 657, 31, 23, 0, 657, 17, 676], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 676], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, ...
5
52
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, a, b, ans; cin >> n >> a >> b; ans = (n % (a + b)) * a; n %= (a + b); ans += min(a, n); cout << ans << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, a, b, ans; cin >> n >> a >> b; ans = (n / (a + b)) * a; n %= (a + b); ans += min(a, n); cout << ans << "\n"; return 0; }
[["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 109], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 85]]
1
86
#include <iostream> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long sum = N / (A + B) * A; if (N % (A + B) <= A) { cout << sum + N % (A + B) << endl; } else { cout << sum << endl; } }
#include <iostream> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long sum = (N / (A + B)) * A; if (N % (A + B) <= A) { cout << sum + N % (A + B) << endl; } else { cout << sum + A << endl; } }
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
79
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import accumulate, permutations, combinations, product, groupby from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import accumulate, permutations, combinations, product, groupby from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_...
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
260
#include <bits/stdc++.h> #define ALL(l) (l).begin(), (l).end() #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; typedef long long ll; // const ll mod = 1000000007; // const ll maxn = 1000000000; //-----------------------------------------------------------------------------------------------...
#include <bits/stdc++.h> #define ALL(l) (l).begin(), (l).end() #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; typedef long long ll; // const ll mod = 1000000007; // const ll maxn = 1000000000; //-----------------------------------------------------------------------------------------------...
[["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
126
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = 1; i <= (int)(n); i++) #define dunk(n) cout << n << endl #define all(a) (a).begin(), (a).end() typedef pair<int, int> P; typedef long long ll; int main() { ll n, a...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = 1; i <= (int)(n); i++) #define dunk(n) cout << n << endl #define all(a) (a).begin(), (a).end() typedef pair<int, int> P; typedef long long ll; int main() { ll n, a...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]]
1
106
#include <bits/stdc++.h> using namespace std; #define ll long long #define db double #define pii pair<int, int> #define pli pair<ll, int> #define pil pair<int, ll> #define pll pair<ll, ll> const int inf = 1 << 30; const ll linf = 1e18; template <class T> void chmin(T &x, T y) { if (x > y) x = y; } template <class...
#include <bits/stdc++.h> using namespace std; #define ll long long #define db double #define pii pair<int, int> #define pli pair<ll, int> #define pil pair<int, ll> #define pll pair<ll, ll> const int inf = 1 << 30; const ll linf = 1e18; template <class T> void chmin(T &x, T y) { if (x > y) x = y; } template <class...
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 17, 33]]
1
164
#include <bits/stdc++.h> using namespace std; #define int long long int #define pb push_back #define N 200100 #define MOD 1000000007 #define fn(i, n) for (int i = 0; i < n; i += 1) #define rep(i, l, r) for (int i = l; i <= r; i += 1) #define INF 100000000000000 #define pii pair<int, int> #define speed ...
#include <bits/stdc++.h> using namespace std; #define int long long int #define pb push_back #define N 200100 #define MOD 1000000007 #define fn(i, n) for (int i = 0; i < n; i += 1) #define rep(i, l, r) for (int i = l; i <= r; i += 1) #define INF 100000000000000 #define pii pair<int, int> #define speed ...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 11, 12, 2, 3, 4, 0, 23, 0, 24], ["+", 0, 23, 0, 16, 12, 16, 12, 23, 0, 25]]
1
170
N, A, B= map(int, input().split()) print(A*N//(A+B)+min(N%(A+B), A))
N, A, B= map(int, input().split()) print(A*(N//(A+B))+min(N%(A+B), A))
[["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 31, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
43
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long int main() { ll n, a, b; cin >> n >> a >> b; ll div = n / (a + b); ll rest = n - n / (a + b) * (a + b); ll ans = div * a + max(rest, a); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long int main() { ll n, a, b; cin >> n >> a >> b; ll div = n / (a + b); ll rest = n - n / (a + b) * (a + b); ll ans = div * a + min(rest, a); cout << ans << endl; }
[["-", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22]]
1
88
n, a, b = map(int, input().split()) if a == 0: print(0) else: print( (n //(a+b))*a + max(a, n%(a+b)) )
n, a, b = map(int, input().split()) if a == 0: print(0) else: print( (n //(a+b))*a + min(a, n%(a+b)) )
[["-", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22]]
5
56
#include <bits/stdc++.h> typedef long long int lli; typedef unsigned long long int ulli; typedef long double ldb; #define endl '\n' #define loop(i, m, n) for (lli i = m; i < n; i++) #define loope(i, m, n) for (lli i = m; i <= n; i++) #define epool(i, m, n) for (lli i = m; i >= n; i--) #define pool(i, m, n) for (lli i ...
#include <bits/stdc++.h> typedef long long int lli; typedef unsigned long long int ulli; typedef long double ldb; #define endl '\n' #define loop(i, m, n) for (lli i = m; i < n; i++) #define loope(i, m, n) for (lli i = m; i <= n; i++) #define epool(i, m, n) for (lli i = m; i >= n; i--) #define pool(i, m, n) for (lli i ...
[["+", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 16, 12, 2, 3, 4, 0, 23, 0, 25], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 22]]
1
531
#include <bits/stdc++.h> using namespace std; int main() { long int N, A, B; cin >> N >> A >> B; long int C = N / (A + B); cout << A * C + min(B, N % (A + B)) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long int N, A, B; cin >> N >> A >> B; long int C = N / (A + B); cout << A * C + min(A, N % (A + B)) << endl; }
[["-", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]]
1
61
#include <bits/stdc++.h> int main(int, char **) { int64_t N, A, B; std::cin >> N >> A >> B; int64_t n_blue; n_blue = A * N / (A + B) + std::min(A, N % (A + B)); std::cout << n_blue << std::endl; return 0; }
#include <bits/stdc++.h> int main(int, char **) { int64_t N, A, B; std::cin >> N >> A >> B; int64_t n_blue; n_blue = A * (N / (A + B)) + std::min(A, N % (A + B)); std::cout << n_blue << std::endl; return 0; }
[["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
73
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) typedef int64_t Int; int main() { Int N, A, B, q, d; cin >> N >> A >> B; q = N / (A + B); d = N % (A + B); cout << N * q + min(A, d) << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) typedef int64_t Int; int main() { Int N, A, B, q, d; cin >> N >> A >> B; q = N / (A + B); d = N % (A + B); cout << A * q + min(A, d) << endl; }
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22]]
1
86
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define pb push_back #define ll long long int #define ull unsigned long long int #define ld long double #define fi first #define se second #define mod 998244353 #define...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define pb push_back #define ll long long int #define ull unsigned long long int #define ld long double #define fi first #define se second #define mod 998244353 #define...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
225
#include <bits/stdc++.h> using namespace std; typedef long long llint; int main() { llint n, a, b; cin >> n >> a >> b; llint ans = a * n / (a + b); ans += min(n % (a + b), a); cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long llint; int main() { llint n, a, b; cin >> n >> a >> b; llint ans = a * (n / (a + b)); ans += min(n % (a + b), a); cout << ans << endl; return 0; }
[["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
69
n,b,r = [int(i) for i in input().split()] k = n // (r+b) * b l = min(n % (r+b), b) print(k,l)
n,b,r = [int(i) for i in input().split()] k = n // (r+b) * b l = min(n % (r+b), b) print(k+l)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
53
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define dunk(n) cout << n << endl #define all(v) v.begin(), v.end() int main() { long long n, a, b; cin >> n >> a >> b; long long ans; ans = a * n / (a + b) + min(a, n % (a + b)); dunk(a...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define dunk(n) cout << n << endl #define all(v) v.begin(), v.end() int main() { long long n, a, b; cin >> n >> a >> b; long long ans; ans = n / (a + b) * a + min(a, n % (a + b)); dunk(a...
[["-", 0, 11, 12, 16, 31, 16, 31, 16, 31, 22], ["-", 0, 11, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22]]
1
84
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long const ll mod = 1e9 + 7; const ll maxn = 2e5 + 5; const double pi = 3.1415926535897932384626433832795028841971693993751058209749445923078; // iostream::sync_with_stdio(false); int main() { ll n, a, b; cin >> n >> a >> b; l...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long const ll mod = 1e9 + 7; const ll maxn = 2e5 + 5; const double pi = 3.1415926535897932384626433832795028841971693993751058209749445923078; // iostream::sync_with_stdio(false); int main() { ll n, a, b; cin >> n >> a >> b; l...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
153
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, n; cin >> n >> a >> b; ll k = 0; if (n % (a + b) <= a) k = n % (a + b); cout << ((n / (a + b)) * a) + k << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, n; cin >> n >> a >> b; ll k = 0; if (n % (a + b) <= a) k = n % (a + b); else k = a; cout << ((n / (a + b)) * a) + k << "\n"; return 0; }
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 75, 76, 0, 1, 0, 35]]
1
96
N, A, B = map(int, input().split()) ans = A * N // (A + B) + min(N % (A + B), A) print(ans)
N, A, B = map(int, input().split()) ans = A * (N // (A + B)) + min(N % (A + B), A) print(ans)
[["+", 0, 662, 12, 657, 31, 657, 12, 23, 0, 24], ["+", 31, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
46
n,a,b=map(int,input().split()) c=n//(a+b) d=n%(a+b) blue=c*a+b if d>=b else c*a+d print(blue)
n,a,b=map(int,input().split()) c=n//(a+b) d=n%(a+b) blue=c*a+a if d>=a else c*a+d print(blue)
[["-", 0, 1, 0, 662, 12, 41, 0, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 12, 22], ["-", 0, 1, 0, 662, 12, 41, 0, 666, 0, 22], ["+", 0, 1, 0, 662, 12, 41, 0, 666, 0, 22]]
5
57
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int64_t n, a, b; cin >> n; cin >> a; cin >> b; int64_t ans = 0; ans += (n / (a + b)) * a; int64_t c = n % (a + b); if (c > a) { ans += b; } el...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int64_t n, a, b; cin >> n; cin >> a; cin >> b; int64_t ans = 0; ans += (n / (a + b)) * a; int64_t c = n % (a + b); if (c > a) { ans += a; } el...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
108
// When you are hungry for something and you're determined and you're focused // and you're committed to something it's hard to surrender, isn't it? #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define endl "\n" #define ll long long #define int ll #define mod 1000000007 #define m...
// When you are hungry for something and you're determined and you're focused // and you're committed to something it's hard to surrender, isn't it? #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define endl "\n" #define ll long long #define int ll #define mod 1000000007 #define m...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]]
1
593
N, A, B = map(int,input().split()) x = N // (A+B) y = N % (A+B) ans = x + min(A, y) print(ans)
N, A, B = map(int,input().split()) x = A * (N // (A+B)) y = N % (A+B) ans = x + min(A, y) print(ans)
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 12, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
50
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using p = pair<int, int>; int main() { ll n, a, b, test1 = 10, test2 = 3; cin >> n >> a >> b; ll c = a + b; ll count = n / c; if (n % c <= a) { cout << count * a + n % c << endl; // cou...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using p = pair<int, int>; int main() { ll n, a, b, test1 = 10, test2 = 3; cin >> n >> a >> b; ll c = a + b; ll count = n / c; if (n % c <= a) { cout << count * a + n % c << endl; // cou...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["-", 31, 16, 12, 16, 12, 23, 0, 16, 31, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
113
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, a, b; cin >> n >> a >> b; ll ans = 0; ll cnt = n / (a + b); ans += cnt * a; cnt = n % (a + b); if (cnt <= b) { ans += cnt; } else { ans += a; } cout << ans << e...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, a, b; cin >> n >> a >> b; ll ans = 0; ll cnt = n / (a + b); ans += cnt * a; cnt = n % (a + b); if (cnt <= a) { ans += cnt; } else { ans += a; } cout << ans << e...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
104
n,a,b=gets.split.map(&:to_i) c=a+b if c<n set=(n/c)*a one=[n%c,a].min puts set+one else puts a end
n,a,b=gets.split.map(&:to_i) c=a+b if c<n set=(n/c)*a one=[n%c,a].min puts set+one else puts [a,n].min end
[["+", 0, 652, 3, 4, 0, 652, 486, 516, 0, 70], ["+", 0, 652, 3, 4, 0, 652, 486, 516, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 486, 516, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 486, 516, 0, 73], ["+", 75, 95, 0, 652, 3, 4, 0, 652, 17, 131], ["+", 75, 95, 0, 652, 3, 4, 0, 652, 735, 22]]
4
52
#include <bits/stdc++.h> using namespace std; long inf = 1000000007; int main() { long n, a, b; cin >> n >> b >> a; long count = 0; long t = n / (a + b); long l = n % (a + b); count += t * b; if (l >= a) { cout << count + b << endl; } else { cout << count + l << endl; } }
#include <bits/stdc++.h> using namespace std; long inf = 1000000007; int main() { long n, a, b; cin >> n >> b >> a; long count = 0; long t = n / (a + b); long l = n % (a + b); count += t * b; if (l >= b) { cout << count + b << endl; } else { cout << count + l << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
92
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define pi pair<int, int> #define ll long long #define rep(i, a, b) for (int i = int(a); i <= int(b); i++) #define repv(vec, v) for (v = (vec).begin(); v != (vec).end(); v++) #define sz(vec) (int)(vec).size() #define PB push_back #define F first() #de...
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define pi pair<int, int> #define ll long long #define rep(i, a, b) for (int i = int(a); i <= int(b); i++) #define repv(vec, v) for (v = (vec).begin(); v != (vec).end(); v++) #define sz(vec) (int)(vec).size() #define PB push_back #define F first() #de...
[["+", 12, 2, 3, 4, 0, 16, 12, 16, 31, 22], ["+", 12, 2, 3, 4, 0, 16, 12, 16, 17, 48], ["+", 3, 4, 0, 16, 12, 16, 12, 23, 0, 24], ["-", 12, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 12, 16, 12, 23, 0, 25]]
1
100
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f #define infll 0x3f3f3f3f3f3f3f3f #define all(x) (x).begin(), (x).end() #define f(i, a, b) for (int i = a; i < (signed)(b); ++i) #define pc __builtin_popcount // counts number of 1's in bin(num) const double pi = 2 * acos(0.0); /...
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f #define infll 0x3f3f3f3f3f3f3f3f #define all(x) (x).begin(), (x).end() #define f(i, a, b) for (int i = a; i < (signed)(b); ++i) #define pc __builtin_popcount // counts number of 1's in bin(num) const double pi = 2 * acos(0.0); /...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
125
N,A,B=map(int,input().split()) d=int(N%(A+B)) ans = A*d+min(A,(N%(A+B))) print(ans)
N,A,B=map(int,input().split()) d=int(N//(A+B)) ans = A*d+min(A,(N%(A+B))) print(ans)
[["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 676]]
5
54
<?php fscanf(STDIN,"%d %d %d", $n,$a,$b); $set = $n/($a+$b); $ama = $n%($a+$b); echo (int)$set*$a + $ama."\n"; ?>
<?php fscanf(STDIN,"%d %d %d", $n,$a,$b); $set = $n/($a+$b); $ama = $n%($a+$b); echo (int)$set*$a + min($ama,$a)."\n"; ?>
[["+", 0, 608, 0, 16, 31, 16, 12, 613, 63, 141], ["+", 0, 16, 31, 16, 12, 613, 3, 3, 0, 24], ["+", 0, 16, 31, 16, 12, 613, 3, 3, 0, 21], ["+", 12, 613, 3, 3, 0, 28, 0, 606, 0, 607], ["+", 12, 613, 3, 3, 0, 28, 0, 606, 0, 141], ["+", 0, 16, 31, 16, 12, 613, 3, 3, 0, 25]]
6
65
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; ll rem = n % (a + b); ll amari = min(rem, a); cout << (a * n / (a + b)) + amari << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; ll rem = n % (a + b); ll amari = min(rem, a); cout << a * (n / (a + b)) + amari << endl; }
[["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24]]
1
71
n,a,b=map(int, input().split()) mod = n % (a+b) num = n // (a+b) if a == 0: print(0) else: print(num*a+mod)
n,a,b=map(int, input().split()) mod = n % (a+b) num = n // (a+b) if a == 0: print(0) else: print(num*a+min(mod,a))
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25]]
5
55
#include <bits/stdc++.h> #define int long long #define quickie \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define rep(i, a, b) for (int i = a; i < b; i++) #define rep1(i, a, b) for (int i = a; i <= b;...
#include <bits/stdc++.h> #define int long long #define quickie \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define rep(i, a, b) for (int i = a; i < b; i++) #define rep1(i, a, b) for (int i = a; i <= b;...
[["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 21], ["+", 51, 16, 12, 2, 3, 4, 0, 23, 0, 24], ["+", 3, 4, 0, 23, 0, 16, 12, 23, 0, 25]]
1
261
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define fst first #define snd second int main() { ll n, a, b; cin >> n >> a >> b; cout << n / (a + b) * a + n % (a + b); return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define fst first #define snd second int main() { ll n, a, b; cin >> n >> a >> b; cout << n / (a + b) * a + min(a, n % (a + b)); return 0; }
[["+", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
65
// Optional FAST //#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops") //#pragma GCC //target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native") // Required Libraries #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> ...
// Optional FAST //#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops") //#pragma GCC //target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native") // Required Libraries #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> ...
[["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22]]
1
474
n,a,b = map(int,input().split()) ans = a*(n//(a+b)) + min(N%(a+b),a) print(ans)
n,a,b = map(int,input().split()) ans = a*(n//(a+b)) + min(n%(a+b),a) print(ans)
[["-", 12, 657, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 12, 657, 12, 652, 3, 4, 0, 657, 31, 22]]
5
48
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long a = sc.nextLong(); long b = sc.nextLong(); long a1 = n / (a + b); long a2; long c = n % (a + b); if (c <= a) { a2 = c; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long a = sc.nextLong(); long b = sc.nextLong(); long a1 = n / (a + b) * a; long a2; long c = n % (a + b); if (c <= a) { a2 = c; ...
[["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 48], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 22]]
3
137
#include <bits/stdc++.h> using namespace std; int main() { unsigned int n, a, b; cin >> n >> a >> b; unsigned int syou = n / (a + b); unsigned int sa = n - syou * (a + b); if (sa > a) sa = a; cout << syou * a + sa << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, a, b; cin >> n >> a >> b; long long int syou = n / (a + b); long long int sa = n - syou * (a + b); if (sa > a) sa = a; cout << syou * a + sa << endl; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
74
N, A, B = map(int,input().split()) ans = (N//(A+B)) + min(N%(A+B),A) print(ans)
N, A, B = map(int,input().split()) ans = A*(N//(A+B)) + min(N%(A+B),A) print(ans)
[["+", 0, 1, 0, 662, 12, 657, 31, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48]]
5
46
//============================================================================ // Name : Hello5.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <bi...
//============================================================================ // Name : Hello5.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <bi...
[["-", 0, 43, 49, 50, 51, 16, 12, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22]]
1
111
import math a,b,c= input().split() x,y,z=(int(a),int(b),int(c)) num_one_gr = y + z num_gr = math.floor(x/num_one_gr) amari = x - num_one_gr*num_gr if amari <= y: total = y * num_gr + amari else: total = y*(num_gr + 1)
import math a,b,c= input().split() x,y,z=(int(a),int(b),int(c)) num_one_gr = y + z num_gr = math.floor(x/num_one_gr) amari = x - num_one_gr*num_gr if amari <= y: total = y * num_gr + amari else: total = y*(num_gr + 1) print(total)
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
82
//#include<bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> using namespace std; #define int long long #define ll long long #define str string #define db double #define ac() cout << "Yes" << endl...
//#include<bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> using namespace std; #define int long long #define ll long long #define str string #define db double #define ac() cout << "Yes" << endl...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
436
import java.util.*; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); long N = stdIn.nextLong(); long A = stdIn.nextLong(); long B = stdIn.nextLong(); stdIn.close(); long Count = 0; if (N % (A + B) > A) { Count = A * N / (A + B) ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); long N = stdIn.nextLong(); long A = stdIn.nextLong(); long B = stdIn.nextLong(); stdIn.close(); long Count = 0; if (N % (A + B) > A) { Count = A * (N / (A + B)...
[["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 25], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 12, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
3
133
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) // repマクロ #define all(v) v.begin(), v.end() // sort等の関数呼び出しを簡潔にする using vi = vector<int>; // intの1次元の型に vi という別名をつける using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける int main() { int N, A, B...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) // repマクロ #define all(v) v.begin(), v.end() // sort等の関数呼び出しを簡潔にする using vi = vector<int>; // intの1次元の型に vi という別名をつける using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける int main() { long long N...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
128
N, A, B = map(int, input().split()) A_amari = A % 2 B_amari = B % 2 # print(A_amari) # print(B_amari) if A+B == 0: print(0) exit() else: cnt = N // (A+B) amari = N % (A+B) # print(cnt) # print(amari) if amari <= A: print(A*cnt+amari) else: if amari <= B: print(A*(cnt+1))
N, A, B = map(int, input().split()) A_amari = A % 2 B_amari = B % 2 # print(A_amari) # print(B_amari) if A+B == 0: print(0) exit() else: cnt = N // (A+B) amari = N % (A+B) # print(cnt) # print(amari) if amari <= A: print(A*cnt+amari) else: if amari <= B or amari > A: print(A*(cnt+1))
[["+", 75, 76, 8, 196, 0, 57, 15, 679, 17, 354], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 47]]
5
96