QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#65593 | #693. Hard Times for Your Data | Qingyu | AC ✓ | 474ms | 434128kb | C++23 | 20.4kb | 2022-12-02 10:42:29 | 2022-12-02 10:42:31 |
Judging History
answer
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define fore(i, b, e) for (int i = (int)(b); i <= (int)(e); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long i64;
typedef unsigned long long u64;
typedef long double ld;
typedef long long ll;
ostream& operator<<(ostream& out, vi a) {
out << "(";
bool first = true;
for (auto x : a) {
if (!first) out << ", ";
first = false;
out << x;
}
return out << ")";
}
namespace dinic {
const int maxn = 100100;
struct Edge {
int to;
i64 c, f;
Edge(int to, i64 c): to(to), c(c), f(0) {}
};
vector<Edge> es;
vector<int> e[maxn];
int q[maxn], d[maxn], pos[maxn];
int n, S, T;
bool bfs() {
fill(d, d + n, maxn);
d[S] = 0, q[0] = S;
int rq = 1;
forn(lq, rq) {
int v = q[lq];
for (int id: e[v]) {
if (es[id].c == es[id].f) continue;
int to = es[id].to;
if (d[to] == maxn) {
d[to] = d[v] + 1;
q[rq++] = to;
}
}
}
return d[T] != maxn;
}
i64 dfs(int v, i64 curf) {
if (v == T) return curf;
i64 ret = 0;
for (int &i = pos[v]; i < (int)e[v].size(); ++i) {
int id = e[v][i];
int to = es[id].to;
i64 delta = min(curf, es[id].c - es[id].f);
if (delta == 0 || d[to] != d[v] + 1) {
continue;
}
delta = dfs(to, delta);
curf -= delta;
ret += delta;
es[id].f += delta;
es[id ^ 1].f -= delta;
if (curf == 0) return ret;
}
return ret;
}
void addEdge(int u, int v, i64 c) {
n = max(n, max(u, v) + 1);
e[u].push_back(es.size());
es.emplace_back(v, c);
e[v].push_back(es.size());
es.emplace_back(u, 0);
}
i64 runDinic(int S_, int T_) {
S = S_;
T = T_;
i64 res = 0;
while (bfs()) {
fill(pos, pos + n, 0);
while (i64 cur = dfs(S, 1e18)) {
res += cur;
}
}
return res;
}
void clear() {
forn(i, n) e[i].clear();
es.clear();
}
} // namespace dinic
const int maxn = 505;
int n, m;
int c[maxn][maxn];
int f[maxn];
int b[maxn][maxn];
void scan() {
cin >> n >> m;
forn(i, n) cin >> f[i];
forn(i, m) {
int u, v, x;
cin >> u >> v >> x;
assert(u != v);
c[u-1][v-1] = c[v-1][u-1] = x;
}
}
void findDirectedFactor() {
int S = n*2, T = n*2+1;
i64 sumf = 0;
forn(i, n) {
dinic::addEdge(S, i, f[i]);
dinic::addEdge(i+n, T, f[i]);
sumf += f[i];
}
forn(i, n) forn(j, n) if (i != j) {
if (c[i][j] > 0) {
dinic::addEdge(i, j+n, c[i][j]);
}
}
i64 flow = dinic::runDinic(S, T);
if (flow != sumf) {
cerr << "No directed factor\n";
cout << "No\n";
assert(false);
exit(0);
}
forn(i, n) {
for (int id : dinic::e[i]) {
if (id%2 == 0) {
const auto& e = dinic::es[id];
if (e.to < n*2) {
b[i][e.to-n] += e.f;
}
}
}
}
bool debug = true;
debug = false;
if (debug) {
cerr << "Directed factor:\n";
forn(i, n) {
forn(j, n) cerr << b[i][j] << " ";
cerr << "\n";
}
}
forn(i, n) forn(j, i) {
int t = b[i][j] + b[j][i];
b[i][j] = b[j][i] = t;
}
// Check symmetry.
forn(i, n) forn(j, n) assert(b[i][j] == b[j][i]);
// Check f-factor.
forn(i, n) {
int x = 0;
forn(j, n) x += b[i][j];
assert(x == f[i] * 2);
}
if (debug) {
cerr << "Symmetrized factor:\n";
forn(i, n) {
forn(j, n) cerr << b[i][j] << " ";
cerr << "\n";
}
}
cerr << "\n";
}
int oddCycleCount;
int oddCycleIndex[maxn*maxn];
int indexInCycle[maxn];
int visited[maxn];
vi oddCycle[maxn*maxn];
vector<int> path;
vi getCycleFromPath(int upTo) {
int i = 0;
while (path[i] != upTo) {
++i;
}
return vi(path.begin() + i, path.end());
}
bool areNeighboursInCycle(int u, int v) {
int c = oddCycleIndex[u];
if (c == -1 || oddCycleIndex[v] != c) return false;
int i = indexInCycle[u], j = indexInCycle[v];
int len = oddCycle[c].size();
return (i+1)%len == j || (j+1)%len == i;
}
bool dfs1(int v, int anc)
{
assert(visited[v] != -1);
path.push_back(v);
forn(i, n) {
if (i == v || i == anc) continue;
if (b[v][i] % 2 == 0) continue;
if (areNeighboursInCycle(i, v)) continue;
if (visited[i] == -1) {
visited[i] = 1 - visited[v];
if (dfs1(i, v)) {
return true;
}
} else {
auto cycle = getCycleFromPath(i);
if (cycle.size() % 2 == 0) {
cerr << "Cancelling even cycle: " << cycle << "\n";
forn(i, cycle.size()) {
int u = cycle[i], v = cycle[(i+1)%cycle.size()];
if (i%2 == 0) ++b[u][v], ++b[v][u];
else --b[u][v], --b[v][u];
}
} else {
cerr << "Found odd cycle: " << cycle << "\n";
int match = -1;
for (int v : cycle) {
if (oddCycleIndex[v] != -1) {
match = v;
break;
}
}
if (match == -1) {
cerr << "Assigned index " << oddCycleCount << "\n";
forn(i, cycle.size()) {
oddCycleIndex[cycle[i]] = oddCycleCount;
indexInCycle[cycle[i]] = i;
}
oddCycle[oddCycleCount] = cycle;
++oddCycleCount;
} else {
int val = 1;
int other = oddCycleIndex[match];
cerr << "Merging with idx " << other << ", " << oddCycle[other] << "\n";
forn(i, cycle.size()) {
int u = cycle[i], v = cycle[(i+1)%cycle.size()];
if (u == match) {
const auto& otherCycle = oddCycle[other];
int idx = find(all(otherCycle), match) - otherCycle.begin();
assert(idx == indexInCycle[match]);
forn(j, oddCycle[other].size()) {
int uu = otherCycle[(j+idx)%otherCycle.size()];
int vv = otherCycle[(j+idx+1)%otherCycle.size()];
b[uu][vv] += val; b[vv][uu] += val;
val = -val;
}
}
b[u][v] += val; b[v][u] += val;
val = -val;
}
assert(val == 1);
for (int v : oddCycle[other]) {
oddCycleIndex[v] = -1;
}
oddCycle[other].clear();
}
}
return true;
}
}
path.pop_back();
return false;
}
void eliminateEvenCycles() {
forn(i, n) oddCycleIndex[i] = -1;
while (true) {
path.clear();
memset(visited, -1, sizeof visited);
bool done = false;
forn(i, n) if (visited[i] == -1) {
visited[i] = 0;
if (dfs1(i, -1)) {
done = true;
break;
}
}
if (!done) break;
}
int cnt = 0;
forn(i, oddCycleCount) {
cnt += !oddCycle[i].empty();
}
assert(cnt%2 == 0);
cerr << "There are " << cnt << " odd cycles\n";
}
namespace NBlos
{
const int maxn = ::maxn * 2;
int pdsu[maxn];
void init(int n = maxn) {
forn(i, n) pdsu[i] = i;
}
int get(int x) {
return pdsu[x] == x ? x : (pdsu[x] = get(pdsu[x]));
}
// X's representative is taken.
bool unite(int x, int y) {
x = get(x); y = get(y);
if (x == y) return false;
pdsu[y] = x;
return true;
}
int nv;
vi blossomL[maxn], blossomR[maxn];
int connectingEdge[maxn];
int bid[maxn];
int base[maxn];
int p[maxn];
int pe[maxn]; // edge from v to p[v]
int isS[maxn], isT[maxn];
int startCycleId;
struct Edge {
bool alive = true;
int u, v;
bool isAdd;
Edge() {}
Edge(int u, int v, bool add) : u(u), v(v), isAdd(add) {}
};
vector<Edge> edges;
// For edge starting from the cycle, keep its original endpoint.
vector<int> originalStart;
vector<int> e[maxn];
vector<int> queue;
void buildInput(int cycle) {
forn(i, maxn) blossomL[i].clear(), blossomR[i].clear();
memset(connectingEdge, -1, sizeof connectingEdge);
memset(p, -1, sizeof p);
memset(pe, -1, sizeof pe);
memset(base, -1, sizeof base);
memset(isS, 0, sizeof isS);
memset(isT, 0, sizeof isT);
memset(bid, -1, sizeof bid);
edges.clear();
originalStart.clear();
forn(i, maxn) e[i].clear();
queue.clear();
startCycleId = cycle;
init();
auto addEdge = [] (int i, int j, bool c) {
if (oddCycleIndex[i] == startCycleId) {
originalStart.push_back(i);
i = n;
} else if (oddCycleIndex[j] == startCycleId) {
originalStart.push_back(j);
j = n;
} else {
originalStart.push_back(-1);
}
e[i].push_back(edges.size());
e[j].push_back(edges.size());
edges.emplace_back(i, j, c);
};
forn(i, n) forn(j, i) if (b[i][j]%2 == 0) {
if (oddCycleIndex[i] == cycle && oddCycleIndex[j] == cycle) continue;
int nAdd = min(2, c[i][j] - b[i][j] / 2);
int nSub = min(2, b[i][j] / 2);
forn(k, nAdd) {
addEdge(i, j, true);
}
forn(k, nSub) {
addEdge(i, j, false);
}
}
nv = n;
queue.push_back(nv);
isS[nv] = isT[nv] = true;
++nv;
}
int lca(int u, int v) {
static int used[maxn];
memset(used, 0, sizeof used);
while (u != -1) used[u] = 1, u = p[u] == -1 ? -1 : get(p[u]);
while (v != -1 && !used[v]) v = p[v] == -1 ? -1 : get(p[v]);
assert(v != -1);
return v;
}
int getBlossomRepresentative(int v, int b) {
while (v != -1 && bid[v] != b) v = bid[v];
return v;
}
int getTrueBase(int b) {
while (b > n) b = base[b];
return b;
}
int getEndpointInBlossom(int b, int edgeId) {
int r1 = getBlossomRepresentative(b, edges[edgeId].u);
int r2 = getBlossomRepresentative(b, edges[edgeId].v);
assert((r1 == -1) != (r2 == -1));
return max(r1, r2);
}
bool isBlossom(int v) {
return v > n;
}
vi unrollBlossomToTrueBase(int b, int inId);
vi unrollBlossomUp(int b, int from, int inId, int to) {
vi res;
assert(bid[from] == b);
assert(bid[to] == b);
while (from != to) {
if (isBlossom(from)) {
auto t = unrollBlossomToTrueBase(from, inId);
res.insert(res.end(), all(t));
}
res.push_back(pe[from]);
inId = pe[from];
from = p[from];
while (bid[from] != b) from = bid[from];
assert(bid[from] == b);
}
return res;
}
vi unrollBlossomToTrueBase(int b, int inId) {
std::cerr << "Unrolling blossom " << b << " to true base\n";
auto ein = edges[inId];
int repr;
{
int r1 = getBlossomRepresentative(ein.v, b);
int r2 = getBlossomRepresentative(ein.u, b);
assert((r1 == -1) != (r2 == -1));
repr = max(r1, r2);
}
vi res;
if ((ein.isAdd && isS[repr]) || (!ein.isAdd && isT[repr])) {
// Can go up.
res = unrollBlossomUp(b, repr, inId, base[b]);
} else {
// Must move all the way round.
assert(!isBlossom(repr));
vi* down = &blossomL[b];
vi* up = &blossomR[b];
if (!count(all(*down), repr)) swap(down, up);
assert(count(all(*down), repr));
vi unrolledDown = unrollBlossomUp(b, down->front(), connectingEdge[b], repr);
vi unrolledUp = unrollBlossomUp(b, up->front(), connectingEdge[b], base[b]);
reverse(all(unrolledDown));
res = unrolledDown;
res.push_back(connectingEdge[b]);
res.insert(res.end(), all(unrolledUp));
}
int base = NBlos::base[b];
if (isBlossom(base)) {
auto nested = unrollBlossomToTrueBase(base, res.empty() ? inId : res.back());
res.insert(res.end(), all(nested));
}
return res;
}
void addValueToCycle(int v, int val) {
int idx = indexInCycle[v];
int c = oddCycleIndex[v];
cerr << "Cancelling cycle " << c << " starting with " << v << "\n";
forn(i, oddCycle[c].size()) {
int x = oddCycle[c][(i+idx)%oddCycle[c].size()];
int y = oddCycle[c][(i+idx+1)%oddCycle[c].size()];
cerr << "Add " << val << " to " << x << " - " << y << "\n";
assert(b[x][y] % 2 == 1);
b[x][y] += val;
b[y][x] += val;
val = -val;
}
for (int x : oddCycle[c]) oddCycleIndex[x] = -1;
oddCycle[c].clear();
cerr << "Finished cancelling cycle\n";
}
void unrollPath(int v) {
cerr << "Ready to unroll the path from " << v << endl;
assert(!isBlossom(v));
int origV = v;
vi res;
while (p[v] != -1) {
res.push_back(pe[v]);
if (isBlossom(p[v])) {
auto nested = unrollBlossomToTrueBase(p[v], pe[v]);
res.insert(res.end(), all(nested));
}
v = p[v];
}
cerr << "Unrolled path:\n";
for (auto eid : res) {
auto e = edges[eid];
cerr << e.u << " " << e.v << " " << e.isAdd << "\n";
}
cerr << "\n";
forn(i, res.size() - 1) {
assert(edges[res[i]].isAdd != edges[res[i+1]].isAdd);
}
v = origV;
assert(!res.empty());
addValueToCycle(v, edges[res[0]].isAdd ? -1 : 1);
forn(i, res.size()) {
auto e = edges[res[i]];
int u = e.u^e.v^v;
if (u == n) u = originalStart[res.back()];
assert(b[u][v] % 2 == 0);
cerr << "Add " << (e.isAdd ? 2 : -2) << " to " << u << " " << v << "\n";
if (e.isAdd) {
assert(b[u][v] + 2 <= c[u][v] * 2);
b[u][v] += 2;
b[v][u] += 2;
} else {
assert(b[u][v] >= 2);
b[u][v] -= 2;
b[v][u] -= 2;
}
v = u;
}
int realV = originalStart[res.back()];
assert(v == realV);
addValueToCycle(realV, edges[res.back()].isAdd ? -1 : 1);
}
// Returns whether the alternating walk was found.
// If it was found then both affected cycles are killed.
bool processVertex(int v) {
// Vertex was shrunk into some blossom.
if (get(v) != v) return false;
int S, T;
string mode;
forn(III, 2) {
if (III == 0) S = 1, T = 0, mode = ", mode = S";
else S = 0, T = 1, mode = ", mode = T";
if (S && !isS[v]) continue;
if (T && !isT[v]) continue;
cerr << "Processing " << v << mode << "\n";
// Find blossoms.
for (int id : e[v]) {
const auto& edge = edges[id];
int to;
if (get(edge.u) == v) to = get(edge.v);
else if (get(edge.v) == v) to = get(edge.u);
else assert(false);
if (to == v) continue;
if (!edge.alive) continue;
if (edge.isAdd != S) continue;
// Blossom is found.
if ((S && isS[to]) || (T && isT[to])) {
cerr << "Found a blossom edge to " << to << "\n";
int base = lca(v, to);
cerr << "LCA is " << base << "\n";
vi curBlossom;
// from v
{
int x = v;
while (x != base) {
blossomL[nv].push_back(x);
curBlossom.push_back(x);
x = get(p[x]);
}
blossomL[nv].push_back(base);
curBlossom.push_back(base);
}
reverse(all(curBlossom));
// from to
{
int x = to;
while (x != base) {
blossomR[nv].push_back(x);
curBlossom.push_back(x);
x = get(p[x]);
}
blossomR[nv].push_back(base);
}
connectingEdge[nv] = id;
// Wrong assertion. Wait till it fails and remove.
// assert(curBlossom.size() % 2 == 1);
cerr << "Blossom: " << curBlossom << ", new id is " << nv << "\n";
cerr << "Left part: " << blossomL[nv] << "\n";
cerr << "Right part: " << blossomR[nv] << "\n";
for (int x : curBlossom) {
unite(nv, x);
e[nv].insert(e[nv].end(), all(e[x]));
bid[x] = nv;
}
NBlos::base[nv] = base;
assert(p[nv] == -1);
p[nv] = p[base];
pe[nv] = pe[base];
isS[nv] = isT[nv] = true;
queue.push_back(nv);
++nv;
return false;
}
}
// Grow tree.
for (int id : e[v]) {
auto& edge = edges[id];
int to;
if (get(edge.u) == v) to = get(edge.v);
else if (get(edge.v) == v) to = get(edge.u);
else assert(false);
if (to == v) continue;
if (!edge.alive) continue;
if (edge.isAdd != S) continue;
if (S) {
assert(!isS[to]);
if (isT[to]) continue;
} else {
assert(!isT[to]);
if (isS[to]) continue;
}
cerr << "Growing a tree to " << to << "\n";
edge.alive = false;
assert(p[to] == -1);
p[to] = v;
pe[to] = id;
if (S) isT[to] = true;
else isS[to] = true;
queue.push_back(to);
// Haven't we finished?
if (to < n && oddCycleIndex[to] != -1 && oddCycleIndex[to] != startCycleId) {
unrollPath(to);
return true;
}
}
}
return false;
}
bool mergeTwoCycles() {
int c = 0;
while (c < oddCycleCount && oddCycle[c].empty()) ++c;
if (c == oddCycleCount) {
// Nothing to merge.
return false;
}
cerr << "Will search for a walk from cycle " << c << "\n";
buildInput(c);
forn(i, queue.size()) {
if (processVertex(queue[i])) {
return true;
}
}
// No solution. However, in our tests we don't expect this.
assert(false);
}
} // namespace NBlos
void solve() {
// cerr << "Finding directed factor\n";
findDirectedFactor();
// cerr << "\n***\n\n";
eliminateEvenCycles();
// cerr << "\n***\n\n";
while (NBlos::mergeTwoCycles()) {
cerr << "Two cycles merged\n";
}
forn(i, n) forn(j, n) {
assert(b[i][j] % 2 == 0);
assert(b[i][j] >= 0);
assert(b[i][j] / 2 <= c[i][j]);
assert(b[i][j] == b[j][i]);
}
forn(i, n) {
int x = 0;
forn(j, n) x += b[i][j];
assert(x == f[i] * 2);
}
int cnt = 0;
forn(i, n) forn(j, i) cnt += b[i][j] > 0;
cout << cnt << "\n";
forn(i, n) forn(j, i) if (b[i][j] > 0) {
cout << j+1 << " " << i+1 << " " << b[i][j]/2 << "\n";
}
}
int main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif
ios::sync_with_stdio(false);
scan();
solve();
#ifdef LOCAL
cerr << "Time elapsed: " << clock() / 1000 << " ms" << endl;
#endif
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 4ms
memory: 11848kb
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 2 3 1 1 4 1 1 5 2
result:
ok OK
Test #2:
score: 0
Accepted
time: 3ms
memory: 11904kb
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 2 3 1 1 4 1 2 5 1 4 5 1 2 6 1 5 6 1 1 7 1 1 8 1 2 8 1 5 8 1 5 9 1 6 9 1 8 9 1 1 10 1 2 10 1 4 10 1 6 10 1 7 10 1 8 10 1
result:
ok OK
Test #3:
score: 0
Accepted
time: 22ms
memory: 15256kb
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 10 12 1 15 17 1 16 18 1 5 24 1 21 27 1 25 32 1 28 36 1 34 43 1 29 47 1 31 51 1 58 59 1 55 63 1 70 73 1 19 75 1 65 76 1 14 85 1 4 90 1 33 92 1 11 98 1 52 101 1 80 102 1 84 103 1 50 105 1 83 114 1 45 121 1 96 124 1 108 126 1 62 129 1 78 130 1 81 131 1 111 132 1 110 133 1 88 135 1 37 138 1 74 142 1...
result:
ok OK
Test #4:
score: 0
Accepted
time: 2ms
memory: 12092kb
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 2 5 1 3 5 1 3 7 1 1 8 1 3 8 1 6 10 1 4 11 1 9 11 1 1 12 1 2 13 1 3 13 1 11 13 1 2 14 1 5 14 1 6 14 1 12 14 1 3 15 1 15 16 1 3 17 1 6 17 1 8 17 1 14 18 1 15 18 1 17 18 1 11 19 1 5 20 1 6 20 1 15 20 1 18 20 1 1 21 1 12 21 1 15 21 1 16 21 1 19 21 1 11 22 1 5 23 1 20 23 1 2 24 1 5 24 1 6 24 1 8...
result:
ok OK
Test #5:
score: 0
Accepted
time: 2ms
memory: 11884kb
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 2 3 1 2 4 1 3 4 1 1 5 1 4 5 1 1 6 1 2 6 1 4 6 1 1 7 1 4 7 1 5 7 1 6 7 1 1 8 1 2 8 1 3 8 1 4 8 1 6 8 1 7 8 1
result:
ok OK
Test #6:
score: 0
Accepted
time: 0ms
memory: 12108kb
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 5 6 1 3 8 1 4 9 1 1 10 1 4 10 1 4 11 1 5 11 1 6 11 1 8 12 1 11 12 1 1 13 1 3 13 1 11 13 1 12 13 1 5 14 1 10 14 1 2 15 1 12 15 1 10 16 1 11 16 1 12 16 1 15 16 1 6 17 1 10 17 1 12 17 1 2 18 1 7 18 1 11 18 1 14 18 1 1 19 1 6 19 1 7 19 1 13 19 1 1 20 1 3 20 1 5 20 1 11 20 1 16 20 1 18 20 1
result:
ok OK
Test #7:
score: 0
Accepted
time: 2ms
memory: 12128kb
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 2 3 1 3 6 1 1 9 1 5 9 1 1 10 1 9 10 1 3 13 1 8 13 1 4 14 1 11 14 1 12 15 1 6 16 1 8 16 1 16 17 1 1 18 1 17 18 1 16 19 1 14 20 1 16 20 1 19 20 1 4 21 1 7 21 1 12 21 1 19 21 1 8 22 1 5 23 1 16 23 1 7 24 1 23 24 1 1 25 1 16 25 1 23 25 1 25 26 1 17 28 1 26 28 1 14 29 1 19 29 1 5 30 1 23 30 1 3 31 1 1...
result:
ok OK
Test #8:
score: 0
Accepted
time: 22ms
memory: 14056kb
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 43 52 1 18 68 1 39 69 1 34 71 1 61 73 1 17 76 1 1 77 1 53 79 1 55 84 1 15 87 1 85 92 1 80 93 1 62 94 1 3 97 1 42 98 1 37 105 1 88 108 1 67 111 1 38 112 1 27 116 1 101 117 1 6 122 1 56 126 1 30 128 1 46 131 1 124 136 1 91 142 1 81 147 1 57 149 1 144 150 1 120 162 1 35 166 1 63 169 1 25 171 1 65 1...
result:
ok OK
Test #9:
score: 0
Accepted
time: 14ms
memory: 15196kb
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 4 11 1 12 18 1 25 26 1 2 29 1 10 31 1 1 34 1 9 44 1 35 46 1 47 51 1 16 55 1 23 59 1 8 61 1 30 67 1 19 69 1 57 70 1 63 75 1 52 78 1 37 79 1 48 83 1 17 88 1 89 90 1 42 94 1 20 95 1 24 97 1 22 98 1 6 99 1 71 102 1 73 108 1 101 111 1 74 114 1 62 116 1 86 129 1 85 132 1 125 133 1 14 135 1 92 136 1 65...
result:
ok OK
Test #10:
score: 0
Accepted
time: 14ms
memory: 14616kb
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 15 25 1 23 34 1 1 39 1 27 44 1 3 45 1 46 47 1 26 49 1 18 51 1 9 59 1 32 61 1 29 66 1 56 75 1 65 78 1 35 79 1 30 82 1 19 87 1 28 96 1 94 106 1 21 108 1 90 114 1 69 116 1 52 117 1 83 120 1 33 121 1 97 122 1 63 123 1 77 125 1 60 126 1 48 128 1 54 131 1 72 135 1 73 137 1 14 138 1 24 139 1 42 144 1 8...
result:
ok OK
Test #11:
score: 0
Accepted
time: 27ms
memory: 14028kb
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 4 28 1 25 35 1 30 43 1 1 45 1 8 54 1 50 55 1 42 56 1 21 57 1 44 61 1 29 65 1 3 67 1 11 68 1 19 70 1 41 78 1 5 83 1 2 84 1 74 91 1 69 100 1 62 102 1 59 104 1 13 108 1 79 110 1 76 111 1 93 112 1 89 113 1 87 114 1 12 116 1 81 126 1 26 128 1 16 130 1 6 133 1 127 135 1 107 138 1 64 139 1 39 140 1 115...
result:
ok OK
Test #12:
score: 0
Accepted
time: 15ms
memory: 17292kb
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 9 26 1 23 32 1 3 34 1 13 38 1 3 42 1 14 43 1 10 45 1 33 46 1 1 47 1 9 48 1 33 48 1 4 50 1 13 50 1 31 50 1 35 50 1 29 52 1 8 53 1 32 54 1 29 56 1 49 56 1 36 57 1 37 57 1 26 58 1 53 58 1 6 59 1 46 59 1 50 59 1 33 60 1 17 61 1 38 61 1 44 62 1 57 63 1 63 65 1 35 68 1 5 69 1 7 69 1 26 69 1 34 69 1 1...
result:
ok OK
Test #13:
score: 0
Accepted
time: 12ms
memory: 16516kb
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 7 9 1 1 14 1 3 15 1 4 15 1 5 15 1 14 16 1 2 18 1 12 19 1 2 21 1 8 22 1 12 23 1 20 24 1 8 25 1 22 25 1 19 26 1 15 27 1 14 28 1 16 28 1 25 28 1 6 29 1 9 30 1 3 31 1 18 31 1 12 32 1 28 33 1 14 34 1 19 36 1 16 37 1 22 37 1 34 37 1 20 39 1 28 39 1 20 40 1 22 40 1 19 41 1 2 42 1 6 42 1 11 42 1 34 42 ...
result:
ok OK
Test #14:
score: 0
Accepted
time: 31ms
memory: 15188kb
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 4 9 1 2 12 1 3 12 1 4 12 1 3 13 1 13 14 1 4 15 1 3 16 1 13 17 1 10 18 1 16 21 1 1 22 1 6 22 1 16 22 1 9 23 1 7 24 1 20 24 1 9 25 1 11 25 1 17 25 1 13 28 1 18 28 1 14 29 1 28 29 1 1 30 1 3 30 1 15 30 1 14 32 1 16 32 1 4 33 1 2 34 1 3 34 1 6 34 1 11 34 1 17 35 1 24 35 1 1 36 1 9 36 1 14 36 1 33 3...
result:
ok OK
Test #15:
score: 0
Accepted
time: 24ms
memory: 14188kb
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 3 9 1 16 25 1 12 28 1 14 32 1 1 35 1 26 43 1 8 44 1 46 52 1 37 53 1 42 56 1 23 57 1 4 64 1 39 65 1 21 67 1 54 68 1 36 74 1 22 80 1 34 83 1 27 84 1 24 89 1 63 90 1 17 94 1 50 95 1 66 96 1 38 98 1 11 104 1 75 105 1 49 108 1 19 111 1 101 112 1 41 115 1 81 116 1 88 117 1 7 120 1 59 122 1 76 124 1 18...
result:
ok OK
Test #16:
score: 0
Accepted
time: 2ms
memory: 12472kb
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 5 1 3 5 1 2 9 1 4 9 1 7 9 1 6 10 1 9 10 1 5 12 1 9 12 1 2 13 1 6 13 1 14 15 1 2 16 1 8 17 1 5 18 1 5 19 1 6 19 1 12 19 1 15 20 1 3 21 1 17 21 1 21 22 1 5 23 1 12 23 1 14 23 1 20 23 1 5 24 1 17 25 1 21 25 1 24 25 1 10 28 1 16 28 1 21 28 1 23 28 1 23 29 1 25 29 1 10 30 1 25 30 1 27 30 1 21 31 1 ...
result:
ok OK
Test #17:
score: 0
Accepted
time: 0ms
memory: 12892kb
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 8 9 1 9 10 1 8 11 1 2 12 1 1 14 1 2 14 1 9 14 1 10 14 1 11 14 1 13 14 1 9 15 1 2 16 1 1 17 1 10 17 1 11 17 1 13 17 1 4 18 1 11 18 1 14 18 1 16 18 1 18 19 1 2 20 1 8 20 1 9 20 1 11 20 1 2 21 1 8 22 1 14 22 1 19 22 1 8 23 1 16 23 1 18 23 1 20 23 1 2 24 1 9 24 1 12 24 1 14 24 1 15 24 1 17 24 1 5 2...
result:
ok OK
Test #18:
score: 0
Accepted
time: 37ms
memory: 17320kb
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 5 7 1 20 21 1 20 22 1 21 22 1 21 24 1 22 25 1 23 25 1 18 26 1 23 26 1 24 26 1 25 26 1 18 27 1 19 27 1 20 27 1 21 27 1 22 27 1 25 27 1 13 28 1 16 28 1 19 28 1 20 28 1 25 28 1 26 28 1 27 28 1 18 29 1 20 29 1 21 29 1 22 29 1 23 29 1 26 29 1 15 30 1 17 30 1 20 30 1 21 30 1 22 30 1 23 30 1 24 30 1 ...
result:
ok OK
Test #19:
score: 0
Accepted
time: 6ms
memory: 13764kb
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 6 11 1 13 14 1 18 22 1 3 25 1 25 32 1 7 34 1 14 34 1 9 39 1 33 48 1 17 50 1 15 52 1 28 52 1 41 53 1 8 59 1 64 68 1 27 70 1 29 70 1 1 73 1 5 76 1 9 76 1 66 77 1 45 78 1 31 82 1 5 84 1 14 87 1 1 89 1 22 91 1 57 93 1 94 95 1 88 96 1 88 99 1 54 102 1 66 102 1 85 104 1 75 106 1 50 107 1 26 110 1 23 1...
result:
ok OK
Test #20:
score: 0
Accepted
time: 41ms
memory: 27212kb
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 3 1 2 3 1 2 4 1 3 4 1 2 5 1 3 5 1 4 5 1 3 6 1 5 6 1 3 7 1 5 7 1 6 7 1 5 8 1 6 8 1 7 8 1 6 9 1 7 9 1 8 9 1 6 10 1 7 10 1 8 10 1 9 10 1 7 11 1 9 11 1 10 11 1 9 12 1 11 12 1 9 13 1 11 13 1 12 13 1 9 14 1 11 14 1 13 14 1 9 15 1 11 15 1 13 15 1 15 16 1 16 17 1 17 18 1 17 19 1 18 19 1 17 20 1 18 20...
result:
ok OK
Test #21:
score: 0
Accepted
time: 43ms
memory: 27244kb
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 4 1 3 4 1 1 5 1 2 5 1 3 5 1 4 5 1 1 6 1 2 6 1 3 6 1 1 7 1 6 7 1 6 8 1 7 8 1 7 9 1 8 9 1 7 10 1 8 10 1 9 10 1 7 11 1 8 11 1 8 12 1 11 12 1 8 13 1 11 13 1 12 13 1 11 14 1 12 14 1 13 14 1 11 15 1 13 15 1 14 15 1 11 16 1 13 16 1 14 16 1 15 16 1 11 17 1 15 17 1 16 17 1 15 18 1 16 18 1 17 18 1 15 1...
result:
ok OK
Test #22:
score: 0
Accepted
time: 46ms
memory: 27268kb
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 2 5 1 3 5 1 4 5 1 1 6 1 2 6 1 3 6 1 4 6 1 5 6 1 1 7 1 2 7 1 3 7 1 4 7 1 5 7 1 6 7 1 1 8 1 2 8 1 5 8 1 6 8 1 1 9 1 2 9 1 5 9 1 8 9 1 1 10 1 2 10 1 9 10 1 9 11 1 10 11 1 9 12 1 10 12 1 11 12 1 9 13 1 11 13 1 12 13 1 9 14 1 11 14 1 12 14 1 9 15 1 11 15 1 12 15 1 13 15 1 11 16 1 12 16 1 13 16 1 11 ...
result:
ok OK
Test #23:
score: 0
Accepted
time: 38ms
memory: 27276kb
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 2 4 1 3 4 1 1 5 1 2 5 1 3 5 1 4 5 1 1 6 1 2 6 1 3 6 1 4 6 1 5 6 1 1 7 1 2 7 1 3 7 1 4 7 1 5 7 1 6 7 1 1 8 1 2 8 1 3 8 1 4 8 1 5 8 1 6 8 1 7 8 1 1 9 1 2 9 1 3 9 1 5 9 1 6 9 1 7 9 1 8 9 1 3 10 1 5 10 1 6 10 1 3 11 1 10 11 1 3 12 1 10 12 1 11 12 1 10 13 1 11 13 1 12 13 1 10 14 1 11 14 1 12 14 1 13...
result:
ok OK
Test #24:
score: 0
Accepted
time: 102ms
memory: 27196kb
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 42 43 1 41 44 1 43 44 1 39 45 1 40 45 1 42 45 1 43 45 1 44 45 1 38 46 1 40 46 1 41 46 1 42 46 1 43 46 1 44 46 1 45 46 1 36 47 1 39 47 1 40 47 1 42 47 1 43 47 1 44 47 1 45 47 1 46 47 1 32 48 1 34 48 1 37 48 1 38 48 1 40 48 1 41 48 1 42 48 1 43 48 1 44 48 1 45 48 1 46 48 1 47 48 1 30 49 1 33 49 ...
result:
ok OK
Test #25:
score: 0
Accepted
time: 203ms
memory: 27208kb
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 3 1 3 4 1 3 6 1 3 7 1 3 9 1 3 14 1 3 20 1 1 22 1 3 22 1 8 22 1 10 22 1 12 22 1 14 22 1 15 22 1 17 22 1 20 22 1 22 24 1 14 25 1 20 25 1 9 26 1 12 26 1 13 26 1 7 29 1 12 29 1 13 29 1 14 29 1 17 29 1 20 29 1 22 29 1 25 29 1 29 30 1 2 31 1 3 31 1 5 31 1 7 31 1 9 31 1 10 31 1 11 31 1 15 31 1 17 3...
result:
ok OK
Test #26:
score: 0
Accepted
time: 2ms
memory: 11892kb
input:
1 0 0
output:
0
result:
ok OK
Test #27:
score: 0
Accepted
time: 113ms
memory: 26668kb
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:
47355 20 27 1 22 27 1 23 27 1 25 27 1 25 28 1 26 28 2 27 28 2 21 29 1 24 29 1 25 29 1 26 29 1 28 29 1 23 30 1 26 30 1 27 30 1 28 30 1 29 30 2 11 31 1 14 31 1 15 31 1 18 31 1 19 31 1 22 31 1 24 31 1 26 31 1 27 31 1 29 31 2 30 31 2 21 32 1 23 32 1 24 32 1 28 32 1 29 32 1 31 32 2 16 33 1 17 33 1 20 33 ...
result:
ok OK
Test #28:
score: 0
Accepted
time: 212ms
memory: 36316kb
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:
99336 1 2 1 2 3 1 2 4 1 2 6 2 4 6 2 3 8 1 6 8 1 7 8 1 1 9 2 2 9 2 3 9 2 4 9 1 6 9 2 7 9 1 4 10 1 9 10 3 1 11 1 2 11 1 3 11 1 6 11 3 7 11 1 8 11 1 1 12 1 4 12 2 8 12 1 1 13 1 2 13 1 3 13 1 4 13 2 6 13 2 8 13 1 9 13 2 11 13 1 2 14 1 3 14 1 4 14 1 6 14 1 9 14 1 11 14 1 13 14 2 1 15 1 2 15 1 3 15 1 5 15...
result:
ok OK
Test #29:
score: 0
Accepted
time: 284ms
memory: 37248kb
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:
108029 1 2 1 2 3 1 1 4 1 2 4 1 1 5 1 2 5 1 4 5 1 1 6 2 2 6 1 1 7 1 2 7 3 3 7 1 5 7 1 6 7 1 1 8 1 2 8 3 3 8 2 4 8 1 5 8 1 6 8 1 7 8 3 2 9 1 7 9 1 8 9 1 1 10 1 2 10 2 5 10 1 6 10 1 7 10 1 8 10 3 9 10 3 1 11 2 2 11 1 3 11 2 4 11 1 5 11 1 6 11 1 7 11 2 8 11 4 1 12 1 2 12 2 3 12 2 4 12 4 5 12 2 6 12 1 7 ...
result:
ok OK
Test #30:
score: 0
Accepted
time: 84ms
memory: 26556kb
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:
69614 30 66 1 54 66 1 30 84 1 84 86 1 54 97 2 54 99 1 84 99 1 84 102 1 84 107 1 66 112 1 84 112 2 99 112 1 84 117 2 54 119 1 84 122 2 54 123 1 84 123 1 84 126 1 119 128 1 54 129 1 84 129 1 99 129 1 112 129 2 123 129 1 54 131 2 119 131 1 123 131 1 129 131 1 130 131 1 36 132 1 54 132 1 131 132 1 99 13...
result:
ok OK
Test #31:
score: 0
Accepted
time: 208ms
memory: 298240kb
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:
56234 19 23 1 20 23 3 22 23 1 12 24 1 14 24 1 15 24 1 18 24 1 19 24 1 20 24 2 16 25 1 18 25 1 19 25 1 20 25 2 21 25 1 23 25 4 24 25 2 11 26 2 13 26 1 14 26 2 15 26 1 19 26 1 20 26 1 23 26 2 24 26 1 10 27 1 11 27 2 14 27 1 15 27 1 16 27 2 17 27 1 18 27 1 20 27 1 21 27 1 22 27 1 23 27 1 24 27 2 25 27 ...
result:
ok OK
Test #32:
score: 0
Accepted
time: 213ms
memory: 36584kb
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:
110265 1 2 2 1 3 3 2 3 2 1 4 1 2 4 1 3 4 1 1 5 1 2 5 1 3 5 1 1 6 2 2 6 1 3 6 2 5 6 2 1 7 1 2 7 1 3 7 2 5 7 2 1 8 3 2 8 1 3 8 2 4 8 2 5 8 1 7 8 1 1 9 2 2 9 3 3 9 3 4 9 1 5 9 3 6 9 1 7 9 1 8 9 1 1 10 2 2 10 3 3 10 2 4 10 2 5 10 3 6 10 3 7 10 2 8 10 2 9 10 2 1 11 2 2 11 1 3 11 2 5 11 1 6 11 1 7 11 1 9 ...
result:
ok OK
Test #33:
score: 0
Accepted
time: 99ms
memory: 37108kb
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:
64872 15 16 225 12 17 146 13 17 627 14 17 914 15 17 331 16 17 1187 8 18 399 9 18 455 10 18 676 11 18 252 12 18 327 13 18 472 14 18 210 15 18 587 16 18 890 17 18 214 7 19 32 8 19 327 10 19 95 11 19 253 12 19 892 13 19 121 14 19 820 15 19 310 16 19 1444 17 19 975 18 19 919 8 20 10 9 20 102 10 20 44 11...
result:
ok OK
Test #34:
score: 0
Accepted
time: 58ms
memory: 27288kb
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 660 1 3 884 2 3 900 1 4 900 2 4 900 3 4 660 1 5 901 2 5 902 3 5 903 4 5 899 1 6 901 2 6 901 3 6 903 4 6 901 5 6 665 1 7 903 2 7 902 3 7 902 4 7 901 5 7 901 6 7 886 1 8 903 2 8 901 3 8 902 4 8 902 5 8 903 6 8 901 7 8 686 1 9 902 2 9 902 3 9 902 4 9 902 5 9 902 6 9 902 7 9 900 8 9 876 1 10 ...
result:
ok OK
Test #35:
score: 0
Accepted
time: 293ms
memory: 27280kb
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:
117568 1 4 2 1 5 1 4 5 1 1 6 2 2 6 2 3 6 2 4 6 3 1 7 2 2 7 1 3 7 2 4 7 3 5 7 2 6 7 2 6 8 2 7 8 3 1 9 4 2 9 3 3 9 3 4 9 3 5 9 4 6 9 3 7 9 3 8 9 1 1 10 2 2 10 1 3 10 2 4 10 1 5 10 2 6 10 3 7 10 3 8 10 1 9 10 3 1 11 2 2 11 2 3 11 2 4 11 1 5 11 2 6 11 2 7 11 2 8 11 1 9 11 4 10 11 2 1 12 3 2 12 4 3 12 2 ...
result:
ok OK
Test #36:
score: 0
Accepted
time: 240ms
memory: 42796kb
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:
116368 1 2 2 2 3 2 2 4 1 2 5 4 3 5 1 2 6 2 4 6 1 5 6 1 1 7 2 2 7 2 4 7 1 5 7 2 6 7 1 1 8 1 2 8 1 3 8 2 4 8 2 5 8 3 6 8 1 7 8 2 3 9 1 5 9 1 7 9 1 8 9 2 1 10 4 2 10 4 3 10 2 4 10 3 5 10 4 6 10 1 7 10 4 8 10 4 1 11 2 2 11 2 3 11 2 4 11 1 5 11 1 6 11 2 7 11 3 8 11 3 9 11 1 10 11 1 1 12 1 2 12 3 3 12 2 4...
result:
ok OK
Test #37:
score: 0
Accepted
time: 174ms
memory: 85160kb
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:
124668 1 2 25 1 3 31 2 3 31 1 4 29 2 4 31 3 4 31 1 5 28 2 5 31 3 5 29 4 5 29 1 6 26 2 6 30 3 6 30 4 6 30 5 6 29 1 7 30 2 7 30 3 7 31 4 7 30 5 7 30 6 7 30 1 8 19 2 8 31 3 8 31 4 8 30 5 8 30 6 8 30 7 8 30 1 9 23 2 9 31 3 9 30 4 9 30 5 9 30 6 9 31 7 9 30 8 9 31 1 10 29 2 10 31 3 10 30 4 10 30 5 10 31 6...
result:
ok OK
Test #38:
score: 0
Accepted
time: 120ms
memory: 41776kb
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:
124434 1 2 15 1 3 16 2 3 30 1 4 16 2 4 30 3 4 32 1 5 15 2 5 31 3 5 32 4 5 32 1 6 17 2 6 31 3 6 30 4 6 31 5 6 32 1 7 26 2 7 32 3 7 32 4 7 30 5 7 31 6 7 31 1 8 20 2 8 31 3 8 30 4 8 32 5 8 30 6 8 30 7 8 32 1 9 17 2 9 20 3 9 15 4 9 15 5 9 17 6 9 16 7 9 16 8 9 15 1 10 32 2 10 30 3 10 32 4 10 30 5 10 30 6...
result:
ok OK
Test #39:
score: 0
Accepted
time: 163ms
memory: 434128kb
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:
50158 15 16 1 15 18 1 15 19 1 3 20 1 7 20 1 13 20 1 15 20 2 16 21 1 15 22 1 16 22 1 21 23 1 3 24 1 15 24 1 16 24 2 19 24 1 21 24 1 1 25 1 12 25 1 17 25 1 1 26 1 3 26 1 4 26 1 5 26 1 7 26 2 11 26 1 12 26 2 14 26 1 16 26 1 17 26 3 21 26 1 24 26 1 1 27 1 5 27 1 17 27 2 21 27 1 22 27 1 26 27 1 1 28 1 12...
result:
ok OK
Test #40:
score: 0
Accepted
time: 474ms
memory: 372648kb
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:
117588 1 2 2 1 3 3 2 3 1 1 4 1 3 4 2 1 5 3 2 5 3 3 5 2 4 5 2 1 6 2 2 6 2 3 6 2 4 6 1 5 6 4 1 7 1 2 7 2 3 7 2 4 7 3 5 7 1 6 7 2 1 8 4 2 8 2 3 8 4 4 8 2 5 8 4 6 8 4 7 8 1 1 9 2 2 9 1 3 9 1 4 9 2 5 9 2 6 9 4 7 9 2 8 9 4 5 10 1 6 10 2 8 10 2 9 10 2 1 11 1 2 11 2 3 11 4 4 11 1 5 11 2 6 11 4 7 11 2 8 11 4...
result:
ok OK
Test #41:
score: 0
Accepted
time: 330ms
memory: 46912kb
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:
117554 1 2 4 1 3 3 2 3 2 1 4 2 2 4 1 1 5 3 2 5 4 3 5 2 4 5 2 1 6 1 2 6 3 3 6 2 4 6 4 5 6 2 1 7 4 2 7 4 3 7 1 4 7 2 5 7 4 6 7 1 1 8 2 2 8 2 3 8 1 4 8 4 5 8 1 6 8 3 7 8 2 1 9 4 2 9 3 3 9 3 4 9 3 5 9 3 6 9 3 7 9 3 8 9 4 1 10 3 2 10 4 3 10 4 4 10 4 5 10 3 6 10 4 7 10 4 8 10 3 9 10 4 1 11 2 2 11 1 4 11 2...
result:
ok OK
Test #42:
score: 0
Accepted
time: 56ms
memory: 30640kb
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 7215 1 3 9303 2 3 9416 1 4 9191 2 4 8985 3 4 7411 1 5 5564 2 5 7109 3 5 6646 4 5 7465 1 6 8182 2 6 4842 3 6 6741 4 6 9242 5 6 7436 1 7 8396 2 7 7270 3 7 6431 4 7 5500 5 7 7687 6 7 8689 1 8 9944 2 8 8732 3 8 8860 4 8 7104 5 8 9562 6 8 8728 7 8 5858 1 9 8849 2 9 9013 3 9 8791 4 9 8968 5 9 8...
result:
ok OK
Test #43:
score: 0
Accepted
time: 179ms
memory: 45740kb
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:
124750 1 2 9434 1 3 375 2 3 8465 1 4 3082 2 4 7414 3 4 4604 1 5 9642 2 5 3875 3 5 8184 4 5 6211 1 6 8035 2 6 4783 3 6 2894 4 6 7877 5 6 3459 1 7 3108 2 7 5517 3 7 8978 4 7 6431 5 7 9474 6 7 8604 1 8 7505 2 8 7588 3 8 3538 4 8 5731 5 8 8278 6 8 9270 7 8 3508 1 9 9216 2 9 7359 3 9 6672 4 9 3014 5 9 54...
result:
ok OK
Test #44:
score: 0
Accepted
time: 0ms
memory: 16060kb
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: 0ms
memory: 16108kb
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: 16228kb
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 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 7...
result:
ok OK
Test #47:
score: 0
Accepted
time: 4ms
memory: 16116kb
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 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 7...
result:
ok OK
Test #48:
score: 0
Accepted
time: 2ms
memory: 16440kb
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 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 7...
result:
ok OK
Test #49:
score: 0
Accepted
time: 2ms
memory: 16112kb
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 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 1 1 10 1 2 10 1 4 10 1 9 10 1 4 11 2 9 11 1 1 12 1 5 12 1 1 13 1 9 13 1 10 13 1 13 14 1 14 15 1 14 16 1 15 17 1 9 18 1 9 19 1 13 19 1 5 20 1 9 20 1 10 20 1 16 20 1 4 21 1 15 21 1 14 22 1 20 22 1 16 23 1 2 24 ...
result:
ok OK
Test #50:
score: 0
Accepted
time: 2ms
memory: 16252kb
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 8 9 1 7 10 1 9 10 1 10 11 1 11 12 1 12 13 1 13 14 1 12 15 1 14 16 1 11 17 1 12 17 1 12 18 1 17 18 1 12 19 2 15 19 1 18 20 1 18 21 1 18 22 1 21 22 1 17 23 2 21 23 1 18 24 1 22 24 1 17 25 1 12 26 2 19 26 1 25 27 1 18 28 1 23 28 1 21 29 1 ...
result:
ok OK
Test #51:
score: 0
Accepted
time: 13ms
memory: 16256kb
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 2 3 1 3 4 1 4 5 1 1 6 2 3 6 1 4 6 1 5 6 1 4 7 1 6 7 1 7 8 1 6 9 1 8 9 1 2 10 1 9 10 1 4 11 1 7 11 1 8 11 1 9 11 1 10 12 1 9 13 1 6 14 1 8 14 1 9 14 1 10 14 1 4 15 1 7 15 1 14 15 1 5 16 1 9 16 1 15 16 1 7 17 1 9 17 1 14 17 1 16 17 1 9 18 2 14 18 1 16 18 1 17 18 1 8 19 1 9 19 1 10 19 ...
result:
ok OK
Test #52:
score: 0
Accepted
time: 17ms
memory: 18872kb
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:
1284 1 2 3 1 3 3 2 3 2 1 4 5 2 4 1 1 5 2 4 5 1 5 6 2 5 7 1 6 7 1 4 8 1 6 8 1 6 9 1 7 9 3 9 10 1 4 11 1 6 11 1 7 11 1 10 11 2 6 12 2 9 12 1 10 12 2 10 13 4 11 13 1 12 13 2 4 14 1 7 14 1 11 14 1 9 15 1 12 15 1 13 15 1 7 16 1 10 16 1 13 16 3 10 17 2 15 17 2 6 18 1 16 18 3 10 19 2 15 19 2 12 20 1 16 20 ...
result:
ok OK
Test #53:
score: 0
Accepted
time: 7ms
memory: 16544kb
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:
1345 1 2 1 2 3 2 1 4 3 3 4 2 1 5 1 4 5 1 1 6 1 3 6 1 4 6 2 5 6 2 1 7 1 3 7 1 5 7 1 1 8 3 2 8 1 5 8 2 6 8 1 1 9 1 3 9 1 8 9 1 2 10 1 5 10 1 9 10 1 3 11 1 4 11 1 10 11 1 7 12 1 11 12 1 10 13 2 10 14 1 11 15 1 14 15 1 9 16 1 11 16 2 13 16 1 16 17 1 10 18 1 15 18 1 16 18 1 18 19 1 10 20 1 14 20 1 6 21 1...
result:
ok OK
Test #54:
score: 0
Accepted
time: 12ms
memory: 16924kb
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:
3062 1 2 2 1 3 12 2 3 2 1 4 9 2 4 1 3 4 1 1 5 6 2 5 3 3 5 2 4 5 3 1 6 4 2 6 3 3 6 2 4 6 4 5 6 3 1 7 5 3 7 1 5 7 2 6 7 4 1 8 4 2 8 1 3 8 4 4 8 3 6 8 2 1 9 2 2 9 2 3 9 1 6 9 2 7 9 3 2 10 3 6 10 1 7 10 3 9 10 1 1 11 1 2 11 3 6 11 1 7 11 2 9 11 2 7 12 1 11 12 1 7 13 2 9 13 3 11 13 2 3 14 1 9 14 4 10 14 ...
result:
ok OK
Test #55:
score: 0
Accepted
time: 9ms
memory: 16736kb
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:
2929 1 2 2 1 3 17 2 3 1 1 4 7 2 4 1 3 4 2 1 5 8 2 5 1 3 5 10 4 5 1 1 6 7 2 6 4 3 6 1 5 6 1 1 7 1 2 7 5 4 7 3 5 7 7 6 7 2 2 8 3 3 8 5 4 8 2 2 9 2 3 9 3 4 9 3 5 9 5 6 9 2 7 9 1 2 10 1 4 10 3 5 10 1 6 10 1 9 10 2 4 11 1 6 11 3 9 11 2 10 11 3 5 12 1 6 12 4 9 12 4 5 13 2 6 13 1 9 13 3 10 13 3 11 13 1 9 1...
result:
ok OK
Test #56:
score: 0
Accepted
time: 40ms
memory: 17624kb
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:
2281 1 2 1 1 3 14 2 3 1 1 4 5 2 4 7 3 4 3 1 5 6 2 5 3 3 5 2 4 5 1 1 6 5 2 6 4 3 6 3 4 6 2 3 7 1 4 7 6 6 7 1 3 8 1 4 8 2 6 8 1 7 8 1 4 9 2 6 9 6 7 9 5 8 9 2 6 10 4 7 10 7 8 10 7 7 11 6 8 11 5 9 11 1 6 12 2 7 12 3 8 12 1 6 13 4 7 13 2 8 13 2 9 13 2 12 13 2 7 14 3 8 14 2 12 14 8 13 14 2 8 15 5 12 15 5 ...
result:
ok OK
Test #57:
score: 0
Accepted
time: 69ms
memory: 18052kb
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:
2251 1 2 2 1 3 12 2 3 1 1 4 7 2 4 7 3 4 2 1 5 2 2 5 8 3 5 1 4 5 1 3 6 4 4 6 3 5 6 2 3 7 1 4 7 6 5 7 5 6 7 1 5 8 5 6 8 4 7 8 3 5 9 2 6 9 9 7 9 1 5 10 3 6 10 3 7 10 3 8 10 2 7 11 6 8 11 5 10 11 2 7 12 2 8 12 3 10 12 3 11 12 3 8 13 1 10 13 3 11 13 3 12 13 3 10 14 2 11 14 3 12 14 1 10 15 2 11 15 5 12 15...
result:
ok OK
Test #58:
score: 0
Accepted
time: 41ms
memory: 17104kb
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:
2196 1 2 3 1 3 12 2 3 2 1 4 14 2 4 4 3 4 1 1 5 2 2 5 3 3 5 4 4 5 1 4 6 7 5 6 1 3 7 1 4 7 5 6 7 2 5 8 7 6 8 5 7 8 2 5 9 6 6 9 7 7 9 5 8 9 1 6 10 2 7 10 6 8 10 3 9 10 3 8 11 3 10 11 2 10 12 2 11 12 2 10 13 3 11 13 7 12 13 1 10 14 4 11 14 6 12 14 3 11 15 6 12 15 3 13 15 3 11 16 3 12 16 7 13 16 3 15 16 ...
result:
ok OK
Test #59:
score: 0
Accepted
time: 31ms
memory: 17528kb
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:
2184 1 2 1 1 3 14 2 3 3 1 4 6 2 4 4 3 4 2 2 5 5 3 5 5 4 5 2 2 6 2 4 6 7 5 6 2 4 7 4 5 7 4 6 7 1 4 8 1 5 8 5 6 8 6 7 8 3 5 9 6 6 9 8 7 9 4 8 9 2 6 10 3 7 10 6 8 10 5 7 11 4 8 11 6 6 12 2 7 12 5 8 12 2 9 12 1 8 13 3 9 13 2 12 13 1 8 14 2 9 14 2 12 14 8 13 14 2 8 15 2 9 15 2 12 15 2 13 15 2 12 16 4 13 ...
result:
ok OK
Test #60:
score: 0
Accepted
time: 50ms
memory: 17068kb
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:
2180 1 2 3 1 3 14 2 3 1 1 4 8 2 4 5 3 4 1 1 5 3 2 5 4 3 5 9 4 5 2 3 6 4 4 6 4 5 6 2 3 7 1 4 7 6 5 7 3 6 7 1 5 8 3 6 8 4 7 8 1 5 9 5 6 9 5 8 9 1 6 10 4 7 10 4 8 10 3 9 10 1 6 11 4 7 11 5 8 11 5 10 11 1 8 12 5 10 12 3 11 12 1 6 13 2 7 13 11 8 13 3 10 13 1 7 14 4 8 14 1 10 14 5 8 15 6 10 15 4 11 15 4 1...
result:
ok OK
Test #61:
score: 0
Accepted
time: 15ms
memory: 16188kb
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:
2562 1 2 1 1 3 9 2 3 3 1 4 8 2 4 5 3 4 2 1 5 5 2 5 5 4 5 2 1 6 2 2 6 4 3 6 2 4 6 1 5 6 1 3 7 3 4 7 6 5 7 4 6 7 1 4 8 1 6 8 2 7 8 2 4 9 2 5 9 1 6 9 5 7 9 4 8 9 2 6 10 4 7 10 4 9 10 1 6 11 4 7 11 2 8 11 4 9 11 4 10 11 2 8 12 4 9 12 5 10 12 4 11 12 3 8 13 2 9 13 1 10 13 6 11 13 2 12 13 1 9 14 3 10 14 4...
result:
ok OK
Test #62:
score: 0
Accepted
time: 34ms
memory: 16536kb
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:
2102 1 2 4 1 3 6 2 3 2 1 4 2 2 4 2 3 4 1 1 5 1 4 5 4 2 6 1 3 6 2 4 6 3 5 6 1 3 7 2 4 7 3 5 7 7 6 7 1 5 8 3 6 8 5 7 8 1 5 9 4 6 9 1 7 9 3 8 9 2 6 10 2 7 10 7 8 10 5 9 10 3 7 11 5 8 11 5 9 11 4 10 11 2 8 12 2 10 12 8 9 13 5 10 13 5 11 13 1 9 14 3 10 14 3 11 14 1 9 15 2 11 15 3 12 15 1 13 15 1 9 16 2 1...
result:
ok OK
Test #63:
score: 0
Accepted
time: 50ms
memory: 17240kb
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:
1886 1 2 3 1 3 10 2 3 3 1 4 4 2 4 2 4 5 3 2 6 1 3 6 2 4 6 3 5 6 1 3 7 2 4 7 2 5 7 4 6 7 1 4 8 1 5 8 4 6 8 6 7 8 1 5 9 2 6 9 1 7 9 4 8 9 1 6 10 4 7 10 5 8 10 6 9 10 3 7 11 3 9 11 2 10 11 2 8 12 3 9 12 6 10 12 2 11 12 1 10 13 1 11 13 5 12 13 1 11 14 3 12 14 2 13 14 1 11 15 6 12 15 1 14 15 1 12 16 1 13...
result:
ok OK
Test #64:
score: 0
Accepted
time: 59ms
memory: 16472kb
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:
1408 1 2 2 1 3 6 2 3 2 1 4 5 2 4 4 3 4 1 3 5 5 4 5 1 3 6 3 4 6 8 5 6 2 4 7 7 5 7 4 6 7 2 5 8 1 6 8 10 7 8 1 6 9 1 7 9 5 8 9 1 7 10 2 8 10 4 9 10 2 8 11 6 9 11 4 10 11 1 9 12 1 10 12 8 11 12 1 10 13 5 11 13 5 12 13 3 11 14 5 12 14 5 13 15 9 14 15 2 13 16 1 14 16 6 15 16 1 14 17 5 15 17 5 16 17 1 15 1...
result:
ok OK
Test #65:
score: 0
Accepted
time: 34ms
memory: 16384kb
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:
1423 1 2 2 1 3 10 2 3 1 1 4 1 2 4 5 3 4 1 2 5 4 3 5 9 4 5 1 3 6 7 4 6 4 5 6 2 4 7 5 5 7 5 6 7 1 5 8 4 6 8 7 7 8 3 6 9 9 7 9 6 8 9 1 8 10 5 9 10 2 8 11 2 9 11 4 10 11 2 9 12 2 10 12 4 11 12 2 10 13 6 11 13 6 12 13 1 11 14 3 12 14 7 13 14 2 12 15 4 14 15 1 13 16 6 14 16 5 15 16 1 14 17 4 15 17 5 16 17...
result:
ok OK
Test #66:
score: 0
Accepted
time: 73ms
memory: 16764kb
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:
1417 1 2 1 1 3 12 2 3 1 1 4 1 2 4 5 3 4 3 3 5 4 4 5 1 3 6 7 4 6 7 5 6 2 4 7 1 5 7 6 6 7 3 5 8 5 6 8 5 7 8 1 6 9 4 7 9 4 8 9 2 7 10 6 8 10 5 9 10 1 9 11 1 10 11 3 9 12 1 10 12 6 11 12 2 10 13 2 11 13 2 12 13 1 12 14 5 13 14 1 12 15 7 13 15 9 14 15 2 13 16 10 14 16 2 14 17 5 15 17 2 16 17 1 15 18 7 16...
result:
ok OK
Test #67:
score: 0
Accepted
time: 91ms
memory: 17364kb
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:
1536 1 2 4 1 3 20 2 3 4 1 4 11 2 4 8 3 4 3 2 5 14 3 5 14 4 5 3 3 6 11 4 6 16 5 6 3 4 7 13 5 7 18 6 7 4 5 8 19 6 8 15 7 8 3 6 9 13 7 9 17 8 9 3 7 10 16 8 10 9 9 10 3 8 11 9 9 11 20 10 11 4 9 12 9 10 12 13 11 12 4 10 13 13 11 13 15 12 13 4 11 14 11 12 14 11 13 14 5 12 15 18 13 15 14 14 15 3 13 16 7 14...
result:
ok OK
Test #68:
score: 0
Accepted
time: 49ms
memory: 16496kb
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:
1671 1 2 31 1 3 278 2 3 31 1 4 140 2 4 144 3 4 31 2 5 148 3 5 132 4 5 30 3 6 147 4 6 149 5 6 31 4 7 135 5 7 124 6 7 30 5 8 123 6 8 154 7 8 31 6 9 133 7 9 132 8 9 30 7 10 146 8 10 124 9 10 31 8 11 149 9 11 144 10 11 30 9 12 114 10 12 142 11 12 30 10 13 132 11 13 130 12 13 31 11 14 129 12 14 154 13 14...
result:
ok OK
Test #69:
score: 0
Accepted
time: 44ms
memory: 16448kb
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 81 1 3 683 2 3 80 2 4 692 3 4 81 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 80 9 11 730 10 11 80 10 12 729 11 12 81 11 13 726 12 13 82 12 14 724 13 14 81 13 15 701 14 15 81 14 16 678 15 16 82 15 17 680 16 17 80 16 18 690 17 18 81 17 19 710 18 19...
result:
ok OK
Test #70:
score: 0
Accepted
time: 63ms
memory: 16920kb
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:
2085 1 2 501 1 3 509 2 3 499 1 4 293 2 4 248 3 4 502 2 5 240 3 5 236 4 5 500 3 6 220 4 6 229 5 6 501 4 7 249 5 7 265 6 7 501 5 8 262 6 8 258 7 8 502 6 9 240 7 9 245 8 9 501 7 10 256 8 10 241 9 10 502 8 11 266 9 11 273 10 11 501 9 12 267 10 12 293 11 12 502 10 13 234 11 13 287 12 13 500 11 14 232 12 ...
result:
ok OK
Test #71:
score: 0
Accepted
time: 61ms
memory: 16184kb
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:
820 1 2 2 1 3 2 2 3 2 3 4 2 4 5 3 4 6 1 5 6 1 5 7 1 6 7 4 6 8 2 7 8 1 8 9 3 9 10 2 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 24 2 23...
result:
ok OK
Test #72:
score: 0
Accepted
time: 75ms
memory: 24016kb
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:
2126 1 2 200 1 3 38 2 3 201 2 4 36 3 4 201 3 5 44 4 5 202 4 6 45 5 6 201 5 7 39 6 7 200 6 8 38 7 8 200 7 9 35 8 9 201 8 10 36 9 10 201 9 11 35 10 11 201 10 12 46 11 12 201 11 13 48 12 13 202 12 14 45 13 14 200 13 15 32 14 15 200 14 16 40 15 16 202 15 17 41 16 17 200 16 18 40 17 18 203 17 19 30 18 19...
result:
ok OK
Test #73:
score: 0
Accepted
time: 47ms
memory: 16732kb
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:
3767 1 2 201 1 3 42 2 3 200 1 4 30 2 4 11 3 4 200 1 5 26 2 5 10 3 5 7 4 5 200 1 6 7 2 6 11 3 6 10 4 6 6 5 6 199 2 7 3 3 7 17 4 7 9 5 7 13 6 7 202 3 8 9 4 8 8 5 8 4 6 8 9 7 8 200 4 9 11 5 9 16 6 9 10 7 9 6 8 9 201 5 10 17 6 10 7 7 10 15 8 10 10 9 10 200 6 11 11 7 11 16 8 11 8 9 11 15 10 11 200 7 12 7...
result:
ok OK
Test #74:
score: 0
Accepted
time: 88ms
memory: 18976kb
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:
5448 1 2 170 1 3 1570 2 3 171 1 4 1024 2 4 455 3 4 170 1 5 478 2 5 496 3 5 485 4 5 173 2 6 514 3 6 501 4 6 514 5 6 169 3 7 518 4 7 487 5 7 527 6 7 171 4 8 502 5 8 496 6 8 531 7 8 171 5 9 506 6 9 524 7 9 531 8 9 170 6 10 517 7 10 526 8 10 514 9 10 170 7 11 502 8 11 498 9 11 531 10 11 170 8 12 564 9 1...
result:
ok OK
Test #75:
score: 0
Accepted
time: 5ms
memory: 16220kb
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 117 134 1 27 140 1 117 140 1 134 140 1 27 172 1 117 172 1 134 172 1 140 172 1 27 217 1 117 217 1 134 217 1 140 217 1 172 217 1 27 263 1 117 263 1 134 263 1 140 263 1 172 263 1 217 263 1 27 287 1 117 287 1 134 287 1 140 287 1 172 287 1 217 287 1 263 287 1 27 355 1 117 355 1 134 3...
result:
ok OK
Test #76:
score: 0
Accepted
time: 7ms
memory: 17008kb
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:
4910 7 8 1 7 13 1 8 13 1 7 15 1 8 15 1 13 15 1 7 19 1 8 19 1 13 19 1 15 19 1 7 20 1 8 20 1 13 20 1 15 20 1 19 20 1 7 22 1 8 22 1 13 22 1 15 22 1 19 22 1 20 22 1 7 27 1 8 27 1 13 27 1 15 27 1 19 27 1 20 27 1 22 27 1 7 29 1 8 29 1 13 29 1 15 29 1 19 29 1 20 29 1 22 29 1 27 29 1 7 36 1 8 36 1 13 36 1 1...
result:
ok OK
Test #77:
score: 0
Accepted
time: 45ms
memory: 26728kb
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:
14410 4 7 1 7 9 1 7 10 1 7 15 1 16 28 2 7 29 1 7 36 1 7 43 1 38 43 1 7 45 1 16 45 1 43 47 1 45 47 1 17 49 1 38 49 2 47 49 1 7 50 1 28 50 2 29 50 1 34 50 1 45 50 2 47 50 2 9 53 2 28 53 1 38 53 1 43 53 1 45 55 1 47 55 1 49 55 2 50 55 1 7 56 1 9 56 1 17 56 1 29 56 1 38 56 1 43 56 1 49 56 2 53 56 1 4 59...
result:
ok OK
Test #78:
score: 0
Accepted
time: 3ms
memory: 16856kb
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:
2435 3 18 1 16 20 1 11 21 1 14 24 1 5 25 1 17 25 1 22 25 2 12 27 1 13 27 1 15 31 1 28 34 1 14 35 1 17 35 1 24 35 1 33 35 1 27 36 1 33 37 1 16 38 1 30 38 1 12 39 1 22 39 1 27 40 1 30 40 1 10 42 1 23 42 1 22 43 1 29 43 1 20 44 1 22 44 1 19 45 1 21 45 1 44 45 1 12 47 1 30 47 1 45 47 1 1 49 1 11 49 1 47...
result:
ok OK
Test #79:
score: 0
Accepted
time: 16ms
memory: 16988kb
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 7 8 1 3 13 1 10 14 1 9 16 1 15 24 1 25 31 1 4 32 1 30 35 1 27 39 1 17 42 1 18 43 1 6 44 1 37 46 1 11 51 1 20 53 1 38 54 1 2 55 1 34 56 1 50 59 1 48 60 1 21 61 1 62 63 1 36 64 1 57 66 1 40 72 1 26 74 1 65 75 1 29 77 1 52 78 1 70 81 1 23 85 1 84 86 1 67 87 1 80 93 1 76 94 1 90 95 1 47 98 1 69 100 ...
result:
ok OK