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 = gets.chomp.split(' ').map(&:to_i)
sum = a + b
remai = n % sum
set = (n - remai) / sum
blue = [a,remai].min
puts = a * remai + blue | n,a,b = gets.chomp.split(" ").map(&:to_i)
sum = a + b
remai = n % sum
set = (n - remai) / sum
blue = [a,remai].min
puts a * set + blue
| [["-", 12, 652, 486, 652, 3, 4, 0, 557, 0, 62], ["+", 12, 652, 486, 652, 3, 4, 0, 557, 0, 62], ["-", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["-", 0, 493, 0, 662, 12, 738, 31, 738, 12, 22], ["+", 0, 652, 3, 4, 0, 738, 31, 738, 12, 22]] | 4 | 57 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 109], ["-", 64, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["-", 64, 1, 0, 11, 12, 16, 12, 16, 12, 22]] | 1 | 3,866 |
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {... | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {... | [["+", 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 | 128 |
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))
n, a, b = map(int, input().split())
if (a == 0):
print (0)
exit()
ans = n // (a+b) * 3
amari = n % (a+b)
if (amari <= a):
ans += amari
else:
ans +=a
print (ans)
| #k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))
n, a, b = map(int, input().split())
if (a == 0):
print (0)
exit()
ans = n // (a+b) * a
amari = n % (a+b)
if (amari <= a):
ans += amari
else:
ans +=a
print (ans)
| [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 75 |
s = input()
n, a, b = s.split(' ')
n = int(n)
a = int(a)
b = int(b)
na = n / (a+b) * a
if n % (a+b) >= a :
na += a
else:
na += n % (a+b)
print(na) | s = input()
n, a, b = s.split(' ')
n = int(n)
a = int(a)
b = int(b)
na = n // (a+b) * a
if n % (a+b) >= a:
na += a
else:
na += (n % (a + b))
print(na) | [["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 85], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676], ["+", 8, 196, 0, 1, 0, 677, 12, 23, 0, 24], ["+", 0, 677, 12, 23, 0, 657, 12, 23, 0, 25]] | 5 | 77 |
# -*= coding: utf-8 -*-
N, A, B = map(int, input().split())
if A == 0:
print(0)
exit()
x = N // (A+B)
x = x * A
y = N % (A+B)
if y >= 3:
y = A
print(x + y) | # -*= coding: utf-8 -*-
N, A, B = map(int, input().split())
if A == 0:
print(0)
exit()
x = N // (A+B)
x = x * A
y = N % (A+B)
if y >= A:
y = A
print(x + y) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]] | 5 | 68 |
#include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long int, long long int> a,
pair<long long int, long long int> b) {
if (a.first == b.first) {
if (a.second <= b.second)
return true;
else
return false;
}
if (a.first > b.first)
return true;
else
return false;... | #include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long int, long long int> a,
pair<long long int, long long int> b) {
if (a.first == b.first) {
if (a.second <= b.second)
return true;
else
return false;
}
if (a.first > b.first)
return true;
else
return false;... | [["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 220 |
n, a, b = map(int, input().split())
ret = 0
ret += a*n//(a+b)
rem = n%(a+b)
ret += min(rem, a)
print(ret) | n, a, b = map(int, input().split())
ret = 0
ret += a*(n//(a+b))
rem = n%(a+b)
ret += min(rem, a)
print(ret) | [["+", 0, 1, 0, 677, 12, 657, 12, 23, 0, 24], ["+", 12, 657, 12, 23, 0, 657, 12, 23, 0, 25]] | 5 | 53 |
a,b,c=map(int,input().split())
n = a // (b+c)
m = a - (b+c)*n
res = n*b
if b < m:
res += m
else:
res += b
print(res) | a,b,c=map(int,input().split())
n = a // (b+c)
m = a - (b+c)*n
res = n*b
if m < b:
res += m
else:
res += b
print(res) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]] | 5 | 60 |
n,b,r=map(int,input().split());print((n//(b+r))*b+n%(b+r)) | n,b,r=map(int,input().split());print((n//(b+r))*b+min(b,n%(b+r))) | [["+", 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 | 41 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x, ll y) {
if (y == 0)
return x;
else
return GCD(y, x % y);
}
int main() {
ll N, A, B;
cin >> N >> A >> B;
ll sum = (N / (A + B)) * A;
N -= (A + B);
if (N <= A) {
sum += N;
} else {
sum += A;
}
cout << su... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x, ll y) {
if (y == 0)
return x;
else
return GCD(y, x % y);
}
int main() {
ll N, A, B;
cin >> N >> A >> B;
ll sum = (N / (A + B)) * A;
N %= (A + B);
if (N <= A) {
sum += N;
} else {
sum += A;
}
cout << su... | [["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132]] | 1 | 111 |
n,a,b=map(int,input().split())
i=n%(a+b)
print(i)
if i>a:
print(a*(n//(a+b))+a)
else:
print(a*(n//(a+b))+i) | n,a,b=map(int,input().split())
i=n%(a+b)
if i>a:
print(a*(n//(a+b))+a)
else:
print(a*(n//(a+b))+i) | [["-", 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 | 70 |
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ins insert
#define eb emplace_back
#define endl '\n'
#define ll long long
#define ld long double
#define vl vector<ll>
#define tc \
ll t; ... | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ins insert
#define eb emplace_back
#define endl '\n'
#define ll long long
#define ld long double
#define vl vector<ll>
#define tc \
ll t; ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 166 |
n,a,b = map(int,input().split())
c = n // (a + b)
d = n % (a + b)
if d - a < 0:
print((c * a) + d)
else:
print((c * a) + (d - a)) | n,a,b = map(int,input().split())
c = n // (a + b)
d = n % (a + b)
if d - a < 0:
print((c * a) + d)
else:
print((c * 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], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 69 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long N, A, B;
cin >> N >> A >> B;
long ans = 0;
ans += A * (N / (A + B));
N %= (A + B);
cout << min(N, A) << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long N, A, B;
cin >> N >> A >> B;
long ans = 0;
ans += A * (N / (A + B));
N %= (A + B);
cout << ans + min(N, A) << "\n";
} | [["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72]] | 1 | 67 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long N, A, B;
cin >> N >> A >> B;
cout << N / (A + B) + min(A, N % (A + B)) << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long N, A, B;
cin >> N >> A >> B;
cout << N / (A + B) * A + min(A, N % (A + B)) << "\n";
} | [["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22]] | 1 | 54 |
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
struct IoSetup {
IoSetup() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
cerr << fixed << setprecision(10);
}
} iosetup;
in... | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
struct IoSetup {
IoSetup() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
cerr << fixed << setprecision(10);
}
} iosetup;
in... | [["+", 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 | 117 |
N,A,B=map(int,input().split())
t=N//(A+B)
s=N%(A+B)
ans = t*A + s
print(ans) | N,A,B=map(int,input().split())
t=N//(A+B)
s=N%(A+B)
ans = t*A + min(s,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 | 47 |
n,a,b=map(int,input().split())
x=n//(a+b)
y=n-(a+b)*x
ans=a*x
if y>=(a+b):
ans+=a
else:
ans+=y
print(ans) | n,a,b=map(int,input().split())
x=n//(a+b)
y=n-(a+b)*x
ans=a*x
if y>=a:
ans+=a
else:
ans+=y
print(ans) | [["-", 0, 656, 0, 57, 15, 666, 0, 23, 0, 24], ["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 72], ["-", 0, 57, 15, 666, 0, 23, 0, 657, 12, 22], ["-", 0, 656, 0, 57, 15, 666, 0, 23, 0, 25]] | 5 | 64 |
N,A,B = map(int,input().split())
#n blue red
#8 3 4
#bbbrrrrb
#4
ans = 0
x = N // (A+B)
ans += (x * A)
N -= x * (A+B)
if N <= A:
ans += N
else:
ans += A
| N,A,B = map(int,input().split())
#n blue red
#8 3 4
#bbbrrrrb
#4
ans = 0
x = N // (A+B)
ans += (x * A)
N -= x * (A+B)
if N <= A:
ans += N
else:
ans += A
print(ans) | [["+", 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 | 63 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unorde... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unorde... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22]] | 1 | 482 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, n) for (int i = 1; i <= (int)(n); i++)
#define FOR(i, m, n) for (int i = m; i n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, n) for (int i = 1; i <= (int)(n); i++)
#define FOR(i, m, n) for (int i = m; i n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(... | [["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 190 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
cout << n * a / (a + b) + min(a, n % (a + b)) << endl;
return 0;
} | #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;
return 0;
} | [["+", 31, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["-", 31, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["-", 31, 16, 12, 16, 31, 16, 31, 16, 12, 22], ["+", 31, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22]] | 1 | 58 |
N,A,B = map(int, input().split())
S = A+B
x = N//S
y = N%S
print(x*A+y) | N,A,B = map(int, input().split())
S = A+B
x = N//S
y = N%S
print(x*A+min(y,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 | 41 |
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (n <= a && a != 0) {
cout << n;
} else {
ll g = n / (a + b);
ll r = n % (a + b);
ll ans = (g * a) + r;
cout << ans;
}
} | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (n <= a && a != 0) {
cout << n;
} else {
ll g = n / (a + b);
ll r = n % (a + b);
ll ans = (g * a) + min(a, r);
cout << ans;
}
} | [["+", 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], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 25]] | 1 | 86 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define int64... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define int64... | [["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 16, 12, 2, 3, 4, 0, 23, 0, 24], ["+", 3, 4, 0, 23, 0, 16, 12, 23, 0, 25]] | 1 | 96 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, a, b;
cin >> n >> a >> b;
long long int ans = n / (a + b) * a;
ans += (a, n % (a + b));
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, a, b;
cin >> n >> a >> b;
long long int ans = n / (a + b) * a;
ans += min(a, n % (a + b));
cout << ans << endl;
} | [["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22]] | 1 | 64 |
n, a, b = map(int,input().split())
if a != 0:
answer = n // (a+b)
remainder = n % (a+b)
print(answer*a) + min(a, remainder)
else:
print(0) | n, a, b = map(int,input().split())
if a != 0:
answer = n // (a+b)
remainder = n % (a+b)
print((answer*a) + min(a, remainder))
else:
print(0) | [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25]] | 5 | 60 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long x = 0;
if (n % (a + b) > b) {
x = a;
} else {
x = n % (a + b);
}
cout << n / (a + b) * a + x << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long x = 0;
if (n % (a + b) > a) {
x = a;
} else {
x = n % (a + b);
}
cout << n / (a + b) * a + x << endl;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 81 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
long long ans = n / (a + b);
long long r = n % (a + b);
ans += min(r, a);
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);
ans *= a;
long long r = n % (a + b);
ans += min(r, a);
cout << ans << endl;
}
| [["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 67 |
N, A, B = map(int, input().split())
total = N//(A + B)*B + max(0, N%(A+B)-A)
print(total) | N, A, B = map(int, input().split())
total = N//(A + B)*A + min(A, N%(A+B))
print(total) | [["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["-", 0, 1, 0, 662, 12, 657, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 652, 63, 22], ["-", 0, 662, 12, 657, 12, 652, 3, 4, 0, 612], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22], ["-", 12, 657, 12, 652, 3, 4, 0, 657, ... | 5 | 48 |
N, A, B = map(int, input().split())
tmp = 0
tmp = N // (A + B) * A
print(tmp + min(N - (A + B), A))
| N, A, B = map(int, input().split())
tmp = 0
tmp = N // (A + B) * A
print(tmp + min(N % (A + B), A))
| [["-", 0, 657, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 17, 109]] | 5 | 49 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
long long N, A, B, Ans = 0;
cin >> N >> A >> B;
Ans = A * N / (A + B);
if (N % (A + B) < A) {
Ans = Ans + N % (A + B);
} else {
An... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
long long N, A, B, Ans = 0;
cin >> N >> A >> B;
Ans = N / (A + B) * A;
if (N % (A + B) < A) {
Ans = Ans + N % (A + B);
} else {
An... | [["-", 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], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 103 |
// CODING ME ACCHHA KARNEKA HAI TERKO TO BAS PRACTICE KARTE REH
#include <bits/stdc++.h>
#define pragma
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define aisort sort(a, a + n)
#define adsort sort(a, a + n, greater<ll>())
#define PI 2 * acos(0)
typedef p... | // CODING ME ACCHHA KARNEKA HAI TERKO TO BAS PRACTICE KARTE REH
#include <bits/stdc++.h>
#define pragma
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define aisort sort(a, a + n)
#define adsort sort(a, a + n, greater<ll>())
#define PI 2 * acos(0)
typedef p... | [["+", 75, 76, 0, 1, 0, 16, 12, 16, 17, 72], ["+", 75, 76, 0, 1, 0, 16, 12, 16, 12, 22]] | 1 | 441 |
require 'set'
class Hash
def push(key, value)
self[key] = [] if self[key] == nil
self[key].push(value)
end
end
class Array
def lower_bound(value)
left = -1;
right = self.length;
while left + 1 < right
mid = left + (right - left) / 2;
if self[mid] >= value
right = mid
... | require 'set'
class Hash
def push(key, value)
self[key] = [] if self[key] == nil
self[key].push(value)
end
end
class Array
def lower_bound(value)
left = -1;
right = self.length;
while left + 1 < right
mid = left + (right - left) / 2;
if self[mid] >= value
right = mid
... | [["-", 0, 662, 12, 754, 15, 739, 0, 738, 12, 743], ["+", 0, 662, 12, 754, 15, 739, 0, 738, 12, 743], ["-", 36, 36, 0, 493, 0, 662, 12, 754, 64, 743], ["+", 36, 36, 0, 493, 0, 662, 12, 754, 64, 743]] | 4 | 200 |
#include <bits/stdc++.h>
#define SIZE 10
#define PI 3.141592653589793
using namespace std;
typedef long long ll;
int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, A, B;
int i, j;
int tmp;
ll answer = 0;
int counter = 0;
vector<int> given;
cin >> N >> A >> B;
answer += (N / (A + B)... | #include <bits/stdc++.h>
#define SIZE 10
#define PI 3.141592653589793
using namespace std;
typedef long long ll;
int main(void) {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, A, B;
int i, j;
int tmp;
ll answer = 0;
int counter = 0;
vector<int> given;
cin >> N >> A >> B;
answer += (N / (A + B)... | [["+", 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, 107], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 75, 76, 0, 1, 0, 35]] | 1 | 122 |
#
import sys
input=sys.stdin.readline
def main():
N,A,B=map(int,input().split())
if N%(A+B)<=A:
print(A*N//(A+B)+N%(A+B))
else:
print(A*N//(A+B)+A)
if __name__=="__main__":
main()
| #
import sys
input=sys.stdin.readline
def main():
N,A,B=map(int,input().split())
if N%(A+B)<=A:
print(A*(N//(A+B))+N%(A+B))
else:
print(A*(N//(A+B))+A)
if __name__=="__main__":
main()
| [["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 31, 657, 12, 23, 0, 657, 12, 23, 0, 25]] | 5 | 90 |
/// Bismillahir Rahmanir Rahim
/* Mohammad Morsalin
Dept of ICE, NSTU
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define mp make_pair
#define endl "\n"
#define int long long
#define f0... | /// Bismillahir Rahmanir Rahim
/* Mohammad Morsalin
Dept of ICE, NSTU
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define mp make_pair
#define endl "\n"
#define int long long
#define f0... | [["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 49, 50, 51, 16, 31, 23, 0, 16, 17, 109], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 85], ["+", 0, 14, 8, 9, ... | 1 | 457 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define fo(i, n) for (i = 0; i < n; i++)
#define fo1(i, n) for (i = 1; i <= n; i++)
#define FO(i, k, n) for (i = k; k <= n ? i <= n : i >= n; k <= n ? ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define fo(i, n) for (i = 0; i < n; i++)
#define fo1(i, n) for (i = 1; i <= n; i++)
#define FO(i, k, n) for (i = k; k <= n ? i <= n : i >= n; k <= n ? ... | [["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 718 |
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define intmax INT_MAX
#define lmax LONG_MAX
... | #include <algorithm>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define intmax INT_MAX
#define lmax LONG_MAX
... | [["+", 0, 2, 3, 4, 0, 16, 12, 2, 63, 22], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 22], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 1 | 448 |
import java.util.*;
public class Main {
public static void main(String[] args) {
long N, A, B;
Scanner sc = new Scanner(System.in);
N = sc.nextLong();
A = sc.nextLong();
B = sc.nextLong();
long n1 = N / (A + B);
long n2 = N % (A + B);
System.out.println(A * n1 + (n2 >= A ? n2 : A));
... | import java.util.*;
public class Main {
public static void main(String[] args) {
long N, A, B;
Scanner sc = new Scanner(System.in);
N = sc.nextLong();
A = sc.nextLong();
B = sc.nextLong();
long n1 = N / (A + B);
long n2 = N % (A + B);
System.out.println(A * n1 + (n2 >= A ? A : n2));
... | [["-", 3, 4, 0, 16, 12, 23, 0, 510, 64, 22], ["-", 3, 4, 0, 16, 12, 23, 0, 510, 0, 102], ["+", 3, 4, 0, 16, 12, 23, 0, 510, 0, 102], ["+", 3, 4, 0, 16, 12, 23, 0, 510, 75, 22]] | 3 | 109 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int main() {
ll n, a, b, ans = 0;
cin >> n >> a >> b;
ans += a * n / (a + b);
n %= a + b;
if (a > n)
ans += n;
else
ans += a;
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int main() {
ll n, a, b, ans = 0;
cin >> n >> a >> b;
ans += n / (a + b) * a;
n %= a + b;
if (a > n)
ans += n;
else
ans += a;
cout << ans << endl;
return 0;
}
| [["-", 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], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 87 |
n, a, b = map(int,input().split())
p = n // (a+b)
ans = a*b + min(a,(n%(a + b)))
print(ans) | n, a, b = map(int,input().split())
p = n // (a+b)
ans = a*p + min(a,(n%(a + b)))
print(ans)
| [["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22]] | 5 | 51 |
n,a,b = map(int,input().split())
c = n//(a+b)
if n%(a+b) >= b:
print((c*a)+a)
else:
print((c*a)+n%(a+b)) | n,a,b = map(int,input().split())
c = n//(a+b)
if n%(a+b) >= a:
print((c*a)+a)
else:
print((c*a)+n%(a+b)) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]] | 5 | 66 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, a, b;
cin >> n >> a >> b;
if (a == 0) {
cout << "0";
exit(0);
}
long long int sum = a + b, count = a * (n / sum);
if (n % sum > a)
count += a;
else
count += n % sum;
cout << sum;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, a, b;
cin >> n >> a >> b;
if (a == 0) {
cout << "0";
exit(0);
}
long long int sum = a + b, count = a * (n / sum);
if (n % sum > a)
count += a;
else
count += n % sum;
cout << count;
} | [["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 90 |
n,a,b = map(int,input().split())
x=n//(a+b)
y=n - C1*(a+b)
if y >= a:
y=a
print(a*x+y) | n,a,b = map(int,input().split())
x=n//(a+b)
y=n - x*(a+b)
if y >= a:
y=a
print(a*x+y) | [["-", 0, 1, 0, 662, 12, 657, 12, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 31, 22]] | 5 | 54 |
// SeeAlso:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MAX 100000
#define NIL -1
#define MOD 1000000007
typedef int _loop_int;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ... | // SeeAlso:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MAX 100000
#define NIL -1
#define MOD 1000000007
typedef int _loop_int;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ... | [["-", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 17, 33]] | 1 | 422 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using str = string;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
const double PI = 3.141592653589793238;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define REP(i, m, n) for (int i = m; i < (int)n; i++)
#def... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using str = string;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
const double PI = 3.141592653589793238;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define REP(i, m, n) for (int i = m; i < (int)n; i++)
#def... | [["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 185 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using str = string;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
const double PI = 3.141592653589793238;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define REP(i, m, n) for (int i = m; i < (int)n; i++)
#def... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using str = string;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
const double PI = 3.141592653589793238;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define REP(i, m, n) for (int i = m; i < (int)n; i++)
#def... | [["+", 0, 16, 31, 16, 12, 16, 31, 2, 63, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 31, 2, 3, 4, 0, 16, 12, 23, 0, 25], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 22]] | 1 | 291 |
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
ll n, a, b;
cin >> n >> a >> b;
cout << ((n / (a + b)) * a) + n % (a + b) << '\n';
return 0;
} | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
ll n, a, b;
cin >> n >> a >> b;
cout << ((n / (a + b)) * a) + min(n % (a + b), a) << '\n';
return 0;
} | [["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 64 |
def main():
n, a, b = map(int, input().split())
q, mod = divmod(n, (a+b))
x = mod if mod < n else a
print(q*a+x)
if __name__ == "__main__":
main()
| def main():
n, a, b = map(int, input().split())
q, mod = divmod(n, (a+b))
x = mod if mod < a else a
print(q*a+x)
if __name__ == "__main__":
main() | [["-", 0, 1, 0, 662, 12, 41, 0, 666, 0, 22], ["+", 0, 1, 0, 662, 12, 41, 0, 666, 0, 22]] | 5 | 64 |
n,a,b=map(int,input().split())
#x=n//(a+b)
#y=n%(a+b)
if n%(a+b) < a: print(a*n//(a+b)+n%(a+b))
else: print(a*(n//(a+b)+1))
| n,a,b=map(int,input().split())
#x=n//(a+b)
#y=n%(a+b)
if n%(a+b) < a: print(a*(n//(a+b))+(n%(a+b)))
else: print(a*((n//(a+b)+1)))
| [["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 25], ["+", 0, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["+", 0, 657, 12, 23, 0, 657, 12, 23, 0, 25], ["+", 3, 4, 0, 657, 12, 23, 0, 23, 0, 25]] | 5 | 69 |
/*
* cpp_filepath
*/
// C++ 14
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring> // memset
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for (int __x = __start; __x < __end; __x++)
template <class T> ostream &operator<<(ost... | /*
* cpp_filepath
*/
// C++ 14
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring> // memset
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for (int __x = __start; __x < __end; __x++)
template <class T> ostream &operator<<(ost... | [["-", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 179 |
n,a,b = map(int, input().split())
x = n//(a+b)
y = n%(a+b)
print(x*a + max(y,y-b)) | n,a,b = map(int, input().split())
x = n//(a+b)
y = n%(a+b)
print(x*a + min(y,a)) | [["-", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["-", 0, 657, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 657, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 657, 12, 652, 3, 4, 0, 657, 12, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22]] | 5 | 51 |
n,a,b = map(int, input().split())
t = n //(a+b)
s = min(n-(a+b), a)
print(t*a+s) | n,a,b = map(int, input().split())
t = n //(a+b)
s = min(n-(a+b)*t, a)
print(t*a+s) | [["+", 12, 652, 3, 4, 0, 657, 12, 657, 17, 48], ["+", 12, 652, 3, 4, 0, 657, 12, 657, 12, 22]] | 5 | 49 |
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#define INF 0x3f3f3f3f
#define DOF 0x7f7f7f7f
#define mem(a, b) memset(a, b, sizeof(a))
#define IO ... | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#define INF 0x3f3f3f3f
#define DOF 0x7f7f7f7f
#define mem(a, b) memset(a, b, sizeof(a))
#define IO ... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["-", 31, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["-", 31, 16, 12, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25],... | 1 | 138 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define INT(str) stoi((str), 0)
#define INTB(str) stoi((str), 0, 2) // 2進数の文字列を int に
int main() {
ll N, A, B;
cin >> N >> A >> B;
cout << N / (A... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define INT(str) stoi((str), 0)
#define INTB(str) stoi((str), 0, 2) // 2進数の文字列を int に
int main() {
ll N, A, B;
cin >> N >> A >> B;
cout << N / (A... | [["-", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["-", 31, 16, 12, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 93 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long C = N / (A + B);
if (C * (A + B) + A < N) {
cout << C * A + (N - C * (A + B)) << endl;
} else if (C == 0) {
if (N < A) {
cout << N << endl;
} else {
cout << A << endl;
}
}... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long C = N / (A + B);
if (C * (A + B) + A >= N) {
cout << C * A + (N - C * (A + B)) << endl;
} else if (C == 0) {
if (N < A) {
cout << N << endl;
} else {
cout << A << endl;
}
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 121 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
cout << N / (A + B) + min(N % (A + B), A) << 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(N % (A + B), A) << endl;
}
| [["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22]] | 1 | 53 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long kami = 0;
if (N % (A + B) >= B)
kami = B;
else
kami = N % (A + B);
cout << N / (A + B) * A + kami << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long kami = 0;
if (N % (A + B) >= A)
kami = A;
else
kami = N % (A + B);
cout << N / (A + B) * A + kami << endl;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22]] | 1 | 77 |
N,A,B=map(int,input().split())
a=(N//(A+B))
b=N%(A+B)
print(a*A+b)
| N,A,B=map(int,input().split())
a=(N//(A+B))
b=min(A,N%(A+B))
print(a*A+b)
| [["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 46 |
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll a, b, n;
cin >> n >> a >> b;
ll rep, ans = 0;
ans = n / (a + b) * a;
rep = n % (a + b);
ans += rep;
cout << ans << endl;
return 0;
}
| #include <iostream>
using namespace std;
using ll = long long;
int main() {
ll a, b, n;
cin >> n >> a >> b;
ll rep, ans = 0;
ans = n / (a + b) * a;
rep = n % (a + b);
ans += min(rep, a);
cout << ans << endl;
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 | 75 |
#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(), c.end()
#define make_uni... | #include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(), c.end()
#define make_uni... | [["-", 51, 16, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 31, 22]] | 1 | 277 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int64_t n, a, b;
cin >> n >> a >> b;
int64_t ans;
ans = (n * a / (a + b)) + min(n % (a + b), a);
cout << ans << '\n';
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int64_t n, a, b;
cin >> n >> a >> b;
int64_t ans;
ans = (n / (a + b) * a) + min(n % (a + b), a);
cout << ans << '\n';
return 0;
}
| [["-", 12, 16, 31, 23, 0, 16, 31, 16, 17, 48], ["-", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 48], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 91 |
n,a,b = map(int, input().split())
hoge = n // (a+b)
hoge1 = n % (a+b)
if hoge1 <= 4:
print(hoge*a + hoge1)
else:
print(hoge*a + 4) | n,a,b = map(int, input().split())
hoge = n // (a+b)
hoge1 = n % (a+b)
if hoge1 <= a:
print(hoge*a + hoge1)
else:
print(hoge*a + a) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 59 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long P = N % (A + B);
if (P >= A)
cout << A * N / (A + B) + A << endl;
else
cout << A * N / (A + B) + P << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long P = N % (A + B);
if (P >= A)
cout << A * (N / (A + B)) + A << endl;
else
cout << A * (N / (A + B)) + P << endl;
} | [["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 79 |
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)
| 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)
| [["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109]] | 5 | 69 |
N,A,B=map(int,input().split())
ans=0
times=N//(A+B)
rest=N%(A+B)
ans=times*A
if rest>A:
a=A
else:
a=rest
print(ans+rest) | N,A,B=map(int,input().split())
ans=0
times=N//(A+B)
rest=N%(A+B)
ans=times*A
if rest>A:
a=A
else:
a=rest
print(ans+a) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 63 |
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
func main() {
sc.Split(bufio.ScanWords)
n := nextInt()
a := nextInt()
b := nextInt()
if a == 0 {
fmt.Println(0)
return
}
if n <= a {
fmt.Println(a)
return
}
if n <= a+b {
fmt.Println(a)
return
}
b... | package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
func main() {
sc.Split(bufio.ScanWords)
n := nextInt()
a := nextInt()
b := nextInt()
if a == 0 {
fmt.Println(0)
return
}
if n <= a {
fmt.Println(n)
return
}
if n <= a+b {
fmt.Println(a)
return
}
b... | [["-", 64, 196, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 2, 3, 4, 0, 22]] | 7 | 229 |
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
// File file = new File("src/in.txt");
// Scanner sc = new Scanner(file);
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
... | import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
// File file = new File("src/in.txt");
// Scanner sc = new Scanner(file);
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
... | [["+", 0, 503, 49, 200, 51, 16, 12, 492, 500, 22], ["+", 0, 503, 49, 200, 51, 16, 12, 492, 0, 131], ["+", 0, 503, 49, 200, 51, 16, 12, 492, 141, 22], ["+", 49, 200, 51, 16, 12, 492, 3, 4, 0, 22], ["+", 49, 200, 51, 16, 12, 492, 3, 4, 0, 21]] | 3 | 129 |
n,a,b = map(int,input().split())
c = n // (a+b)
ans = a * c
d = n % (a+b)
if 0 < d <= a:
print(ans+d)
else:
print(ans+a) | n,a,b = map(int,input().split())
c = n // (a+b)
ans = a * c
d = n % (a+b)
if 0 <= d <= a:
print(ans+d)
else:
print(ans+a) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]] | 5 | 62 |
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (n % (a + b) >= a)
cout << a * (n % (a + b)) + a << endl;
else
cout << a * (n % (a ... | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
int main() {
ll n, a, b;
cin >> n >> a >> b;
if (n % (a + b) >= a)
cout << a * (n / (a + b)) + a << endl;
else
cout << a * (n / (a ... | [["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 109], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 85]] | 1 | 104 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
cout << (n / (a + b)) * a + n % (a + b) << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long 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], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 55 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define mod 1000000007
#define inf 1000000000000000
#define infty 1000000000000000000LL
#define md 998244353
#define PI acos(-1.0)
#define endl "\n"
#define rr return
#define br cout << "\n";
long long prime[1000000];
void sieve(... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define mod 1000000007
#define inf 1000000000000000
#define infty 1000000000000000000LL
#define md 998244353
#define PI acos(-1.0)
#define endl "\n"
#define rr return
#define br cout << "\n";
long long prime[1000000];
void sieve(... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]] | 1 | 614 |
n, a, b = map(int, input().split())
b_count = n // (a+b)
if (n-(a+b)*b_count) <= a:
print(n-b*b_count)
else:
print(n-b*b_count + a) | n, a, b = map(int, input().split())
b_count = n // (a+b)
if (n-(a+b)*b_count) <= a:
print(n-b*b_count)
else:
print(a*b_count + a) | [["-", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["-", 3, 4, 0, 657, 31, 657, 12, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22]] | 5 | 62 |
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long int
#define mod 1000000007
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, a, b;
cin >> n >> a >> b;
ll ans = n / (a + b) * a + n % (a + b);
cout <<... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long int
#define mod 1000000007
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, a, b;
cin >> n >> a >> b;
ll ans = n / (a + b) * a + min(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 | 80 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
cout << (n / (a + b)) * a + min(n % (a + b), b) << endl;
return 0;
} | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
cout << (n / (a + b)) * a + min(n % (a + b), a) << endl;
return 0;
} | [["-", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 61 |
n,a,b=map(int,input().split())
p,q=divmod(n,(a+b))
print(p*b + [b,q][q<b]) | n,a,b=map(int,input().split())
p,q=divmod(n,(a+b))
print(p*a + [a,q][q<a]) | [["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 3, 4, 0, 657, 12, 206, 51, 634, 0, 22], ["+", 3, 4, 0, 657, 12, 206, 51, 634, 0, 22], ["-", 3, 4, 0, 657, 12, 206, 206, 666, 0, 22], ["+", 3, 4, 0, 657, 12, 206, 206, 666, 0, 22]] | 5 | 49 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll k = (a + b);
ll p = n / k;
cout << a * p + n % k;
return 0;
}
| #include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll n, a, b;
cin >> n >> a >> b;
ll k = (a + b);
ll p = n / k;
cout << a * p + min(a, n % k);
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], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 25]] | 1 | 64 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, a, b;
cin >> N >> a >> b;
long long ans = 0;
if (N % (a + b) <= a) {
ans = (N / (a + b)) * a + N % (a + b);
} else {
ans = (N / (a + b)) * (a + 1);
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, a, b;
cin >> N >> a >> b;
long long ans = 0;
if (N % (a + b) <= a) {
ans = (N / (a + b)) * a + N % (a + b);
} else {
ans = (N / (a + b)) * a + a;
}
cout << ans << endl;
}
| [["-", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["-", 0, 11, 12, 16, 12, 23, 0, 16, 12, 13], ["-", 0, 1, 0, 11, 12, 16, 12, 23, 0, 25], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 97 |
#include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
int64_t group = n / (a + b);
int64_t x = n % (a + b);
if (x > a) {
cout << n * a + a;
} else {
cout << n * a + x;
}
}
| #include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
int64_t group = n / (a + b);
int64_t x = n % (a + b);
if (x > a) {
cout << group * a + a;
} else {
cout << group * a + x;
}
}
| [["-", 0, 1, 0, 16, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 31, 22]] | 1 | 86 |
def solve():
N,A,B = map(int, input().split())
x,y = divmod(N, A+B)
if y>B:
y = A
print(A*x + y)
if __name__ == '__main__':
solve() | def solve():
N,A,B = map(int, input().split())
x,y = divmod(N, A+B)
if y>A:
y = A
print(A*x + y)
if __name__ == '__main__':
solve() | [["-", 0, 14, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 0, 22]] | 5 | 61 |
#include <iostream>
using namespace std;
int main() {
long long n, a, b, amari;
cin >> n >> a >> b;
if (a == 0) {
cout << 0 << endl;
return 0;
}
amari = n % (a + b);
if (amari < a) {
cout << a * n / (a + b) + amari << endl;
} else {
cout << a * n / (a + b) + a << endl;
}
} | #include <iostream>
using namespace std;
int main() {
long long n, a, b, amari;
cin >> n >> a >> b;
if (a == 0) {
cout << 0 << endl;
return 0;
}
amari = n % (a + b);
if (amari < a) {
cout << a * (n / (a + b)) + amari << endl;
} else {
cout << a * (n / (a + b)) + a << endl;
}
} | [["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 100 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
int64_t c = n / (a + b);
int64_t d = n % (a + b);
cout << a * c + d << endl;
}
| #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n, a, b;
cin >> n >> a >> b;
int64_t c = n / (a + b);
int64_t d = n % (a + b);
cout << a * c + min(a, d) << endl;
}
| [["+", 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], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]] | 1 | 61 |
n, a, b = map(int, input().split())
x = n // (a + b) * a
k = n % (a + b)
if k <= a:
print(n + k)
else:
print(n + a) | n, a, b = map(int, input().split())
x = n // (a + b) * a
k = n % (a + b)
if k <= a:
print(x + k)
else:
print(x + a)
| [["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22]] | 5 | 57 |
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(s, t) \
for (int s = 0; s < t; ++s) \
;
using ll = long long;
int main() {
ll a, b, n;
cin >> n >> a >> b... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(s, t) \
for (int s = 0; s < t; ++s) \
;
using ll = long long;
int main() {
ll a, b, n;
cin >> n >> a >> b... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]] | 1 | 111 |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, a, b) for (ll i = ll(a); i <= ll(b); i++)
int main() {
ll n, a, b, ans = 0, t = 0, rem = 0, bball = 0;
cin >> n >> a >> b;
ans = (n / (a + b)) * a;
rem = n % (a + b);
ans += min(ans, rem);
cout << ans;... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, a, b) for (ll i = ll(a); i <= ll(b); i++)
int main() {
ll n, a, b, ans = 0, t = 0, rem = 0, bball = 0;
cin >> n >> a >> b;
ans = (n / (a + b)) * a;
rem = n % (a + b);
ans += min(a, rem);
cout << ans;
} | [["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 102 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
int dx[] = {... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
int dx[] = {... | [["+", 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 | 175 |
N, A, B = map(int,input().split())
t = N%(A+B)
if t > A:
print(N//(A+B)*A)
else:
print(N//(A+B)*A+t) | N, A, B = map(int,input().split())
t = N%(A+B)
if t > A:
print((N//(A+B)+1)*A)
else:
print(N//(A+B)*A+t) | [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 31, 657, 12, 23, 0, 25], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612]] | 5 | 60 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B, n;
cin >> N >> A >> B;
n = N / (A + B);
if (N % (A + B) <= A) {
cout << n * A + N % (A + B) << endl;
} else {
cout << n * A;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B, n;
cin >> N >> A >> B;
n = N / (A + B);
if (N % (A + B) <= A) {
cout << n * A + N % (A + B) << endl;
} else {
cout << (n + 1) * A;
}
return 0;
} | [["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25]] | 1 | 82 |
N,A,B = list(map(int, input().split()))
print(N//(A+B)*A + min(N%(A+B), B)) | N,A,B = list(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 | 46 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long c = N % (A + B);
if (c == 0 || A < c) { //青いボールはジャストセットになる
cout << (N / (A + B) + 1) * A << endl;
} else {
cout << c + (N / (A + B)) * A << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long c = N % (A + B);
if (A < c) { //青いボールはジャストセットになる
cout << (N / (A + B) + 1) * A << endl;
} else {
cout << c + (N / (A + B)) * A << endl;
}
} | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]] | 1 | 92 |
def main():
N, A, B = map(int, input().split())
AB = A + B
q, r = divmod(N, AB)
print(A * q + r)
if __name__ == '__main__':
main()
| def main():
N, A, B = map(int, input().split())
AB = A + B
q, r = divmod(N, AB)
print(A * q + min(r, A))
if __name__ == '__main__':
main()
| [["+", 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 | 56 |
#include <iomanip>
#include <iostream>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)
int main() {
ll n, a, b;
cin >> n >> a >> b;
cout << n / (a + b) * a + min(n - a - b, a) << endl;
return 0;
} | #include <iomanip>
#include <iostream>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)
int main() {
ll n, a, b;
cin >> n >> a >> b;
cout << n / (a + b) * a + min(n % (a + b), a) << endl;
return 0;
} | [["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 17, 109], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["-", 12, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 1 | 86 |
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#d... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#d... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 224 |
N, A, B = map(int, input().split())
print(min((N//(A+B))*A + N-(N//(A+B)), (N//(A+B))*A + A)) | N, A, B = map(int, input().split())
print(min((N//(A+B))*A + N - (N//(A+B))*(A+B), (N//(A+B))*A + A)) | [["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 48], ["+", 3, 4, 0, 657, 12, 657, 12, 23, 0, 24], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 12, 22], ["+", 3, 4, 0, 657, 12, 657, 12, 23, 0, 25]] | 5 | 61 |
Nf,Af,Bf = (input().split(' '))
N = int(Nf)
A = int(Af)
B = int(Bf)
a = N % (A + B)
b = N // (A + B)
if a < A + 1:
print(A*b+a)
else:
print(A*b) | Nf,Af,Bf = (input().split(' '))
N = int(Nf)
A = int(Af)
B = int(Bf)
a = N % (A + B)
b = N // (A + B)
if a < A + 1:
print(A*b+a)
else:
print(A*b+A) | [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 77 |
#include <stdio.h>
int main(void) {
long int n, a, b, setNum, remainBall;
scanf("%ld%ld%ld", &n, &a, &b);
/* 青と赤のボールを1セットとし、n番目までに完全な形で並ぶセット数を数える */
setNum = n / (a + b);
remainBall = n % setNum;
/* 残りのボール数が1セット当たりの青ボール数以下なら、残りのボールはすべて青
*/
if (remainBall <= a) {
printf("%ld", a * setNum + remai... | #include <stdio.h>
int main(void) {
long int n, a, b, setNum, remainBall;
scanf("%ld%ld%ld", &n, &a, &b);
/* 青と赤のボールを1セットとし、n番目までに完全な形で並ぶセット数を数える */
setNum = n / (a + b);
remainBall = n % (a + b);
/* 残りのボール数が1セット当たりの青ボール数以下なら、残りのボールはすべて青
*/
if (remainBall <= a) {
printf("%ld", a * setNum + rema... | [["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 31, 22], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 25]] | 0 | 95 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long A, B, N;
cin >> N >> A >> B;
long long ans = 0;
ans += (N / (A + B)) * A;
if (ans > 0 && N % (A + B) - A > 0) {
ans += A;
} else {
ans += N % (A + B);
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long A, B, N;
cin >> N >> A >> B;
long long ans = 0;
ans += (N / (A + B)) * A;
if (N % (A + B) - A >= 0) {
ans += A;
} else {
ans += N % (A + B);
}
cout << ans << endl;
}
| [["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 91 |
#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);
n %= (a + b);
if (n < a)
ans += n;
else
ans += a;
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;
n %= (a + b);
if (n < a)
ans += n;
else
ans += a;
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 | 71 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.