QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#65592 | #693. Hard Times for Your Data | Qingyu | AC ✓ | 847ms | 6884kb | C++23 | 6.0kb | 2022-12-02 10:40:55 | 2022-12-02 10:41:03 |
Judging History
answer
/**
* author: tourist
* created: 01.02.2020 12:34:53
**/
#undef _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(5889);
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) {
return '"' + s + '"';
}
string to_string(const char* s) {
return to_string((string) s);
}
string to_string(bool b) {
return (b ? "true" : "false");
}
string to_string(vector<bool> v) {
bool first = true;
string res = "{";
for (int i = 0; i < static_cast<int>(v.size()); i++) {
if (!first) {
res += ", ";
}
first = false;
res += to_string(v[i]);
}
res += "}";
return res;
}
template <size_t N>
string to_string(bitset<N> v) {
string res = "";
for (size_t i = 0; i < N; i++) {
res += static_cast<char>('0' + v[i]);
}
return res;
}
template <typename A>
string to_string(A v) {
bool first = true;
string res = "{";
for (const auto &x : v) {
if (!first) {
res += ", ";
}
first = false;
res += to_string(x);
}
res += "}";
return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
cerr << " " << to_string(H);
debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<int> limit(n);
long long expected = 0;
for (int i = 0; i < n; i++) {
cin >> limit[i];
expected += limit[i];
}
assert(expected % 2 == 0);
expected /= 2;
vector<vector<int>> c(n, vector<int>(n, 0));
vector<vector<int>> f(n, vector<int>(n, 0));
vector<int> total(n);
for (int i = 0; i < m; i++) {
int x, y, z;
cin >> x >> y >> z;
--x; --y;
c[x][y] = c[y][x] = z;
total[x] += z;
total[y] += z;
}
long long sum_total = 0;
long long sum_limit = 0;
for (int i = 0; i < n; i++) {
sum_total += total[i];
sum_limit += limit[i];
}
bool flip = false;
auto backup_limit = limit;
if (sum_limit > sum_total - sum_limit) {
expected = 0;
for (int i = 0; i < n; i++) {
limit[i] = total[i] - limit[i];
expected += limit[i];
}
expected /= 2;
flip = true;
}
vector<int> have(n, 0);
vector<int> was(n, -1);
int T = 0;
vector<int> order(n);
iota(order.begin(), order.end(), 0);
function<int(int, int)> Dfs = [&](int v, int flow) {
assert(flow <= limit[v] - have[v]);
was[v] = T;
int ret = 0;
for (int u : order) {
if (have[u] < limit[u] && c[v][u] > f[v][u]) {
int take = min(limit[u] - have[u], min(c[v][u] - f[v][u], flow));
f[v][u] += take;
f[u][v] += take;
have[u] += take;
have[v] += take;
flow -= take;
ret += take;
if (flow == 0) {
return ret;
}
}
}
for (int i = 1; i < n; i++) {
swap(order[i], order[rng() % (i + 1)]);
}
for (int u : order) {
if (c[v][u] > f[v][u]) {
for (int w : order) {
if (was[w] != T && f[u][w] > 0) {
flow = min(flow, limit[v] - have[v]);
int take = min(flow, min(c[v][u] - f[v][u], f[u][w]));
f[v][u] += take;
f[u][v] += take;
f[u][w] -= take;
f[w][u] -= take;
have[v] += take;
have[w] -= take;
int rt = Dfs(w, take);
int take_back = min(take - rt, min(limit[w] - have[w], min(f[u][v], c[u][w] - f[u][w])));
f[v][u] -= take_back;
f[u][v] -= take_back;
f[u][w] += take_back;
f[w][u] += take_back;
have[v] -= take_back;
have[w] += take_back;
flow -= rt;
flow = min(flow, limit[v] - have[v]);
ret += rt;
if (flow == 0) {
return ret;
}
}
}
}
}
return ret;
};
long long found = 0;
bool last_zero = false;
for (int iter = 0; ; iter++) {
if (found == expected) {
break;
}
shuffle(order.begin(), order.end(), rng);
long long delta = 0;
for (int i : order) {
if (have[i] < limit[i]) {
++T;
int rt = Dfs(i, !last_zero ? limit[i] - have[i] : (limit[i] - have[i] + 1) / 2);
found += rt;
delta += rt;
if (found == expected) {
break;
}
}
}
last_zero = (delta == 0);
// debug(have, f);
}
vector<tuple<int, int, int>> res;
vector<int> got(n);
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (flip) {
f[i][j] = c[i][j] - f[i][j];
}
if (i < j && f[i][j] > 0) {
assert(f[i][j] <= c[i][j]);
res.emplace_back(i, j, f[i][j]);
got[i] += f[i][j];
got[j] += f[i][j];
}
}
}
assert(got == backup_limit);
cout << res.size() << '\n';
for (auto& p : res) {
cout << get<0>(p) + 1 << " " << get<1>(p) + 1 << " " << get<2>(p) << '\n';
}
cerr << "time = " << clock() << " ms" << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3460kb
input:
5 6 3 1 1 1 2 1 2 1 1 4 1 2 3 2 2 4 1 3 4 1 1 5 3
output:
3 1 2 1 1 5 2 3 4 1
result:
ok OK
Test #2:
score: 0
Accepted
time: 2ms
memory: 3528kb
input:
10 30 5 6 1 3 5 4 2 5 3 6 1 2 1 1 4 1 1 7 1 1 8 1 1 10 1 2 3 1 2 5 1 2 6 1 2 8 1 2 10 1 4 5 1 4 10 1 5 6 1 5 8 1 5 9 1 6 8 1 6 9 1 7 10 1 8 10 1 9 10 1 6 7 1 3 9 1 4 7 1 7 9 1 3 4 1 3 7 1 8 9 1 3 8 1 6 10 1 3 5 1
output:
20 1 2 1 1 4 1 1 7 1 1 8 1 1 10 1 2 3 1 2 5 1 2 6 1 2 8 1 2 10 1 4 5 1 4 10 1 5 6 1 5 8 1 5 9 1 6 8 1 6 10 1 7 10 1 8 9 1 9 10 1
result:
ok OK
Test #3:
score: 0
Accepted
time: 2ms
memory: 5536kb
input:
500 1500 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 285 1 2 484 1 3 455 1 4 145 1 5 287 1 6 483 1 7 221 1 8 199 1 9 120 1 10 493 1 11 98 1 12 151 1 13 185 1 14 85 1 15 463 1 16 154 1 17 62 1 18 320 1 19 466 1 20 313 1 21 230 1 22 310 1 23 160 1 24 257 1 25 168 1 26 311 1 27 392 1 28 36 1 29 47 1 30 496 1 31 208 1 32 478 1 33 92 1 34 288 1 35 43...
result:
ok OK
Test #4:
score: 0
Accepted
time: 2ms
memory: 3484kb
input:
30 100 5 5 7 2 7 6 1 4 1 3 5 3 3 5 5 3 4 4 2 7 5 2 4 6 4 5 2 2 5 3 1 4 1 1 8 1 1 12 1 1 21 1 1 26 1 2 5 1 2 8 1 2 14 1 2 24 1 2 29 1 3 5 1 3 13 1 3 15 1 3 17 1 3 19 1 3 20 1 3 23 1 4 11 1 5 7 1 5 14 1 5 20 1 5 24 1 5 26 1 6 10 1 6 17 1 6 24 1 6 25 1 6 27 1 6 28 1 8 17 1 8 22 1 9 20 1 10 24 1 10 29 1...
output:
60 1 4 1 1 8 1 1 12 1 1 21 1 1 26 1 2 6 1 2 14 1 2 15 1 2 23 1 2 24 1 3 5 1 3 6 1 3 8 1 3 13 1 3 15 1 3 17 1 3 20 1 4 12 1 5 7 1 5 14 1 5 20 1 5 23 1 5 24 1 5 26 1 6 10 1 6 14 1 6 17 1 6 24 1 8 17 1 8 24 1 9 29 1 10 24 1 10 29 1 11 13 1 11 19 1 11 20 1 11 24 1 11 30 1 12 21 1 13 18 1 14 18 1 14 28 1...
result:
ok OK
Test #5:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
8 28 4 4 3 6 3 5 5 6 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 2 3 1 2 4 1 2 5 1 2 6 1 2 7 1 2 8 1 3 4 1 3 5 1 3 6 1 3 7 1 3 8 1 4 5 1 4 6 1 4 7 1 4 8 1 5 6 1 5 7 1 5 8 1 6 7 1 6 8 1 7 8 1
output:
18 1 4 1 1 6 1 1 7 1 1 8 1 2 4 1 2 6 1 2 7 1 2 8 1 3 4 1 3 6 1 3 7 1 4 5 1 4 6 1 4 8 1 5 7 1 5 8 1 6 8 1 7 8 1
result:
ok OK
Test #6:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
20 50 5 2 3 3 4 5 2 2 1 5 8 6 5 3 3 5 3 5 4 6 1 6 1 1 10 1 1 13 1 1 19 1 1 20 1 2 15 1 2 18 1 3 8 1 3 18 1 3 20 1 4 10 1 4 11 1 4 16 1 5 10 1 5 11 1 5 14 1 5 20 1 6 11 1 6 13 1 6 17 1 6 19 1 7 18 1 7 19 1 8 12 1 9 11 1 10 14 1 10 17 1 11 12 1 11 13 1 11 16 1 11 20 1 12 13 1 12 15 1 12 16 1 12 17 1 1...
output:
40 1 6 1 1 10 1 1 13 1 1 19 1 1 20 1 2 15 1 2 18 1 3 8 1 3 13 1 3 20 1 4 10 1 4 11 1 4 19 1 5 9 1 5 11 1 5 14 1 5 20 1 6 11 1 6 13 1 6 17 1 6 19 1 7 18 1 7 19 1 8 12 1 10 14 1 10 16 1 10 17 1 11 12 1 11 13 1 11 16 1 11 18 1 11 20 1 12 13 1 12 15 1 12 16 1 12 17 1 14 18 1 15 16 1 16 20 1 18 20 1
result:
ok OK
Test #7:
score: 0
Accepted
time: 2ms
memory: 3540kb
input:
50 200 5 1 4 2 5 5 4 3 3 2 4 3 2 8 2 8 3 2 5 3 5 2 5 2 4 3 2 3 2 2 2 5 3 1 3 3 6 2 2 1 4 2 4 1 2 6 2 2 3 2 1 3 1 1 18 1 1 25 1 1 31 1 1 37 1 2 17 1 3 13 1 3 14 1 3 17 1 4 21 1 4 38 1 5 32 1 5 35 1 5 43 1 5 45 1 5 49 1 6 16 1 6 19 1 6 21 1 6 37 1 6 41 1 7 21 1 7 36 1 7 39 1 7 42 1 8 16 1 8 29 1 8 37 ...
output:
80 1 3 1 1 9 1 1 12 1 1 25 1 1 37 1 2 17 1 3 6 1 3 14 1 3 28 1 4 14 1 4 31 1 5 9 1 5 23 1 5 35 1 5 37 1 5 45 1 6 16 1 6 19 1 6 37 1 6 47 1 7 21 1 7 36 1 7 39 1 7 42 1 8 16 1 8 29 1 8 42 1 9 11 1 10 13 1 10 34 1 11 14 1 11 46 1 11 49 1 12 15 1 12 37 1 13 16 1 14 20 1 14 29 1 14 41 1 14 44 1 14 46 1 1...
result:
ok OK
Test #8:
score: 0
Accepted
time: 7ms
memory: 5576kb
input:
500 1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 77 1 2 259 1 3 97 1 4 352 1 5 463 1 6 226 1 7 305 1 8 413 1 9 297 1 10 114 1 11 227 1 12 416 1 13 432 1 14 177 1 15 456 1 16 199 1 17 76 1 18 325 1 19 119 1 20 364 1 21 187 1 22 309 1 23 398 1 24 267 1 25 246 1 26 176 1 27 116 1 28 276 1 29 346 1 30 409 1 31 375 1 32 56 1 33 408 1 34 184 1 35 ...
result:
ok OK
Test #9:
score: 0
Accepted
time: 7ms
memory: 5548kb
input:
500 1500 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 483 1 2 161 1 3 490 1 4 11 1 5 115 1 6 99 1 7 195 1 8 61 1 9 255 1 10 368 1 12 436 1 13 268 1 14 243 1 15 472 1 16 428 1 17 342 1 18 422 1 19 197 1 20 360 1 21 311 1 22 67 1 23 139 1 24 97 1 25 442 1 26 467 1 27 464 1 28 318 1 29 241 1 30 112 1 31 158 1 32 423 1 33 489 1 34 306 1 35 363 1 36 3...
result:
ok OK
Test #10:
score: 0
Accepted
time: 4ms
memory: 5636kb
input:
500 1400 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 87 1 2 371 1 3 45 1 4 322 1 5 446 1 6 111 1 7 385 1 8 363 1 9 206 1 10 288 1 11 241 1 12 383 1 13 172 1 14 215 1 15 319 1 16 216 1 17 497 1 18 63 1 19 157 1 20 167 1 21 234 1 22 437 1 23 424 1 24 139 1 25 218 1 26 116 1 27 208 1 28 306 1 29 325 1 30 195 1 31 89 1 32 340 1 33 305 1 34 51 1 35 2...
result:
ok OK
Test #11:
score: 0
Accepted
time: 5ms
memory: 5488kb
input:
500 1400 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 157 1 2 84 1 3 67 1 4 306 1 5 83 1 6 133 1 7 74 1 8 494 1 9 145 1 10 199 1 11 97 1 12 453 1 13 108 1 14 226 1 15 147 1 16 269 1 17 118 1 18 228 1 19 480 1 20 191 1 21 478 1 22 132 1 23 350 1 24 450 1 25 35 1 26 374 1 27 222 1 28 426 1 29 461 1 30 273 1 31 407 1 32 240 1 33 275 1 34 448 1 36 18...
result:
ok OK
Test #12:
score: 0
Accepted
time: 6ms
memory: 5520kb
input:
500 4500 6 8 4 11 6 9 11 3 6 3 9 13 5 7 7 8 14 8 12 6 6 6 9 9 11 4 8 11 10 7 8 5 7 3 6 7 6 10 6 8 11 7 4 7 7 11 8 7 8 10 5 7 11 11 5 5 11 7 8 12 14 10 8 8 4 8 8 8 10 11 3 6 7 9 6 9 5 4 8 8 7 10 11 9 4 6 5 12 9 5 10 3 7 8 11 9 11 9 10 7 11 8 9 9 8 7 9 8 10 5 7 5 10 12 9 16 9 7 9 11 8 7 9 6 9 10 7 8 5...
output:
2000 1 107 1 1 130 1 1 238 1 1 279 1 1 451 1 1 455 1 2 89 1 2 181 1 2 213 1 2 218 1 2 358 1 2 379 1 2 426 1 2 446 1 3 34 1 3 166 1 3 272 1 3 448 1 4 29 1 4 50 1 4 96 1 4 109 1 4 164 1 4 165 1 4 237 1 4 246 1 4 345 1 4 365 1 4 465 1 5 50 1 5 83 1 5 138 1 5 263 1 5 288 1 5 321 1 6 59 1 6 64 1 6 80 1 6...
result:
ok OK
Test #13:
score: 0
Accepted
time: 4ms
memory: 5668kb
input:
500 8000 22 32 20 22 24 24 25 27 33 25 33 29 19 28 33 32 33 29 22 26 28 37 30 28 22 28 28 30 25 32 31 30 24 25 27 25 37 31 28 25 32 32 28 28 25 23 24 29 33 22 34 32 28 31 27 25 22 43 31 22 32 27 30 32 32 25 30 27 28 22 28 26 25 34 24 30 35 29 21 30 30 25 28 28 26 25 38 35 22 28 24 34 18 34 24 22 32 ...
output:
7000 1 14 1 1 36 1 1 84 1 1 189 1 1 219 1 1 228 1 1 229 1 1 236 1 1 238 1 1 242 1 1 247 1 1 253 1 1 260 1 1 301 1 1 314 1 1 326 1 1 371 1 1 372 1 1 377 1 1 396 1 1 426 1 1 452 1 2 19 1 2 21 1 2 42 1 2 74 1 2 80 1 2 83 1 2 103 1 2 126 1 2 161 1 2 189 1 2 247 1 2 272 1 2 279 1 2 292 1 2 308 1 2 329 1 ...
result:
ok OK
Test #14:
score: 0
Accepted
time: 8ms
memory: 5580kb
input:
500 9000 35 32 42 35 48 26 34 23 31 33 29 38 33 39 34 33 38 29 23 41 34 34 31 30 35 24 31 32 28 33 25 24 25 37 20 30 36 44 38 31 27 33 33 26 36 25 27 20 35 33 30 33 25 30 25 37 22 24 28 30 34 26 45 31 30 43 29 33 36 29 28 21 36 29 30 37 32 31 38 34 35 37 29 30 29 35 29 33 41 29 34 40 33 35 25 31 29 ...
output:
8000 1 22 1 1 30 1 1 36 1 1 39 1 1 62 1 1 65 1 1 70 1 1 76 1 1 102 1 1 125 1 1 133 1 1 141 1 1 155 1 1 172 1 1 176 1 1 197 1 1 213 1 1 231 1 1 312 1 1 313 1 1 317 1 1 337 1 1 338 1 1 343 1 1 344 1 1 350 1 1 366 1 1 389 1 1 396 1 1 397 1 1 406 1 1 417 1 1 486 1 1 488 1 1 493 1 2 12 1 2 58 1 2 65 1 2 ...
result:
ok OK
Test #15:
score: 0
Accepted
time: 3ms
memory: 5648kb
input:
500 1500 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 35 1 2 181 1 3 117 1 4 66 1 5 146 1 6 166 1 7 387 1 8 247 1 9 12 1 10 136 1 11 149 1 13 284 1 14 207 1 15 302 1 16 401 1 17 343 1 18 186 1 19 190 1 20 454 1 21 331 1 22 80 1 23 147 1 24 201 1 25 38 1 26 376 1 27 293 1 28 262 1 29 43 1 30 378 1 31 154 1 32 45 1 33 431 1 34 415 1 36 74 1 37 278 ...
result:
ok OK
Test #16:
score: 0
Accepted
time: 2ms
memory: 3600kb
input:
100 1000 3 6 3 4 7 3 3 2 5 5 2 4 4 5 2 3 3 1 3 3 6 4 7 3 5 2 3 7 2 4 6 4 4 3 6 2 3 7 3 4 3 2 2 3 6 1 4 3 6 5 4 6 2 7 2 1 2 2 6 5 4 5 5 7 7 7 2 3 5 2 5 2 4 1 6 2 6 8 5 2 4 4 4 7 6 2 5 5 4 4 2 2 4 8 6 5 1 3 4 4 1 13 1 1 28 1 1 77 1 2 9 1 2 14 1 2 38 1 2 75 1 2 98 1 2 100 1 3 58 1 3 68 1 3 96 1 4 69 1 ...
output:
200 1 25 1 1 62 1 1 69 1 2 54 1 2 61 1 2 64 1 2 75 1 2 96 1 2 100 1 3 25 1 3 50 1 3 58 1 4 36 1 4 72 1 4 85 1 4 94 1 5 12 1 5 19 1 5 24 1 5 30 1 5 54 1 5 77 1 5 100 1 6 13 1 6 43 1 6 46 1 7 11 1 7 81 1 7 96 1 8 33 1 8 87 1 9 35 1 9 39 1 9 44 1 9 82 1 9 84 1 10 30 1 10 34 1 10 54 1 10 66 1 10 78 1 11...
result:
ok OK
Test #17:
score: 0
Accepted
time: 4ms
memory: 3920kb
input:
200 5000 13 10 8 5 12 6 15 9 12 12 10 8 9 9 12 14 10 13 4 9 6 13 15 12 6 15 5 8 13 6 10 11 5 11 10 13 10 7 10 8 14 12 17 10 9 11 13 6 9 8 8 11 11 11 8 11 19 9 12 11 12 7 11 12 7 7 5 4 6 6 11 11 7 10 13 10 13 11 17 7 14 5 12 11 14 6 9 8 11 12 14 6 10 11 11 11 17 7 14 15 6 5 6 6 11 16 5 8 4 8 8 6 11 1...
output:
1000 1 35 1 1 42 1 1 43 1 1 59 1 1 88 1 1 129 1 1 145 1 1 154 1 1 160 1 1 176 1 1 183 1 1 185 1 1 196 1 2 9 1 2 16 1 2 20 1 2 29 1 2 46 1 2 54 1 2 130 1 2 179 1 2 183 1 2 191 1 3 46 1 3 89 1 3 130 1 3 174 1 3 176 1 3 179 1 3 199 1 3 200 1 4 18 1 4 36 1 4 109 1 4 136 1 4 144 1 5 18 1 5 38 1 5 40 1 5 ...
result:
ok OK
Test #18:
score: 0
Accepted
time: 11ms
memory: 4372kb
input:
300 30000 67 70 83 76 68 63 62 58 62 69 60 80 64 73 74 60 66 52 69 64 68 71 74 68 62 67 62 72 75 83 73 67 73 70 69 70 73 70 78 72 62 79 66 78 76 50 67 73 61 67 77 83 66 65 59 64 75 66 63 75 65 62 51 64 68 70 80 60 50 58 69 51 63 72 79 57 72 73 70 58 68 76 69 72 63 63 66 79 63 58 62 68 65 60 67 70 67...
output:
10000 1 4 1 1 10 1 1 20 1 1 21 1 1 31 1 1 32 1 1 33 1 1 35 1 1 38 1 1 40 1 1 42 1 1 46 1 1 59 1 1 63 1 1 64 1 1 65 1 1 66 1 1 70 1 1 73 1 1 80 1 1 88 1 1 91 1 1 98 1 1 103 1 1 107 1 1 108 1 1 111 1 1 112 1 1 128 1 1 130 1 1 134 1 1 136 1 1 138 1 1 141 1 1 142 1 1 143 1 1 150 1 1 154 1 1 155 1 1 157 ...
result:
ok OK
Test #19:
score: 0
Accepted
time: 0ms
memory: 4840kb
input:
400 500 3 1 1 4 4 2 2 3 4 1 6 2 1 4 1 2 1 3 2 1 1 6 4 2 2 3 3 2 3 3 4 3 2 2 2 1 1 3 1 1 2 2 1 3 2 1 1 2 2 3 2 4 1 1 3 2 1 2 1 2 1 1 2 2 1 2 3 4 1 2 1 1 4 3 2 3 2 2 1 2 1 1 1 2 1 1 1 4 1 1 3 1 2 2 2 3 1 3 1 2 3 5 1 2 1 3 2 2 2 2 2 2 1 4 2 1 1 2 2 1 2 1 2 3 2 1 3 2 3 1 3 3 3 3 1 4 2 1 2 3 1 1 3 1 2 1 ...
output:
400 1 73 1 1 89 1 1 282 1 2 114 1 3 25 1 4 212 1 4 230 1 4 272 1 4 370 1 5 76 1 5 84 1 5 279 1 5 395 1 6 11 1 6 182 1 7 34 1 7 381 1 8 59 1 8 176 1 8 315 1 9 39 1 9 76 1 9 318 1 9 383 1 10 163 1 11 119 1 11 163 1 11 184 1 11 190 1 11 388 1 12 209 1 12 322 1 13 14 1 14 34 1 14 87 1 14 162 1 15 52 1 1...
result:
ok OK
Test #20:
score: 0
Accepted
time: 27ms
memory: 5656kb
input:
500 124750 3 4 6 4 6 6 7 5 9 5 7 3 5 3 4 2 7 3 5 5 4 4 2 3 6 3 7 8 6 4 4 5 3 5 6 5 6 6 4 3 5 6 5 5 7 5 3 5 6 7 3 5 8 3 7 5 5 4 3 2 6 6 7 2 7 4 7 2 4 7 6 6 4 5 4 5 4 2 6 4 3 7 4 6 8 5 4 2 4 7 3 5 4 7 4 4 5 4 8 4 7 3 3 5 4 2 7 4 9 8 4 4 4 7 5 4 5 4 4 5 4 9 6 2 3 5 2 4 5 9 7 3 5 2 2 3 8 2 5 4 3 7 4 6 3...
output:
1200 1 31 1 1 46 1 1 409 1 2 186 1 2 193 1 2 316 1 2 358 1 3 29 1 3 59 1 3 107 1 3 222 1 3 360 1 3 446 1 4 17 1 4 53 1 4 267 1 4 368 1 5 37 1 5 254 1 5 306 1 5 335 1 5 385 1 5 457 1 6 55 1 6 57 1 6 286 1 6 336 1 6 359 1 6 412 1 7 52 1 7 184 1 7 238 1 7 273 1 7 287 1 7 425 1 7 430 1 8 49 1 8 74 1 8 7...
result:
ok OK
Test #21:
score: 0
Accepted
time: 15ms
memory: 5512kb
input:
500 124750 6 5 5 4 4 5 6 7 3 3 8 4 6 5 12 6 8 7 5 8 10 8 5 6 5 7 4 6 7 1 4 4 7 3 7 6 4 9 7 4 11 8 6 7 8 6 10 2 7 5 5 7 7 14 7 5 7 6 9 5 6 3 6 6 6 7 7 3 4 7 8 6 5 5 4 8 6 8 12 4 6 9 5 7 6 5 5 7 5 5 3 9 8 6 7 5 2 6 6 7 5 6 4 5 5 3 7 5 7 4 9 7 4 5 9 6 7 4 4 4 4 9 10 6 11 4 4 2 4 4 3 5 4 3 3 6 5 6 6 8 6...
output:
1500 1 46 1 1 107 1 1 214 1 1 381 1 1 383 1 1 473 1 2 186 1 2 193 1 2 227 1 2 316 1 2 358 1 3 29 1 3 59 1 3 222 1 3 360 1 3 446 1 4 17 1 4 21 1 4 267 1 4 368 1 5 329 1 5 385 1 5 457 1 5 478 1 6 55 1 6 57 1 6 79 1 6 286 1 6 412 1 7 52 1 7 184 1 7 273 1 7 287 1 7 425 1 7 430 1 8 49 1 8 74 1 8 76 1 8 1...
result:
ok OK
Test #22:
score: 0
Accepted
time: 19ms
memory: 5584kb
input:
500 124750 9 9 6 6 8 7 6 5 10 5 11 10 5 3 4 9 10 4 8 11 5 7 6 8 6 4 6 13 8 10 8 6 7 9 5 4 10 7 3 6 7 5 5 9 5 7 9 8 7 11 11 4 14 8 11 5 6 5 4 6 8 8 6 5 5 9 12 10 9 10 7 8 9 10 5 4 13 13 4 5 7 7 5 5 4 6 7 7 7 6 10 6 5 6 6 9 9 5 7 7 7 10 6 7 9 7 5 9 2 7 6 11 3 5 6 6 9 10 5 8 4 7 4 11 6 4 5 3 6 6 6 3 11...
output:
1700 1 3 1 1 29 1 1 31 1 1 46 1 1 59 1 1 107 1 1 214 1 1 222 1 1 383 1 2 18 1 2 109 1 2 156 1 2 193 1 2 221 1 2 316 1 2 348 1 2 358 1 2 413 1 3 29 1 3 59 1 3 222 1 3 383 1 3 446 1 4 17 1 4 53 1 4 267 1 4 303 1 4 368 1 4 494 1 5 37 1 5 139 1 5 254 1 5 306 1 5 317 1 5 329 1 5 371 1 5 385 1 6 28 1 6 55...
result:
ok OK
Test #23:
score: 0
Accepted
time: 27ms
memory: 5540kb
input:
500 124750 8 8 11 7 9 9 8 8 7 8 12 9 8 9 10 11 6 7 11 12 12 9 7 9 9 5 7 8 2 7 12 9 8 7 8 8 8 11 9 9 11 14 5 8 4 13 11 9 6 12 11 7 5 6 6 8 6 12 10 13 9 11 9 7 8 12 12 7 7 10 6 15 8 9 6 10 8 11 15 7 12 10 13 11 11 7 11 6 9 13 6 6 11 9 7 7 10 12 6 8 8 12 11 11 11 9 12 13 4 6 9 11 9 14 14 10 5 9 14 7 6 ...
output:
2300 1 3 1 1 31 1 1 46 1 1 59 1 1 107 1 1 297 1 1 381 1 1 383 1 2 18 1 2 186 1 2 193 1 2 227 1 2 316 1 2 334 1 2 348 1 2 480 1 3 59 1 3 107 1 3 209 1 3 222 1 3 341 1 3 355 1 3 360 1 3 383 1 3 432 1 3 446 1 4 21 1 4 134 1 4 267 1 4 279 1 4 303 1 4 368 1 4 494 1 5 37 1 5 139 1 5 254 1 5 306 1 5 317 1 ...
result:
ok OK
Test #24:
score: 0
Accepted
time: 319ms
memory: 6124kb
input:
500 124750 176 179 173 181 174 176 181 180 163 164 172 195 184 169 184 183 194 169 160 181 198 171 169 188 176 175 159 186 187 175 165 182 189 183 176 172 185 186 184 190 200 173 165 173 164 163 180 168 188 188 175 193 194 184 186 172 181 175 186 187 165 181 189 176 160 174 169 171 183 175 183 161 1...
output:
44151 1 3 1 1 4 1 1 10 1 1 11 1 1 17 1 1 19 1 1 20 1 1 21 1 1 22 1 1 24 1 1 25 1 1 29 1 1 31 1 1 35 1 1 38 1 1 41 1 1 46 1 1 50 1 1 53 1 1 56 1 1 59 1 1 61 1 1 67 1 1 68 1 1 81 1 1 85 1 1 87 1 1 88 1 1 92 1 1 93 1 1 96 1 1 97 1 1 99 1 1 102 1 1 104 1 1 105 1 1 106 1 1 107 1 1 108 1 1 110 1 1 113 1 1...
result:
ok OK
Test #25:
score: 0
Accepted
time: 231ms
memory: 6696kb
input:
500 124750 347 346 369 352 345 337 356 350 356 354 341 356 356 358 356 349 351 343 345 355 348 364 352 356 350 342 353 339 359 354 372 360 366 343 351 337 349 361 348 367 338 363 345 354 359 345 354 348 346 345 360 353 338 349 344 368 349 344 351 348 342 364 362 329 353 356 362 343 347 352 347 346 3...
output:
88184 1 2 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 18 1 1 23 1 1 24 1 1 26 1 1 27 1 1 28 1 1 30 1 1 32 1 1 33 1 1 34 1 1 36 1 1 37 1 1 39 1 1 40 1 1 41 1 1 42 1 1 43 1 1 44 1 1 45 1 1 47 1 1 48 1 1 49 1 1 51 1 1 52 1 1 54 1 1 55 1 1 57 1 1 58 1 1 60 1 1 61 1 1 62 1...
result:
ok OK
Test #26:
score: 0
Accepted
time: 2ms
memory: 3516kb
input:
1 0 0
output:
0
result:
ok OK
Test #27:
score: 0
Accepted
time: 95ms
memory: 6068kb
input:
500 93511 228 252 255 233 246 214 246 241 247 249 254 249 252 227 260 253 260 268 254 244 238 266 242 253 249 268 254 225 250 244 233 229 241 243 260 257 236 246 272 288 231 241 265 242 238 243 241 245 247 245 245 264 266 243 238 257 247 262 270 228 233 255 250 238 254 263 255 250 247 231 245 254 26...
output:
47373 1 5 2 1 12 2 1 13 1 1 15 1 1 16 2 1 26 1 1 27 1 1 32 1 1 33 1 1 36 1 1 37 2 1 39 1 1 40 1 1 42 1 1 44 1 1 45 2 1 47 1 1 49 1 1 55 1 1 57 1 1 58 1 1 60 1 1 63 1 1 64 1 1 65 2 1 66 1 1 70 2 1 73 1 1 74 1 1 76 2 1 80 2 1 83 2 1 84 1 1 86 2 1 91 1 1 95 2 1 98 1 1 100 1 1 101 1 1 103 1 1 111 2 1 11...
result:
ok OK
Test #28:
score: 0
Accepted
time: 52ms
memory: 6832kb
input:
500 124750 733 754 732 741 753 768 745 752 735 774 749 745 767 744 737 767 749 750 772 744 756 760 728 744 755 736 746 741 744 747 760 755 753 737 764 743 742 759 737 750 749 770 746 756 758 754 742 742 762 738 760 745 732 746 753 743 744 777 769 761 749 735 728 752 742 742 746 742 758 757 740 770 7...
output:
94248 1 2 2 1 5 1 1 6 1 1 7 2 1 8 2 1 9 3 1 12 2 1 13 1 1 14 2 1 15 2 1 16 3 1 18 2 1 22 1 1 23 2 1 24 3 1 26 3 1 27 2 1 28 1 1 30 3 1 33 3 1 34 2 1 36 2 1 37 3 1 39 2 1 40 1 1 41 2 1 42 3 1 43 2 1 44 2 1 45 1 1 47 2 1 48 2 1 49 1 1 50 3 1 51 2 1 52 2 1 54 2 1 55 2 1 57 3 1 58 2 1 60 2 1 61 2 1 62 3...
result:
ok OK
Test #29:
score: 0
Accepted
time: 48ms
memory: 6884kb
input:
500 124750 989 1032 998 988 1012 1009 1024 1022 988 1006 1029 1013 999 1028 985 1018 974 957 1001 1002 984 997 1024 970 996 1043 996 1015 992 986 983 966 1000 1018 978 973 988 1005 984 974 997 967 984 965 989 981 1010 987 1023 960 1002 1019 1025 1012 1002 1046 1007 1019 1032 990 965 1007 975 962 102...
output:
100483 1 2 4 1 5 1 1 6 3 1 7 2 1 8 2 1 9 3 1 11 3 1 12 2 1 13 3 1 14 3 1 15 4 1 16 2 1 18 2 1 22 1 1 23 1 1 24 2 1 26 3 1 27 2 1 28 2 1 30 3 1 32 2 1 33 2 1 34 3 1 36 4 1 37 2 1 38 1 1 39 3 1 41 4 1 42 3 1 43 1 1 44 2 1 45 2 1 47 3 1 48 3 1 49 3 1 50 2 1 51 3 1 52 2 1 54 3 1 55 3 1 57 3 1 58 3 1 60 ...
result:
ok OK
Test #30:
score: 0
Accepted
time: 56ms
memory: 6884kb
input:
500 104092 498 488 489 514 476 506 512 479 481 468 516 509 476 537 479 498 513 493 517 507 498 475 516 503 480 508 468 520 497 518 476 524 483 520 536 508 522 477 489 482 492 528 494 486 507 511 481 502 486 522 498 505 504 507 494 504 513 509 470 522 495 498 492 519 532 529 485 481 512 483 487 520 5...
output:
70081 1 5 2 1 6 1 1 7 1 1 8 1 1 9 3 1 13 2 1 14 1 1 15 1 1 16 1 1 24 1 1 26 1 1 27 1 1 30 3 1 32 1 1 34 1 1 36 1 1 37 2 1 40 2 1 42 1 1 43 2 1 45 1 1 46 1 1 47 3 1 48 3 1 49 2 1 50 1 1 51 1 1 52 1 1 54 2 1 55 2 1 60 2 1 61 3 1 62 2 1 63 2 1 64 2 1 65 3 1 66 2 1 68 2 1 69 1 1 71 1 1 72 1 1 73 2 1 74 ...
result:
ok OK
Test #31:
score: 0
Accepted
time: 115ms
memory: 6056kb
input:
500 110890 522 485 507 512 492 496 472 517 508 530 493 484 468 493 473 508 521 493 502 527 523 497 455 510 466 503 516 459 502 498 499 479 512 487 514 514 479 506 489 463 515 517 522 494 535 504 481 525 515 495 488 507 496 489 495 482 485 523 515 499 500 527 474 502 493 488 476 464 469 508 493 510 4...
output:
56946 1 3 1 1 4 2 1 7 2 1 9 1 1 10 2 1 11 2 1 17 1 1 19 4 1 20 2 1 22 1 1 23 3 1 24 4 1 25 2 1 29 1 1 31 3 1 35 3 1 38 4 1 41 1 1 43 1 1 46 1 1 50 1 1 51 1 1 52 3 1 53 2 1 56 3 1 59 2 1 61 2 1 62 1 1 69 3 1 71 2 1 76 1 1 81 1 1 82 4 1 85 2 1 87 2 1 88 3 1 92 2 1 93 3 1 96 1 1 97 3 1 99 4 1 102 2 1 1...
result:
ok OK
Test #32:
score: 0
Accepted
time: 48ms
memory: 6692kb
input:
500 124750 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 998 9...
output:
100290 1 2 2 1 5 2 1 6 3 1 7 3 1 8 3 1 9 2 1 11 2 1 12 2 1 13 2 1 14 2 1 15 3 1 16 2 1 18 2 1 22 3 1 23 3 1 24 2 1 26 2 1 28 2 1 30 3 1 33 2 1 34 2 1 36 2 1 37 3 1 39 3 1 40 3 1 41 3 1 42 3 1 43 3 1 44 2 1 45 2 1 47 2 1 48 2 1 49 2 1 50 2 1 51 2 1 52 2 1 54 3 1 55 2 1 57 3 1 58 3 1 60 2 1 61 2 1 62 ...
result:
ok OK
Test #33:
score: 0
Accepted
time: 199ms
memory: 6180kb
input:
500 124750 252889 255529 243016 255430 261844 245011 259101 253197 243666 249639 246098 253370 266006 245667 245715 244189 252380 251515 247190 247805 250077 247286 248169 240596 250036 247222 251517 264594 257846 234620 254052 243612 250944 248254 252225 262739 253024 254425 249527 243222 250721 24...
output:
64885 1 2 1808 1 5 843 1 6 1666 1 8 1491 1 12 1659 1 13 558 1 14 786 1 15 975 1 16 1249 1 18 1262 1 26 783 1 27 1666 1 28 350 1 29 80 1 30 838 1 32 938 1 33 1055 1 36 686 1 37 961 1 39 516 1 40 753 1 42 1257 1 44 1074 1 45 1305 1 47 647 1 48 1482 1 49 1410 1 54 1303 1 55 1123 1 57 1091 1 58 688 1 60...
result:
ok OK
Test #34:
score: 0
Accepted
time: 49ms
memory: 6716kb
input:
500 124750 449593 449569 449616 449586 449608 449597 449608 449617 449596 449638 449586 449614 449599 449587 449613 449605 449617 449614 449602 449622 449609 449571 449577 449624 449598 449571 449608 449578 449607 449590 449599 449612 449580 449575 449586 449574 449613 449610 449577 449586 449579 44...
output:
124750 1 2 903 1 3 900 1 4 900 1 5 901 1 6 901 1 7 903 1 8 903 1 9 902 1 10 869 1 11 900 1 12 900 1 13 902 1 14 901 1 15 901 1 16 902 1 17 900 1 18 901 1 19 900 1 20 901 1 21 903 1 22 903 1 23 901 1 24 902 1 25 900 1 26 902 1 27 901 1 28 903 1 29 901 1 30 901 1 31 900 1 32 902 1 33 902 1 34 900 1 35...
result:
ok OK
Test #35:
score: 0
Accepted
time: 39ms
memory: 6740kb
input:
500 124750 1490 1491 1491 1483 1493 1488 1486 1487 1487 1489 1490 1490 1490 1491 1488 1491 1491 1489 1490 1489 1493 1488 1487 1487 1492 1491 1492 1483 1480 1492 1488 1490 1489 1485 1489 1490 1494 1493 1488 1490 1492 1490 1491 1485 1489 1480 1490 1492 1487 1489 1486 1490 1486 1487 1490 1492 1488 1493...
output:
107319 1 2 3 1 5 4 1 6 3 1 7 4 1 8 3 1 9 4 1 10 4 1 12 3 1 13 4 1 14 4 1 16 4 1 17 4 1 18 4 1 19 4 1 20 3 1 21 4 1 23 3 1 24 4 1 25 3 1 26 3 1 27 4 1 28 4 1 30 3 1 32 3 1 33 4 1 34 3 1 35 4 1 36 4 1 37 3 1 38 3 1 39 4 1 40 4 1 41 3 1 42 3 1 43 4 1 44 3 1 45 4 1 47 4 1 48 4 1 49 4 1 50 3 1 51 3 1 52 ...
result:
ok OK
Test #36:
score: 0
Accepted
time: 38ms
memory: 6880kb
input:
500 124750 1374 1380 1370 1369 1367 1374 1359 1367 1363 1392 1372 1346 1367 1385 1367 1362 1366 1365 1370 1385 1376 1371 1353 1393 1365 1378 1370 1355 1363 1380 1369 1375 1369 1373 1388 1364 1383 1378 1383 1377 1374 1378 1377 1380 1387 1373 1370 1371 1374 1360 1358 1381 1375 1385 1370 1373 1369 1378...
output:
106158 1 2 4 1 4 1 1 5 3 1 6 3 1 7 4 1 8 2 1 9 3 1 10 4 1 11 3 1 12 3 1 13 4 1 14 4 1 15 3 1 16 3 1 17 4 1 18 3 1 19 3 1 20 1 1 21 2 1 22 3 1 23 3 1 24 4 1 25 2 1 26 3 1 27 3 1 28 3 1 30 4 1 32 3 1 33 3 1 34 4 1 35 2 1 36 4 1 37 4 1 39 3 1 40 4 1 41 3 1 42 3 1 43 2 1 44 3 1 45 4 1 47 4 1 48 3 1 49 3...
result:
ok OK
Test #37:
score: 0
Accepted
time: 41ms
memory: 6768kb
input:
500 124750 14862 14860 14841 14845 14847 14829 14830 14843 14855 14860 14843 14849 14856 14849 14851 14854 14853 14850 14831 14850 14832 14843 14851 14820 14828 14835 14857 14844 14860 14845 14852 14836 14853 14842 14847 14863 14828 14838 14839 14849 14847 14849 14852 14836 14835 14850 14839 14833 1...
output:
123020 1 2 30 1 3 9 1 4 31 1 5 30 1 6 29 1 7 30 1 8 31 1 9 31 1 10 31 1 11 31 1 12 30 1 13 30 1 14 30 1 15 30 1 16 31 1 17 30 1 18 30 1 19 31 1 20 30 1 21 31 1 22 30 1 23 31 1 24 31 1 25 31 1 26 30 1 27 29 1 28 31 1 29 1 1 30 30 1 32 30 1 33 31 1 34 30 1 35 30 1 36 30 1 37 30 1 38 30 1 39 30 1 40 30...
result:
ok OK
Test #38:
score: 0
Accepted
time: 53ms
memory: 6792kb
input:
500 124750 14970 14968 14968 14969 14970 14969 14969 14970 14970 14970 14969 14970 14970 14970 14970 14970 14969 14970 14969 14970 14970 14970 14969 14970 14970 14970 14970 14970 14969 14970 14970 14969 14969 14970 14969 14970 14970 14968 14970 14970 14969 14970 14970 14970 14969 14970 14970 14970 1...
output:
121230 1 2 30 1 4 32 1 5 30 1 6 32 1 7 30 1 8 32 1 9 32 1 10 32 1 11 30 1 12 32 1 13 32 1 14 30 1 15 31 1 16 32 1 17 31 1 18 31 1 19 32 1 20 31 1 21 32 1 22 32 1 23 31 1 24 30 1 25 32 1 26 30 1 27 30 1 28 31 1 30 31 1 32 32 1 33 30 1 34 32 1 35 32 1 36 30 1 37 32 1 38 32 1 39 31 1 40 32 1 41 30 1 42...
result:
ok OK
Test #39:
score: 0
Accepted
time: 616ms
memory: 6020kb
input:
500 114257 387 364 374 392 369 372 365 372 380 371 375 388 378 371 377 373 366 380 374 362 372 371 366 358 378 389 378 360 380 376 369 378 374 363 372 384 361 364 375 381 371 368 382 383 373 389 365 357 379 358 344 379 369 367 378 376 382 372 378 362 371 374 361 371 384 391 364 376 372 370 383 378 3...
output:
52381 1 3 3 1 4 1 1 7 3 1 10 1 1 11 3 1 15 2 1 17 1 1 19 1 1 22 2 1 24 1 1 25 3 1 29 1 1 31 1 1 34 1 1 38 3 1 41 3 1 43 3 1 45 1 1 46 3 1 50 1 1 51 2 1 52 3 1 53 1 1 56 3 1 59 1 1 61 3 1 67 1 1 68 1 1 72 1 1 80 1 1 82 2 1 85 3 1 87 3 1 88 2 1 92 1 1 93 3 1 96 1 1 97 1 1 99 2 1 102 2 1 105 1 1 106 2 ...
result:
ok OK
Test #40:
score: 0
Accepted
time: 46ms
memory: 6692kb
input:
500 124750 1488 1485 1492 1493 1490 1489 1482 1495 1486 1482 1479 1486 1490 1490 1487 1489 1484 1487 1493 1490 1486 1489 1491 1494 1491 1485 1490 1482 1485 1491 1488 1488 1488 1488 1488 1487 1484 1486 1486 1483 1489 1491 1490 1486 1490 1485 1485 1489 1492 1489 1488 1489 1491 1487 1487 1487 1491 1491...
output:
107281 1 2 3 1 4 3 1 5 3 1 6 3 1 7 3 1 8 4 1 9 3 1 10 3 1 12 2 1 13 3 1 14 4 1 15 3 1 16 4 1 17 4 1 18 3 1 19 4 1 20 3 1 21 3 1 22 3 1 23 3 1 24 4 1 25 4 1 26 4 1 27 3 1 28 4 1 30 4 1 33 3 1 34 3 1 36 4 1 37 3 1 38 3 1 39 4 1 40 3 1 41 4 1 42 4 1 43 3 1 44 3 1 45 3 1 47 4 1 48 4 1 49 4 1 50 4 1 51 4...
result:
ok OK
Test #41:
score: 0
Accepted
time: 41ms
memory: 6840kb
input:
500 124750 1489 1492 1491 1485 1490 1490 1487 1487 1488 1492 1489 1487 1488 1491 1488 1490 1486 1487 1490 1488 1493 1485 1485 1486 1487 1493 1486 1494 1483 1490 1493 1491 1492 1491 1491 1488 1489 1491 1487 1491 1491 1491 1488 1486 1488 1491 1493 1491 1483 1491 1487 1490 1489 1491 1489 1490 1491 1491...
output:
107306 1 2 4 1 4 3 1 5 3 1 6 3 1 7 4 1 8 3 1 9 4 1 10 3 1 12 3 1 13 4 1 14 3 1 15 3 1 16 4 1 17 3 1 18 3 1 19 4 1 20 1 1 21 4 1 22 3 1 23 3 1 24 3 1 25 3 1 26 3 1 27 3 1 28 3 1 30 3 1 32 4 1 33 4 1 34 4 1 35 3 1 36 4 1 37 4 1 38 4 1 39 3 1 40 4 1 41 3 1 42 3 1 43 3 1 44 4 1 45 4 1 47 3 1 48 3 1 49 3...
result:
ok OK
Test #42:
score: 0
Accepted
time: 733ms
memory: 6828kb
input:
500 124750 4238117 4262284 4290935 4320891 4240110 4319111 4268307 4239303 4212959 4269182 4278289 4229143 4256508 4292763 4307952 4295643 4262663 4317763 4307141 4305875 4279249 4257100 4307968 4255606 4282654 4194421 4250479 4286031 4251648 4263126 4309087 4231518 4246623 4241153 4285256 4262092 4...
output:
124750 1 2 9621 1 3 9512 1 4 9191 1 5 5564 1 6 8182 1 7 8396 1 8 9944 1 9 8849 1 10 7350 1 11 8915 1 12 8129 1 13 4900 1 14 8043 1 15 8415 1 16 9751 1 17 9555 1 18 7838 1 19 8178 1 20 9094 1 21 8609 1 22 8519 1 23 9864 1 24 8129 1 25 9493 1 26 8567 1 27 9955 1 28 7390 1 29 9586 1 30 6713 1 31 7789 1...
result:
ok OK
Test #43:
score: 0
Accepted
time: 482ms
memory: 6760kb
input:
500 124750 3270752 3406208 3336140 3318852 3193241 3377251 3268856 3263877 3283306 3309608 3394677 3273425 3300385 3222003 3228209 3366078 3367603 3374843 3257915 3308319 3341540 3255608 3277939 3375558 3327128 3323671 3273432 3300132 3310094 3343160 3374260 3327771 3277600 3267769 3337235 3361960 3...
output:
124744 1 2 9434 1 3 375 1 4 3082 1 5 9642 1 6 8356 1 7 4031 1 8 7505 1 9 9216 1 10 9799 1 11 9066 1 12 1607 1 13 6554 1 14 5451 1 15 4934 1 16 7734 1 17 6825 1 18 5772 1 19 6244 1 20 8378 1 21 6026 1 22 8441 1 23 9968 1 24 7578 1 25 8208 1 26 8443 1 27 1961 1 28 9511 1 29 7285 1 30 7717 1 31 5972 1 ...
result:
ok OK
Test #44:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
10 13 1 1 1 1 1 1 1 1 1 1 1 2 1 1 3 1 2 3 1 3 4 1 3 5 1 4 5 1 5 6 1 5 7 1 6 7 1 7 8 2 8 9 1 7 10 1 9 10 1
output:
5 1 2 1 3 4 1 5 6 1 7 8 1 9 10 1
result:
ok OK
Test #45:
score: 0
Accepted
time: 3ms
memory: 3592kb
input:
100 148 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 3 1 2 3 1 3 4 1 3 5 1 4 5 1 5 6 1 5 7 1 6 7 1 7 8 1 7 9 1 8 9 1 9 10 1 9 11 1 10 11 ...
output:
50 1 2 1 3 4 1 5 6 1 7 8 1 9 10 1 11 12 1 13 14 1 15 16 1 17 18 1 19 20 1 21 22 1 23 24 1 25 26 1 27 28 1 29 30 1 31 32 1 33 34 1 35 36 1 37 38 1 39 40 1 41 42 1 43 44 1 45 46 1 47 48 1 49 50 1 51 52 1 53 54 1 55 56 1 57 58 1 59 60 1 61 62 1 63 64 1 65 66 1 67 68 1 69 70 1 71 72 1 73 74 1 75 76 1 77...
result:
ok OK
Test #46:
score: 0
Accepted
time: 3ms
memory: 5484kb
input:
500 848 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
250 1 2 1 3 4 1 5 6 1 7 8 1 9 10 1 11 12 1 13 14 1 15 16 1 17 18 1 19 20 1 21 22 1 23 24 1 25 26 1 27 28 1 29 31 1 30 376 1 32 33 1 34 35 1 36 37 1 38 39 1 40 41 1 42 43 1 44 45 1 46 47 1 48 49 1 50 51 1 52 53 1 54 55 1 56 325 1 57 58 1 59 60 1 61 62 1 63 64 1 65 67 1 66 356 1 68 69 1 70 71 1 72 73 ...
result:
ok OK
Test #47:
score: 0
Accepted
time: 3ms
memory: 5644kb
input:
500 1243 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 2 1 3 4 1 5 7 1 6 481 1 8 448 1 9 130 1 10 11 1 12 13 1 14 323 1 15 16 1 17 446 1 18 19 1 20 174 1 21 56 1 22 67 1 23 24 1 25 197 1 26 68 1 27 391 1 28 29 1 30 31 1 32 191 1 33 34 1 35 37 1 36 447 1 38 39 1 40 178 1 41 400 1 42 43 1 44 77 1 45 46 1 47 48 1 49 50 1 51 173 1 52 326 1 53 55 1 54 ...
result:
ok OK
Test #48:
score: 0
Accepted
time: 3ms
memory: 5552kb
input:
500 1738 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 2 1 3 4 1 5 78 1 6 402 1 7 9 1 8 140 1 10 11 1 12 340 1 13 278 1 14 362 1 15 16 1 17 331 1 18 19 1 20 106 1 21 104 1 22 122 1 23 452 1 24 25 1 26 27 1 28 488 1 29 159 1 30 31 1 32 124 1 33 34 1 35 36 1 37 168 1 38 358 1 39 40 1 41 403 1 42 43 1 44 45 1 46 492 1 47 52 1 48 49 1 50 51 1 53 255 1...
result:
ok OK
Test #49:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
100 222 13 7 6 9 11 12 2 3 14 11 5 4 8 7 8 7 5 3 4 9 2 6 1 4 2 4 7 5 4 4 7 2 2 2 3 9 1 3 1 3 2 2 6 4 5 6 2 3 7 2 6 6 3 3 2 3 3 8 6 2 2 3 1 3 2 2 3 3 4 3 2 4 4 3 2 3 4 3 4 2 2 5 2 3 4 1 3 2 3 1 2 3 2 1 1 1 1 1 2 2 1 2 1 2 3 1 3 4 1 1 5 2 2 5 1 3 5 1 4 5 1 1 6 2 2 6 1 5 6 1 1 7 1 3 7 1 1 8 1 4 8 1 5 8...
output:
193 1 2 1 1 5 2 1 6 2 1 7 1 1 8 1 1 10 1 1 12 1 1 13 1 1 35 1 1 45 2 2 3 1 2 5 1 2 10 1 2 24 1 2 45 1 2 83 1 3 4 1 3 5 1 3 7 1 3 29 1 3 31 1 4 5 1 4 8 1 4 10 1 4 11 2 4 35 1 4 60 1 4 68 1 5 6 1 5 8 1 5 12 1 5 20 1 5 24 1 5 26 1 6 9 1 6 27 1 6 29 1 6 38 1 6 42 1 6 46 1 6 58 1 6 79 1 6 84 1 9 10 1 9 1...
result:
ok OK
Test #50:
score: 0
Accepted
time: 5ms
memory: 5548kb
input:
500 851 1 2 3 2 3 3 5 3 4 3 3 9 2 2 2 1 6 7 4 1 4 3 7 2 2 3 2 4 4 4 3 6 5 1 1 3 1 10 1 1 3 3 6 3 3 3 6 4 6 1 2 2 1 4 11 4 4 2 2 6 1 8 2 7 4 3 5 2 2 1 2 2 3 2 1 2 2 3 5 10 7 3 4 2 6 5 12 4 3 1 5 4 3 2 4 7 3 2 9 2 2 4 3 3 1 4 4 10 2 1 3 5 6 2 2 9 2 1 2 2 5 3 1 6 8 1 4 1 3 2 3 9 2 3 5 5 7 2 2 4 1 2 2 4...
output:
756 1 2 1 2 3 1 3 4 1 3 5 1 4 5 1 5 6 1 6 7 1 6 8 1 7 8 1 7 9 2 7 10 1 8 9 1 9 10 1 10 11 1 11 12 1 11 17 1 12 13 1 12 15 1 12 17 1 12 18 1 12 19 2 12 26 2 13 14 1 14 16 1 15 19 1 17 18 1 17 23 2 17 25 1 18 20 1 18 21 1 18 22 1 18 24 1 18 28 1 19 26 1 21 22 1 21 23 1 21 29 1 22 24 1 23 28 1 23 30 1 ...
result:
ok OK
Test #51:
score: 0
Accepted
time: 5ms
memory: 5492kb
input:
500 1466 5 3 5 6 3 8 7 5 13 5 4 1 1 12 5 9 9 5 5 8 18 1 4 11 19 5 1 3 5 12 6 2 3 15 4 2 3 11 5 1 4 5 7 21 12 3 3 4 7 6 3 9 12 6 11 3 7 22 5 3 3 24 3 2 3 25 2 2 2 5 22 5 7 15 4 7 19 4 4 17 3 9 25 30 3 4 4 5 3 20 2 5 4 8 2 21 1 15 9 4 15 15 1 13 18 5 6 6 10 6 4 8 2 3 6 10 2 5 4 10 2 4 16 6 5 3 3 33 2 ...
output:
1372 1 2 1 1 3 2 1 6 2 2 3 1 2 10 1 3 4 1 3 6 1 4 5 1 4 6 1 4 7 1 4 11 1 4 15 1 5 6 1 5 16 1 6 7 1 6 9 1 6 14 1 7 8 1 7 11 1 7 15 1 7 17 1 7 21 1 8 9 1 8 11 1 8 14 1 8 19 1 9 10 1 9 11 1 9 13 1 9 14 1 9 16 1 9 17 1 9 18 2 9 19 1 9 25 1 9 33 1 10 12 1 10 14 1 10 19 1 14 15 1 14 17 1 14 18 1 14 25 1 1...
result:
ok OK
Test #52:
score: 0
Accepted
time: 7ms
memory: 5592kb
input:
500 2838 13 6 5 10 6 9 9 2 7 16 9 11 11 3 8 12 12 4 4 9 6 8 10 4 2 2 13 7 4 5 2 3 5 3 3 7 17 8 8 3 9 6 3 5 7 6 5 8 7 10 4 3 6 8 5 4 3 5 6 13 6 10 3 15 2 2 2 2 2 2 6 3 22 18 25 6 3 1 31 4 10 11 25 12 32 16 29 5 3 6 2 2 3 4 6 14 13 3 2 4 8 4 11 18 2 4 7 7 15 18 3 4 7 3 1 3 5 2 3 2 6 7 10 12 10 10 3 4 ...
output:
1325 1 2 3 1 3 1 1 4 5 1 8 1 1 9 2 1 10 1 2 3 1 2 6 1 2 10 1 3 4 2 3 7 1 4 5 1 4 8 1 4 15 1 5 6 2 5 9 1 5 13 1 5 17 1 6 7 2 6 12 2 6 14 1 6 23 1 7 9 1 7 11 1 7 16 1 7 18 1 7 23 1 7 27 1 9 10 1 9 15 1 9 17 1 10 11 3 10 12 1 10 13 2 10 16 1 10 17 2 10 19 2 10 21 1 10 37 1 11 12 1 11 14 1 11 23 2 11 37...
result:
ok OK
Test #53:
score: 0
Accepted
time: 8ms
memory: 5588kb
input:
500 2195 11 5 8 9 8 8 4 10 9 10 7 2 3 9 12 6 1 12 1 2 9 13 3 7 13 8 14 2 5 6 4 17 3 9 2 3 5 14 4 23 6 20 2 4 3 16 19 2 6 3 5 3 21 5 18 3 4 9 9 2 5 4 4 3 14 4 3 2 3 5 3 5 6 2 7 3 1 1 2 5 2 10 8 7 21 17 4 3 4 8 3 1 4 10 4 3 3 6 2 5 17 2 3 4 2 2 2 7 16 3 5 21 6 4 5 3 6 3 2 4 18 21 18 14 9 2 13 12 15 2 ...
output:
1350 1 2 1 1 3 1 1 4 2 1 5 1 1 6 1 1 7 1 1 8 3 1 9 1 2 3 2 2 4 1 2 10 1 3 4 1 3 6 1 3 7 1 3 9 1 3 11 1 4 6 1 4 8 1 4 10 1 4 11 1 4 14 1 5 6 2 5 7 1 5 8 2 5 10 1 5 15 1 6 12 1 6 21 1 6 22 1 7 15 1 8 9 1 8 13 1 8 24 1 8 25 1 9 10 1 9 16 1 9 22 2 9 26 1 9 33 1 10 11 1 10 13 1 10 14 1 10 18 1 10 21 1 10...
result:
ok OK
Test #54:
score: 0
Accepted
time: 12ms
memory: 5668kb
input:
500 4891 45 20 26 21 19 26 23 14 35 9 29 6 36 32 35 48 19 8 40 48 41 6 47 12 4 38 42 25 45 13 15 12 13 48 14 33 10 13 30 58 26 73 8 5 15 10 27 15 25 11 11 10 18 7 14 9 62 70 9 9 15 9 54 38 11 39 33 29 13 10 10 52 35 14 5 16 17 10 35 8 18 20 26 9 10 50 39 39 67 11 66 8 17 10 113 15 39 25 16 16 15 10 ...
output:
3212 1 2 3 1 3 12 1 4 6 1 5 4 1 6 4 1 7 5 1 8 4 1 9 6 1 11 1 2 3 2 2 4 1 2 6 2 2 9 2 2 10 3 2 11 5 2 13 2 3 4 1 3 5 2 3 6 2 3 8 3 3 11 2 3 14 2 4 5 3 4 6 4 4 8 2 4 9 1 4 10 1 4 11 1 4 14 1 5 6 2 5 7 1 5 11 3 5 13 1 5 14 1 5 16 1 5 18 1 6 8 3 6 9 1 6 11 1 6 12 3 6 13 1 6 14 1 6 16 1 6 17 1 7 9 3 7 10...
result:
ok OK
Test #55:
score: 0
Accepted
time: 13ms
memory: 5588kb
input:
500 3939 42 20 39 23 38 26 19 10 43 33 23 9 39 13 53 6 53 69 16 64 33 32 31 18 11 12 11 17 16 10 63 9 14 11 40 37 58 14 44 11 62 26 21 47 44 36 56 14 62 24 48 61 48 10 61 12 16 53 10 25 15 60 10 55 12 9 14 28 15 55 22 35 21 36 12 52 8 11 32 10 11 11 48 59 11 21 8 52 34 12 36 13 48 12 20 83 10 55 24 ...
output:
3069 1 2 2 1 3 15 1 4 7 1 5 6 1 6 7 1 7 2 1 9 3 2 3 1 2 4 1 2 5 1 2 6 4 2 8 2 2 9 4 2 10 5 3 4 2 3 5 9 3 6 1 3 8 5 3 9 3 3 10 2 3 11 1 4 5 1 4 6 1 4 7 3 4 9 3 4 10 1 4 11 1 4 13 3 5 6 1 5 7 7 5 9 5 5 10 1 5 12 1 5 13 2 5 15 4 6 7 2 6 9 1 6 10 1 6 11 3 6 12 3 6 13 1 6 14 1 7 8 2 7 9 2 7 13 1 8 10 1 9...
result:
ok OK
Test #56:
score: 0
Accepted
time: 9ms
memory: 5612kb
input:
500 3031 31 16 25 28 12 32 38 40 18 18 12 47 37 18 17 13 50 48 14 50 12 13 66 31 13 32 51 14 48 34 25 44 9 29 39 26 16 23 40 32 7 14 7 43 13 52 14 8 36 22 17 30 57 10 34 27 24 24 37 23 24 18 21 25 32 12 21 26 14 11 59 14 13 36 37 72 13 30 43 8 31 13 12 10 44 31 16 41 50 51 9 10 11 14 77 20 61 34 88 ...
output:
2338 1 2 3 1 3 15 1 4 1 1 5 6 1 6 6 2 4 8 2 5 2 2 6 1 2 7 2 3 4 3 3 6 4 3 7 1 3 8 2 4 6 2 4 7 4 4 8 7 4 9 2 4 12 1 5 6 2 5 7 1 5 8 1 6 7 1 6 9 6 6 10 4 6 12 3 6 13 3 7 8 1 7 9 5 7 10 6 7 11 6 7 12 3 7 13 2 7 14 3 7 17 3 8 9 2 8 10 7 8 11 4 8 12 1 8 13 2 8 14 2 8 17 3 8 18 4 8 19 4 9 10 1 9 11 1 9 13...
result:
ok OK
Test #57:
score: 0
Accepted
time: 9ms
memory: 5632kb
input:
500 3011 23 18 21 26 29 26 28 23 12 23 29 28 22 7 24 11 33 9 35 39 66 13 34 10 28 41 17 18 12 41 18 16 9 9 7 53 13 79 19 11 12 11 80 61 54 23 13 11 15 24 17 12 23 22 9 83 11 63 15 14 23 8 10 47 22 59 29 48 46 30 37 15 46 23 12 14 13 24 13 18 47 14 16 10 45 18 33 44 16 41 19 23 38 11 31 59 41 47 13 6...
output:
2326 1 2 2 1 3 12 1 4 4 1 5 5 2 3 1 2 4 7 2 5 4 2 6 4 3 4 1 3 5 1 3 6 4 3 7 2 4 5 1 4 6 3 4 7 7 4 8 3 5 6 1 5 7 5 5 8 5 5 9 2 5 10 5 6 8 1 6 9 5 6 10 6 6 11 2 7 8 3 7 9 3 7 10 1 7 11 5 7 12 2 8 10 2 8 11 5 8 13 4 9 11 1 9 13 1 10 11 2 10 12 3 10 13 1 10 14 2 10 15 1 11 12 3 11 13 2 11 15 5 11 16 1 1...
result:
ok OK
Test #58:
score: 0
Accepted
time: 7ms
memory: 5576kb
input:
500 3014 31 12 20 32 24 24 21 21 22 25 29 29 50 13 46 27 16 19 11 42 9 54 75 28 26 18 53 20 13 12 25 47 16 12 12 48 21 46 19 12 58 15 71 13 47 9 17 55 55 46 43 10 25 20 46 15 39 44 14 41 11 8 6 8 30 11 22 39 25 49 13 30 8 46 37 46 47 50 11 11 22 19 13 29 12 20 8 15 17 8 14 25 60 14 12 13 11 52 52 23...
output:
2314 1 2 4 1 3 5 1 4 12 1 5 10 2 3 2 2 4 3 2 6 3 3 4 1 3 5 5 3 6 4 3 7 3 4 5 1 4 6 7 4 7 7 4 8 1 5 6 1 5 8 1 5 9 6 6 7 2 6 8 5 6 10 2 7 8 3 7 9 4 7 10 2 8 9 1 8 10 3 8 11 4 8 12 3 9 10 2 9 11 2 9 12 5 9 13 2 10 11 1 10 12 2 10 13 3 10 14 4 10 15 6 11 12 2 11 13 7 11 14 4 11 15 6 11 16 3 12 13 1 12 1...
result:
ok OK
Test #59:
score: 0
Accepted
time: 7ms
memory: 5700kb
input:
500 2873 21 15 24 26 29 31 31 37 27 14 10 30 20 24 9 26 21 36 31 51 32 21 11 55 13 57 13 68 11 19 11 14 55 17 9 34 28 13 21 12 11 17 46 18 56 50 39 11 13 8 15 29 42 40 16 34 51 24 21 32 32 53 11 33 35 49 15 26 23 9 40 26 9 18 15 13 15 49 13 42 36 10 8 11 43 24 10 13 28 14 11 39 14 55 18 13 52 11 13 ...
output:
2259 1 2 1 1 3 14 1 4 4 1 5 2 2 4 4 2 5 5 2 6 5 3 4 1 3 5 5 3 6 3 3 7 1 4 5 2 4 6 7 4 7 4 4 8 4 5 6 2 5 7 4 5 8 5 5 9 4 6 7 2 6 8 4 6 9 5 6 10 3 7 8 3 7 9 4 7 11 4 7 12 6 7 13 3 8 9 3 8 10 6 8 11 4 8 12 2 8 14 2 8 15 4 9 10 3 9 12 1 9 13 1 9 14 1 9 15 2 9 16 3 10 12 2 11 12 2 12 13 1 12 14 7 12 16 4...
result:
ok OK
Test #60:
score: 0
Accepted
time: 11ms
memory: 5636kb
input:
500 2837 28 13 30 26 31 30 36 32 12 28 26 33 18 11 40 37 14 15 29 10 25 45 32 13 12 37 44 40 11 16 44 8 68 16 25 14 36 22 69 61 25 41 29 18 9 10 12 14 21 53 17 15 20 14 12 11 14 51 42 14 27 52 30 27 17 11 19 38 15 12 61 12 57 15 91 21 10 15 21 12 10 10 13 91 11 27 37 30 14 22 12 33 15 16 56 22 7 21 ...
output:
2270 1 2 2 1 3 14 1 4 5 1 5 7 2 4 4 2 5 4 2 6 3 3 5 8 3 6 4 3 7 4 4 5 2 4 6 4 4 7 5 4 8 6 5 6 2 5 7 3 5 9 5 6 8 4 6 9 4 6 10 4 6 11 4 6 13 1 7 8 1 7 9 1 7 10 2 7 11 5 7 13 11 7 14 4 8 10 1 8 11 5 8 12 5 8 13 2 8 15 8 9 10 1 9 12 1 10 11 1 10 12 3 10 13 2 10 14 5 10 15 3 10 16 6 11 12 1 11 13 1 11 15...
result:
ok OK
Test #61:
score: 0
Accepted
time: 10ms
memory: 5628kb
input:
500 3273 25 18 19 27 18 26 26 17 28 30 31 35 29 30 16 13 19 25 35 31 30 25 55 16 12 38 40 33 15 19 16 27 16 35 36 44 16 50 13 27 14 23 15 28 27 23 25 13 15 41 43 23 19 14 6 13 14 58 62 85 15 14 14 14 18 81 27 16 14 13 64 21 21 24 40 37 18 40 14 59 11 10 9 13 35 10 37 54 16 27 13 15 69 12 30 18 16 10...
output:
2672 1 2 2 1 3 9 1 4 3 1 5 3 1 6 8 2 3 3 2 4 5 2 5 4 2 7 4 3 4 2 3 6 2 3 8 3 4 5 4 4 6 1 4 7 6 4 8 2 4 9 4 5 7 4 5 10 3 6 7 2 6 9 5 6 10 4 6 11 4 7 8 1 7 9 4 7 10 4 7 12 1 8 9 2 8 11 4 8 12 4 8 13 1 9 10 1 9 11 4 9 12 5 9 14 3 10 12 4 10 13 6 10 14 4 10 15 4 11 12 3 11 13 2 11 14 5 11 15 3 11 16 3 1...
result:
ok OK
Test #62:
score: 0
Accepted
time: 12ms
memory: 5596kb
input:
500 2800 13 9 13 15 20 16 29 23 29 37 26 11 25 8 9 26 18 21 19 20 23 33 22 39 52 11 8 7 54 10 52 40 36 16 32 11 10 38 10 30 17 15 18 5 7 8 30 7 53 20 12 52 5 13 37 5 11 12 11 8 30 11 26 8 11 5 6 37 47 24 33 20 27 32 30 29 28 17 9 19 14 18 12 13 45 55 36 29 11 34 33 22 15 12 39 8 27 8 4 22 25 8 12 8 ...
output:
2174 1 2 5 1 3 4 1 5 4 2 3 1 2 5 1 2 6 2 3 6 2 3 7 6 4 5 4 4 6 2 4 7 4 4 8 5 5 7 7 5 9 4 6 7 1 6 8 3 6 9 1 6 10 5 7 9 2 7 10 4 7 11 5 8 9 2 8 10 5 8 11 5 8 12 2 8 13 1 9 10 2 9 11 3 9 13 5 9 14 3 9 15 4 9 16 3 10 12 7 10 13 5 10 14 3 10 15 1 10 16 5 11 12 1 11 13 1 11 15 3 11 16 3 11 17 4 11 18 1 12...
result:
ok OK
Test #63:
score: 0
Accepted
time: 8ms
memory: 5456kb
input:
500 2381 17 9 17 15 14 19 22 22 19 23 22 17 17 21 16 14 19 21 13 25 18 26 17 25 18 22 29 23 20 23 19 18 21 16 19 25 23 18 23 12 12 23 21 19 20 19 21 15 16 25 23 23 21 24 24 23 20 3 24 28 27 16 25 11 24 20 18 21 26 25 27 22 14 19 22 20 17 24 17 21 23 22 15 30 28 22 27 8 11 18 26 24 13 21 25 20 5 24 2...
output:
1930 1 2 3 1 3 10 1 4 2 1 5 2 2 5 1 2 6 5 3 6 4 3 7 3 4 5 3 4 6 3 4 7 5 4 8 2 5 7 4 5 8 4 6 7 1 6 8 5 6 10 1 7 8 1 7 9 4 7 10 1 7 11 3 8 9 2 8 10 7 8 11 1 9 10 1 9 11 1 9 12 8 9 13 3 10 11 2 10 12 3 10 13 4 10 14 4 11 13 4 11 14 3 11 15 8 12 13 1 12 14 3 12 15 1 12 16 1 13 14 1 13 16 3 13 17 1 14 16...
result:
ok OK
Test #64:
score: 0
Accepted
time: 11ms
memory: 5528kb
input:
500 1500 13 8 17 26 13 26 21 23 14 22 22 18 23 23 26 18 22 22 22 19 17 19 15 17 19 18 26 23 17 28 18 25 16 21 22 21 18 22 24 22 27 32 28 24 23 27 21 19 26 21 22 26 15 23 12 17 21 22 26 22 27 18 25 19 27 14 24 21 20 21 23 17 27 17 16 17 18 20 21 21 19 21 23 21 27 26 28 27 26 25 24 24 35 18 25 20 21 1...
output:
1365 1 2 3 1 3 5 1 4 5 2 4 4 2 5 1 3 4 1 3 5 5 3 6 6 4 5 1 4 6 8 4 7 7 5 6 1 5 7 5 6 7 1 6 8 10 7 8 1 7 9 5 7 10 2 8 9 1 8 10 4 8 11 7 9 10 2 9 11 4 9 12 2 10 11 1 10 12 8 10 13 5 11 12 1 11 13 4 11 14 5 12 14 4 12 15 3 13 14 1 13 15 9 13 16 4 14 15 2 14 16 5 14 17 6 15 16 1 15 17 4 15 18 7 16 17 1 ...
result:
ok OK
Test #65:
score: 0
Accepted
time: 5ms
memory: 5580kb
input:
500 1488 13 12 28 17 25 30 20 22 24 19 19 20 21 22 21 18 16 22 18 12 24 26 20 22 24 13 9 18 13 17 15 17 17 13 12 16 11 20 16 21 16 23 18 26 17 25 23 16 17 27 13 20 18 13 19 13 18 29 23 28 19 20 28 25 20 21 16 17 17 18 19 16 13 20 16 15 17 27 17 13 24 22 33 22 28 29 24 31 28 21 24 22 16 16 18 18 13 2...
output:
1356 1 2 2 1 3 9 1 4 2 2 3 1 2 4 4 2 5 5 3 4 1 3 5 8 3 6 9 4 6 4 4 7 6 5 6 2 5 7 4 5 8 6 6 7 1 6 8 3 6 9 11 7 8 3 7 9 4 7 10 2 8 9 1 8 10 5 8 11 4 9 10 2 9 11 4 9 12 2 10 11 1 10 12 4 10 13 5 11 12 2 11 13 6 11 14 2 12 13 1 12 14 6 12 15 5 13 14 3 13 16 6 14 15 1 14 16 6 14 17 4 15 16 1 15 17 5 15 1...
result:
ok OK
Test #66:
score: 0
Accepted
time: 14ms
memory: 5628kb
input:
500 1493 14 7 27 18 18 28 21 18 13 23 8 22 25 15 27 21 16 23 20 20 19 22 21 17 17 24 14 28 17 27 19 25 20 16 17 16 17 14 19 12 11 15 16 20 18 21 19 21 18 17 12 26 20 23 25 27 30 25 17 27 16 17 23 18 27 24 19 32 20 28 17 25 23 20 15 17 16 14 15 18 15 21 16 25 14 20 21 18 22 10 24 21 14 14 20 16 12 18...
output:
1352 1 2 1 1 3 12 1 4 1 2 4 4 2 5 2 3 5 3 3 6 12 4 6 7 4 7 6 5 7 6 5 8 7 6 7 2 6 8 3 6 9 4 7 10 7 8 9 2 8 10 5 8 11 1 9 10 1 9 12 6 10 12 6 10 13 4 11 12 2 11 13 2 11 14 3 12 14 2 12 15 6 13 14 1 13 15 9 13 16 9 14 15 1 14 16 3 14 17 5 15 17 3 15 18 8 16 17 1 16 18 5 16 19 3 17 18 1 17 19 3 17 20 3 ...
result:
ok OK
Test #67:
score: 0
Accepted
time: 10ms
memory: 5608kb
input:
500 1538 35 30 52 54 71 62 71 58 65 58 63 59 58 58 69 61 61 71 60 63 59 80 46 60 60 52 71 58 67 72 57 57 49 65 58 62 67 71 52 62 55 56 59 47 57 55 50 53 64 39 56 53 48 54 51 52 64 60 60 68 59 62 68 41 63 69 61 56 56 69 67 51 74 57 64 68 61 66 63 66 59 67 73 54 69 62 59 60 67 79 59 66 68 68 69 61 71 ...
output:
1523 1 2 2 1 3 21 1 4 12 2 3 3 2 4 8 2 5 17 3 4 3 3 5 14 3 6 11 4 5 3 4 6 15 4 7 13 5 6 3 5 7 18 5 8 16 6 7 4 6 8 15 6 9 14 7 8 2 7 9 16 7 10 18 8 9 3 8 10 9 8 11 13 9 10 3 9 11 17 9 12 12 10 11 2 10 12 13 10 13 13 11 12 3 11 13 15 11 14 13 12 13 4 12 14 9 12 15 18 13 14 5 13 15 14 13 16 7 14 16 14 ...
result:
ok OK
Test #68:
score: 0
Accepted
time: 9ms
memory: 5588kb
input:
500 1686 449 354 619 629 588 644 598 611 584 605 612 597 572 605 565 609 557 597 600 592 598 631 608 637 623 624 636 610 612 620 589 636 618 612 623 582 626 579 639 556 618 622 604 618 592 654 576 632 627 592 633 607 605 624 577 587 629 575 631 562 585 591 583 609 551 588 615 550 651 611 577 606 611...
output:
1684 1 2 30 1 3 279 1 4 140 2 3 29 2 4 144 2 5 151 3 4 31 3 5 131 3 6 149 4 5 30 4 6 149 4 7 135 5 6 29 5 7 124 5 8 123 6 7 30 6 8 154 6 9 133 7 8 31 7 9 131 7 10 147 8 9 28 8 10 124 8 11 151 9 10 32 9 11 144 9 12 116 10 11 28 10 12 142 10 13 132 11 12 30 11 13 130 11 14 129 12 13 31 12 14 154 12 15...
result:
ok OK
Test #69:
score: 0
Accepted
time: 15ms
memory: 5604kb
input:
500 1513 764 853 1520 1525 1534 1569 1583 1616 1615 1608 1617 1616 1590 1564 1544 1530 1551 1568 1590 1614 1588 1592 1596 1632 1653 1636 1664 1552 1641 1614 1703 1657 1676 1648 1580 1627 1598 1630 1636 1588 1650 1546 1617 1589 1627 1591 1648 1587 1610 1581 1561 1623 1564 1637 1572 1587 1558 1586 160...
output:
1511 1 2 78 1 3 686 2 3 80 2 4 695 3 4 78 3 5 676 4 5 80 4 6 672 5 6 80 5 7 698 6 7 80 6 8 737 7 8 80 7 9 725 8 9 80 8 10 719 9 10 79 9 11 731 10 11 81 10 12 729 11 12 78 11 13 727 12 13 81 12 14 728 13 14 81 13 15 701 14 15 80 14 16 675 15 16 82 15 17 681 16 17 80 16 18 693 17 18 78 17 19 712 18 19...
result:
ok OK
Test #70:
score: 0
Accepted
time: 10ms
memory: 5728kb
input:
500 2203 1303 1488 1966 2021 2004 1949 2018 2030 2028 2027 2061 2054 2011 2000 1968 1996 2021 1966 1983 2011 1976 1977 1990 1975 2006 1979 2061 2041 2030 2041 1979 2008 2000 2006 1991 2006 2041 1964 2002 2040 1992 2023 2022 1984 1963 1987 1965 1999 2016 1986 2042 2042 1996 2007 1952 2009 1976 2038 1...
output:
2175 1 2 499 1 3 509 1 4 295 2 3 497 2 4 249 2 5 243 3 4 501 3 5 236 3 6 223 4 5 499 4 6 227 4 7 250 5 6 501 5 7 265 5 8 260 6 7 501 6 8 258 6 9 239 7 8 502 7 9 242 7 10 258 8 9 498 8 10 240 8 11 272 9 10 503 9 11 273 9 12 273 10 11 495 10 12 293 10 13 238 11 12 502 11 13 287 11 14 232 12 13 499 12 ...
result:
ok OK
Test #71:
score: 0
Accepted
time: 0ms
memory: 5544kb
input:
500 905 4 4 6 6 5 8 6 6 6 5 6 6 6 6 6 7 7 8 6 7 7 6 9 7 8 7 8 6 8 8 8 7 7 6 6 7 6 6 5 5 4 7 4 9 5 7 5 7 5 11 6 9 7 5 6 7 4 8 8 9 8 7 5 4 6 6 5 8 4 6 5 4 6 6 5 6 5 7 5 9 5 8 7 10 7 8 6 7 7 8 8 5 6 4 6 5 8 6 9 6 9 5 6 5 4 6 4 6 4 5 4 8 4 8 5 5 5 6 4 6 5 7 9 6 9 7 5 9 4 7 7 6 9 5 6 5 5 6 5 6 4 7 6 8 8 ...
output:
839 1 2 1 1 3 3 2 3 2 2 4 1 3 4 1 4 5 2 4 6 2 5 6 2 5 7 1 6 7 4 7 8 1 8 9 4 8 10 1 9 10 1 9 11 1 10 11 2 10 12 1 11 12 2 11 13 1 12 13 2 12 14 1 13 14 2 13 15 1 14 15 1 14 16 2 15 16 2 15 17 2 16 17 2 16 18 1 17 18 2 17 19 1 18 19 3 18 20 2 19 20 2 20 21 2 20 22 1 21 22 2 21 23 3 22 23 2 22 24 1 23 ...
result:
ok OK
Test #72:
score: 0
Accepted
time: 7ms
memory: 5644kb
input:
500 2399 238 437 484 484 486 484 474 475 472 484 485 494 482 485 475 482 474 480 475 484 490 483 493 469 488 474 481 474 474 481 474 490 478 488 484 481 481 478 476 483 481 479 486 483 495 492 494 480 480 476 481 482 492 486 493 484 480 472 472 472 480 475 485 473 488 477 487 490 497 493 484 483 468...
output:
2306 1 2 198 1 3 40 2 3 201 2 4 38 3 4 198 3 5 45 4 5 200 4 6 48 5 6 200 5 7 41 6 7 200 6 8 36 7 8 199 7 9 34 8 9 201 8 10 39 9 10 201 9 11 36 10 11 198 10 12 46 11 12 202 11 13 49 12 13 200 12 14 46 13 14 199 13 15 34 14 15 200 14 16 40 15 16 202 15 17 39 16 17 200 16 18 40 17 18 203 17 19 32 18 19...
result:
ok OK
Test #73:
score: 0
Accepted
time: 1ms
memory: 5708kb
input:
500 4061 306 436 485 475 492 472 488 472 488 473 501 489 473 504 483 487 471 488 498 476 468 477 497 473 475 481 480 480 467 480 468 469 478 492 472 474 483 474 494 471 490 473 485 467 474 472 484 480 475 482 462 477 480 482 479 469 478 479 480 481 477 480 476 487 490 506 495 497 495 499 486 478 475...
output:
3980 1 2 201 1 3 41 1 4 30 1 5 24 1 6 10 2 3 200 2 4 11 2 5 9 2 6 11 2 7 4 3 4 200 3 5 7 3 6 10 3 7 17 3 8 10 4 5 200 4 6 5 4 7 9 4 8 8 4 9 12 5 6 197 5 7 13 5 8 4 5 9 17 5 10 21 6 7 200 6 8 8 6 9 10 6 10 7 6 11 14 7 8 200 7 9 3 7 10 15 7 11 16 7 12 11 8 9 201 8 10 10 8 11 8 8 12 16 8 13 7 9 10 200 ...
result:
ok OK
Test #74:
score: 0
Accepted
time: 8ms
memory: 5644kb
input:
500 5512 3242 1806 3415 3325 3330 3441 3433 3446 3481 3470 3328 3508 3444 3375 3413 3406 3372 3460 3354 3423 3435 3430 3463 3521 3381 3410 3526 3390 3502 3432 3566 3462 3416 3428 3491 3329 3414 3458 3427 3459 3365 3479 3510 3458 3523 3361 3466 3338 3438 3463 3421 3363 3462 3425 3431 3406 3514 3420 3...
output:
5505 1 2 170 1 3 1570 1 4 1022 1 5 480 2 3 171 2 4 455 2 5 495 2 6 515 3 4 168 3 5 486 3 6 501 3 7 519 4 5 173 4 6 514 4 7 487 4 8 506 5 6 170 5 7 527 5 8 493 5 9 506 6 7 170 6 8 531 6 9 524 6 10 516 7 8 171 7 9 531 7 10 525 7 11 503 8 9 170 8 10 514 8 11 497 8 12 564 9 10 170 9 11 531 9 12 506 9 13...
result:
ok OK
Test #75:
score: 0
Accepted
time: 2ms
memory: 5524kb
input:
500 145 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 9 0 0 0 0 0 0 ...
output:
45 27 117 1 27 134 1 27 140 1 27 172 1 27 217 1 27 263 1 27 287 1 27 355 1 27 481 1 117 134 1 117 140 1 117 172 1 117 217 1 117 263 1 117 287 1 117 355 1 117 481 1 134 140 1 134 172 1 134 217 1 134 263 1 134 287 1 134 355 1 134 481 1 140 172 1 140 217 1 140 263 1 140 287 1 140 355 1 140 481 1 172 21...
result:
ok OK
Test #76:
score: 0
Accepted
time: 13ms
memory: 5676kb
input:
500 5905 0 0 0 0 0 0 99 99 0 0 0 0 99 0 99 0 0 0 99 99 0 99 0 0 0 0 99 0 99 0 0 0 0 0 0 99 0 0 0 99 0 99 99 0 0 0 99 0 0 0 0 0 0 99 0 0 0 99 0 0 0 0 0 99 0 0 0 0 0 0 99 0 0 0 0 0 0 99 99 0 0 0 0 0 0 0 0 0 0 0 99 0 0 0 0 0 99 0 99 0 0 0 0 0 0 0 0 0 99 0 0 0 0 0 99 0 0 0 0 0 0 0 99 0 0 0 0 0 0 99 99 9...
output:
4908 7 8 1 7 13 1 7 15 1 7 19 1 7 20 1 7 22 1 7 27 1 7 29 1 7 36 1 7 40 1 7 42 1 7 43 1 7 47 1 7 54 1 7 58 1 7 64 1 7 71 1 7 78 1 7 79 1 7 91 1 7 97 1 7 99 1 7 109 1 7 115 1 7 123 1 7 130 1 7 131 1 7 132 1 7 135 1 7 138 1 7 143 1 7 145 1 7 150 1 7 153 1 7 156 1 7 159 1 7 161 1 7 172 1 7 179 1 7 181 ...
result:
ok OK
Test #77:
score: 0
Accepted
time: 847ms
memory: 5532kb
input:
500 54514 0 0 0 199 0 0 199 0 199 199 0 0 0 0 199 199 199 0 0 0 0 0 0 0 0 0 0 199 199 0 0 0 0 199 0 199 0 199 0 0 0 0 199 199 199 0 199 0 199 199 0 0 199 0 199 199 0 0 199 0 0 199 0 0 0 0 0 0 0 199 199 199 199 199 199 0 0 199 199 0 199 199 0 199 199 0 199 199 0 199 199 0 199 0 0 199 199 199 0 0 0 19...
output:
14842 4 7 1 4 9 1 4 15 1 4 29 2 4 36 1 4 38 1 4 45 1 4 47 2 4 50 2 4 53 1 4 59 2 4 62 1 4 71 3 4 72 1 4 78 1 4 81 3 4 82 1 4 84 2 4 85 1 4 87 1 4 90 2 4 93 1 4 96 2 4 97 1 4 98 1 4 102 1 4 104 1 4 107 1 4 109 3 4 110 1 4 113 1 4 114 2 4 120 1 4 122 1 4 125 1 4 129 1 4 131 1 4 132 1 4 133 1 4 141 3 4...
result:
ok OK
Test #78:
score: 0
Accepted
time: 9ms
memory: 5708kb
input:
500 7285 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ...
output:
2431 1 108 1 1 158 1 1 204 1 1 280 1 1 285 1 1 293 1 1 310 1 1 410 1 1 466 1 1 467 1 2 36 1 2 104 1 2 172 1 2 179 1 2 198 1 2 344 1 2 353 1 2 413 1 2 487 1 2 498 1 3 68 1 3 107 1 3 145 1 3 158 1 3 223 1 3 320 1 3 357 2 3 381 1 3 414 1 4 25 1 4 31 3 4 237 1 4 257 1 4 276 1 4 341 1 4 356 1 4 434 1 5 1...
result:
ok OK
Test #79:
score: 0
Accepted
time: 2ms
memory: 5544kb
input:
500 6087 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
250 1 485 1 2 388 1 3 147 1 4 143 1 5 36 1 6 54 1 7 68 1 8 489 1 9 144 1 10 279 1 11 416 1 12 39 1 13 60 1 14 493 1 15 56 1 16 420 1 17 108 1 18 413 1 19 414 1 20 351 1 21 102 1 22 41 1 23 362 1 24 396 1 25 31 1 26 74 1 27 297 1 28 469 1 29 392 1 30 406 1 32 133 1 33 140 1 34 287 1 35 382 1 37 325 1...
result:
ok OK