aboutsummaryrefslogtreecommitdiff
path: root/codeforces
diff options
context:
space:
mode:
Diffstat (limited to 'codeforces')
-rwxr-xr-xcodeforces/BearAndBigBrother/mainbin0 -> 17832 bytes
-rwxr-xr-xcodeforces/BearAndBigBrother/main.cpp136
-rw-r--r--codeforces/BearAndBigBrother/main_input0.txt1
-rw-r--r--codeforces/BearAndBigBrother/main_input1.txt1
-rw-r--r--codeforces/BearAndBigBrother/main_input2.txt1
-rw-r--r--codeforces/BearAndBigBrother/main_output0.txt1
-rw-r--r--codeforces/BearAndBigBrother/main_output1.txt1
-rw-r--r--codeforces/BearAndBigBrother/main_output2.txt1
-rwxr-xr-xcodeforces/BlankSpace/mainbin0 -> 20360 bytes
-rwxr-xr-xcodeforces/BlankSpace/main.cpp147
-rw-r--r--codeforces/BlankSpace/main_input0.txt11
-rw-r--r--codeforces/BlankSpace/main_output0.txt5
-rwxr-xr-xcodeforces/GameWithBoard/mainbin0 -> 16376 bytes
-rwxr-xr-xcodeforces/GameWithBoard/main.cpp137
-rw-r--r--codeforces/GameWithBoard/main_input0.txt3
-rw-r--r--codeforces/GameWithBoard/main_output0.txt2
-rwxr-xr-xcodeforces/GoldRush/mainbin0 -> 16376 bytes
-rwxr-xr-xcodeforces/GoldRush/main.cpp139
-rw-r--r--codeforces/GoldRush/main_input0.txt12
-rw-r--r--codeforces/GoldRush/main_output0.txt11
-rwxr-xr-xcodeforces/InsertDigit/mainbin0 -> 25848 bytes
-rwxr-xr-xcodeforces/InsertDigit/main.cpp148
-rw-r--r--codeforces/InsertDigit/main_input0.txt23
-rw-r--r--codeforces/InsertDigit/main_output0.txt11
-rwxr-xr-xcodeforces/KeepItBeautiful/mainbin0 -> 43296 bytes
-rwxr-xr-xcodeforces/KeepItBeautiful/main.cpp156
-rw-r--r--codeforces/KeepItBeautiful/main_input0.txt7
-rw-r--r--codeforces/KeepItBeautiful/main_output0.txt3
-rwxr-xr-xcodeforces/LoveStory/mainbin0 -> 24064 bytes
-rwxr-xr-xcodeforces/LoveStory/main.cpp138
-rw-r--r--codeforces/LoveStory/main_input0.txt6
-rw-r--r--codeforces/LoveStory/main_output0.txt5
-rwxr-xr-xcodeforces/Matching/mainbin0 -> 19504 bytes
-rwxr-xr-xcodeforces/Matching/main.cpp149
-rw-r--r--codeforces/Matching/main_input0.txt9
-rw-r--r--codeforces/Matching/main_input1.txt2
-rw-r--r--codeforces/Matching/main_output0.txt8
-rw-r--r--codeforces/Matching/main_output1.txt1
-rwxr-xr-xcodeforces/MrPerfectlFine/mainbin0 -> 17288 bytes
-rwxr-xr-xcodeforces/MrPerfectlFine/main.cpp150
-rw-r--r--codeforces/MrPerfectlFine/main_input0.txt30
-rw-r--r--codeforces/MrPerfectlFine/main_output0.txt6
-rwxr-xr-xcodeforces/SortTheSubarray/mainbin0 -> 33136 bytes
-rwxr-xr-xcodeforces/SortTheSubarray/main.cpp171
-rw-r--r--codeforces/SortTheSubarray/main_input0.txt10
-rw-r--r--codeforces/SortTheSubarray/main_output0.txt3
-rwxr-xr-xcodeforces/Tram/mainbin27800 -> 22664 bytes
-rwxr-xr-xcodeforces/Tram/main.cpp11
-rw-r--r--codeforces/TubeTubeFeed/main.rs51
-rw-r--r--codeforces/TubeTubeFeed/rust-project.json16
-rwxr-xr-xcodeforces/TwoGroups/main.cpp16
-rwxr-xr-xcodeforces/TwoTowers/main.cpp30
-rwxr-xr-xcodeforces/XorAverage/main.cpp39
-rwxr-xr-xcodeforces/Yes-Yes/main.cpp85
-rwxr-xr-xcodeforces/YoungPhysicist/YoungPhysicist.cpp15
55 files changed, 1800 insertions, 108 deletions
diff --git a/codeforces/BearAndBigBrother/main b/codeforces/BearAndBigBrother/main
new file mode 100755
index 0000000..0098166
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main
Binary files differ
diff --git a/codeforces/BearAndBigBrother/main.cpp b/codeforces/BearAndBigBrother/main.cpp
new file mode 100755
index 0000000..d4e9c1f
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main.cpp
@@ -0,0 +1,136 @@
+#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 a, b;
+ cin >> a >> b;
+ int ans = 0;
+ while (a <= b) {
+ a *= 3;
+ b *= 2;
+ ans++;
+ }
+ cout << ans << '\n';
+}
+
+int main () {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ solve();
+}
+
+
diff --git a/codeforces/BearAndBigBrother/main_input0.txt b/codeforces/BearAndBigBrother/main_input0.txt
new file mode 100644
index 0000000..9ac1165
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main_input0.txt
@@ -0,0 +1 @@
+4 7
diff --git a/codeforces/BearAndBigBrother/main_input1.txt b/codeforces/BearAndBigBrother/main_input1.txt
new file mode 100644
index 0000000..aaf5572
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main_input1.txt
@@ -0,0 +1 @@
+4 9
diff --git a/codeforces/BearAndBigBrother/main_input2.txt b/codeforces/BearAndBigBrother/main_input2.txt
new file mode 100644
index 0000000..2fb73a0
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main_input2.txt
@@ -0,0 +1 @@
+1 1
diff --git a/codeforces/BearAndBigBrother/main_output0.txt b/codeforces/BearAndBigBrother/main_output0.txt
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main_output0.txt
@@ -0,0 +1 @@
+2
diff --git a/codeforces/BearAndBigBrother/main_output1.txt b/codeforces/BearAndBigBrother/main_output1.txt
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main_output1.txt
@@ -0,0 +1 @@
+3
diff --git a/codeforces/BearAndBigBrother/main_output2.txt b/codeforces/BearAndBigBrother/main_output2.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/codeforces/BearAndBigBrother/main_output2.txt
@@ -0,0 +1 @@
+1
diff --git a/codeforces/BlankSpace/main b/codeforces/BlankSpace/main
new file mode 100755
index 0000000..4d5ec29
--- /dev/null
+++ b/codeforces/BlankSpace/main
Binary files differ
diff --git a/codeforces/BlankSpace/main.cpp b/codeforces/BlankSpace/main.cpp
new file mode 100755
index 0000000..cfbe4e3
--- /dev/null
+++ b/codeforces/BlankSpace/main.cpp
@@ -0,0 +1,147 @@
+#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 dbg() { cerr << "\n"; }
+
+template <typename T, typename... TS> void dbg(T val, TS... vals) {
+ cerr << val << " ";
+ dbg(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;
+ int ans = 0;
+ for (int i = 0; i < n; i++) {
+ if (v[i] == 0) {
+ int cnt = 0;
+ while (v[i] == 0 && i < n) {
+ cnt++;
+ i++;
+ }
+ ans = max(ans, cnt);
+ }
+ }
+ cout << ans << '\n';
+}
+
+int main() {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while (tt--) {
+ solve();
+ }
+}
diff --git a/codeforces/BlankSpace/main_input0.txt b/codeforces/BlankSpace/main_input0.txt
new file mode 100644
index 0000000..6eaba88
--- /dev/null
+++ b/codeforces/BlankSpace/main_input0.txt
@@ -0,0 +1,11 @@
+5
+5
+1 0 0 1 0
+4
+0 1 1 1
+1
+0
+3
+1 1 1
+9
+1 0 0 0 1 0 0 0 1
diff --git a/codeforces/BlankSpace/main_output0.txt b/codeforces/BlankSpace/main_output0.txt
new file mode 100644
index 0000000..1d18ba1
--- /dev/null
+++ b/codeforces/BlankSpace/main_output0.txt
@@ -0,0 +1,5 @@
+2
+1
+1
+0
+3
diff --git a/codeforces/GameWithBoard/main b/codeforces/GameWithBoard/main
new file mode 100755
index 0000000..20d57ba
--- /dev/null
+++ b/codeforces/GameWithBoard/main
Binary files differ
diff --git a/codeforces/GameWithBoard/main.cpp b/codeforces/GameWithBoard/main.cpp
new file mode 100755
index 0000000..f9df6d0
--- /dev/null
+++ b/codeforces/GameWithBoard/main.cpp
@@ -0,0 +1,137 @@
+#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 dbg() { cerr << "\n"; }
+
+template <typename T, typename... TS> void dbg(T val, TS... vals) {
+ cerr << val << " ";
+ dbg(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;
+ if (n <= 4) {
+ cout << "Bob\n";
+ } else {
+ cout << "Alice\n";
+ }
+}
+
+int main() {
+ ios_base::sync_with_stdio(false);
+ cin.tie(NULL);
+ int tt;
+ cin >> tt;
+ while (tt--) {
+ solve();
+ }
+}
diff --git a/codeforces/GameWithBoard/main_input0.txt b/codeforces/GameWithBoard/main_input0.txt
new file mode 100644
index 0000000..a178d04
--- /dev/null
+++ b/codeforces/GameWithBoard/main_input0.txt
@@ -0,0 +1,3 @@
+2
+3
+6
diff --git a/codeforces/GameWithBoard/main_output0.txt b/codeforces/GameWithBoard/main_output0.txt
new file mode 100644
index 0000000..45531b2
--- /dev/null
+++ b/codeforces/GameWithBoard/main_output0.txt
@@ -0,0 +1,2 @@
+Bob
+Alice
diff --git a/codeforces/GoldRush/main b/codeforces/GoldRush/main
new file mode 100755
index 0000000..dbaf809
--- /dev/null
+++ b/codeforces/GoldRush/main
Binary files differ
diff --git a/codeforces/GoldRush/main.cpp b/codeforces/GoldRush/main.cpp
new file mode 100755
index 0000000..a6de3d9
--- /dev/null
+++ b/codeforces/GoldRush/main.cpp
@@ -0,0 +1,139 @@
+#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 dbg() { cerr << "\n"; }
+
+template <typename T, typename... TS> void dbg(T val, TS... vals) {
+ cerr << val << " ";
+ dbg(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, s;