buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <algorithm> #include <complex> #include <cstdlib> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define SAY_YES cout << "YES...
#include <algorithm> #include <complex> #include <cstdlib> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define SAY_YES cout << "YES...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
226
#!/usr/bin/env python3 S = int(input()) if (S[0] == S[1] and S[1]== S[2]): print("No") else: print("Yes")
#!/usr/bin/env python3 S = str(input()) if (S[0] == S[1] and S[1]== S[2]): print("No") else: print("Yes")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
46
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char s[4] = {0}; scanf("%s", s); if (strcmp(s, "aaa") == 0 || strcmp(s, "bbb") == 0) { printf("No"); } else { printf("Yes"); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char s[4] = {0}; scanf("%s", s); if (strcmp(s, "AAA") == 0 || strcmp(s, "BBB") == 0) { printf("No"); } else { printf("Yes"); } return 0; }
[["-", 31, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 31, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["-", 12, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 12, 16, 31, 2, 3, 4, 0, 5, 0, 6]]
0
77
s = input() ans='No' if s=='AAA': ans='Yes' if s=='BBB': ans='Yes' print(ans)
s = input() ans='Yes' if s=='AAA': ans='No' if s=='BBB': ans='No' print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
38
// its_mind_changer_ // _don't_under_estimate_ #include <bits/stdc++.h> using namespace std; #define int long long signed main() { string a; cin >> a; int x = 0; for (int i = 0; i < 3; i++) if (a[i] == 'A') x++; if (x and x != 3) cout << "YES\n"; else cout << "NO\n...
// its_mind_changer_ // _don't_under_estimate_ #include <bits/stdc++.h> using namespace std; #define int long long signed main() { string a; cin >> a; int x = 0; for (int i = 0; i < 3; i++) if (a[i] == 'A') x++; if (x and x != 3) cout << "Yes\n"; else cout << "No\n...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
80
#include <bits/stdc++.h> using namespace std; /* run this program using the console pauser or add your own getch, * system("pause") or input loop */ #define ll long long #define pb push_back #define rep(i, a, b) for (ll i = a; i <= b; i++) #define rep2(i, a, b) for (ll i = a; i >= b; i--) int main(int argc, char **ar...
#include <bits/stdc++.h> using namespace std; /* run this program using the console pauser or add your own getch, * system("pause") or input loop */ #define ll long long #define pb push_back #define rep(i, a, b) for (ll i = a; i <= b; i++) #define rep2(i, a, b) for (ll i = a; i >= b; i--) int main(int argc, char **ar...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
130
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.flush(); ll t = 1; cin >> t; while (t--) { string s; cin >> s; ll a = 0, b = 0; for (ll i = 0; i < 3; i++) { if (s[i] == 'A') { ...
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.flush(); ll t = 1; // cin>>t; while (t--) { string s; cin >> s; ll a = 0, b = 0; for (ll i = 0; i < 3; i++) { if (s[i] == 'A') {...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
164
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define se second #define fi first #define ll long long int #define INF INT_MAX #define mod #define chutiyaap \ ios_base::sync_with_stdio(false); \...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define se second #define fi first #define ll long long int #define INF INT_MAX #define mod #define chutiyaap \ ios_base::sync_with_stdio(false); \...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
177
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines def main(): s = readline().strip() if s == "BBB": print("No") else: print("Yes") if __name__ == "__main__": main()
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines def main(): s = readline().strip() if s == "BBB" or s == "AAA": print("No") else: print("Yes") if __name__ == "__main__": main()
[["+", 0, 14, 8, 196, 0, 57, 15, 679, 17, 354], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 57, 15, 679, 12, 666, 0, 557, 0, 654], ["+", 0, 57, 15, 679, 12, 666, 0, 557, 0, 6], ["+", 0, 57, 15, 679, 12, 666, 0, 557, 0, 655]]
5
68
#include <algorithm> #include <stdio.h> using namespace std; int main() { char ch1, ch2, ch3; ch1 = getchar(); ch2 = getchar(); ch3 = getchar(); if (ch1 == ch2 & ch2 == ch3) { printf("NO"); } else printf("YES"); }
#include <algorithm> #include <stdio.h> using namespace std; int main() { char ch1, ch2, ch3; ch1 = getchar(); ch2 = getchar(); ch3 = getchar(); if (ch1 == ch2 & ch2 == ch3) { printf("No"); } else printf("Yes"); }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
66
#include <iostream> #include <vector> using namespace std; int main() { string a; cin >> a; if (a[0] == a[1] == a[2]) { cout << "No"; } else { cout << "Yes"; } return 0; }
#include <iostream> #include <vector> using namespace std; int main() { string a; cin >> a; if (a[0] == a[1] and a[1] == a[2]) { cout << "No"; } else { cout << "Yes"; } return 0; }
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73]]
1
58
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "ABA" || S == "BAB") { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "AAA" || S == "BBB") { cout << "No" << endl; } else { cout << "Yes" << endl; } return 0; }
[["-", 15, 339, 51, 16, 31, 16, 12, 5, 0, 6], ["+", 15, 339, 51, 16, 31, 16, 12, 5, 0, 6], ["-", 15, 339, 51, 16, 12, 16, 12, 5, 0, 6], ["+", 15, 339, 51, 16, 12, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
57
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) typedef long long ll; long long MOD = 1e9 + 7; const long long INF = 1LL << 60; using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) typedef long long ll; long long MOD = 1e9 + 7; const long long INF = 1LL << 60; using namespace std; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
177
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; using ll = long lon...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; using ll = long lon...
[["-", 0, 1, 0, 41, 15, 16, 12, 103, 0, 125], ["+", 0, 1, 0, 41, 15, 16, 12, 103, 0, 125]]
1
195
#include <bits/stdc++.h> #include <iostream> #include <math.h> #include <vector> #define lli long long int #define mod 1000000007 using namespace std; int main() { ios_base::sync_with_stdio(false); // cin.tie(NULL); cout.tie(NULL); string s; cin >> s; set<char> st; for (int i = 0; i < s.length(); i++) ...
#include <bits/stdc++.h> #include <iostream> #include <math.h> #include <vector> #define lli long long int #define mod 1000000007 using namespace std; int main() { ios_base::sync_with_stdio(false); // cin.tie(NULL); cout.tie(NULL); string s; cin >> s; set<char> st; for (int i = 0; i < s.length(); i++) ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
106
/* "Whatever sprinkles your donuts" :-) ~amit_dwivedi */ #include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; #define _(_1, _2, _3, _4, NAME, ...) NAME #define f3(i, a, n, inc) \ for (int i = (a) - (inc < 0); (inc) > 0 ? ...
/* "Whatever sprinkles your donuts" :-) ~amit_dwivedi */ #include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; #define _(_1, _2, _3, _4, NAME, ...) NAME #define f3(i, a, n, inc) \ for (int i = (a) - (inc < 0); (inc) > 0 ? ...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
1,551
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { string s; cin >> s; if (s == "AAA" || s == "BBB") cout << "NO" << endl; else cout << "Yes" << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { string s; cin >> s; if (s == "AAA" || s == "BBB") cout << "No" << endl; else cout << "Yes" << endl; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
64
s = input() if (s[0]==s[1] and s[1]==s[2]): print("NO") else: print("YES")
s = input() if (s[0]==s[1] and s[1]==s[2]): print("No") else: print("Yes")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
42
#include <bits/stdc++.h> using namespace std; #define INF 1000000007 #define ll long long #define F first #define S second #define pii pair<ll int, ll int> #define pb push_back #define ppb pop_back #define vi vector<ll int> int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t = 1; // cin >> t; ...
#include <bits/stdc++.h> using namespace std; #define INF 1000000007 #define ll long long #define F first #define S second #define pii pair<ll int, ll int> #define pb push_back #define ppb pop_back #define vi vector<ll int> int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t = 1; // cin >> t; ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
108
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main(void) { string s; cin >> s; if (s == "AAA" || s == "BBB") cout << "Yes" << endl; else cout << "No" << 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; using P = pair<int, int>; int main(void) { string s; cin >> s; if (s == "AAA" || s == "BBB") cout << "No" << endl; else cout << "Yes" << endl; return 0; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
78
s = set(input()) if(len(s) == 2): print('Yes') else: print('NO')
s = set(input()) if(len(s) == 2): print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
32
#include <bits/stdc++.h> #include <string.h> typedef long long int ll; using namespace std; void SieveOfEratosthenes(int n, vector<int> &primes) { // Create a boolean array "prime[0..n]" and initialize // all entries it as true. A value in prime[i] will // finally be false if i is Not a prime, else true. boo...
#include <bits/stdc++.h> #include <string.h> typedef long long int ll; using namespace std; void SieveOfEratosthenes(int n, vector<int> &primes) { // Create a boolean array "prime[0..n]" and initialize // all entries it as true. A value in prime[i] will // finally be false if i is Not a prime, else true. boo...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73]]
1
286
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define INF (int)9e18 #define HELL (int)(1e9 + 7) #define int long long #define double long double #define uint unsigned long long #define deb(x) cerr << #x << " => " << x << "\n" #define deba(x) ...
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define INF (int)9e18 #define HELL (int)(1e9 + 7) #define int long long #define double long double #define uint unsigned long long #define deb(x) cerr << #x << " => " << x << "\n" #define deba(x) ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
234
S = input() print("Yes" if S.count("A")*S.count("B") > 0 else "NO")
S = input() print("Yes" if S.count("A")*S.count("B") > 0 else "No")
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
35
#include <bits/stdc++.h> #define int long long #define double long double #define vi vector<int> #define vpi vector<pair<int, int>> #define mii map<int, int> #define mpi map<pair<int, int>, int> #define msi map<string, int> #define set set<int> #define u_set unordered_set<int> #define pb push_back #define mp make_pair...
#include <bits/stdc++.h> #define int long long #define double long double #define vi vector<int> #define vpi vector<pair<int, int>> #define mii map<int, int> #define mpi map<pair<int, int>, int> #define msi map<string, int> #define set set<int> #define u_set unordered_set<int> #define pb push_back #define mp make_pair...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
124
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "AAA" || S == "BBB") printf("NO\n"); else printf("YES\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "AAA" || S == "BBB") printf("No\n"); else printf("Yes\n"); return 0; }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
53
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define ins insert #define endl '\n' #define all(x) x.begin(), x.end() #define debug(X) \ { cerr << endl << (#X) << " = " << (X) << endl; } //#define cerr if(0)cerr t...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define ins insert #define endl '\n' #define all(x) x.begin(), x.end() #define debug(X) \ { cerr << endl << (#X) << " = " << (X) << endl; } //#define cerr if(0)cerr t...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
112
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #incl...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #incl...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
580
// shan61916 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double dll; #define mp make_pair #define pb push_back #define ff first #define ss second #define IOS \ ios::sync_with_stdio(false...
// shan61916 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double dll; #define mp make_pair #define pb push_back #define ff first #define ss second #define IOS \ ios::sync_with_stdio(false...
[["-", 8, 9, 0, 1, 0, 41, 15, 16, 17, 60], ["+", 8, 9, 0, 1, 0, 41, 15, 16, 17, 47]]
1
153
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73]]
1
1,083
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for (ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for (ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
140
// 21171_somesh || asomesh999 #include <bits/stdc++.h> using namespace std; #define fr(i, a, b) for (long long i = a; i < b; i++) #define io \ ios::sync_with_stdio(false); \ cin.tie(NULL); typedef lo...
// 21171_somesh || asomesh999 #include <bits/stdc++.h> using namespace std; #define fr(i, a, b) for (long long i = a; i < b; i++) #define io \ ios::sync_with_stdio(false); \ cin.tie(NULL); typedef lo...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
196
#include <algorithm> // sort #include <cstring> #include <fstream> #include <iostream> #include <map> #include <unistd.h> #include <vector> #define pii pair<int, int> #define REP(i, n) for (long long i = 0; i < (n); i++) using namespace std; typedef long long ll; static const ll INF = 1000000000000000000LL; static co...
#include <algorithm> // sort #include <cstring> #include <fstream> #include <iostream> #include <map> #include <unistd.h> #include <vector> #define pii pair<int, int> #define REP(i, n) for (long long i = 0; i < (n); i++) using namespace std; typedef long long ll; static const ll INF = 1000000000000000000LL; static co...
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["-", 0, 57, 64, 1, 0, 11, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 11, 12, 5, 0, 6]]
1
106
#include <bits/stdc++.h> using namespace std; string s; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> s; set<char> c; for (int i = 0; i < s.size(); i++) c.insert(s[i]); if (c.size() == 1) cout << "NO"; else cout << "YES"; }
#include <bits/stdc++.h> using namespace std; string s; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> s; set<char> c; for (int i = 0; i < s.size(); i++) c.insert(s[i]); if (c.size() == 1) cout << "No"; else cout << "Yes"; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
97
#include <bits/stdc++.h> using namespace std; // Optimization //#pragma GCC optimize("O3") #define endl '\n' // Shortcut #define int long long #define eb emplace_back #define pb push_back #define pob pop_back #define mp make_pair #define upb upper_bound #define lwb lower_bound #define fi first #define se second #de...
#include <bits/stdc++.h> using namespace std; // Optimization //#pragma GCC optimize("O3") #define endl '\n' // Shortcut #define int long long #define eb emplace_back #define pb push_back #define pob pop_back #define mp make_pair #define upb upper_bound #define lwb lower_bound #define fi first #define se second #de...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
445
#include <bits/stdc++.h> #define ff first #define ss second #define mp make_pair using namespace std; typedef long long ll; int main() { int n; char s[5]; scanf(" %s", s); if (s[0] == s[1] && s[1] == s[2]) printf("NO\n"); else printf("YES\n"); return 0; }
#include <bits/stdc++.h> #define ff first #define ss second #define mp make_pair using namespace std; typedef long long ll; int main() { int n; char s[5]; scanf(" %s", s); if (s[0] == s[1] && s[1] == s[2]) printf("No\n"); else printf("Yes\n"); return 0; }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
86
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; sort(s.begin(), s.end()); if (s[0] == s[2]) cout << "NO"; else cout << "YES"; }
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; sort(s.begin(), s.end()); if (s[0] == s[2]) cout << "No"; else cout << "Yes"; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
79
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--) #define RREPS(i, x) fo...
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--) #define RREPS(i, x) fo...
[["+", 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
187
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { ll n, a, b; cin >> n >> a >> b; cout << n / (a + b) * a + n % (a + b); // your code goes here return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { ll n, a, b; cin >> n >> a >> b; cout << n / (a + b) * a + min(n % (a + b), a); // your code goes here return 0; }
[["+", 0, 1, 0, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 22]]
1
62
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { ll n, a, b; cin >> n >> a >> b; ll ans = n / (a + b) * b; ans += max(n % (a + b) - a, ll(0)); cout << ans; // your code goes here return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { ll n, a, b; cin >> n >> a >> b; ll ans = n / (a + b) * a; ans += min(n % (a + b), ll(a)); cout << ans; // your code goes here return 0; }
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 22], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 13], ["+", 12, 2, 3, 4, 0, 2, 3...
1
79
#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; cin >> N >> A >> B; cout << (N / (A + B)) * (A + B) + min(N % (A + B), A) << 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; cin >> N >> A >> B; cout << (N / (A + B)) * A + min(N % (A + B), A) << endl; return 0; }
[["-", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["-", 31, 16, 12, 16, 31, 16, 12, 23, 0, 25]]
1
77
n, a, b = map(int, input().split()) c = a + b div = n // c mod = n % c if mod > a: mod -= a ans = div * a + mod print(ans)
n, a, b = map(int, input().split()) c = a + b div = n // c mod = n % c if mod > a: mod = a ans = div * a + mod print(ans)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32]]
5
52
#include <algorithm> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long ans = (n / (a + b)) * a + min(n % (a + b), b); cout << ans << endl; return 0; }
#include <algorithm> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { long long n, a, b; cin >> n >> a >> b; long long ans = (n / (a + b)) * a + min(n % (a + b), a); cout << ans << endl; return 0; }
[["-", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 22]]
1
74
#include <bits/stdc++.h> using namespace std; int main() { long long int n, a, b; cin >> n >> a >> b; if (a == 0) { cout << 0 << endl; return 0; } long long int ans = (n / (a + b)); long long int rem = n % (a + b); if (rem <= a) ans = ans * a + rem; else ans = ans * a + rem; cout << an...
#include <bits/stdc++.h> using namespace std; int main() { long long int n, a, b; cin >> n >> a >> b; if (a == 0) { cout << 0 << endl; return 0; } long long int ans = (n / (a + b)); long long int rem = n % (a + b); if (rem <= a) ans = ans * a + rem; else ans = ans * a + a; cout << ans ...
[["-", 75, 76, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 12, 22]]
1
103
// vec[i]の範囲外エラー表示 #define _GLIBCXX_DEBUG // includeとusing #include <bits/stdc++.h> using namespace std; //型名省略 using ll = long long; using st = string; using vl = vector<long long>; using vvl = vector<vector<long long>>; using vc = vector<char>; using vvc = vector<vector<char>>; using vs = vector<string>; using pll = ...
// vec[i]の範囲外エラー表示 #define _GLIBCXX_DEBUG // includeとusing #include <bits/stdc++.h> using namespace std; //型名省略 using ll = long long; using st = string; using vl = vector<long long>; using vvl = vector<vector<long long>>; using vc = vector<char>; using vvc = vector<vector<char>>; using vs = vector<string>; using pll = ...
[["+", 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
561
N, A, B = map(int, input().split()) ans = A*(N//(A+B)) + N%(A+B) print(ans)
N, A, B = map(int, input().split()) ans = A*(N//(A+B)) + min(N%(A+B), A) print(ans)
[["+", 0, 1, 0, 662, 12, 657, 12, 652, 63, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22]]
5
43
/* 17/10/2017 */ #include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { ll n, a, b; cin >> n >> a >> b; ll k = n / (a + b); n %= (a + b); cout << k * a + n << endl; }
/* 17/10/2017 */ #include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { ll n, a, b; cin >> n >> a >> b; ll k = n / (a + b); n %= (a + b); cout << k * a + min(n, a) << 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, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]]
1
63
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) REP(i, 0, n) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define sz(x) int(x.size()) #define bitsz(x) int(__builtin_popcount(x)) #define all(x) (x).begin(), (x).end() #define ral...
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) REP(i, 0, n) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define sz(x) int(x.size()) #define bitsz(x) int(__builtin_popcount(x)) #define all(x) (x).begin(), (x).end() #define ral...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
308
#include <algorithm> #include <iostream> using namespace std; int main() { int n, a, b, ans; cin >> n >> a >> b; ans = n / (a + b); ans += min(n % (a + b), a); cout << ans; }
#include <algorithm> #include <iostream> using namespace std; int main() { long long int n, a, b, ans; cin >> n >> a >> b; ans = n / (a + b) * a; ans += min(n % (a + b), a); cout << ans; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
60
#include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0, xxx_rep_end = (n); i < xxx_rep_end; ++i) #define all(x) (x).begin(), (x).end() template <class T1, class T2> inline bool chmax(T1 &a, const T2 &b) { if (a < b) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0, xxx_rep_end = (n); i < xxx_rep_end; ++i) #define all(x) (x).begin(), (x).end() template <class T1, class T2> inline bool chmax(T1 &a, const T2 &b) { if (a < b) { ...
[["+", 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
186
n, a, b = map(int, input().split()) ans = 0 ans = (n//(a+b)) * a if n%(a+b) > b: ans += b else: ans += n%(a+b) print(ans)
n, a, b = map(int, input().split()) ans = 0 ans = (n//(a+b)) * a if n%(a+b) > a: ans += a else: ans += n%(a+b) 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
63
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int64_t N, A, B, Q, R; cin >> N >> A >> B; Q = N / (A + B); R = N % (A + B); if (R > A) { cout << (A + 1) * Q << endl; } else { cout << A * Q + R << endl; } }
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int64_t N, A, B, Q, R; cin >> N >> A >> B; Q = N / (A + B); R = N % (A + B); if (R > A) { cout << A * Q + A << endl; } else { cout << A * Q + R << endl; } }
[["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["-", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["-", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
86
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, a, b, tt, ans; cin >> n >> a >> b; tt = n / (a + b); ans = tt * a; n %= (a + b); if (n < b) { ans += n; } else { ans += b; } cout << ans << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, a, b, tt, ans; cin >> n >> a >> b; tt = n / (a + b); ans = tt * a; n %= (a + b); if (n < a) { ans += n; } else { ans += a; } cout << ans << '\n'; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22]]
1
100
N,A,B = map(int,input().split()) if A == 1: print(0) exit(0) first = (N // (A+B))*A second = min(A, N % (A+B)) ans = first + second print(ans)
N,A,B = map(int,input().split()) if A == 0: print(0) exit(0) first = (N // (A+B))*A second = min(A, N % (A+B)) ans = first + second print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
67
N,A,B = map(int, input().split()) blue = N//(A+B)*A + N%(A+B) print(blue)
N,A,B = map(int, input().split()) blue = N//(A+B)*A + min(N%(A+B), A) print(blue)
[["+", 0, 1, 0, 662, 12, 657, 12, 652, 63, 22], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 657, 12, 652, 3, 4, 0, 22]]
5
41
# coding: utf-8 import math count = 0 num, blue_num, red_num = map(int, input().split()) all_ball = blue_num + red_num count = num // (all_ball) rest = num % all_ball print(count * all_ball + min(rest, blue_num))
# coding: utf-8 import math count = 0 num, blue_num, red_num = map(int, input().split()) all_ball = blue_num + red_num count = num // all_ball rest = num % all_ball print(count * blue_num + min(rest, blue_num))
[["-", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["-", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22]]
5
54
n,a,b=map(int,input().split()) p=a+b c=n%p d=n//p if d<a: print(c*a+d) else: print((c+1)*a)
n,a,b=map(int,input().split()) p=a+b c=n%p d=n//p if c<a: print(d*a+c) else: print((d+1)*a)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 31, 22], ["+"...
5
58
#include <stdio.h> long long int min(long long int a, long long int b) { return a < b ? a : b; } int main(void) { long long int n, a, b; scanf("%lld %lld %lld", &n, &a, &b); printf("%lld\n", a * n / (a + b) + min(a, n % (a + b))); return 0; }
#include <stdio.h> long long int min(long long int a, long long int b) { return a < b ? a : b; } int main(void) { long long int n, a, b; scanf("%lld %lld %lld", &n, &a, &b); printf("%lld\n", a * (n / (a + b)) + min(a, n % (a + b))); return 0; }
[["+", 3, 4, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
0
94
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T>...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T>...
[["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
194
n,a,b=map(int,input().split()) print(a*(n//(a+b))+n%(a+b))
n,a,b=map(int,input().split()) print(a*(n//(a+b))+min(a,n%(a+b)))
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 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
40
// 有點不耐煩會破壞偉大的計劃 #include <bits/stdc++.h> #define append push_back using namespace std; using ll = long long; const int N = 1e5 + 3; const int M = 1e6 + 7; const long long MOD = 1e9 + 7; const long long INF = 1e14 + 9; const int SM = 1e3 + 5; const int logN = 22, BL = 400; const double EPS = 1e-9, PI = acos(-1); co...
// 有點不耐煩會破壞偉大的計劃 #include <bits/stdc++.h> #define append push_back using namespace std; using ll = long long; const int N = 1e5 + 3; const int M = 1e6 + 7; const long long MOD = 1e9 + 7; const long long INF = 1e14 + 9; const int SM = 1e3 + 5; const int logN = 22, BL = 400; const double EPS = 1e-9, PI = acos(-1); co...
[["+", 64, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21]]
1
264
n,a,b=map(int,input().split()) x=n//(a+b) y=n%(a+b) if(y>=a): print(x*a+a) else: a*x+y
n,a,b=map(int,input().split()) x=n//(a+b) y=n%(a+b) if(y>=a): print(x*a+a) else: print(a*x+y)
[["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
58
n,a,b=map(int,input().split()) t=a+b if n%t<=a: diff=n%t else: diff=a print(a*n//t+diff)
n,a,b=map(int,input().split()) t=a+b if n%t<=a: diff=n%t else: diff=a print(a*(n//t)+diff)
[["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 25]]
5
50
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; typedef long long ll; const ll MOD = 1000000007; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; typedef long long ll; const ll MOD = 1000000007; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1;...
[["+", 0, 1, 0, 11, 12, 16, 12, 2, 63, 22], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 25]]
1
470
N,A,B = map(int,input().split()) n = N//(A+B) m = N%(A+B) k = max(0,m-A) print(n*B+k)
N,A,B = map(int,input().split()) n = N//(A+B) m = N%(A+B) k = min(m,A) print(n*A+k)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+",...
5
54
#include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #define ll long long #define ld long double #define rep(i, n) for (ll i = 0; i < n; ++i) #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rrep(i, a, b) for (ll i = a; i >= b; --i) #define pii ...
#include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #define ll long long #define ld long double #define rep(i, n) for (ll i = 0; i < n; ++i) #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rrep(i, a, b) for (ll i = a; i >= b; --i) #define pii ...
[["+", 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
309
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); i++) using namespace std; typedef unsigned long long ull; typedef long long ll; const ll INF = 1e18; const int MOD = 1e9 + 7; const double pi = acos(-1); int main() { ll n, a, b; cin >> n >> a >> b; ll ans = 0; ans += (n / (a + b)) * a; ...
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); i++) using namespace std; typedef unsigned long long ull; typedef long long ll; const ll INF = 1e18; const int MOD = 1e9 + 7; const double pi = acos(-1); int main() { ll n, a, b; cin >> n >> a >> b; ll ans = 0; ans += (n / (a + b)) * a; ...
[["+", 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
116
#include <bits/stdc++.h> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; cout << N / (A + B) * A + max(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, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22]]
1
55
n,a,b=map(int,input().split()) x=n*a//(a+b) y=n%(a+b) if y<=a: print(x+y) else: print(x+a)
n,a,b=map(int,input().split()) x=n//(a+b) y=n%(a+b) if y<=a: print(a*x+y) else: print(a*x+a)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48]]
5
57
n,a,b=map(int,input().split()) x=n*a//(a+b) y=n%(a+b) if y<a: print(x+y) else: print(x+a)
n,a,b=map(int,input().split()) x=n//(a+b)*a y=n%(a+b) if y<a: print(x+y) else: print(x+a)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
57
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long #define fr(i, a, b) for (int i = a; i <= b; ++i) #define rep(i, a, b) for (int i = a; i < (b); ++i) #define tr...
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define int long long #define fr(i, a, b) for (int i = a; i <= b; ++i) #define rep(i, a, b) for (int i = a; i < (b); ++i) #define tr...
[["+", 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
428
n,a,b = map(int, input().split()) m1 = n // (a + b) m2 = n % (a + b) if a ==0: print(0) elif a >= n: print(n) elif a + b >n: print(a) else: if m2 >= a: print(m1 * (a +1)) else: print(m1 * a + m2)
n,a,b = map(int, input().split()) m1 = n // (a + b) m2 = n % (a + b) if a ==0: print(0) elif a >= n: print(n) elif a + b >n: print(a) else: if m2 >= a: print((m1 + 1) * a ) else: print(m1 * a + m2)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 48], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 31, 22], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
92
N,A,B = map(int, input().split()) X = N//(A+B) Y = N%(A+B) if Y < B: print(A*X+Y) else: print(A*(X+1))
N,A,B = map(int, input().split()) X = N//(A+B) Y = N%(A+B) if Y < A: print(A*X+Y) else: print(A*(X+1))
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
61
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, a, b; cin >> n >> a >> b; cout << n * a / (a + b) + min(n % (a + b), a) << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, a, b; cin >> n >> a >> b; cout << n / (a + b) * a + min(n % (a + b), a) << '\n'; return 0; }
[["-", 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, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22]]
1
74
N,A,B = map(int,input().split()) c = N//(A + B) rem = N - c * (A + B) if rem >= A: sum = c * A + rem else: sum =c + rem print(sum)
N,A,B = map(int,input().split()) c = N//(A + B) rem = N - c * (A + B) if rem >= A: sum = c * A + A else: sum =c * A + rem print(sum)
[["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22]]
5
61
import sys import numpy as np import math as mt read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n, a, b = map(int, readline().split()) ans = a * (n//(a + b)) if n%(a+b) < a: ans += a-n%(a+b) else: ans += a print(ans)
import sys import numpy as np import math as mt read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n, a, b = map(int, readline().split()) ans = a * (n//(a + b)) if n%(a+b) < a: ans += n%(a+b) else: ans += a print(ans)
[["-", 64, 196, 0, 1, 0, 677, 12, 657, 31, 22], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 17, 33]]
5
99
N, A, B = map(int, input().split()) if A==0: print(0) exit(0) x = N//(A+B) y = (N - x*(A+B))%A blue=x*A + (A if y>=A else y%A) print(blue)
N, A, B = map(int, input().split()) if A==0: print(0) exit(0) x = N//(A+B) y = (N - x*(A+B)) blue=x*A + (A if y>=A else y%A) print(blue)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
76
#include <iostream> int main() { long long N, A, B; std::cin >> N >> A >> B; std::cout << A * N / (A + B) + std::min(A, N % (A + B)) << std::endl; return 0; }
#include <iostream> int main() { long long N, A, B; std::cin >> N >> A >> B; std::cout << (N / (A + B)) * A + std::min(A, N % (A + B)) << std::endl; return 0; }
[["-", 31, 16, 12, 16, 31, 16, 31, 16, 31, 22], ["-", 31, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 31, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 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
62
n,a,b = map(int,input().split()) k = n//(a+b) h = min(a,n%(a+b)) print(k+h)
n,a,b = map(int,input().split()) k = n//(a+b) h = min(a,n%(a+b)) print(a*k+h)
[["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48]]
5
47
// God put a smile upon your face <3 #include <bits/stdc++.h> #define slld(longvalue) scanf("%lld", &longvalue) #define ll long long #define ull unsigned long long #define pll pair<long long, long long> #define fastio \ ios_base::sync_with_stdio(fals...
// God put a smile upon your face <3 #include <bits/stdc++.h> #define slld(longvalue) scanf("%lld", &longvalue) #define ll long long #define ull unsigned long long #define pll pair<long long, long long> #define fastio \ ios_base::sync_with_stdio(fals...
[["+", 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
209
n, a, b = map(int, input().split()) ans = n//(a+b)*a n %= (a+b) if n > a: ans += n-b else: ans += n print(ans)
n, a, b = map(int, input().split()) ans = n//(a+b)*a n %= (a+b) if n > a: ans += a else: ans += n print(ans)
[["-", 64, 196, 0, 1, 0, 677, 12, 657, 31, 22], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 17, 33], ["-", 64, 196, 0, 1, 0, 677, 12, 657, 12, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 12, 22]]
5
55
n,a,b=map(int,input().split()) res=a*n//(a+b) if n%(a+b)>=a: res+=a else: res+=n%(a+b) print(res)
n,a,b=map(int,input().split()) res=n//(a+b)*a if n%(a+b)>=a: res+=a else: res+=n%(a+b) print(res)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 31, 22], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
58
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scn = new Scanner(System.in); long N = scn.nextLong(); long A = scn.nextLong(); long B = scn.nextLong(); if (A != 0) { long tmp = (N / (A + B)) * A; tmp += N / (A + B) <= A ? N ...
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scn = new Scanner(System.in); long N = scn.nextLong(); long A = scn.nextLong(); long B = scn.nextLong(); if (A != 0) { long tmp = (N / (A + B)) * A; tmp += N % (A + B) <= A ? N ...
[["-", 0, 11, 12, 510, 15, 16, 31, 16, 17, 85], ["+", 0, 11, 12, 510, 15, 16, 31, 16, 17, 109]]
3
128
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef tuple<int, int, int> T; int main() { ll a, b, n; ll ans; cin >> n >> a >> b; if (a >= n) ans = n; else ans = n / (...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef tuple<int, int, int> T; int main() { ll a, b, n; ll ans; cin >> n >> a >> b; if (a >= n) ans = n; else ans = n / (...
[["+", 0, 1, 0, 11, 12, 16, 12, 2, 63, 22], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 11, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
104
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a, int b) { if ((a % b) * 2 >= b) { return (a / b) + 1; } return a / b; } int gcd(int a, int b) { int c; while (b != 0) { c = a...
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a, int b) { if ((a % b) * 2 >= b) { return (a / b) + 1; } return a / b; } int gcd(int a, int b) { int c; while (b != 0) { c = a...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 31, 22], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 12, 22], ["+...
1
1,215
#include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mod 1000000007ll const ll maxn = 9e18; using namespace std; const ll maxsize = 100000009; void solve() { ll n, b, r, t, rem; cin >> n >> b >> r; t = n / (r + b); rem = n % (r + b); ll ans = t * b; if (t % 2) ans += min(rem, b);...
#include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mod 1000000007ll const ll maxn = 9e18; using namespace std; const ll maxsize = 100000009; void solve() { ll n, b, r, t, rem; cin >> n >> b >> r; t = n / (r + b); rem = n % (r + b); ll ans = t * b; ans += min(rem, b); cout << ans ...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 109], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25]]
1
145
n,a,b = gets.chomp.split(' ').map(&:to_i) puts (n / (a + b)) * a + [(n % (a + b)),b].min
n,a,b = gets.chomp.split(' ').map(&:to_i) puts (n / (a + b)) * a + [(n % (a + b)),a].min
[["-", 3, 4, 0, 738, 12, 652, 486, 516, 0, 22], ["+", 3, 4, 0, 738, 12, 652, 486, 516, 0, 22]]
4
50
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; // n%(a+b) ll per = n / (a + b); n %= (a + b); if (n <= a) cout << n + per * a << endl; else cout << (n - a) + per * a << endl; return 0...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { ll n, a, b; cin >> n >> a >> b; // n%(a+b) ll per = n / (a + b); n %= (a + b); if (n <= a) cout << n + per * a << endl; else cout << a + per * a << endl; return 0; }
[["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["-", 31, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["-", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]]
1
94
n, a, b = map(int, input().split()) x = int(n / (a + b)) y = n - ((a + b) / x) if y >= a: z = a else: z = y print(int(a * x + z))
n, a, b = map(int, input().split()) x = int(n / (a + b)) y = n - ((a + b) * x) if y >= a: z = a else: z = y print(int((a * x) + z))
[["-", 0, 662, 12, 657, 12, 23, 0, 657, 17, 85], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 48], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25]]
5
67
#include <iostream> using namespace std; int main() { long long N; cin >> N; long long A, B; cin >> A >> B; long long count = N / (A + B); N %= A + B; if (N <= A) cout << count * A + N << endl; else cout << count * A + count << endl; }
#include <iostream> using namespace std; int main() { long long N; cin >> N; long long A, B; cin >> A >> B; long long count = N / (A + B); N %= A + B; if (N <= A) cout << count * A + N << endl; else cout << count * A + A << endl; }
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
77
#include <iostream> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long res = 0; res += (res / (A + B)) * A + min(res % (A + B), A); cout << res << endl; }
#include <iostream> using namespace std; int main() { long long N, A, B; cin >> N >> A >> B; long long res = 0; res += (N / (A + B)) * A + min(N % (A + B), A); cout << res << endl; }
[["-", 12, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["-", 12, 16, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 31, 22]]
1
67
n, a, b = map(int,input().split()) c = n % (a + b) d = n // (a + b) if c <= a: ans = d * a + c else: ans = d * a + a + (a - c) print(ans)
n, a, b = map(int,input().split()) c = n % (a + b) d = n // (a + b) if c <= a: ans = d * a + c else: ans = d * a + a print(ans)
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 17, 33], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 12, 22], ["-", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
67
n, a, b = [int(i) for i in input().split()] l = n % (a+b) s = n // (a+b) print(s*a+l)
n, a, b = [int(i) for i in input().split()] l = min(n % (a+b),a) s = n // (a+b) print(s*a+l)
[["+", 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
48
/* #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/rational.hpp> */ #include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, t) for (ll i = (ll)(0); i < (ll)(t); i++) #define rep2(i, s, t) for (ll i = (ll)(s); i < (ll)(t); i++) #d...
/* #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/rational.hpp> */ #include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, t) for (ll i = (ll)(0); i < (ll)(t); i++) #define rep2(i, s, t) for (ll i = (ll)(s); i < (ll)(t); i++) #d...
[["+", 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
2,504
N, A, B = map(int, input().split()) M = N // (A + B) print(A * M + N - M * (A + B))
N, A, B = map(int, input().split()) M = N // (A + B) print(A * M + min(N - M * (A + B), 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, 657, 12, 23, 0, 25], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22]]
5
43
#include <bits/stdc++.h> using namespace std; //#define LOCAL #define fastIO ios::sync_with_stdio(0), cin.tie(0) #define endl '\n' #define ft first #define sd second #define sz size() #define pb push_back #define pob pop_back() #define pf push_front #define pof pop_front() #define all(x) (x).begin(), (x).end() typedef ...
#include <bits/stdc++.h> using namespace std; //#define LOCAL #define fastIO ios::sync_with_stdio(0), cin.tie(0) #define endl '\n' #define ft first #define sd second #define sz size() #define pb push_back #define pob pop_back() #define pf push_front #define pof pop_front() #define all(x) (x).begin(), (x).end() typedef ...
[["-", 49, 50, 51, 16, 31, 23, 0, 16, 17, 109], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 85]]
1
196
#include <stdio.h> int main(void) { long int n, a, b, x, y; scanf("%ld%ld%ld", &n, &a, &b); x = n / (a + b); y = n % (a + b); if (y <= a) printf("%ld", x * a + y); else printf("%ld", x * a + y); return 0; }
#include <stdio.h> int main(void) { long int n, a, b, x, y; scanf("%ld%ld%ld", &n, &a, &b); x = n / (a + b); y = n % (a + b); if (y <= a) printf("%ld\n", x * a + y); else printf("%ld\n", x * a + a); return 0; }
[["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
0
93
import sys N, A, B = map(int, input().split()) if A == 0: print(0) sys.exit() print(A * (N // (A + B)) + N % (A + B))
import sys N, A, B = map(int, input().split()) if A == 0: print(0) sys.exit() print(A * (N // (A + B)) + min(A, N % (A + B)))
[["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 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
56
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll x = 1e9 + 7; const int INF = 1001001001; int main() { ll n, a, b; cin >> n >> a >> b; ll ans = a * (n / (a + b)); ans += min(n % (a + b) - b, b); cout << ans << en...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll x = 1e9 + 7; const int INF = 1001001001; int main() { ll n, a, b; cin >> n >> a >> b; ll ans = a * (n / (a + b)); ans += min(n % (a + b), a); cout << ans << endl; ...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
105
#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; cout << n / (a + b) * a + n % (a + b) << endl; return 0; }
#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; 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
60