## 1 https://codeforces.com/problemset/problem/1992/A -- Only Plusses ```cpp= #include <iostream> #include <algorithm> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b, c; cin >> a >> b >> c; int rizz = 5; int sigma[3] = {a, b, c}; sort(sigma, sigma + 3); while (rizz > 0) { if (sigma[0] <= sigma[1] && sigma[0] <= sigma[2]) { sigma[0]++; } else if (sigma[1] <= sigma[0] && sigma[1] <= sigma[2]) { sigma[1]++; } else { sigma[2]++; } rizz--; } int ploh = sigma[0] * sigma[1] * sigma[2]; cout << ploh << endl; } return 0; } ``` ## 2 https://codeforces.com/problemset/problem/1990/A -- Submission bait (wierd name but okay) ```cpp= #include <iostream> #include <vector> #include <algorithm> using namespace std; string s1mple(const vector<int>& a) { int n = a.size(); vector<int> arr = a; sort(arr.begin(), arr.end(), greater<int>()); int scoutfromtf2 = 0; int scoutfromcs2 = 0; for (int i = 0; i < n; ++i) { if (arr[i] >= scoutfromcs2) { scoutfromcs2 = arr[i]; scoutfromtf2++; } } return (scoutfromtf2 % 2 == 1) ? "YES" : "NO"; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } cout << s1mple(a) << endl; } return 0; } ``` ## 3 https://codeforces.com/problemset/problem/1988/A -- Split the Multiset ```cpp= #include <iostream> #include <cmath> using namespace std; int methOperation(int methylamine, int walterwhite) { if (walterwhite == 1) { return methylamine - 1; } return (methylamine - 1 + (walterwhite - 2)) / (walterwhite - 1); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int methylamine, walterwhite; cin >> methylamine >> walterwhite; cout << methOperation(methylamine, walterwhite) << endl; } return 0; } ``` ## 4 https://codeforces.com/problemset/problem/1986/A -- X Axis ```cpp= #include <iostream> #include <algorithm> using namespace std; int guh(int xjuan, int xtoo, int xfree) { int arthurmorgan[3] = {xjuan, xtoo, xfree}; sort(arthurmorgan, arthurmorgan + 3); int dutchvanderline = arthurmorgan[1]; return abs(dutchvanderline - xjuan) + abs(dutchvanderline - xtoo) + abs(dutchvanderline - xfree); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int xjuan, xtoo, xfree; cin >> xjuan >> xtoo >> xfree; cout << guh(xjuan, xtoo, xfree) << endl; } return 0; } ``` ## 5 https://codeforces.com/problemset/problem/1981/A -- Turtle and Piggy Are Playing a Game ```cpp #include <iostream> #include <cmath> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { long long l, r; cin >> l >> r; long long x = 1; while (x <= r) { x *= 2; } if (x > r) { x /= 2; } if (x < l) { cout << 0 << '\n'; } else { int MYNAMEISJOHNMARSTON = log2(x); cout << MYNAMEISJOHNMARSTON << '\n'; } } return 0; } ``` ## 6 https://codeforces.com/problemset/problem/546/A -- Soldier and Bananas ```cpp! #include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; for (int i = 1; i <= c; i++) { b -= i * a; } if (b < 0) cout << abs(b) << endl; else cout << 0; return 0; } ``` ## 7 https://codeforces.com/problemset/problem/236/A -- Boy or Girl ```cpp! #include <iostream> #include <set> using namespace std; int main() { string s; cin >> s; set <char> c; for (int i = 0; i < s.length(); i++) { c.insert(s[i]); } cout << ( ((c.size()) % 2 == 0) ? "CHAT WITH HER!" : "IGNORE HIM!"); return 0; } ``` ## 8 https://codeforces.com/problemset/problem/750/A -- New Year and Hurry ```cpp! #include <iostream> using namespace std; int main() { int n, k; cin >> n >> k; int time = 240 - k; int output = 0; for (int i = 1; i <= n; i++) { time -= 5*i; if (time >= 0) output++; else break; } cout << output << endl; return 0; } ```