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 |
|---|---|---|---|---|
N, A, B = map(int, input().split())
a = N//(A+B)
b = N % (A+B)
if A == 0:
print(0)
elif b <= A:
print(a*A+b)
else:
print(a*A+a) | N, A, B = map(int, input().split())
a = N//(A+B)
b = N % (A+B)
if A == 0:
print(0)
elif b <= A:
print(a*A+b)
else:
print(a*A+A) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 68 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll sum = a + b;
ll val = a * (n / sum);
ll ans = val + min(b, n % sum);
cout << ans;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll sum = a + b;
ll val = a * (n / sum);
ll ans = val + min(a, n % sum);
cout << ans;
}
| [["-", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22]] | 1 | 69 |
#include <algorithm>
#include <bitset>
#include <cerrno>
#include <cfenv>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
long long N, A, B;
long long ans = 0;
int amari = 0;
long long shou = 0;
int main() {
cin ... | #include <algorithm>
#include <bitset>
#include <cerrno>
#include <cfenv>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
long long N, A, B;
long long ans = 0;
long long amari = 0;
long long shou = 0;
int main() {
... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22]] | 1 | 116 |
N,A,B = map(int,input().split())
if A == 0 and B == 0:
print(0)
kumi = N // (A + B)
amari = N % (A + B)
if amari > A:
print(kumi * A + N)
else:
print(kumi * A + amari) | N,A,B = map(int,input().split())
if A == 0 and B == 0:
print(0)
kumi = N // (A + B)
amari = N % (A + B)
if amari > A:
print(kumi * A + A)
else:
print(kumi * A + amari) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 72 |
//#include<bits/stdc++.h>
#include <iostream>
//#include<vector>
//#include<algorithm>
using namespace std;
//#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n) for (int i = (int)(n - ... | //#include<bits/stdc++.h>
#include <iostream>
//#include<vector>
//#include<algorithm>
using namespace std;
//#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n) for (int i = (int)(n - ... | [["-", 0, 9, 0, 1, 0, 16, 12, 16, 12, 22], ["+", 0, 9, 0, 1, 0, 16, 12, 16, 12, 22]] | 1 | 122 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
#define deb(x) cerr << #x << ":" << x << "\n"
void DP_82() {
ll n, a, b;
cin >> n >> a >> b;
cout << ((n / (a + b)) * a) + (n % (a + b));
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
DP_82();
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
#define deb(x) cerr << #x << ":" << x << "\n"
void DP_82() {
ll n, a, b;
cin >> n >> a >> b;
cout << ((n / (a + b)) * a) + min(n % (a + b), a);
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
DP_82();
return 0;
} | [["+", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 94 |
N, A, B = map(int, input().split())
out = N // (A + B) * A
rem = N % (A + B)
print(out + rem)
|
N, A, B = map(int, input().split())
out = N // (A + B) * A
rem = min(N % (A + B), A)
print(out + rem)
| [["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]] | 5 | 44 |
n,a,b=map(int,input().split())
kaisu = int(n // (a+b))
amari = int(n % (a + b))
ans = kaisu * a
if amari > b:
ans += b
else:
ans += amari
print(ans) | n,a,b=map(int,input().split())
kaisu = int(n // (a+b))
amari = int(n % (a + b))
ans = kaisu * a
if amari > a:
ans += a
else:
ans += amari
print(ans) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 22]] | 5 | 64 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long ans = n / (a + b) * a;
if (a != 0)
ans += n % (a + b);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long ans = n / (a + b) * a;
if (a != 0)
ans += min(a, n % (a + b));
cout << ans << endl;
} | [["+", 0, 57, 64, 1, 0, 11, 12, 2, 63, 22], ["+", 64, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 64, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 64, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 1 | 64 |
<?php
fscanf(STDIN, "%d %d %d", $N, $A, $B);
$numOfBlue = 0;
if ($A !== 0) {
$I = (int) $N / ($A + $B) ;
$J = $N % ( $A + $B );
if ($J > $A) {
$K = $A;
} else {
$K = $J;
}
$numOfBlue = $I * $A + $K;
}
echo $numOfBlue; | <?php
fscanf(STDIN, "%d %d %d", $N, $A, $B);
$numOfBlue = 0;
if ($A !== 0) {
$I = (int) floor($N / ($A + $B)) ;
$J = $N % ( $A + $B );
if ($J > $A) {
$K = $A;
} else {
$K = $J;
}
$numOfBlue = $I * $A + $K;
}
echo $numOfBlue; | [["+", 0, 1, 0, 11, 12, 74, 51, 613, 63, 141], ["+", 0, 11, 12, 74, 51, 613, 3, 3, 0, 24], ["+", 3, 3, 0, 28, 0, 16, 12, 23, 0, 25]] | 6 | 105 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (a + b == 0)
cout << 0 << endl;
else
cout << (((n) / (a + b)) * b + max((n % ((a + b))) - a, 0LL)) << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (a + b == 0)
cout << 0 << endl;
else
cout << (((n) / (a + b)) * a + min((n % ((a + b))), a)) << endl;
return 0;
} | [["-", 31, 16, 12, 23, 0, 16, 31, 16, 12, 22], ["+", 31, 16, 12, 23, 0, 16, 31, 16, 12, 22], ["-", 31, 16, 12, 23, 0, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 23, 0, 16, 12, 2, 63, 22], ["-", 0, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 16, 12, 2, 3, 4, 0, 16, 12, 22], ["-", 12, 23, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 12, 2... | 1 | 90 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINTVEC(x) \
for (int i = 0; i < (int)x.size(); i++) \
... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINTVEC(x) \
for (int i = 0; i < (int)x.size(); i++) \
... | [["-", 0, 1, 0, 11, 12, 2, 63, 343, 141, 22], ["+", 0, 1, 0, 11, 12, 2, 63, 343, 141, 22]] | 1 | 126 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, b, w, r;
cin >> n >> a >> b;
w = a * (n / a + b);
r = n % (a + b);
cout << w + min(r, a) << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b, w, r;
cin >> n >> a >> b;
w = a * (n / (a + b));
r = n % (a + b);
cout << w + min(r, a) << endl;
return 0;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 12, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["+", 12, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 69 |
n, a, b = map(int, input().split())
r = a+b
if n%r <= a:
print(n//r * a + n%r)
else:
print(n//r + a) | n, a, b = map(int, input().split())
r = a+b
if n%r <= a:
print(n//r * a + n%r)
else:
print(n//r * a + a) | [["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22]] | 5 | 52 |
#include <bits/stdc++.h>
using namespace std;
#include <string>
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0... | #include <bits/stdc++.h>
using namespace std;
#include <string>
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0... | [["+", 64, 9, 0, 1, 0, 16, 12, 2, 63, 22], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 25]] | 1 | 255 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N, A, B;
cin >> N;
cin >> A;
cin >> B;
cout << A * N / (A + B) + min(A, N % (A + B)) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N, A, B;
cin >> N;
cin >> A;
cin >> B;
cout << N / (A + B) * A + min(A, N % (A + B)) << 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 | 58 |
#include <iostream>
#define ll long long int
#define vi vector<ll>
#define ii pair<ll, ll>
#define iii pair<ii, ll>
#define iiii pair<ii, ii>
#define pb push_back
#define fi first
#define se second
using namespace std;
int t;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
ll n, a, b;
cin >> n >> a >> b;
ll a... | #include <iostream>
#define ll long long int
#define vi vector<ll>
#define ii pair<ll, ll>
#define iii pair<ii, ll>
#define iiii pair<ii, ii>
#define pb push_back
#define fi first
#define se second
using namespace std;
int t;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
ll n, a, b;
cin >> n >> a >> b;
ll a... | [["-", 0, 57, 64, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 2, 63, 22], ["-", 64, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 64, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]] | 1 | 148 |
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
LL n, a, b;
cin >> n >> a >> b;
LL sum = a + b;
LL res = n / sum;
res = res * a;
// cout<<res<<"\n";
// cout<<res%sum<<"\n";
res += n % sum;
cout << res;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
LL n, a, b;
cin >> n >> a >> b;
LL sum = a + b;
LL res = n / sum;
res = res * a;
// cout<<res<<"\n";
// cout<<res%sum<<"\n";
res += min(n % sum, a);
cout << res;
return 0;
} | [["+", 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 | 67 |
n, a, b = map(int,input().split())
tot = a + b
bcnt = (n // tot) * b
n -= (n // tot) * tot
bcnt += min(n,b)
print(bcnt)
| n, a, b = map(int,input().split())
tot = a + b
bcnt = (n // tot) * a
n -= (n // tot) * tot
bcnt += min(n,a)
print(bcnt)
| [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["-", 0, 1, 0, 677, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 677, 12, 652, 3, 4, 0, 22]] | 5 | 53 |
N,A,B = map(int,input().split())
s = N/(A+B)
a = N-(A+B)*s
print(int(A*s+a if A>a else A*(s+1))) | N,A,B = map(int,input().split())
s = int(N/(A+B))
a = N-(A+B)*s
print(int(A*s+a if A>a else A*(s+1))) | [["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 61 |
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
long long int N, A, B;
cin >> N >> A >> B;
long long int l = (N / (A + B));
long long int n = l * A;
long long int k = N % (A + B);
if (k < A) {
n += k;
} else {
n += A;
}
cout ... | #include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
long long int N, A, B;
cin >> N >> A >> B;
long long int l = (N / (A + B));
long long int n = l * A;
long long int k = N % (A + B);
if (k < A) {
n += k;
} else {
n += A;
}
cout ... | [["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 100 |
n, a, b = [int(i) for i in input().split()]
answer, amari = divmod(n, a+b)
answer *= a
print(answer + max(a, amari)) | n, a, b = [int(i) for i in input().split()]
answer, amari = divmod(n, a+b)
answer *= a
print(answer + min(a, amari)) | [["-", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22]] | 5 | 48 |
n, a, b = map(int,input().split())
x = int(n/(a+b)) #何周目か
y = n%(a+b)
if y > a:
ans = (x+1) * a
else:
x * a + y
print(ans) | n, a, b = map(int,input().split())
x = int(n/(a+b)) #何周目か
y = n%(a+b) #余り
if y > a:
ans = (x+1) * a
else:
ans = x * a + y
print(ans) | [["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32]] | 5 | 65 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B;
cin >> N >> A >> B;
if (A >= N) {
cout << A << endl;
}
else {
int n = N / (A + B);
if (N % (A + B) >= A) {
cout << n * A + A << endl;
} else {
cout << n * A + N % (A + B) << endl;
}
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long N, A, B;
cin >> N >> A >> B;
if (A >= N) {
cout << N << endl;
}
else {
long n = N / (A + B);
if (N % (A + B) >= A) {
cout << n * A + A << endl;
} else {
cout << n * A + N % (A + B) << endl;
}
}
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 57, 75, 76, 0, 9, 0, 43, 39, 40], ["+", 75, 76, 0, 9, 0, 43, 39, 86, 0, 96]] | 1 | 98 |
#include <bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define f first
#define s second
#define MOD 998244353
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
// cin.tie(0);
cout << fixed << setprecision(12);
// memset(dp,-1,sizeof(dp));
ll n, a, b, c... | #include <bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define f first
#define s second
#define MOD 998244353
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
// cin.tie(0);
cout << fixed << setprecision(12);
// memset(dp,-1,sizeof(dp));
ll n, a, b;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 93 |
#include <bits/stdc++.h>
#include <cfloat>
#include <climits>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <string>
#include <unordered_map>
using namespace std;
int main() {
long long int n, a, b;
cin >> n >> a >> b;
long long int ans = n / (a + b) * a ... | #include <bits/stdc++.h>
#include <cfloat>
#include <climits>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <string>
#include <unordered_map>
using namespace std;
int main() {
long long int n, a, b;
cin >> n >> a >> b;
long long int ans = n / (a + b) * a ... | [["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 21], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22]] | 1 | 79 |
n, a, b = map(int, input().split(' '))
print(int(n%(a+b))+int((n//(a+b))*a)) | n, a, b = map(int, input().split(' '))
print(min(int(n%(a+b)),a)+int((n//(a+b))*a)) | [["+", 0, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 22]] | 5 | 49 |
n, a, b = map(int, input().split(' '))
r = n//(a+b)
print(int(r*a+(n-r*(a+b)))) | n, a, b = map(int, input().split(' '))
r = n//(a+b)
print(int(r*a+min((n-r*(a+b),a)))) | [["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24], ["+", 0, 660, 0, 657, 12, 657, 12, 23, 0, 25], ["+", 0, 657, 12, 652, 3, 4, 0, 660, 0, 21], ["+", 0, 657, 12, 652, 3, 4, 0, 660, 0, 22]] | 5 | 51 |
x, b, r = [int(x) for x in input().split(' ')]
print((x // (b+r) * b) + min(x % (b+r),r))
| x, b, r = [int(x) for x in input().split(' ')]
print((x // (b+r) * b) + min(x % (b+r),b))
| [["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22]] | 5 | 52 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, c;
long long int x, y;
cin >> a >> b >> c;
x = a / (b + c) * b;
y = a % (b + c);
x += min(y, a);
cout << x;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, c;
long long int x, y;
cin >> a >> b >> c;
x = a / (b + c) * b;
y = a % (b + c);
x += min(y, b);
cout << x;
} | [["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 71 |
n,a,b=map(int,input().split())
x=n//(a+b)
if (a+b)*x<=a:
t=n-x*(a+b)
else:
t=a
print(a*x+t)
| n,a,b=map(int,input().split())
x=n//(a+b)
if n-(a+b)*x<=a:
t=n-x*(a+b)
else:
t=a
print(a*x+t)
| [["+", 0, 656, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33]] | 5 | 62 |
N, A, B = map(int, input().split())
cy = N // (A + B)
cynum = N % (A + B)
tmpans = cy * A
#print(cy)
#print(cynum)
#print(tmpans)
if 0 <= cynum and cynum < A:
ans = cynum + tmpans
else:
ans = cynum + A
print(ans) | N, A, B = map(int, input().split())
cy = N // (A + B)
cynum = N % (A + B)
tmpans = cy * A
#print(cy)
#print(cynum)
#print(tmpans)
if 0 <= cynum and cynum < A:
ans = cynum + tmpans
else:
ans = tmpans + A
print(ans) | [["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22]] | 5 | 69 |
n , a , b= list(map(int,input().split()))
s = n//(a+b)
t = n% (a+b)
if t>=a:
print(a*s+a)
if t<=a:
print(a*s+t) | n , a , b= list(map(int,input().split()))
s = n//(a+b)
t = n% (a+b)
if t>a:
print(a*s+a)
if t<=a:
print(a*s+t)
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]] | 5 | 65 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
long long int n;
long long int a;
long long int b;
long long total = 0;
scanf("%lld %lld %lld", &n, &a, &b);
long long sum = a + b; // 赤と青のボールの個数
long long dif = n / sum; // 前からn個にsum(=赤と青)が何個分フルに入るか
long long ... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
long long int n;
long long int a;
long long int b;
long long total = 0;
scanf("%lld %lld %lld", &n, &a, &b);
long long sum = a + b; // 赤と青のボールの個数
long long dif = n / sum; // 前からn個にsum(=赤と青)が何個分フルに入るか
long long ... | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22]] | 0 | 119 |
n, a, b = map(int, input().split())
if a==0:
print(0)
else:
s= n//(a+b)
sn = n%(a+b)
if sn > a:
print (s*a+a)
else:
print (s*a+a-sn)
|
n, a, b = map(int, input().split())
if a==0:
print(0)
else:
s= n//(a+b)
sn = n%(a+b)
if sn > a:
print (s*a+a)
else:
print (s*a+sn)
| [["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 72 |
a,b,n = map(int, input().split())
if a==0 and b==0:
print(0)
else:
set = n//(a+b)
rem = n % (a+b)
if rem >= a:
print( set * a + a)
else:
print( set * a + rem) | n,a,b = map(int, input().split())
if a==0 and b==0:
print(0)
else:
set = n//(a+b)
rem = n % (a+b)
if rem >= a:
print( set * a + a)
else:
print( set * a + rem) | [["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22]] | 5 | 74 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, R, B;
// scanf("%ld %ld %ld",&N,&B,&R);
cin >> N >> B >> R;
long long res = B * (N / (B + R));
if (R == 0)
cout << "0\n";
else {
long long r = N % (B + R);
if (r <= B) {
cout << res + r << "\n";
} else {
cout... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, R, B;
// scanf("%ld %ld %ld",&N,&B,&R);
cin >> N >> B >> R;
long long res = B * (N / (B + R));
if (B == 0)
cout << "0\n";
else {
long long r = N % (B + R);
if (r <= B) {
cout << res + r << "\n";
} else {
cout... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]] | 1 | 107 |
/*
ID: hn.csxs1
TASK: test
LANG: C++
*/
#include <bits/stdc++.h>
#define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__)
#define File(x) \
freopen(x ".in", "r", stdin); \
freopen(x "... | #include <bits/stdc++.h>
#define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__)
#define File(x) \
freopen(x ".in", "r", stdin); \
freopen(x ".out", "w", stdout)
using namespace std... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22]] | 1 | 321 |
from sys import stdin
def main():
N, A, B = map(int,input().split())
k = N/(A+B)
val = k*A+ min(A, N-k*(A+B))
print(int(val))
if __name__ == "__main__":
main() | from sys import stdin
def main():
N, A, B = map(int,input().split())
k = int(N/(A+B))
val = k*A+ min(A, N-k*(A+B))
print(int(val))
if __name__ == "__main__":
main() | [["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 73 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
if (a == 0 and b == 0)
cout << 0 << endl;
else {
int64_t ans1 = n / (a + b) * a;
int64_t ans2;
if (n % (a + b) - a <= 0)
ans2 = 0;
else
ans2 = n % (a + b);
cout << ans1 + ans2 << ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
if (a == 0 and b == 0)
cout << 0 << endl;
else {
int64_t ans1 = n / (a + b) * a;
int64_t ans2;
if (n % (a + b) >= a)
ans2 = a;
else
ans2 = n % (a + b);
cout << ans1 + ans2 << endl... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 0, 9, 0, 57, 64, 1, 0, 11, 12, 22]] | 1 | 99 |
N,A,B = list(map(int,input().split()))
ans = A*N//(A+B)
if N%(A+B)>=A:
ans+=A
else: ans+=N%(A+B)
print(ans) | import math
N,A,B = list(map(int,input().split()))
ans = A*(N//(A+B))
if N%(A+B)>=A:
ans+=A
else: ans+=N%(A+B)
print(ans) | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 12, 657, 12, 23, 0, 657, 12, 23, 0, 25]] | 5 | 61 |
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a... | #include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a... | [["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 139 |
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
ll n, a, b;
int main() {
scanf("%lld %lld %lld", &n, &a, &b);
ll ans = n / (a + b) * a + n % (a + b);
printf("%lld", ans);
return 0;
}
| #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
ll n, a, b;
int main() {
scanf("%lld %lld %lld", &n, &a, &b);
ll ans = n / (a + b) * a + min(a, n % (a + b));
printf("%lld", ans);
return 0;
}
| [["+", 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 | 77 |
n, a, b = map(int, input().split())
ans = n // (a+b) * n
tmp = n % (a+b)
ans += min(a, tmp)
print(ans) | n, a, b = map(int, input().split())
ans = n // (a+b) * a
tmp = n % (a+b)
ans += min(a, tmp)
print(ans)
| [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 50 |
#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(a, (n % (a + b)));
} | #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(a, (n % (a + b)));
} | [["-", 0, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 16, 31, 16, 12, 23, 0, 24]] | 1 | 59 |
import java.util.*;
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();
System.out.println((n / (a + b)) * a + (((n % (a + b)) > a) ? a : n));
}
}
| import java.util.*;
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();
System.out.println((n / (a + b)) * a +
(((n % (a + b)) > a) ? a : n % (a + b)));
}
}
| [["+", 0, 16, 12, 23, 0, 510, 75, 16, 17, 109], ["+", 12, 23, 0, 510, 75, 16, 12, 23, 0, 24], ["+", 0, 510, 75, 16, 12, 23, 0, 16, 31, 22], ["+", 0, 510, 75, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 510, 75, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 23, 0, 510, 75, 16, 12, 23, 0, 25]] | 3 | 100 |
n,a,b = map(int,input().split())
c = n//(a+b)
d = n % (a+b)
if d > a:
ans = c * (a+1)
else:
ans = c * a + d
print(ans) | n,a,b = map(int,input().split())
c = n//(a+b)
d = n % (a+b)
if d > a:
ans = a * (c+1)
else:
ans = c * a + d
print(ans) | [["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22]] | 5 | 63 |
#include <bits/stdc++.h>
using namespace std;
long long count_balls(long long N, long long A, long long B) {
return A * (N / (A + B)) + (N % (A + B));
}
int main() {
long long N, A, B;
cin >> N >> A >> B;
cout << count_balls(N, A, B);
return 0;
} | #include <bits/stdc++.h>
using namespace std;
long long count_balls(long long N, long long A, long long B) {
return A * (N / (A + B)) + min(A, N % (A + B));
}
int main() {
long long N, A, B;
cin >> N >> A >> B;
cout << count_balls(N, A, B);
return 0;
} | [["+", 8, 9, 0, 37, 0, 16, 12, 2, 63, 22], ["+", 0, 37, 0, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 37, 0, 16, 12, 2, 3, 4, 0, 21]] | 1 | 83 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int N;
cin >> N;
long long int A;
cin >> A;
long long int B;
cin >> B;
if (N % (A + B) <= A) {
cout << N / (A + B) * A + N % (A + B) << endl;
}
else {
cout << N / (A + B) * A << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long int N;
cin >> N;
long long int A;
cin >> A;
long long int B;
cin >> B;
if (N % (A + B) <= A) {
cout << N / (A + B) * A + N % (A + B) << endl;
}
else {
cout << N / (A + B) * A + A << endl;
}
}
| [["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 92 |
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <unordered_map>
#include <vector>... | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <unordered_map>
#include <vector>... | [["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 21], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22]] | 1 | 321 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long ans = a * n / (a + b);
long long c = n % (a + b);
ans += min(a, c);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long ans = n / (a + b) * a;
long long c = n % (a + b);
ans += min(a, c);
cout << ans << endl;
} | [["-", 0, 43, 49, 50, 51, 16, 31, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]] | 1 | 69 |
# -*- coding: utf-8 -*-
import sys
def prob_b(n, a, b):
x = int(n / (a + b)) * a
y = n % (a + b)
print(x+y)
if __name__ == '__main__':
#args = sys.argv
#n = args[1]
#a = args[2]
#b = args[3]
n, a, b = map(int, input().split())
prob_b(n,a,b)
| # -*- coding: utf-8 -*-
import sys
def prob_b(n, a, b):
x = int(n / (a + b)) * a
y = min(n % (a + b), a)
print(x+y)
if __name__ == '__main__':
#args = sys.argv
#n = args[1]
#a = args[2]
#b = args[3]
n, a, b = map(int, input().split())
prob_b(n,a,b)
| [["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]] | 5 | 79 |
N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<A:
print(x*A+y)
else:
print(x*a+a) | N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<A:
print(x*A+y)
else:
print(x*A+A) | [["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 59 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Long n, a, b, ans;
n = sc.nextLong();
a = sc.nextLong();
b = sc.nextLong();
if (a * b != 0) {
ans = n / (a + b);
n %= a + b;
ans *= a;
if (n < a... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n, a, b, ans;
n = sc.nextLong();
a = sc.nextLong();
b = sc.nextLong();
if (a + b != 0) {
ans = n / (a + b);
n %= a + b;
ans *= a;
if (n < a... | [["-", 8, 498, 0, 195, 8, 196, 0, 503, 39, 78], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 57, 15, 15, 0, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 17, 72]] | 3 | 142 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long n, a, b;
cin >> n >> a >> b;
long m = a + b;
long r = n % m;
long ans = (a / m) * a + min(r, a);
cout << ans;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long n, a, b;
cin >> n >> a >> b;
long m = a + b;
long r = n % m;
long ans = (n / m) * a + min(r, a);
cout << ans;
return 0;
} | [["-", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22]] | 1 | 66 |
n,a,b=map(int,input().split())
a*(n//(a+b))+min(n%(a+b),a) | n,a,b=map(int,input().split())
print(a*(n//(a+b))+min(n%(a+b),a)) | [["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25]] | 5 | 42 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long count = n / (a + b);
int remainder = n % (a + b);
long long ans = a * count;
if (remainder < a)
ans += remainder;
else
ans += a;
cout << ans << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long count = n / (a + b);
long long remainder = n % (a + b);
long long ans = a * count;
if (remainder < a)
ans += remainder;
else
ans += a;
cout << ans;
return 0;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 12, 103, 0, 104], ["-", 8, 9, 0, 1, 0, 16, 12, 103, 0, 44]] | 1 | 85 |
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int, int>
#define pll pair<long long, long long>
using namespace std;
ll n, a, b, ans, k;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n >> a >> b;... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int, int>
#define pll pair<long long, long long>
using namespace std;
ll n, a, b, ans, k;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n >> a >> b;... | [["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85]] | 1 | 108 |
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5;
const int INF = 1e9 + 1e5 + 2;
const int mod = 1e9 + 7;
#define eps 1e-15
typedef long long ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (a == 0) {
cout << 0;
return 0;
}
ll x = a + b;
ll y = n % x;
ll ans = a * (n / x) ... | #include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5;
const int INF = 1e9 + 1e5 + 2;
const int mod = 1e9 + 7;
#define eps 1e-15
typedef long long ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (a == 0) {
cout << 0;
return 0;
}
ll x = a + b;
ll y = n % x;
ll ans = a * (n / x) ... | [["+", 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, 21], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 25]] | 1 | 105 |
n, a, b = map(int, input().split())
p, q = divmod(n, a+b)
print(p*(a+b)-p*b+ (q if q <= a else 0))
| n, a, b = map(int, input().split())
p, q = divmod(n, a+b)
print(p*(a+b)-p*b + (q if q <= a else a))
| [["-", 3, 4, 0, 657, 12, 23, 0, 41, 0, 612], ["+", 3, 4, 0, 657, 12, 23, 0, 41, 0, 22]] | 5 | 54 |
#include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define deb1(... | #include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define deb1(... | [["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 117 |
#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
const int INF = 1e9;
const int MXN = 0;
const int MXV = 0;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FOR(i, L, R) for (int i = L; i !... | #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
const int INF = 1e9;
const int MXN = 0;
const int MXV = 0;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FOR(i, L, R) for (int i = L; i !... | [["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 149 |
n,a,b=map(int,input().split())
import math
x=math.floor(n/(a+b))
print(x*a+max(a,n-x*(a+b))) | n,a,b=map(int,input().split())
import math
x=math.floor(n/(a+b))
print(x*a+min(a,n-x*(a+b))) | [["-", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22]] | 5 | 55 |
#include <cmath>
#include <iostream>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long a = N / (A + B);
long long b = N % (A + B);
long long c;
if (b >= A) {
c = A;
} else {
c = b;
}
cout << (a * A) + b << endl;
return 0;
} | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long a = N / (A + B);
long long b = N % (A + B);
long long c;
if (b >= A) {
c = A;
} else {
c = b;
}
cout << (a * A) + c << endl;
return 0;
} | [["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 92 |
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define le length()
#define mp make_pair
#define mt make_tuple
#define fi
#define se second
#define forz(i... | #include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define le length()
#define mp make_pair
#define mt make_tuple
#define fi
#define se second
#define forz(i... | [["+", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48]] | 1 | 185 |
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools
logging.basi... | from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools
logging.basi... | [["+", 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, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 113 |
n, a, b = gets.split.map(&:to_i)
ans = a * n / (a + b)
frac = n % (a + b) >= a ? a : n % (a + b)
puts ans + frac
| n, a, b = gets.split.map(&:to_i)
ans = a * (n / (a + b))
frac = n % (a + b) >= a ? a : n % (a + b)
puts ans + frac
| [["+", 0, 493, 0, 662, 12, 738, 12, 739, 0, 24], ["+", 12, 738, 12, 739, 0, 738, 12, 739, 0, 25]] | 4 | 51 |
n, a, b = gets.split.map(&:to_i)
ans = a * n / (a + b)
frac = [n % (a + b), a].min
puts ans + frac
| n, a, b = gets.split.map(&:to_i)
ans = a * (n / (a + b))
frac = [n % (a + b), a].min
puts ans + frac
| [["+", 0, 493, 0, 662, 12, 738, 12, 739, 0, 24], ["+", 12, 738, 12, 739, 0, 738, 12, 739, 0, 25]] | 4 | 45 |
n, a, b = gets.split.map(&:to_i)
tries = (n / (a + b))
ans = tries * a
puts ans + n % (a + b)
| n, a, b = gets.split.map(&:to_i)
tries = (n / (a + b))
ans = tries * a
puts ans + [n % (a + b), a].min | [["+", 3, 4, 0, 738, 12, 652, 486, 516, 0, 70], ["+", 3, 4, 0, 738, 12, 652, 486, 516, 0, 21], ["+", 3, 4, 0, 738, 12, 652, 486, 516, 0, 22], ["+", 3, 4, 0, 738, 12, 652, 486, 516, 0, 73], ["+", 0, 652, 3, 4, 0, 738, 12, 652, 17, 131], ["+", 0, 652, 3, 4, 0, 738, 12, 652, 735, 22]] | 4 | 41 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
cout << a * (n / (a + b)) + max(n % (a + b), a);
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n, a, b;
cin >> n >> a >> b;
cout << a * (n / (a + b)) + min(n % (a + b), a);
}
| [["-", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22]] | 1 | 60 |
n, a, b = map(int, input().split(' '))
div, mod = divmod(n, a+b)
ans = div*a+(mod if mod < b else b)
print(ans) | n, a, b = map(int, input().split(' '))
div, mod = divmod(n, a+b)
ans = div*a+(mod if mod < a else a)
print(ans) | [["-", 12, 657, 12, 23, 0, 41, 0, 666, 0, 22], ["+", 12, 657, 12, 23, 0, 41, 0, 666, 0, 22], ["-", 0, 662, 12, 657, 12, 23, 0, 41, 0, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 41, 0, 22]] | 5 | 52 |
N, A, B = map(int, input().split())
phrase = A + B
ans = N // phrase * A
ans += N % phrase if N % phrase <= A else 0
print(ans)
| N, A, B = map(int, input().split())
phrase = A + B
ans = N // phrase * A
ans += N % phrase if N % phrase <= A else A
print(ans)
| [["-", 0, 656, 0, 1, 0, 677, 12, 41, 0, 612], ["+", 0, 656, 0, 1, 0, 677, 12, 41, 0, 22]] | 5 | 47 |
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
#define Fast \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr); \
cout... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
#define Fast \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr); \
cout... | [["+", 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, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]] | 1 | 89 |
a = list(map(int, input().split()))
N = a[0]
A = a[1]
B = a[2]
count = 0
i = N % (A + B)
j = N //(A + B)
if i >= A:
i == A
count = j * A + i
print(count) | a = list(map(int, input().split()))
N = a[0]
A = a[1]
B = a[2]
count = 0
i = N % (A + B)
j = N //(A + B)
if i >= A:
i = A
count = j * A + i
print(count) | [["-", 0, 57, 64, 196, 0, 1, 0, 666, 667, 60], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32]] | 5 | 75 |
n,a,b=map(int,input().split())
s=n//(a+b)
ans1=a*s
rem=n%(a+b)
if rem>=a:
print(ans1+a)
else:
print(ans1+a-rem)
| n,a,b=map(int,input().split())
s=n//(a+b)
ans1=a*s
rem=n%(a+b)
if rem>=a:
print(ans1+a)
else:
print(ans1+rem) | [["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 62 |
// Catchharsh
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | // Catchharsh
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | [["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 0, 11, 12, 2, 3, 4, 0, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 222 |
#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 ll long long
#define int ll
#define For(a, b, c) for (int a = b; a <= c; ++a)
#define Ford(a, b, c) for (int a = b; a >= c; --a)
#define All(a, b) for (auto &a ... | #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 ll long long
#define int ll
#define For(a, b, c) for (int a = b; a <= c; ++a)
#define Ford(a, b, c) for (int a = b; a >= c; --a)
#define All(a, b) for (auto &a ... | [["-", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 17, 72], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 12, 22], ["-", 0, 43, 49, 50, 51, 16, 12, 23, 0, 25]] | 1 | 325 |
import sys
n,a,b=(int(x) for x in input().split())
j=0
c=a+b
q, mod=divmod(n,c)
A=q*a+mod
print(A)
| import sys
n,a,b=(int(x) for x in input().split())
j=0
c=a+b
q, mod=divmod(n,c)
A=q*a+min(mod,a)
print(A) | [["+", 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 | 53 |
#include <bits/stdc++.h>
using namespace std;
int main() {
#define ll long long int
ll n, a, b;
cin >> n >> a >> b;
ll ans = n / (a + b);
if (n % (a + b) >= a)
ans += a;
else
ans += (n % (a + b));
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
#define ll long long int
ll n, a, b;
cin >> n >> a >> b;
ll ans = (n / (a + b)) * a;
if (n % (a + b) >= a)
ans += a;
else
ans += (n % (a + b));
cout << ans << endl;
} | [["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 48], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]] | 1 | 76 |
n,a,b=map(int,input().split())
sho=n//(a+b)
amari=n%(a+b)
if amari > 3:
ex=3
else:
ex=amari
blue=a*sho+ex
print(blue) | n,a,b=map(int,input().split())
sho=n//(a+b)
amari=n%(a+b)
if amari > a:
ex=a
else:
ex=amari
blue=a*sho+ex
print(blue) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22]] | 5 | 60 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long n, a, b;
cin >> n >> a >> b;
cout << n / (a + b) * a + max(n % (a + b), a);
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long n, a, b;
cin >> n >> a >> b;
cout << n / (a + b) * a + min(n % (a + b), a);
} | [["-", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22]] | 1 | 52 |
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <functional>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
ll N, A, B;
int main() {
scanf("%lld%lld%lld", &N, &A, &B);... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <functional>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
ll N, A, B;
int main() {
scanf("%lld%lld%lld", &N, &A, &B);... | [["-", 3, 4, 0, 16, 31, 16, 31, 16, 31, 22], ["-", 3, 4, 0, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 22]] | 1 | 97 |
N, A, B = map(int, input().split())
amari = N % (A+B)
sho = N // (A+B)
blue_num = 0
if amari <= B:
blue_num += A * sho + amari
else:
blue_num += A * sho + B
print(blue_num) | import sys
N, A, B = map(int, input().split())
amari = N % (A+B)
sho = N // (A+B)
blue_num = 0
if amari <= A:
blue_num += A * sho + amari
else:
blue_num += A * sho + A
print(blue_num) | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 8, 196, 0, 1, 0, 677, 12, 657, 12, 22], ["+", 8, 196, 0, 1, 0, 677, 12, 657, 12, 22]] | 5 | 64 |
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 2e7 + 9, M = 1e7, OO = 0x3f3f3f3f;
#define AC \
ios::sync_with_stdio(0); ... | #include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 2e7 + 9, M = 1e7, OO = 0x3f3f3f3f;
#define AC \
ios::sync_with_stdio(0); ... | [["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 22]] | 1 | 135 |
N, A, B= map(int, input().split())
re += N//(A+B) *A
re += min(N%(A+B),A)
print(re) | N, A, B = map(int, input().split())
result = 0
result += N // (A + B) * A
result += min(N % (A + B), A)
print(result) | [["-", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 47 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
if (n % (a + b) > a) {
cout << a * (n / (a + b));
} else {
cout << (a * (n / (a + b)) + n % (a + b));
}
cout << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
if (n % (a + b) > a) {
cout << a * (n / (a + b)) + a;
} else {
cout << (a * (n / (a + b)) + n % (a + b));
}
cout << endl;
return 0;
}
| [["+", 64, 9, 0, 1, 0, 16, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 12, 22]] | 1 | 90 |
# A = [list(map(int, input().split())) for _ in range(3)]
# n = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
n, b, r = map(int, input().split())
total = b+r
circle = total//n
diff = n % total
if b < diff:
print(diff + circle*b)
else:
print(b + circle*b)
| # A = [list(map(int, input().split())) for _ in range(3)]
# n = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
n, b, r = map(int, input().split())
total = b+r
circle = n//total
diff = n % total
if b <= diff:
print(b + circle*b)
else:
print(diff + circle*b)
| [["-", 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], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 31,... | 5 | 60 |
x, b, r = map(int, input().split())
k=x/(b+r)
print(k*b+min(x%(b+r), b)) | x, b, r = map(int, input().split())
k=int(x/(b+r))
print(k*b+min(x%(b+r), b)) | [["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 46 |
N,A,B=map(int,input().split)
ans=N//(A+B)*A
rem=N%(A+B)
ans=ans+min(rem,A)
print(ans) | N,A,B=map(int,input().split())
ans=(N//(A+B))*A
rem=N%(A+B)
ans=ans+min(rem,A)
print(ans)
| [["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 12, 657, 31, 23, 0, 657, 12, 23, 0, 25]] | 5 | 50 |
package main
import (
"fmt"
)
func main() {
var N, A, B int
fmt.Scan(&N, &A, &B)
ans := A * N / (A + B)
if (N%(A+B)) < A {
ans += N % (A + B)
} else {
ans += A
}
fmt.Println(ans)
}
| package main
import (
"fmt"
)
func main() {
var N, A, B int
fmt.Scan(&N, &A, &B)
ans := A * (N / (A + B))
if (N%(A+B)) < A {
ans += N % (A + B)
} else {
ans += A
}
fmt.Println(ans)
}
| [["+", 0, 431, 12, 432, 0, 16, 12, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 7 | 91 |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define abdelrahman010 \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
typedef lo... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define abdelrahman010 \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
typedef lo... | [["+", 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 | 72 |
import math
N, A, B = map(int, input().split())
QUO = math.floor(N / (A + B))
if N - (A + B) < A:
print(QUO * A + N - (A + B))
else:
print(QUO * A + A)
| import math
N, A, B = map(int, input().split())
QUO = math.floor(N / (A + B))
if N - (A + B) * QUO < A:
print(QUO * A + N - (A + B) * QUO)
else:
print(QUO * A + A)
| [["+", 0, 57, 15, 666, 0, 657, 12, 657, 17, 48], ["+", 0, 57, 15, 666, 0, 657, 12, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 48], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 12, 22]] | 5 | 69 |
n,a,b=map(int,input().split())
print((n//(a+b))*a + min((n-(a+b)),a)) | n,a,b=map(int,input().split())
print((n//(a+b))*a + min(n%(a+b),a)) | [["-", 0, 657, 12, 652, 3, 4, 0, 23, 0, 24], ["-", 12, 652, 3, 4, 0, 23, 0, 657, 17, 33], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 17, 109], ["-", 3, 4, 0, 23, 0, 657, 12, 23, 0, 25]] | 5 | 47 |
n, a, b = gets.rstrip.split(" ").map { |str| str.to_i }
puts (n.div(a+b)*a) + (n%(a+b)*a) | n, a, b = gets.rstrip.split(" ").map { |str| str.to_i }
puts (n.div(a+b)*a) + [n%(a+b), a].min | [["-", 0, 652, 3, 4, 0, 738, 12, 739, 0, 24], ["+", 3, 4, 0, 738, 12, 652, 486, 516, 0, 70], ["-", 12, 739, 0, 652, 3, 4, 0, 738, 17, 48], ["+", 12, 652, 486, 516, 0, 652, 3, 4, 0, 21], ["-", 0, 652, 3, 4, 0, 738, 12, 739, 0, 25], ["+", 3, 4, 0, 738, 12, 652, 486, 516, 0, 73], ["+", 0, 652, 3, 4, 0, 738, 12, 652, 17, 1... | 4 | 48 |
package main
import (
"fmt"
)
func main() {
var n, a, b, surplus, times int
fmt.Scan(&n, &a, &b)
surplus = n % (a+b)
times = n / (a+b)
if a == 0 {
fmt.Println(0);
} else if a > surplus {
fmt.Println(surplus + a*times)
} else {
fmt.Println(a*times)
}
} | package main
import (
"fmt"
)
func main() {
var n, a, b, surplus, times int
fmt.Scan(&n, &a, &b)
surplus = n % (a+b)
times = n / (a+b)
if a == 0 {
fmt.Println(0);
} else if a > surplus {
fmt.Println(surplus + a*times)
} else {
fmt.Println(a*times + a)
}
} | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]] | 7 | 107 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
using namespace ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <typeinfo>
#include <utility>
#include <vector>
using namespace ... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]] | 1 | 306 |
# coding:utf-8
from math import ceil
import numpy as np
strInput = input()
N, A, B = np.array(strInput.split(' ')).astype(int)
numGroup = floor(N / (A + B))
numExtendBall = N % (A + B)
if numExtendBall >= A:
numExtendBlueBall = A
else:
numExtendBlueBall = numExtendBall
print(numGroup * A + numExtendBlueBall... | # coding:utf-8
from math import floor
import numpy as np
strInput = input()
N, A, B = np.array(strInput.split(' ')).astype(int)
numGroup = floor(N / (A + B))
numExtendBall = N % (A + B)
if numExtendBall >= A:
numExtendBlueBall = A
else:
numExtendBlueBall = numExtendBall
print(numGroup * A + numExtendBlueBal... | [["-", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22]] | 5 | 80 |
#include <bits/stdc++.h>
#define int long long
#define ld long double
#define endl '\n'
const int mod = 1e9 + 7;
const int inf = 1e17 + 10;
#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#define si(a) a.size()
#define pii pair<int, int>
using namespace std;
//#if !defined(ONLINE... | #include <bits/stdc++.h>
#define int long long
#define ld long double
#define endl '\n'
const int mod = 1e9 + 7;
const int inf = 1e17 + 10;
#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#define si(a) a.size()
#define pii pair<int, int>
using namespace std;
//#if !defined(ONLINE... | [["+", 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 | 135 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
cout << (n / (a + b)) * a + max((long long)0, (n % (a + b))) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
cout << (n / (a + b)) * a + min(a, (n % (a + b))) << endl;
} | [["-", 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, 2, 63, 22], ["-", 3, 4, 0, 74, 39, 77, 39, 86, 0, 96], ["-", 12, 16, 12, 2, 3, 4, 0, 74, 0, 25], ["-", 12, 16, 12, 2, 3, 4, 0, 74, 51, 13], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 63 |
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
const int maxn = 1e5 + 5;
long long N, A, B;
int main() {
#define LOCAL
#ifdef LOCAL
freopen("in.tx... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
const int maxn = 1e5 + 5;
long long N, A, B;
int main() {
//#define LOCAL
#ifdef LOCAL
freopen("in.... | [["-", 0, 30, 0, 14, 8, 9, 0, 58, 0, 148], ["-", 0, 30, 0, 14, 8, 9, 0, 58, 141, 22]] | 1 | 183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.