aboutsummaryrefslogtreecommitdiff
path: root/contests/Round862
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-07-24 13:11:33 +0300
committeromagdy7 <omar.professional8777@gmail.com>2023-07-24 13:11:33 +0300
commit6b548332bfc6469756526002971c422f43f86d0a (patch)
tree261fde23f07c3e20cea375030f0c52863b59228c /contests/Round862
parentcff8cae22ee9c25d193ff976143813f93e658e55 (diff)
downloadcompetitive-programming-6b548332bfc6469756526002971c422f43f86d0a.tar.xz
competitive-programming-6b548332bfc6469756526002971c422f43f86d0a.zip
Removed some empty *.cpp files and Solved some new problems
Diffstat (limited to 'contests/Round862')
-rwxr-xr-xcontests/Round862/A/mainbin0 -> 22480 bytes
-rwxr-xr-xcontests/Round862/A/main.cpp153
-rw-r--r--contests/Round862/A/main_input0.txt11
-rw-r--r--contests/Round862/A/main_output0.txt5
-rwxr-xr-xcontests/Round862/B/mainbin0 -> 52312 bytes
-rwxr-xr-xcontests/Round862/B/main.cpp159
-rw-r--r--contests/Round862/B/main_input0.txt9
-rw-r--r--contests/Round862/B/main_input1.txt3
-rw-r--r--contests/Round862/B/main_output0.txt4
-rw-r--r--contests/Round862/B/main_output1.txt1
-rwxr-xr-xcontests/Round862/C/mainbin0 -> 41192 bytes
-rwxr-xr-xcontests/Round862/C/main.cpp176
-rw-r--r--contests/Round862/C/main_input0.txt22
-rw-r--r--contests/Round862/C/main_input1.txt4
-rw-r--r--contests/Round862/C/main_input2.txt4
-rw-r--r--contests/Round862/C/main_output0.txt19
-rw-r--r--contests/Round862/C/main_output1.txt2
-rw-r--r--contests/Round862/C/main_output2.txt2
-rwxr-xr-xcontests/Round862/D/main.cpp132
-rwxr-xr-xcontests/Round862/E/main.cpp132
-rwxr-xr-xcontests/Round862/F/main.cpp132
21 files changed, 970 insertions, 0 deletions
diff --git a/contests/Round862/A/main b/contests/Round862/A/main
new file mode 100755
index 0000000..f58e479
--- /dev/null
+++ b/contests/Round862/A/main
Binary files differ
diff --git a/contests/Round862/A/main.cpp b/contests/Round862/A/main.cpp
new file mode 100755
index 0000000..439022f
--- /dev/null
+++ b/contests/Round862/A/main.cpp
@@ -0,0 +1,153 @@
+#include<bits/stdc++.h>
+using namespace std;
+
+using ll = long long;
+using pii = pair<int, int>;
+using vpi = vector<pii>;
+using vi = vector<int>;
+using vll = vector<long long>;
+using mpii = map<int, int>;
+using mpll = map<ll, ll>;
+using db = long double;
+
+#define pb push_back
+#define all(x) (x).begin(), (x).end()
+#define rall(x) (x).rbegin(), (x).rend()
+#define lb lower_bound
+#define ub upper_bound
+#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
+#define ceil(a, b) ((a) + (b) - 1) / (b))
+
+const int MOD = (int)1e9 + 7;
+const db PI = acos((db)-1);
+const int dx[4]{1, 0, -1, 0};
+const int dy[4]{0, 1, 0, -1};
+
+template<typename K, typename V> ostream& operator<<(ostream& os, const pair<K, V>& p);
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec);
+template<typename K, typename V> ostream& operator<<(ostream& os, const map<K, V>& m);
+template<typename K, typename V> ostream& operator<<(ostream& os, const unordered_map<K, V>& m);
+template<typename T> ostream& operator<<(ostream& os, const set<T>& s);
+template<typename T> ostream& operator<<(ostream& os, const unordered_set<T>& s);
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const pair<K, V>& p) {
+ os << "(" << p.first << ", " << p.second << ")";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const vector<T>& vec) {
+ os << "{";
+ for (size_t i = 0; i < vec.size(); ++i) {
+ if (i > 0) os << ", ";
+ os << vec[i];
+ }
+ os << "}";
+ return os;
+}
+
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const unordered_map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const unordered_set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+void print() {
+ cerr << "\n";
+}
+
+template<typename T, typename... TS>
+void print(T val, TS... vals) {
+ cerr << val << " ";
+ print(vals...);
+}
+
+
+
+/* stuff you should look for:
+ ---------------------------
+ * special cases (n=1?)
+ * int overflow, array bounds
+ * do smth instead of nothing and stay organized
+ * WRITE STUFF DOWN
+ * DON'T GET STUCK ON ONE APPROACH
+ */
+
+void solve() {
+ int n;
+ cin >> n;
+ vi v(n);
+ for (auto &x : v) {
+ cin >> x;
+ }
+ for (int i = 0; i < (1 << 8); i++) {
+ vi b(n);
+ int x = 0;
+ for (int j = 0; j < n; j++) {
+ b[j] = v[j] ^ i;
+ x ^= b[j];
+ }
+ if (x == 0) {
+ cout << i << '\n';
+ return;
+ }
+ }
+ cout << -1 << '\n';
+
+
+
+}
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--) {
+ solve();
+ }
+}
+
+
diff --git a/contests/Round862/A/main_input0.txt b/contests/Round862/A/main_input0.txt
new file mode 100644
index 0000000..a5980e2
--- /dev/null
+++ b/contests/Round862/A/main_input0.txt
@@ -0,0 +1,11 @@
+5
+3
+1 2 5
+3
+1 2 3
+4
+0 1 2 3
+4
+1 2 2 3
+1
+1
diff --git a/contests/Round862/A/main_output0.txt b/contests/Round862/A/main_output0.txt
new file mode 100644
index 0000000..c731a0f
--- /dev/null
+++ b/contests/Round862/A/main_output0.txt
@@ -0,0 +1,5 @@
+6
+0
+3
+-1
+1
diff --git a/contests/Round862/B/main b/contests/Round862/B/main
new file mode 100755
index 0000000..e47f442
--- /dev/null
+++ b/contests/Round862/B/main
Binary files differ
diff --git a/contests/Round862/B/main.cpp b/contests/Round862/B/main.cpp
new file mode 100755
index 0000000..b256f22
--- /dev/null
+++ b/contests/Round862/B/main.cpp
@@ -0,0 +1,159 @@
+#include<bits/stdc++.h>
+using namespace std;
+
+using ll = long long;
+using pii = pair<int, int>;
+using vpi = vector<pii>;
+using vi = vector<int>;
+using vll = vector<long long>;
+using mpii = map<int, int>;
+using mpll = map<ll, ll>;
+using db = long double;
+
+#define pb push_back
+#define all(x) (x).begin(), (x).end()
+#define rall(x) (x).rbegin(), (x).rend()
+#define lb lower_bound
+#define ub upper_bound
+#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
+#define ceil(a, b) ((a) + (b) - 1) / (b))
+
+const int MOD = (int)1e9 + 7;
+const db PI = acos((db)-1);
+const int dx[4]{1, 0, -1, 0};
+const int dy[4]{0, 1, 0, -1};
+
+template<typename K, typename V> ostream& operator<<(ostream& os, const pair<K, V>& p);
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec);
+template<typename K, typename V> ostream& operator<<(ostream& os, const map<K, V>& m);
+template<typename K, typename V> ostream& operator<<(ostream& os, const unordered_map<K, V>& m);
+template<typename T> ostream& operator<<(ostream& os, const set<T>& s);
+template<typename T> ostream& operator<<(ostream& os, const unordered_set<T>& s);
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const pair<K, V>& p) {
+ os << "(" << p.first << ", " << p.second << ")";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const vector<T>& vec) {
+ os << "{";
+ for (size_t i = 0; i < vec.size(); ++i) {
+ if (i > 0) os << ", ";
+ os << vec[i];
+ }
+ os << "}";
+ return os;
+}
+
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const unordered_map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const unordered_set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+void print() {
+ cerr << "\n";
+}
+
+template<typename T, typename... TS>
+void print(T val, TS... vals) {
+ cerr << val << " ";
+ print(vals...);
+}
+
+
+
+/* stuff you should look for:
+ ---------------------------
+ * special cases (n=1?)
+ * int overflow, array bounds
+ * do smth instead of nothing and stay organized
+ * WRITE STUFF DOWN
+ * DON'T GET STUCK ON ONE APPROACH
+ */
+
+void solve() {
+ int n;
+ cin >> n;
+ string s;
+ cin >> s;
+ map<char, int> mp;
+ string alphabet = "abcdefghijklmnopqrstuvwxyz";
+ for (int i = 0; i < n; i++) {
+ mp[s[i]] = i;
+ }
+ string ans = "";
+ int pos = find(all(alphabet), s[0]) - alphabet.begin();
+ for (int i = 0; i <= pos; i++) {
+ if (mp[alphabet[i]] != 0) {
+ ans += alphabet[i];
+ for (int j = 0; j < n; j++) {
+ if (j != mp[alphabet[i]]) {
+ ans += s[j];
+ }
+ }
+ break;
+ }
+ }
+ if (ans == "") {
+ cout << s << '\n';
+ } else {
+ cout << ans << '\n';
+ }
+
+}
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--) {
+ solve();
+ }
+}
+
+
diff --git a/contests/Round862/B/main_input0.txt b/contests/Round862/B/main_input0.txt
new file mode 100644
index 0000000..8b27b3c
--- /dev/null
+++ b/contests/Round862/B/main_input0.txt
@@ -0,0 +1,9 @@
+4
+3
+cba
+4
+acac
+5
+abbcb
+4
+aaba
diff --git a/contests/Round862/B/main_input1.txt b/contests/Round862/B/main_input1.txt
new file mode 100644
index 0000000..260e893
--- /dev/null
+++ b/contests/Round862/B/main_input1.txt
@@ -0,0 +1,3 @@
+1
+6
+abbaab \ No newline at end of file
diff --git a/contests/Round862/B/main_output0.txt b/contests/Round862/B/main_output0.txt
new file mode 100644
index 0000000..d872337
--- /dev/null
+++ b/contests/Round862/B/main_output0.txt
@@ -0,0 +1,4 @@
+acb
+aacc
+abbcb
+aaab
diff --git a/contests/Round862/B/main_output1.txt b/contests/Round862/B/main_output1.txt
new file mode 100644
index 0000000..b3be43d
--- /dev/null
+++ b/contests/Round862/B/main_output1.txt
@@ -0,0 +1 @@
+aabbab \ No newline at end of file
diff --git a/contests/Round862/C/main b/contests/Round862/C/main
new file mode 100755
index 0000000..6688851
--- /dev/null
+++ b/contests/Round862/C/main
Binary files differ
diff --git a/contests/Round862/C/main.cpp b/contests/Round862/C/main.cpp
new file mode 100755
index 0000000..edb19ce
--- /dev/null
+++ b/contests/Round862/C/main.cpp
@@ -0,0 +1,176 @@
+#include<bits/stdc++.h>
+using namespace std;
+
+using ll = long long;
+using pii = pair<int, int>;
+using vpi = vector<pii>;
+using vi = vector<int>;
+using vll = vector<long long>;
+using mpii = map<int, int>;
+using mpll = map<ll, ll>;
+using db = long double;
+
+#define pb push_back
+#define all(x) (x).begin(), (x).end()
+#define rall(x) (x).rbegin(), (x).rend()
+#define lb lower_bound
+#define ub upper_bound
+#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
+
+const int MOD = (int)1e9 + 7;
+const db PI = acos((db)-1);
+const int dx[4]{1, 0, -1, 0};
+const int dy[4]{0, 1, 0, -1};
+
+template<typename K, typename V> ostream& operator<<(ostream& os, const pair<K, V>& p);
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec);
+template<typename K, typename V> ostream& operator<<(ostream& os, const map<K, V>& m);
+template<typename K, typename V> ostream& operator<<(ostream& os, const unordered_map<K, V>& m);
+template<typename T> ostream& operator<<(ostream& os, const set<T>& s);
+template<typename T> ostream& operator<<(ostream& os, const unordered_set<T>& s);
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const pair<K, V>& p) {
+ os << "(" << p.first << ", " << p.second << ")";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const vector<T>& vec) {
+ os << "{";
+ for (size_t i = 0; i < vec.size(); ++i) {
+ if (i > 0) os << ", ";
+ os << vec[i];
+ }
+ os << "}";
+ return os;
+}
+
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const unordered_map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const unordered_set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+void print() {
+ cerr << "\n";
+}
+
+template<typename T, typename... TS>
+void print(T val, TS... vals) {
+ cerr << val << " ";
+ print(vals...);
+}
+
+
+
+/* stuff you should look for:
+ ---------------------------
+ * special cases (n=1?)
+ * int overflow, array bounds
+ * do smth instead of nothing and stay organized
+ * WRITE STUFF DOWN
+ * DON'T GET STUCK ON ONE APPROACH
+ */
+
+ll mySqrt(ll n) {
+ ll l = 1, r = sqrt(n) + 4;
+ while (l <= r) {
+ ll mid = (l + r) / 2;
+ if (mid * mid <= n) {
+ l = mid + 1;
+ } else {
+ r = mid - 1;
+ }
+ }
+ return l - 1;
+}
+
+void solve() {
+ int n, m;
+ cin >> n >> m;
+ vi lines(n);
+ for (int i = 0; i < n; ++i) {
+ cin >> lines[i];
+ }
+ sort(all(lines));
+ for (int i = 0; i < m; ++i) {
+ ll a, b, c;
+ cin >> a >> b >> c;
+ if (c <= 0) {
+ cout << "NO\n";
+ continue;
+ }
+ ll ac4 = 4LL * a * c;
+ ac4 = mySqrt(ac4);
+ if (ac4 * ac4 != 4 * a * c) {
+ ac4++;
+ }
+ ll toFindL = b - ac4;
+ ll toFindR = b + ac4;
+ int l = ub(all(lines), toFindL) - lines.begin();
+ if (l != n) {
+ if (lines[l] < toFindR) {
+ cout << "YES\n";
+ cout << lines[l] << '\n';
+ } else {
+ cout << "NO\n";
+ }
+ } else {
+ cout << "NO\n";
+ }
+ }
+}
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--) {
+ solve();
+ }
+}
+
+
diff --git a/contests/Round862/C/main_input0.txt b/contests/Round862/C/main_input0.txt
new file mode 100644
index 0000000..097b096
--- /dev/null
+++ b/contests/Round862/C/main_input0.txt
@@ -0,0 +1,22 @@
+5
+1 2
+1
+1 -1 2
+1 -1 3
+2 2
+1
+4
+1 2 1
+2 5 1
+1 1
+0
+1 0 0
+1 1
+100000000
+100000000 100000000 100000000
+2 3
+0
+2
+2 2 1
+1 -2 1
+1 -2 -1
diff --git a/contests/Round862/C/main_input1.txt b/contests/Round862/C/main_input1.txt
new file mode 100644
index 0000000..e6b2ff6
--- /dev/null
+++ b/contests/Round862/C/main_input1.txt
@@ -0,0 +1,4 @@
+1
+1 1
+0
+4 2 1 \ No newline at end of file
diff --git a/contests/Round862/C/main_input2.txt b/contests/Round862/C/main_input2.txt
new file mode 100644
index 0000000..b6984a2
--- /dev/null
+++ b/contests/Round862/C/main_input2.txt
@@ -0,0 +1,4 @@
+1
+1 1
+0
+5 2 1 \ No newline at end of file
diff --git a/contests/Round862/C/main_output0.txt b/contests/Round862/C/main_output0.txt
new file mode 100644
index 0000000..ed2b9fd
--- /dev/null
+++ b/contests/Round862/C/main_output0.txt
@@ -0,0 +1,19 @@
+YES
+1
+YES
+1
+
+YES
+1
+YES
+4
+
+NO
+
+YES
+100000000
+
+YES
+0
+NO
+NO
diff --git a/contests/Round862/C/main_output1.txt b/contests/Round862/C/main_output1.txt
new file mode 100644
index 0000000..2501d40
--- /dev/null
+++ b/contests/Round862/C/main_output1.txt
@@ -0,0 +1,2 @@
+YES
+0 \ No newline at end of file
diff --git a/contests/Round862/C/main_output2.txt b/contests/Round862/C/main_output2.txt
new file mode 100644
index 0000000..2501d40
--- /dev/null
+++ b/contests/Round862/C/main_output2.txt
@@ -0,0 +1,2 @@
+YES
+0 \ No newline at end of file
diff --git a/contests/Round862/D/main.cpp b/contests/Round862/D/main.cpp
new file mode 100755
index 0000000..70c7757
--- /dev/null
+++ b/contests/Round862/D/main.cpp
@@ -0,0 +1,132 @@
+#include<bits/stdc++.h>
+using namespace std;
+
+using ll = long long;
+using pii = pair<int, int>;
+using vpi = vector<pii>;
+using vi = vector<int>;
+using vll = vector<long long>;
+using mpii = map<int, int>;
+using mpll = map<ll, ll>;
+using db = long double;
+
+#define pb push_back
+#define all(x) (x).begin(), (x).end()
+#define rall(x) (x).rbegin(), (x).rend()
+#define lb lower_bound
+#define ub upper_bound
+#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
+#define ceil(a, b) ((a) + (b) - 1) / (b))
+
+const int MOD = (int)1e9 + 7;
+const db PI = acos((db)-1);
+const int dx[4]{1, 0, -1, 0};
+const int dy[4]{0, 1, 0, -1};
+
+template<typename K, typename V> ostream& operator<<(ostream& os, const pair<K, V>& p);
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec);
+template<typename K, typename V> ostream& operator<<(ostream& os, const map<K, V>& m);
+template<typename K, typename V> ostream& operator<<(ostream& os, const unordered_map<K, V>& m);
+template<typename T> ostream& operator<<(ostream& os, const set<T>& s);
+template<typename T> ostream& operator<<(ostream& os, const unordered_set<T>& s);
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const pair<K, V>& p) {
+ os << "(" << p.first << ", " << p.second << ")";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const vector<T>& vec) {
+ os << "{";
+ for (size_t i = 0; i < vec.size(); ++i) {
+ if (i > 0) os << ", ";
+ os << vec[i];
+ }
+ os << "}";
+ return os;
+}
+
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const unordered_map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const unordered_set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+void print() {
+ cerr << "\n";
+}
+
+template<typename T, typename... TS>
+void print(T val, TS... vals) {
+ cerr << val << " ";
+ print(vals...);
+}
+
+
+
+/* stuff you should look for:
+ ---------------------------
+ * special cases (n=1?)
+ * int overflow, array bounds
+ * do smth instead of nothing and stay organized
+ * WRITE STUFF DOWN
+ * DON'T GET STUCK ON ONE APPROACH
+ */
+
+void solve() {
+
+}
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--) {
+ solve();
+ }
+}
+
+
diff --git a/contests/Round862/E/main.cpp b/contests/Round862/E/main.cpp
new file mode 100755
index 0000000..70c7757
--- /dev/null
+++ b/contests/Round862/E/main.cpp
@@ -0,0 +1,132 @@
+#include<bits/stdc++.h>
+using namespace std;
+
+using ll = long long;
+using pii = pair<int, int>;
+using vpi = vector<pii>;
+using vi = vector<int>;
+using vll = vector<long long>;
+using mpii = map<int, int>;
+using mpll = map<ll, ll>;
+using db = long double;
+
+#define pb push_back
+#define all(x) (x).begin(), (x).end()
+#define rall(x) (x).rbegin(), (x).rend()
+#define lb lower_bound
+#define ub upper_bound
+#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
+#define ceil(a, b) ((a) + (b) - 1) / (b))
+
+const int MOD = (int)1e9 + 7;
+const db PI = acos((db)-1);
+const int dx[4]{1, 0, -1, 0};
+const int dy[4]{0, 1, 0, -1};
+
+template<typename K, typename V> ostream& operator<<(ostream& os, const pair<K, V>& p);
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec);
+template<typename K, typename V> ostream& operator<<(ostream& os, const map<K, V>& m);
+template<typename K, typename V> ostream& operator<<(ostream& os, const unordered_map<K, V>& m);
+template<typename T> ostream& operator<<(ostream& os, const set<T>& s);
+template<typename T> ostream& operator<<(ostream& os, const unordered_set<T>& s);
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const pair<K, V>& p) {
+ os << "(" << p.first << ", " << p.second << ")";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const vector<T>& vec) {
+ os << "{";
+ for (size_t i = 0; i < vec.size(); ++i) {
+ if (i > 0) os << ", ";
+ os << vec[i];
+ }
+ os << "}";
+ return os;
+}
+
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const unordered_map<K, V>& m) {
+ os << "{";
+ for (const auto& p : m) {
+ os << p.first << ": " << p.second << ", ";
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const unordered_set<T>& s) {
+ int i = 0;
+ os << "{";
+ for (const auto& e : s) {
+ if (i > 0) os << ", ";
+ os << e;
+ i++;
+ }
+ os << "}";
+ return os;
+}
+
+void print() {
+ cerr << "\n";
+}
+
+template<typename T, typename... TS>
+void print(T val, TS... vals) {
+ cerr << val << " ";
+ print(vals...);
+}
+
+
+
+/* stuff you should look for:
+ ---------------------------
+ * special cases (n=1?)
+ * int overflow, array bounds
+ * do smth instead of nothing and stay organized
+ * WRITE STUFF DOWN
+ * DON'T GET STUCK ON ONE APPROACH
+ */
+
+void solve() {
+
+}
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while(tt--) {
+ solve();
+ }
+}
+
+
diff --git a/contests/Round862/F/main.cpp b/contests/Round862/F/main.cpp
new file mode 100755
index 0000000..70c7757
--- /dev/null
+++ b/contests/Round862/F/main.cpp
@@ -0,0 +1,132 @@
+#include<bits/stdc++.h>
+using namespace std;
+
+using ll = long long;
+using pii = pair<int, int>;
+using vpi = vector<pii>;
+using vi = vector<int>;
+using vll = vector<long long>;
+using mpii = map<int, int>;
+using mpll = map<ll, ll>;
+using db = long double;
+
+#define pb push_back
+#define all(x) (x).begin(), (x).end()
+#define rall(x) (x).rbegin(), (x).rend()
+#define lb lower_bound
+#define ub upper_bound
+#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
+#define ceil(a, b) ((a) + (b) - 1) / (b))
+
+const int MOD = (int)1e9 + 7;
+const db PI = acos((db)-1);
+const int dx[4]{1, 0, -1, 0};
+const int dy[4]{0, 1, 0, -1};
+
+template<typename K, typename V> ostream& operator<<(ostream& os, const pair<K, V>& p);
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec);
+template<typename K, typename V> ostream& operator<<(ostream& os, const map<K, V>& m);
+template<typename K, typename V> ostream& operator<<(ostream& os, const unordered_map<K, V>& m);
+template<typename T> ostream& operator<<(ostream& os, const set<T>& s);
+template<typename T> ostream& operator<<(ostream& os, const unordered_set<T>& s);
+
+template<typename K, typename V>
+ostream& operator<<(ostream& os, const pair<K, V>& p) {
+ os << "(" << p.first << ", " << p.second << ")";
+ return os;
+}
+
+template<typename T>
+ostream& operator<<(ostream& os, const vector<T>& vec) {
+ os << "{";
+ for (size_t i = 0; i < vec.size(); ++i) {
+ if (i > 0) os << ", ";
+ os << vec[i];
+ }
+ os << "}";
+ return os;
+}
+
+
+template<typename K, typename V></