more code

This commit is contained in:
Barrett Ruth 2025-01-30 17:06:38 -05:00
parent 7aacde99f4
commit 742bf851a9
149 changed files with 7065 additions and 0 deletions

View file

@ -0,0 +1,9 @@
BasedOnStyle: Google
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: false
AllowShortLoopsOnASingleLine: false

95
codeforces/993/a.cc Normal file
View file

@ -0,0 +1,95 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
print(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int a = b; a < c; ++a)
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
void solve() {
int n;
cin >> n;
cout << n - 1 << '\n';
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}

4
codeforces/993/a.in Normal file
View file

@ -0,0 +1,4 @@
3
2
4
6

104
codeforces/993/b.cc Normal file
View file

@ -0,0 +1,104 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
print(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int a = b; a < c; ++a)
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
void solve() {
string s;
cin >> s;
for (int i = sz(s) - 1; i >= 0; --i) {
if (s[i] == 'w')
cout << 'w';
else if (s[i] == 'p')
cout << 'q';
else
cout << 'p';
}
cout << '\n';
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}

6
codeforces/993/b.in Normal file
View file

@ -0,0 +1,6 @@
5
qwq
ppppp
pppwwwqqq
wqpqwpqwwqp
pqpqpqpq

5
codeforces/993/b.out Normal file
View file

@ -0,0 +1,5 @@
pwp
qqqqq
pppwwwqqq
qpwwpqwpqpw
pqpqpqpq

98
codeforces/993/c.cc Normal file
View file

@ -0,0 +1,98 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
print(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int a = b; a < c; ++a)
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
void solve() {
int m, a, b, c;
cin >> m >> a >> b >> c;
int used = min(a, m) + min(b, m);
int rest = min(2 * m - used, c);
cout << used + rest << '\n';
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}

6
codeforces/993/c.in Normal file
View file

@ -0,0 +1,6 @@
5
10 5 5 10
3 6 1 1
15 14 12 4
1 1 1 1
420 6 9 69

5
codeforces/993/c.out Normal file
View file

@ -0,0 +1,5 @@
20
5
30
2
84

View file

@ -0,0 +1,5 @@
-std=c++20
-Wall
-Wextra
-Wpedantic
-Wshadow

121
codeforces/993/d.cc Normal file
View file

@ -0,0 +1,121 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
dbg(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int a = b; a < c; ++a)
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
void solve() {
int n;
cin >> n;
int maxf = 0;
vector<int> a(n + 1), ans(n);
FOR(i, 0, n) {
int x;
cin >> x;
if (!a[x]) {
a[x] = 1;
ans[i] = x;
}
}
queue<int> q;
FOR(i, 1, n + 1)
if (!a[i])
q.push(i);
FOR(i, 0, n) {
if (!ans[i]) {
ans[i] = q.front();
q.pop();
}
}
FOR(i, 0, n)
cout << ans[i] << ' ';
cout << '\n';
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}

9
codeforces/993/d.in Normal file
View file

@ -0,0 +1,9 @@
4
2
1 2
4
1 1 1 2
8
4 5 5 5 1 1 2 1
10
1 1 2 2 1 1 3 3 1 1

4
codeforces/993/d.out Normal file
View file

@ -0,0 +1,4 @@
1 2
1 3 4 2
4 5 3 6 1 7 2 8
1 4 2 5 6 7 3 8 9 10

125
codeforces/993/e.cc Normal file
View file

@ -0,0 +1,125 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
dbg(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int a = b; a < c; ++a)
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
void solve() {
ll k, l1, r1, l2, r2;
cin >> k >> l1 >> r1 >> l2 >> r2;
/*
y = k ^ n * x
x in [l1, r1]; y in [l2, r2]
y/x=k^n -> n bounded by r2/l1=k^n<-> n=log_k(r2/l1)
knowing n, let A=k^n
y=Ax
left bound = max{l1, ceil(l2/A)}
right bound = min{r1, floor r2/A}
ans += right - left
*/
ll max_n = ceill(log((ld)r2 / l1) / log(k));
ll A = 1;
ll ans = 0;
FOR(_, 0, max_n + 1) {
ll left = max(l1, (ll)ceill((ld)l2 / A));
ll right = min(r1, (ll)floorl((ld)r2 / A));
if (left <= right)
ans += right - left + 1;
A *= k;
}
cout << ans << '\n';
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}

6
codeforces/993/e.in Normal file
View file

@ -0,0 +1,6 @@
5
2 2 6 2 12
2 1 1000000000 1 1000000000
3 5 7 15 63
1000000000 1 5 6 1000000000
15 17 78 2596 20914861

5
codeforces/993/e.out Normal file
View file

@ -0,0 +1,5 @@
12
1999999987
6
1
197

BIN
codeforces/993/e.run Executable file

Binary file not shown.

BIN
codeforces/993/exe Executable file

Binary file not shown.

220
codeforces/993/f.cc Normal file
View file

@ -0,0 +1,220 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
dbg(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int a = b; a < c; ++a)
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// https://mirror.codeforces.com/blog/entry/124683
namespace hashing {
using i64 = std::int64_t;
using u64 = std::uint64_t;
static const u64 FIXED_RANDOM =
std::chrono::steady_clock::now().time_since_epoch().count();
#if USE_AES
std::mt19937 rd(FIXED_RANDOM);
const __m128i KEY1{(i64)rd(), (i64)rd()};
const __m128i KEY2{(i64)rd(), (i64)rd()};
#endif
template <class T, class D = void>
struct custom_hash {};
template <class T>
inline void hash_combine(u64 &seed, T const &v) {
custom_hash<T> hasher;
seed ^= hasher(v) + 0x9e3779b97f4a7c15 + (seed << 12) + (seed >> 4);
};
template <class T>
struct custom_hash<T,
typename std::enable_if<std::is_integral<T>::value>::type> {
u64 operator()(T _x) const {
u64 x = _x;
#if USE_AES
__m128i m{i64(u64(x) * 0xbf58476d1ce4e5b9u64), (i64)FIXED_RANDOM};
__m128i y = _mm_aesenc_si128(m, KEY1);
__m128i z = _mm_aesenc_si128(y, KEY2);
return z[0];
#else
x += 0x9e3779b97f4a7c15 + FIXED_RANDOM;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
#endif
}
};
template <class T>
struct custom_hash<T, std::void_t<decltype(std::begin(std::declval<T>()))>> {
u64 operator()(T const &a) const {
u64 value = FIXED_RANDOM;
for (auto &x : a)
hash_combine(value, x);
return value;
}
};
template <class... T>
struct custom_hash<std::tuple<T...>> {
u64 operator()(const std::tuple<T...> &a) const {
u64 value = FIXED_RANDOM;
std::apply(
[&value](T const &...args) {
(hash_combine(value, args), ...);
},
a);
return value;
}
};
template <class T, class U>
struct custom_hash<std::pair<T, U>> {
u64 operator()(std::pair<T, U> const &a) const {
u64 value = FIXED_RANDOM;
hash_combine(value, a.first);
hash_combine(value, a.second);
return value;
}
};
}; // namespace hashing
#ifdef PB_DS_ASSOC_CNTNR_HPP
template <class Key, class Value>
using hashmap = gp_hash_table<
Key, Value, hashing::custom_hash<Key>, std::equal_to<Key>,
direct_mask_range_hashing<>, linear_probe_fn<>,
hash_standard_resize_policy<hash_exponential_size_policy<>,
hash_load_check_resize_trigger<>, true>>;
template <class Key>
using hashset = gp_hash_table<
Key, null_type, hashing::custom_hash<Key>, std::equal_to<Key>,
direct_mask_range_hashing<>, linear_probe_fn<>,
hash_standard_resize_policy<hash_exponential_size_policy<>,
hash_load_check_resize_trigger<>, true>>;
#endif
#ifdef PB_DS_TREE_POLICY_HPP
template <typename T>
using multiset = tree<T, null_type, std::less_equal<T>, rb_tree_tag,
tree_order_statistics_node_update>;
template <class Key, class Value = null_type>
using rbtree = tree<Key, Value, std::less<Key>, rb_tree_tag,
tree_order_statistics_node_update>;
#endif
void solve() {
int n, m, q;
cin >> n >> m >> q;
dbgln("{} {} {}", n, m, q);
vec<ll> a(n), b(m);
for (auto &e : a)
cin >> e;
for (auto &e : b)
cin >> e;
ll bprod = accumulate(all(b), 1, multiplies<int>());
ll total = n * bprod + accumulate(all(a), 0LL);
hashset<ll> hm;
FOR(i, 0, n) {
FOR(j, 0, m) {
hm.insert(total - n * b[j] - m * a[i] + a[i] * b[j]);
}
}
while (q--) {
int x;
cin >> x;
if (hm.find(x) != hm.end())
YES();
else
NO();
}
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
solve();
return 0;
}

9
codeforces/993/f.in Normal file
View file

@ -0,0 +1,9 @@
3 3 6
-2 3 -3
-2 2 -1
-1
1
-2
2
-3
3

94
codeforces/993/g1.cc Normal file
View file

@ -0,0 +1,94 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
print(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int (a) = (b); (a) < (c); ++(a))
#define ROF(a, b, c) for (int (a) = (b); (a) > (c); --(a))
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
void solve() {
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}

0
codeforces/993/g1.in Normal file
View file

0
codeforces/993/g1.out Normal file
View file

137
codeforces/993/h.cc Normal file
View file

@ -0,0 +1,137 @@
#include <bits/stdc++.h>
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
template <typename... Args>
void dbg(std::string const &str, Args &&...args) {
std::cout << std::vformat(str,
// make_format_args binds arguments to const
std::make_format_args(args...));
}
template <typename T>
void dbg(T const &t) {
std::cout << t;
}
template <std::ranges::range T>
void dbgln(T const &t) {
if constexpr (std::is_convertible_v<T, char const *>) {
std::cout << t << '\n';
} else {
for (auto const &e : t) {
std::cout << e << ' ';
}
std::cout << '\n';
}
}
template <typename... Args>
void dbgln(std::string const &str, Args &&...args) {
dbg(str, std::forward<Args>(args)...);
cout << '\n';
}
template <typename T>
void dbgln(T const &t) {
dbg("{}\n", t);
}
void println() {
std::cout << '\n';
}
template <typename T>
constexpr auto MIN = std::numeric_limits<T>::min();
template <typename T>
constexpr auto MAX = std::numeric_limits<T>::min();
#define ff first
#define ss second
#define eb emplace_back
#define ll long long
#define ld long double
#define vec vector
#define all(x) (x).begin(), (x).end()
#define rall(x) (r).rbegin(), (x).rend()
#define sz(x) static_cast<int>((x).size())
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define ROF(a, b, c) for (int(a) = (b); (a) > (c); --(a))
std::random_device rd;
std::mt19937 gen(rd());
void YES() {
cout << "YES\n";
}
void NO() {
cout << "NO\n";
}
void solve() {
int n, q;
cin >> n;
vec<vec<int>> grid(n, vec<int>(n));
FOR(i, 0, n) {
FOR(j, 0, n) {
cin >> grid[i][j];
}
}
vec<vec<int>> dp(n + 1, vec<int>(n + 1, 1));
while (q--) {
int x1, x2, y1, y2;
cin >> x1 >> x2 >> y1 >> y2;
}
/*
00 01 02 03 04 05 ...
10 11 12 13 14 15 ...
1 * 00 * 2 * 01 + 3 * 02
4 * 01 + 5 *
1 * M[i][j] + 2 * M[i][j + 1] + 3 * M[i][j + 2]
+ 4 * M[i + 1][j] + 5 * M[i + 1][j + 2]
= sum r0 * n + c0 -> r1 * n + c1
1 2
3 4
5 6
1 2 0 0
1 2 + 2 2
1 2 + 4 4
3+4^2+8^3+9^4+13^5+14^6
8+9^2+13^3+14^4 - ( 8^2+9^2+13^2 )
*/
// FIX: cout
dbgln("hi");
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}

16
codeforces/993/h.in Normal file
View file

@ -0,0 +1,16 @@
2
4 3
1 5 2 4
4 9 5 3
4 5 2 3
1 5 5 2
1 1 4 4
2 2 3 3
1 2 4 3
3 3
1 2 3
4 5 6
7 8 9
1 1 1 3
1 3 3 3
2 2 2 2

2
codeforces/993/h.out Normal file
View file

@ -0,0 +1,2 @@
hi
hi

BIN
codeforces/993/h.run Executable file

Binary file not shown.