QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#69663 | #1395. Trzy drogi [A] | Qingyu | 4 | 3269ms | 123376kb | C++23 | 8.2kb | 2022-12-30 01:40:55 | 2022-12-30 01:44:34 |
Judging History
answer
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#ifdef LOC
#include "debuglib.h"
#else
#define deb(...)
#define DBP(...)
#endif
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define rep(i, b, e) for (int i = (b); i < (e); i++)
#define each(a, x) for (auto& a : (x))
#define all(x) (x).begin(), (x).end()
#define sz(x) int((x).size())
mt19937 rnd;
int maxCutIters;
ll ans;
ll ch2(ll k) { return k * (k-1) / 2; }
ll ch3(ll k) { return k * (k-1) * (k-2) / 6; }
struct Triple {
int x, y, z;
bool operator<(const Triple& r) const {
return make_tuple(x, y, z) < make_tuple(r.x, r.y, r.z);
}
bool operator==(const Triple& r) const {
return x == r.x && y == r.y && z == r.z;
}
};
struct DSU {
Vi par, rank;
DSU(int n = 0) {
par.resize(n, -1);
rank.resize(n);
}
int find(int v) {
if (par[v] != -1) {
par[v] = find(par[v]);
return par[v];
}
return v;
}
bool join(int u, int v) {
u = find(u);
v = find(v);
if (u == v) return 0;
if (rank[u] < rank[v]) swap(u, v);
rank[u] += (rank[u] == rank[v]);
par[v] = u;
return 1;
}
};
namespace con4 {
vector<Triple> edges;
int n;
vector<Triple> cuts;
vector<vector<Pii>> T, G;
DSU dsu;
Vi anc, over;
vector<bool> col;
Vi dfs(int v, Pii p) {
Vi ret;
anc[v] = v;
each(e, T[v]) if (e.x != p.x) {
Vi other = dfs(e.x, {v, e.y});
if (sz(ret) < sz(other)) ret.swap(other);
each(i, other) ret.pb(i);
dsu.join(v, e.x);
anc[dsu.find(v)] = v;
over[v] += over[e.x];
}
col[v] = 1;
each(e, G[v]) {
ret.pb(e.y);
over[v]++;
if (col[e.x]) {
int lca = anc[dsu.find(e.x)];
over[lca] -= 2;
}
}
if (over[v] == 2) {
Vi tmp;
sort(all(ret));
rep(i, 0, sz(ret)) {
if ((i > 0 && ret[i] == ret[i-1]) || (i+1 < sz(ret) && ret[i] == ret[i+1])) {
continue;
}
tmp.pb(ret[i]);
}
ret = tmp;
assert(sz(ret) == 2);
tmp.pb(p.y);
sort(all(tmp));
cuts.pb({tmp[0], tmp[1], tmp[2]});
}
return ret;
}
Vi mst;
void processMst(const Vi& order) {
mst.clear();
T.assign(n, {});
G.assign(n, {});
dsu = {n};
each(i, order) {
auto& e = edges[i];
if (dsu.join(e.x, e.y)) {
T[e.x].pb({e.y, i});
T[e.y].pb({e.x, i});
mst.pb(i);
} else {
G[e.x].pb({e.y, i});
G[e.y].pb({e.x, i});
}
}
dsu = {n};
anc.assign(n, -1);
over.assign(n, 0);
col.assign(n, 0);
dfs(0, {-1, -1});
}
void solve() {
if (n <= 1) return;
int m = sz(edges);
cuts.clear();
Vi order(m);
iota(all(order), 0);
shuffle(all(order), rnd);
processMst(order);
constexpr double eps = 0.32;
constexpr double alpha = 5;
constexpr double teta = 0.08;
vector<double> cover(m), dual(m);
each(e, mst) cover[e] = 2;
int iters = 0;
double last_lambda = 50;
while (true) {
double lambda = *max_element(all(cover));
//deb(iters, lambda);
if (lambda < 1+eps) break;
if (iters++ >= maxCutIters*4/5 || last_lambda-lambda < 0.01) {
#ifdef LOC
assert(0);
#endif
deb("nope :<", n);
break;
}
rep(i, 0, m) {
dual[i] = exp(alpha*cover[i]);
cover[i] *= 1-teta;
}
sort(all(order), [&](int i, int j) { return dual[i] < dual[j]; });
processMst(order);
each(e, mst) cover[e] += teta*2;
}
//deb(n, m, maxCutIters, iters);
while (iters < maxCutIters) {
shuffle(all(order), rnd);
processMst(order);
iters++;
}
sort(all(cuts));
cuts.erase(unique(all(cuts)), cuts.end());
each(c, cuts) {
ans += ll(edges[c.x].z) * edges[c.y].z * edges[c.z].z;
}
}
};
int n, m;
vector<vector<Pii>> G;
ll bridges;
namespace con3 {
vector<bool> on;
Vi active, deg, pre, low, nxt, siz;
vector<Vi> comps, sigma;
int cnt;
vector<Pii> cycleStack;
vector<vector<Pii>> cycles;
vector<vector<Triple>> tri;
Vi triNum, triPos, dep;
void init() {
on.resize(n);
deg.resize(n);
pre.resize(n);
low.resize(n);
nxt.resize(n);
siz.resize(n);
sigma.resize(n);
triNum.resize(n);
triPos.resize(n);
}
void save(int v) {
comps.back().pb(v);
each(e, sigma[v]) save(e);
}
void absorb(int dst, int begin, int end) {
while (begin != end) {
deg[dst] += deg[begin]-2;
sigma[dst].pb(begin);
begin = nxt[begin];
}
}
void connect(int w, Pii v) {
pre[w] = low[w] = cnt++;
nxt[w] = -1;
deg[w] = 0;
siz[w] = 1;
sigma[w].clear();
each(u, G[w]) if (on[u.x]) {
deg[w]++;
if (pre[u.x] == -1) {
connect(u.x, {w, u.y});
siz[w] += siz[u.x];
int pu = u.x;
if (deg[u.x] == 2) {
pu = nxt[u.x];
comps.emplace_back();
save(u.x);
}
if (low[w] <= low[u.x]) {
absorb(w, pu, -1);
} else {
absorb(w, nxt[w], -1);
low[w] = low[u.x];
nxt[w] = pu;
}
} else if (u != v && pre[w] > pre[u.x]) {
if (pre[u.x] < low[w]) {
absorb(w, nxt[w], -1);
low[w] = pre[u.x];
nxt[w] = -1;
}
} else if (pre[w] < pre[u.x]) {
deg[w] -= 2;
int c = nxt[w];
while (c != -1 && pre[c] <= pre[u.x] && pre[u.x] < pre[c]+siz[c]) {
c = nxt[c];
}
absorb(w, nxt[w], c);
nxt[w] = c;
}
}
}
void cactus(int c, Pii pe, int d) {
dep[c] = d;
each(v, comps[c]) {
each(e, G[v]) if (on[e.x] && e != pe) {
int c2 = triNum[e.x];
if (c2 == c) continue;
if (dep[c2] == -1) {
cycleStack.pb({v, e.x});
cactus(c2, {v, e.y}, d+1);
continue;
}
if (dep[c2] < dep[c]) {
cycles.pb({ {v, e.x} });
while (triNum[cycles.back().back().x] != c2) {
cycles.back().pb(cycleStack.back());
cycleStack.pop_back();
}
reverse(all(cycles.back()));
}
}
}
}
void solve() {
each(v, active) {
on[v] = 1;
pre[v] = -1;
}
cnt = 1;
comps.clear();
tri.clear();
connect(active[0], {-1, -1});
comps.emplace_back();
save(active[0]);
each(vec, comps) {
tri.emplace_back();
rep(i, 0, sz(vec)) {
triNum[vec[i]] = sz(tri)-1;
triPos[vec[i]] = i;
}
}
each(v, active) {
auto& vec = tri[triNum[v]];
each(e, G[v]) {
if (v < e.x && on[e.x] && triNum[e.x] == triNum[v]) {
vec.pb({triPos[v], triPos[e.x], 1});
}
}
}
if (sz(comps) > 1) {
dep.assign(sz(comps), -1);
cycles.clear();
cycleStack.clear();
cactus(0, {-1, -1}, 0);
each(vec, cycles) {
rep(i, 0, sz(vec)) {
int u = vec[i].y;
int v = vec[(i+1)%sz(vec)].x;
if (u != v) {
auto& t = tri[triNum[u]];
t.pb({triPos[u], triPos[v], sz(vec)});
}
}
ll a = sz(vec), b = m-bridges-a;
ans += ch2(a)*b + ch3(a);
}
}
rep(i, 0, sz(tri)) {
con4::edges = move(tri[i]);
con4::n = sz(comps[i]);
con4::solve();
}
each(v, active) {
on[v] = 0;
}
}
};
namespace con2 {
Vi pre, low, st;
vector<Vi> comps;
int cnt;
void dfs(int v, Pii p) {
pre[v] = low[v] = cnt++;
st.pb(v);
each(e, G[v]) if (e != p) {
if (pre[e.x] == -1) {
dfs(e.x, {v, e.y});
low[v] = min(low[v], low[e.x]);
} else {
low[v] = min(low[v], pre[e.x]);
}
}
if (low[v] == pre[v]) {
bridges += (p.x != -1);
comps.emplace_back();
while (st.back() != v) {
comps.back().pb(st.back());
st.pop_back();
}
comps.back().pb(v);
st.pop_back();
}
}
void solve() {
pre.resize(n, -1);
low.resize(n, -1);
con2::dfs(0, {-1, -1});
ans += ch3(m) - ch3(m-bridges);
con3::init();
each(vec, comps) {
con3::active = move(vec);
con3::solve();
}
}
};
int main() {
cin.sync_with_stdio(0); cin.tie(0);
cout << fixed << setprecision(10);
cin >> n >> m;
G.resize(n);
maxCutIters = min(20 * 300000 / m, 500);
//deb(n, m, maxCutIters);
rep(i, 0, m) {
int u, v; cin >> u >> v;
G[u-1].pb({v-1, i});
G[v-1].pb({u-1, i});
}
con2::solve();
cout << ans << endl;
return 0;
}
详细
Subtask #1:
score: 1
Accepted
Test #2:
score: 1
Accepted
time: 3ms
memory: 3844kb
input:
2 3 1 2 1 2 2 1
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
2 4 2 1 2 1 1 2 1 2
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 3ms
memory: 3664kb
input:
5 11 4 5 5 1 2 1 4 1 4 2 1 3 2 4 3 2 1 4 4 1 3 4
output:
10
result:
ok single line: '10'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
10 20 10 9 6 9 1 5 1 3 7 6 7 5 3 7 6 2 1 2 6 1 6 5 1 2 8 1 9 2 9 6 1 4 4 3 8 5 1 10 4 5
output:
39
result:
ok single line: '39'
Test #6:
score: 0
Accepted
time: 4ms
memory: 3648kb
input:
20 44 14 9 8 1 2 18 18 4 19 3 17 11 17 11 14 9 16 14 3 15 10 11 1 15 19 16 10 8 1 20 20 10 19 11 2 10 11 14 19 4 12 15 16 19 11 13 8 15 17 7 15 20 7 12 19 16 8 10 18 19 4 16 11 12 17 18 18 20 13 17 10 6 4 6 1 12 19 10 9 16 15 5 11 9 15 19 12 14
output:
1108
result:
ok single line: '1108'
Test #7:
score: 0
Accepted
time: 7ms
memory: 3760kb
input:
40 117 14 22 40 21 34 10 35 34 24 32 1 20 37 35 30 21 1 16 3 22 20 15 34 3 10 21 26 2 31 18 19 3 27 11 19 11 5 34 34 21 14 4 19 2 24 9 10 8 7 8 7 15 29 35 20 7 26 34 6 15 34 38 33 18 29 26 4 22 31 6 29 8 13 11 22 12 3 1 28 40 9 3 26 29 13 24 6 30 25 18 33 32 28 21 17 2 31 17 2 22 39 13 8 11 9 1 39 1...
output:
118
result:
ok single line: '118'
Test #8:
score: 0
Accepted
time: 7ms
memory: 3808kb
input:
40 120 5 35 3 31 1 22 19 7 40 27 32 26 15 18 14 24 12 6 39 1 19 8 30 19 9 27 38 12 21 23 19 32 8 15 4 11 13 39 11 6 32 37 16 20 2 5 32 40 31 35 23 6 7 29 8 28 5 11 20 29 32 15 16 8 19 9 23 19 35 1 13 39 34 9 12 31 15 8 34 28 36 9 29 20 36 39 6 13 18 20 23 2 25 9 33 3 20 4 26 20 6 9 1 6 24 9 39 35 11...
output:
14044
result:
ok single line: '14044'
Test #9:
score: 0
Accepted
time: 5ms
memory: 3644kb
input:
40 116 19 14 31 27 14 40 18 36 8 17 24 13 19 15 32 9 24 10 5 39 22 11 5 29 25 28 34 30 38 8 14 32 1 13 31 14 32 26 6 40 40 13 37 19 27 9 4 13 28 22 10 36 40 18 26 22 21 1 35 23 1 21 38 3 36 15 9 5 21 40 23 24 21 10 16 7 4 26 23 36 21 18 20 14 23 39 28 29 22 5 37 23 21 36 7 37 40 14 3 39 6 38 17 23 1...
output:
120
result:
ok single line: '120'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3604kb
input:
40 102 38 23 25 33 21 9 26 40 13 18 40 13 13 5 2 23 13 26 8 1 21 32 11 25 28 14 15 18 5 24 34 39 27 17 31 8 4 36 14 27 13 36 24 23 18 30 29 20 4 19 11 37 40 11 34 7 24 18 40 31 16 27 6 33 11 7 24 10 28 39 36 40 4 28 33 9 12 31 4 3 11 21 24 11 23 9 17 29 37 7 10 4 6 16 20 6 23 27 19 4 9 13 1 38 2 37 ...
output:
5548
result:
ok single line: '5548'
Test #11:
score: 0
Accepted
time: 3ms
memory: 3804kb
input:
40 120 34 28 9 16 36 12 23 24 9 16 20 12 15 36 15 37 2 10 4 3 18 8 7 5 9 31 37 28 4 9 20 38 28 15 17 32 6 18 1 18 9 4 13 27 8 22 30 22 38 12 19 23 5 33 1 39 11 38 34 37 3 7 10 37 2 28 11 20 32 14 35 38 13 30 2 15 30 8 19 34 11 1 35 11 31 16 14 17 18 6 31 25 32 17 34 10 36 2 29 36 28 29 38 39 1 35 17...
output:
14044
result:
ok single line: '14044'
Test #12:
score: 0
Accepted
time: 5ms
memory: 3584kb
input:
40 120 11 35 15 23 5 34 32 23 29 22 35 40 38 10 18 36 11 21 8 30 31 4 39 40 18 13 1 13 19 1 13 6 28 16 29 22 19 24 4 17 33 26 38 16 38 10 6 9 7 35 23 37 27 30 31 5 14 3 32 2 4 17 20 38 38 21 35 7 24 19 21 7 17 4 8 30 3 28 3 12 34 31 21 10 19 24 32 39 12 27 11 40 31 5 32 17 10 38 31 17 4 34 25 24 14 ...
output:
125
result:
ok single line: '125'
Test #13:
score: 0
Accepted
time: 3ms
memory: 3668kb
input:
40 60 25 29 34 21 36 17 5 2 31 19 26 27 30 6 29 35 16 31 22 39 1 24 4 37 10 9 28 6 7 16 9 20 21 33 11 18 35 10 13 24 26 12 18 25 28 11 23 18 3 24 7 9 30 38 31 8 32 36 14 16 15 5 30 37 7 35 39 3 29 10 8 40 33 38 23 20 22 40 28 33 20 17 21 1 6 38 8 19 34 4 14 2 22 3 14 5 17 27 34 37 4 32 12 36 32 15 3...
output:
58
result:
ok single line: '58'
Test #14:
score: 0
Accepted
time: 6ms
memory: 3744kb
input:
40 60 38 18 33 13 27 17 35 8 2 11 16 9 26 13 23 40 9 1 22 14 17 18 29 2 32 3 23 37 28 32 30 7 11 38 6 24 32 14 39 22 26 31 20 3 40 5 7 15 35 39 4 35 34 10 37 12 17 36 4 10 27 20 39 38 11 10 21 27 2 16 36 20 29 6 30 33 21 18 28 36 12 7 14 3 25 8 29 25 26 9 19 23 34 1 24 1 24 31 37 31 40 12 30 15 34 1...
output:
58
result:
ok single line: '58'
Test #15:
score: 0
Accepted
time: 3ms
memory: 3796kb
input:
40 60 7 5 16 26 11 23 24 2 4 20 36 12 1 28 23 21 36 20 4 1 12 9 31 7 18 30 19 2 28 36 38 16 19 17 26 38 13 29 5 11 16 14 17 21 5 37 8 15 27 15 13 10 37 7 40 23 34 35 1 32 8 24 14 10 34 32 15 20 30 25 3 33 30 26 17 2 33 39 28 6 9 6 11 31 22 8 24 13 27 40 27 25 22 25 38 18 4 19 34 39 3 6 40 35 9 3 22 ...
output:
58
result:
ok single line: '58'
Test #16:
score: 0
Accepted
time: 6ms
memory: 3852kb
input:
39 57 28 7 22 5 4 16 2 19 7 35 29 39 18 3 31 32 30 31 27 20 34 13 23 37 32 26 5 39 38 3 13 5 21 11 16 14 38 33 2 25 28 8 24 26 20 9 15 27 36 22 8 10 1 35 17 9 3 33 26 31 17 16 15 23 14 12 25 13 4 30 21 6 6 1 19 23 34 15 17 14 29 22 33 34 25 19 21 35 28 11 39 18 32 12 27 37 12 4 7 11 36 6 18 29 1 38 ...
output:
401
result:
ok single line: '401'
Test #17:
score: 0
Accepted
time: 6ms
memory: 3688kb
input:
39 57 8 25 33 31 35 20 2 6 4 24 14 28 15 37 25 16 23 36 12 32 32 9 31 39 27 31 11 9 24 1 22 30 5 29 6 21 19 8 39 3 14 29 4 20 36 30 20 18 28 25 4 37 14 23 12 7 35 13 2 30 18 10 2 17 9 3 35 24 5 16 18 38 28 5 7 3 29 10 17 33 26 21 6 15 1 36 11 34 37 21 33 26 1 15 23 13 19 38 13 38 39 34 8 16 22 7 26 ...
output:
279
result:
ok single line: '279'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3816kb
input:
39 57 26 9 35 32 34 35 22 21 38 31 39 28 11 12 33 9 4 12 11 15 15 24 2 36 34 33 1 13 27 32 21 31 7 27 23 30 25 26 26 15 31 16 4 11 3 30 17 3 7 2 16 38 23 19 27 6 23 22 22 19 20 28 19 29 24 8 3 13 6 39 18 17 24 12 1 4 34 14 5 36 17 2 37 14 1 8 20 10 30 13 35 14 37 32 39 10 33 10 21 29 28 6 37 25 36 1...
output:
464
result:
ok single line: '464'
Test #19:
score: 0
Accepted
time: 3ms
memory: 3724kb
input:
40 60 22 28 5 3 37 33 18 34 25 5 17 32 20 21 38 40 7 35 8 28 18 29 24 17 36 31 32 13 28 11 36 12 17 27 13 9 18 20 23 15 10 6 34 8 36 14 7 16 4 33 23 39 27 24 11 23 3 25 39 11 21 30 30 20 16 9 1 38 30 14 15 26 12 14 1 40 22 26 16 39 8 22 10 24 33 31 4 31 37 6 13 35 3 19 2 15 5 21 2 26 6 38 34 29 27 2...
output:
58
result:
ok single line: '58'
Test #20:
score: 0
Accepted
time: 7ms
memory: 3864kb
input:
40 120 1 30 7 1 2 5 7 1 33 18 33 25 15 3 5 39 17 34 39 5 1 40 5 31 38 16 35 37 24 25 1 35 5 2 1 20 20 22 7 1 40 1 3 6 35 1 9 38 38 9 25 24 34 17 33 36 32 28 37 21 7 11 11 38 33 18 12 17 33 19 7 6 29 15 7 26 28 32 9 28 2 5 12 17 20 12 7 26 5 2 24 25 38 16 13 23 20 1 12 14 25 33 2 27 20 12 34 17 22 20...
output:
15327
result:
ok single line: '15327'
Test #21:
score: 0
Accepted
time: 7ms
memory: 3860kb
input:
40 120 7 3 22 19 38 10 29 33 11 34 23 38 39 5 25 39 21 11 15 35 15 35 23 27 16 28 12 7 26 36 40 36 2 1 16 38 30 12 27 23 16 28 38 16 39 25 35 5 11 21 19 22 19 32 3 7 5 39 32 11 36 38 35 15 28 16 7 35 36 26 13 19 35 5 32 11 19 22 31 12 40 36 29 36 27 23 12 31 32 11 7 3 10 38 24 8 23 27 11 29 16 38 15...
output:
53591
result:
ok single line: '53591'
Test #22:
score: 0
Accepted
time: 3ms
memory: 3880kb
input:
40 120 2 9 28 11 23 31 30 34 8 30 25 4 30 27 34 30 27 30 20 33 2 9 37 10 37 10 40 24 13 28 16 7 9 18 32 2 9 18 17 16 16 11 13 28 15 40 11 35 3 9 27 11 22 3 27 30 23 14 34 30 9 1 11 16 11 27 17 20 30 27 10 9 20 9 16 40 18 9 13 28 1 9 30 38 20 17 38 30 12 9 22 3 9 3 23 31 40 24 20 33 30 26 30 27 30 34...
output:
47710
result:
ok single line: '47710'
Test #23:
score: 0
Accepted
time: 3ms
memory: 3880kb
input:
40 59 36 34 2 18 33 36 4 30 28 18 3 14 3 36 38 24 31 23 31 11 21 17 10 6 8 9 40 35 32 7 14 23 1 3 16 12 37 22 14 37 28 19 25 7 24 25 35 29 6 4 19 16 15 6 17 34 10 32 10 30 32 20 12 5 15 27 23 22 9 20 16 24 7 9 39 21 2 40 30 20 11 26 26 15 40 21 4 26 29 5 38 19 12 28 13 22 39 33 27 13 2 29 27 11 34 3...
output:
173
result:
ok single line: '173'
Test #24:
score: 0
Accepted
time: 2ms
memory: 3980kb
input:
40 59 5 16 1 2 40 25 40 15 7 27 16 17 24 11 29 23 24 37 30 26 36 28 9 38 8 18 17 33 23 34 24 8 8 21 16 9 28 6 25 32 39 26 14 34 13 21 32 39 37 3 25 33 13 22 38 15 21 20 29 4 20 3 18 4 19 23 17 15 5 6 3 19 10 34 22 26 36 5 37 29 20 11 31 18 12 13 22 31 7 35 1 6 10 27 11 12 27 14 7 19 39 31 14 2 38 33...
output:
165
result:
ok single line: '165'
Test #25:
score: 0
Accepted
time: 5ms
memory: 3856kb
input:
38 59 24 1 21 16 34 8 29 33 23 15 24 5 29 22 10 13 6 10 33 8 9 36 5 6 11 12 35 2 7 18 10 31 20 25 36 28 28 23 33 21 24 10 22 12 11 17 14 4 32 21 29 16 19 7 9 15 1 32 27 20 3 19 26 30 19 15 1 16 38 13 18 27 22 37 35 19 31 25 6 24 37 16 26 38 34 12 27 38 13 31 4 9 3 18 24 37 25 10 3 20 14 36 4 15 29 3...
output:
3958
result:
ok single line: '3958'
Test #26:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
40 39 22 26 15 18 8 1 22 9 14 30 33 10 34 21 4 31 33 17 1 5 9 5 34 35 9 28 20 16 24 13 27 7 37 22 2 26 29 22 38 10 22 13 38 40 18 34 27 39 25 2 37 39 34 36 11 4 23 3 16 10 10 19 3 18 21 9 37 12 30 13 9 4 39 6 38 35 21 32
output:
9139
result:
ok single line: '9139'
Subtask #2:
score: 1
Accepted
Test #27:
score: 1
Accepted
time: 24ms
memory: 3984kb
input:
196 599 86 111 68 176 32 111 105 146 183 179 193 48 3 101 61 173 16 134 147 123 129 168 113 34 98 90 103 91 140 93 89 38 137 110 39 62 165 119 54 22 65 70 91 49 135 48 20 167 108 62 169 71 188 8 191 132 63 108 56 194 40 133 171 61 40 79 134 12 165 151 62 141 9 84 170 2 174 72 52 47 58 9 30 138 68 53...
output:
362371
result:
ok single line: '362371'
Test #28:
score: 0
Accepted
time: 24ms
memory: 4084kb
input:
197 599 106 89 188 100 82 104 104 36 175 109 159 106 55 188 13 86 74 80 10 77 16 154 128 159 28 165 83 91 112 187 143 103 87 195 156 129 11 59 164 53 86 82 66 58 54 180 142 151 177 37 121 57 41 64 52 185 164 57 190 146 166 178 53 90 80 166 132 21 14 143 77 195 161 122 162 31 172 55 182 142 101 119 4...
output:
535518
result:
ok single line: '535518'
Test #29:
score: 0
Accepted
time: 21ms
memory: 3812kb
input:
200 598 188 148 39 175 71 128 16 48 100 182 160 76 197 140 134 106 50 138 164 55 149 91 103 34 20 159 149 21 175 37 105 141 120 150 102 3 101 66 9 132 24 20 119 67 104 99 51 125 68 69 73 108 191 58 80 151 10 4 23 14 2 112 36 9 102 189 123 17 4 82 55 35 45 154 191 87 193 180 190 145 50 76 172 23 24 8...
output:
2405
result:
ok single line: '2405'
Test #30:
score: 0
Accepted
time: 34ms
memory: 3860kb
input:
200 600 132 43 177 122 21 63 118 161 107 81 96 148 170 196 162 183 13 147 131 5 15 155 199 58 48 97 57 132 115 188 169 195 95 113 130 187 42 145 130 13 98 162 81 150 9 151 119 107 27 135 90 103 156 24 157 13 189 48 183 106 160 157 6 180 114 189 195 70 139 111 142 18 114 139 156 39 77 14 118 39 73 17...
output:
184487
result:
ok single line: '184487'
Test #31:
score: 0
Accepted
time: 28ms
memory: 3900kb
input:
200 600 184 166 26 196 62 6 139 121 189 37 13 25 28 141 45 90 116 163 149 49 104 200 29 196 116 120 17 115 120 137 124 35 112 182 26 142 26 142 123 67 143 189 165 35 92 44 89 105 133 14 9 158 182 154 41 136 165 35 186 31 42 65 4 36 104 11 83 82 118 112 18 160 72 40 120 165 152 134 192 140 189 37 195...
output:
546865
result:
ok single line: '546865'
Test #32:
score: 0
Accepted
time: 26ms
memory: 3936kb
input:
200 600 82 22 156 78 136 193 63 136 152 154 109 48 79 127 87 77 142 100 137 163 73 24 75 150 178 52 124 47 160 104 47 176 198 156 9 26 16 138 11 39 28 102 170 56 72 144 25 85 158 18 117 80 3 115 33 175 10 110 35 90 161 164 165 55 71 191 160 87 70 150 31 113 158 181 192 96 35 80 138 16 75 150 97 96 1...
output:
8455
result:
ok single line: '8455'
Test #33:
score: 0
Accepted
time: 19ms
memory: 4408kb
input:
200 300 21 137 147 99 110 159 136 77 77 95 29 97 163 13 59 178 175 16 109 27 4 158 37 79 58 41 9 40 143 51 182 131 154 185 193 188 31 6 176 166 127 196 180 169 184 139 59 84 37 80 21 144 48 39 45 18 81 139 31 164 191 62 145 152 194 168 8 63 125 115 179 109 175 44 99 162 38 83 180 125 109 119 98 174 ...
output:
298
result:
ok single line: '298'
Test #34:
score: 0
Accepted
time: 15ms
memory: 4348kb
input:
200 300 157 130 22 189 160 143 89 9 172 119 68 197 66 32 40 173 10 35 70 90 154 143 86 158 174 42 17 186 181 45 49 42 54 114 61 153 65 179 150 13 41 154 73 106 54 92 165 187 46 190 41 56 164 29 71 157 78 123 176 75 122 32 59 178 178 116 96 177 176 22 11 194 2 87 135 80 189 3 57 60 16 130 192 136 105...
output:
298
result:
ok single line: '298'
Test #35:
score: 0
Accepted
time: 24ms
memory: 4284kb
input:
200 300 173 87 53 175 138 8 82 171 168 170 77 36 31 143 80 165 190 189 121 114 191 132 20 124 75 183 69 1 18 67 35 162 62 155 163 47 108 23 26 40 157 173 173 79 134 66 177 40 94 142 116 34 86 76 54 41 49 158 172 31 23 187 83 54 120 62 88 107 182 174 42 102 11 71 110 25 154 186 162 58 139 88 139 193 ...
output:
298
result:
ok single line: '298'
Test #36:
score: 0
Accepted
time: 21ms
memory: 3936kb
input:
199 297 155 128 88 116 106 7 7 78 35 6 179 25 198 41 144 85 74 118 24 91 62 163 106 56 112 132 90 27 58 3 132 90 40 62 155 112 111 151 173 72 26 121 68 12 10 93 104 19 107 43 143 107 68 186 26 152 53 179 1 185 159 184 95 60 115 157 71 152 14 160 62 130 181 190 187 108 120 82 58 50 42 183 18 5 170 84...
output:
2700
result:
ok single line: '2700'
Test #37:
score: 0
Accepted
time: 21ms
memory: 4516kb
input:
199 297 102 43 2 149 100 161 30 148 54 45 138 143 111 94 110 43 132 63 51 113 2 131 109 166 41 179 108 66 67 69 82 91 196 119 42 61 74 43 2 68 129 48 72 152 159 177 89 71 159 154 76 30 181 10 188 155 37 47 22 198 87 183 8 52 14 133 1 36 19 103 106 15 196 98 129 26 56 92 150 96 36 123 44 101 138 127 ...
output:
1775
result:
ok single line: '1775'
Test #38:
score: 0
Accepted
time: 23ms
memory: 4256kb
input:
199 297 79 177 80 141 175 129 166 183 50 78 35 177 155 35 49 118 95 92 172 32 161 27 188 68 132 195 18 2 19 193 151 124 182 159 145 197 54 64 29 139 134 13 72 7 159 81 15 136 183 142 23 60 171 109 107 33 119 59 8 76 65 11 70 71 192 6 42 11 120 112 164 140 127 93 31 68 146 133 23 66 29 100 118 135 36...
output:
2084
result:
ok single line: '2084'
Test #39:
score: 0
Accepted
time: 18ms
memory: 3928kb
input:
200 300 112 187 6 84 50 72 77 86 53 172 197 145 30 195 156 83 5 24 171 156 60 19 116 96 188 104 21 83 144 185 27 172 124 138 132 180 4 42 31 39 8 133 108 183 54 144 134 191 27 60 199 139 142 182 61 180 101 109 76 49 154 59 127 121 173 65 143 160 6 45 190 135 122 195 29 163 129 93 76 28 170 153 167 1...
output:
298
result:
ok single line: '298'
Test #40:
score: 0
Accepted
time: 11ms
memory: 3968kb
input:
200 332 7 158 140 47 62 175 173 22 199 62 179 169 100 5 69 34 174 60 4 56 12 140 150 123 76 67 133 129 34 108 119 139 98 110 6 174 1 99 65 70 23 43 15 131 140 121 93 5 101 133 172 197 199 169 191 19 89 18 168 166 38 64 72 73 194 48 50 154 150 186 39 176 114 133 32 194 199 169 19 77 97 189 123 63 175...
output:
2252697
result:
ok single line: '2252697'
Test #41:
score: 0
Accepted
time: 20ms
memory: 4060kb
input:
200 459 55 172 184 187 10 179 142 23 155 119 38 17 184 108 188 167 155 137 174 112 64 138 187 90 26 12 8 161 153 83 38 61 3 17 17 30 183 108 159 58 191 186 98 111 67 168 33 120 39 178 110 168 126 107 189 22 170 185 72 97 186 198 172 110 118 129 152 34 33 179 55 47 143 157 78 121 44 170 104 85 120 33...
output:
3054618
result:
ok single line: '3054618'
Test #42:
score: 0
Accepted
time: 22ms
memory: 4144kb
input:
200 559 88 140 56 21 52 5 5 2 83 182 77 58 95 27 98 197 181 88 155 145 67 75 195 27 121 175 91 137 175 92 8 88 115 34 191 8 113 154 128 174 198 115 81 18 38 183 54 157 95 12 198 41 51 37 99 116 164 162 80 129 31 142 18 81 11 124 181 134 104 20 116 45 65 81 120 32 58 4 97 57 74 54 71 166 174 98 57 8 ...
output:
2883685
result:
ok single line: '2883685'
Test #43:
score: 0
Accepted
time: 21ms
memory: 3960kb
input:
200 600 196 118 93 146 130 152 76 140 200 58 95 170 175 172 148 188 42 8 30 197 99 30 37 190 120 94 154 23 76 88 41 197 82 58 195 144 63 38 177 105 180 157 6 158 173 159 17 64 163 25 58 82 127 102 196 28 178 155 82 58 191 63 197 41 63 96 109 69 5 21 149 132 58 82 110 47 157 180 197 68 159 173 170 11...
output:
4986139
result:
ok single line: '4986139'
Test #44:
score: 0
Accepted
time: 27ms
memory: 3980kb
input:
200 600 177 123 170 12 134 125 57 40 82 94 25 45 134 107 70 33 26 104 77 83 38 50 100 7 71 174 46 60 131 180 32 123 45 130 79 186 170 103 11 85 10 35 25 2 133 55 69 144 171 131 149 20 67 157 56 58 3 110 161 138 46 199 130 42 24 158 183 132 77 83 154 180 127 176 106 38 62 85 11 85 136 155 136 155 172...
output:
4162448
result:
ok single line: '4162448'
Test #45:
score: 0
Accepted
time: 17ms
memory: 3976kb
input:
195 600 27 178 146 66 86 41 112 51 110 82 122 154 12 169 137 122 170 87 82 110 160 172 186 190 153 71 137 122 21 134 110 82 156 139 131 129 83 89 30 72 88 6 129 14 71 142 73 125 191 16 33 142 23 189 105 177 46 134 148 165 8 128 146 110 172 135 53 182 12 52 101 8 138 15 31 55 3 94 185 137 134 21 45 1...
output:
3669804
result:
ok single line: '3669804'
Test #46:
score: 0
Accepted
time: 17ms
memory: 4552kb
input:
200 299 15 172 45 9 145 109 137 192 127 170 47 22 24 125 6 112 116 91 186 129 24 113 79 84 141 154 92 83 200 122 115 150 56 195 149 130 40 37 198 114 74 177 89 148 78 130 151 191 118 108 9 177 88 142 120 36 76 25 173 8 63 51 159 91 189 7 128 39 133 151 115 5 19 99 83 146 58 64 89 145 193 182 8 30 13...
output:
893
result:
ok single line: '893'
Test #47:
score: 0
Accepted
time: 20ms
memory: 4184kb
input:
200 299 1 161 26 134 179 31 111 128 171 131 80 184 137 86 117 53 157 198 60 98 130 142 196 166 76 20 89 100 69 57 37 103 28 57 114 176 22 124 52 192 129 23 157 151 5 161 123 118 180 63 70 172 152 169 131 94 169 167 19 147 31 79 200 62 143 194 49 158 68 162 79 22 188 37 39 78 197 9 3 183 21 191 188 1...
output:
825
result:
ok single line: '825'
Test #48:
score: 0
Accepted
time: 21ms
memory: 3932kb
input:
200 329 44 9 166 34 96 107 97 58 17 106 153 27 65 188 192 35 138 53 76 133 198 86 121 34 175 52 85 50 12 115 62 133 11 66 139 32 108 64 67 29 176 29 42 99 124 179 122 156 127 67 116 196 28 180 69 155 191 163 64 170 32 184 140 129 168 123 57 48 58 31 164 77 5 160 111 28 135 111 31 66 158 109 141 153 ...
output:
116253
result:
ok single line: '116253'
Test #49:
score: 0
Accepted
time: 18ms
memory: 4092kb
input:
200 329 79 144 17 144 184 179 130 71 168 119 56 118 194 149 31 123 46 96 118 143 7 64 20 164 1 40 107 180 87 84 184 159 143 106 38 113 105 62 85 124 12 135 18 30 150 109 181 97 116 50 4 16 173 137 112 114 79 99 172 49 128 46 179 159 198 111 196 50 161 175 167 47 105 74 47 177 125 96 82 14 72 80 86 2...
output:
111697
result:
ok single line: '111697'
Test #50:
score: 0
Accepted
time: 2ms
memory: 3600kb
input:
200 200 31 195 32 96 112 86 30 16 15 85 82 16 58 65 59 2 100 147 62 179 105 15 26 110 153 186 124 181 85 49 108 157 120 140 36 101 37 8 38 66 20 53 117 68 51 200 190 69 132 21 84 70 177 91 195 33 41 50 168 49 160 177 56 176 178 31 152 161 98 44 90 156 80 192 138 183 56 60 125 154 103 25 3 180 132 52...
output:
1313400
result:
ok single line: '1313400'
Test #51:
score: 0
Accepted
time: 10ms
memory: 3912kb
input:
180 270 10 58 154 177 78 3 171 65 109 95 92 28 14 180 48 141 65 132 20 121 87 144 143 73 180 130 124 28 77 155 23 137 150 179 172 132 114 44 40 177 10 117 90 69 37 63 20 36 180 122 93 16 148 76 79 74 178 20 158 24 65 125 144 87 140 90 54 164 68 11 21 81 133 112 26 9 111 6 85 139 28 151 6 138 136 135...
output:
1477453
result:
ok single line: '1477453'
Test #52:
score: 0
Accepted
time: 10ms
memory: 3848kb
input:
180 255 88 118 171 142 63 40 112 104 166 131 124 53 154 88 1 94 154 88 178 106 93 66 20 79 78 81 130 69 118 162 170 131 33 138 70 86 91 138 29 127 4 135 164 27 44 136 42 151 127 66 93 127 48 72 22 35 92 54 13 68 126 174 31 6 2 139 3 128 175 108 99 158 80 85 137 115 105 120 97 44 132 34 56 144 148 65...
output:
1192973
result:
ok single line: '1192973'
Subtask #3:
score: 1
Accepted
Test #53:
score: 1
Accepted
time: 179ms
memory: 5008kb
input:
998 3000 233 962 435 623 229 654 54 639 799 29 958 154 144 444 23 464 451 699 835 85 272 722 20 226 547 206 616 795 252 964 18 14 447 392 316 681 16 526 359 2 428 382 549 498 78 930 811 610 663 871 16 848 330 202 875 644 334 949 36 698 849 763 654 619 873 259 630 517 410 740 133 600 636 191 997 87 8...
output:
58333417
result:
ok single line: '58333417'
Test #54:
score: 0
Accepted
time: 180ms
memory: 4616kb
input:
1000 2999 490 439 536 98 400 332 307 197 330 658 429 868 659 684 140 608 80 923 440 675 663 533 712 526 703 725 87 714 936 458 143 841 895 76 220 977 129 771 226 707 638 117 412 926 565 487 16 133 269 941 800 826 606 319 773 644 127 961 507 741 817 135 250 155 504 343 142 785 433 576 753 396 860 133...
output:
31477399
result:
ok single line: '31477399'
Test #55:
score: 0
Accepted
time: 119ms
memory: 5108kb
input:
997 3000 596 509 994 252 580 39 587 41 247 313 622 805 717 470 349 774 836 598 100 129 432 696 890 434 830 971 977 492 1 664 86 712 368 959 818 43 324 328 213 760 844 428 882 463 570 26 370 228 585 114 83 269 95 984 661 887 804 607 578 128 722 114 530 73 272 800 238 76 562 586 395 881 857 204 205 47...
output:
27038858
result:
ok single line: '27038858'
Test #56:
score: 0
Accepted
time: 189ms
memory: 4968kb
input:
1000 2999 511 742 48 250 874 756 501 907 870 748 343 116 265 661 351 736 658 802 996 6 447 425 334 992 136 751 487 109 196 254 803 136 388 98 963 78 957 23 939 675 874 105 154 60 580 796 15 594 209 521 853 246 405 651 618 583 611 646 722 758 373 765 404 407 859 719 65 944 437 262 508 219 723 120 981...
output:
31489381
result:
ok single line: '31489381'
Test #57:
score: 0
Accepted
time: 134ms
memory: 4304kb
input:
1000 3000 349 449 637 915 495 765 837 122 515 220 701 52 106 858 64 87 37 157 727 204 705 460 122 43 204 567 961 12 81 171 623 279 339 284 475 639 603 226 431 363 302 269 563 270 981 731 915 79 386 799 831 140 479 614 802 464 769 720 676 286 994 524 330 680 762 229 925 721 231 123 100 229 671 233 32...
output:
31552291
result:
ok single line: '31552291'
Test #58:
score: 0
Accepted
time: 128ms
memory: 4388kb
input:
1000 2998 398 993 344 561 412 41 207 621 62 943 701 451 672 225 91 818 743 336 732 425 42 860 852 231 610 652 381 623 991 230 325 884 170 963 152 229 524 428 704 743 680 968 434 756 56 828 474 974 827 877 396 913 510 558 62 554 164 968 475 183 469 626 154 183 508 946 242 240 623 160 60 41 844 348 49...
output:
177049
result:
ok single line: '177049'
Test #59:
score: 0
Accepted
time: 106ms
memory: 6804kb
input:
1000 1500 726 523 149 216 790 197 794 185 962 838 237 139 529 8 212 318 715 322 918 881 256 626 144 11 107 688 501 152 945 925 91 804 366 835 901 663 595 613 425 701 798 611 423 770 25 669 395 66 931 808 406 345 282 65 482 104 443 910 379 449 850 973 89 601 521 470 665 22 364 84 873 605 910 167 870 ...
output:
1498
result:
ok single line: '1498'
Test #60:
score: 0
Accepted
time: 120ms
memory: 6856kb
input:
1000 1500 701 20 613 695 760 842 5 784 1 8 655 510 115 386 903 334 321 731 431 400 755 504 590 983 74 478 211 556 941 538 785 671 21 489 364 365 579 803 893 883 594 105 801 64 411 194 887 673 326 775 982 581 995 286 37 97 866 256 666 244 250 320 243 648 233 433 587 864 230 561 225 599 829 160 87 949...
output:
1498
result:
ok single line: '1498'
Test #61:
score: 0
Accepted
time: 113ms
memory: 6936kb
input:
1000 1500 287 339 632 966 179 246 506 443 374 228 204 337 858 736 907 372 136 244 391 302 748 738 528 358 633 924 393 25 397 559 998 163 657 600 513 472 873 757 613 692 739 171 264 292 561 252 6 47 147 572 564 732 152 283 539 285 262 490 446 229 19 341 929 383 889 622 100 83 809 350 832 458 909 274 ...
output:
1498
result:
ok single line: '1498'
Test #62:
score: 0
Accepted
time: 98ms
memory: 5452kb
input:
999 1497 390 274 583 520 969 429 817 556 532 583 212 437 420 809 22 11 976 685 471 553 890 984 549 539 332 606 345 977 207 98 879 749 858 986 399 443 113 371 156 320 877 355 952 790 145 807 789 237 998 340 159 721 146 445 734 186 387 338 517 159 179 746 446 649 73 150 71 577 181 23 160 321 597 467 6...
output:
18014
result:
ok single line: '18014'
Test #63:
score: 0
Accepted
time: 113ms
memory: 6728kb
input:
999 1497 591 268 399 993 857 723 930 801 520 456 647 387 159 329 432 98 174 92 926 703 40 582 977 541 813 479 287 65 187 113 402 463 231 625 343 700 349 284 308 42 296 318 246 672 618 261 255 180 329 252 77 83 338 397 263 51 821 836 697 224 283 879 110 809 199 954 379 809 726 303 581 498 694 17 116 ...
output:
7479
result:
ok single line: '7479'
Test #64:
score: 0
Accepted
time: 111ms
memory: 7108kb
input:
999 1497 997 395 412 270 966 34 401 719 106 757 217 854 146 323 568 109 8 123 377 824 624 561 475 134 124 511 703 671 125 435 19 183 754 747 492 591 716 768 685 756 264 788 472 373 513 936 170 679 302 843 99 694 662 819 621 178 154 656 469 931 780 306 598 499 488 820 920 769 490 455 954 113 858 227 ...
output:
11979
result:
ok single line: '11979'
Test #65:
score: 0
Accepted
time: 103ms
memory: 6864kb
input:
1000 1500 210 504 69 269 363 719 923 451 772 235 708 834 680 337 281 436 295 885 442 579 417 174 855 49 497 435 606 119 723 98 334 397 116 658 354 255 555 635 294 260 874 162 445 469 525 377 804 950 708 633 15 275 469 321 448 528 467 297 975 790 864 591 348 782 81 77 73 754 912 247 111 366 609 448 8...
output:
1498
result:
ok single line: '1498'
Test #66:
score: 0
Accepted
time: 63ms
memory: 4284kb
input:
1000 1653 427 444 506 128 781 697 656 55 827 726 566 242 191 965 61 200 29 747 798 796 863 776 128 161 431 186 805 546 690 90 742 566 108 984 115 648 477 75 806 750 163 137 322 864 392 899 617 198 893 473 662 988 151 119 233 495 713 461 665 220 64 304 607 156 10 540 831 155 840 491 55 493 614 119 69...
output:
260491928
result:
ok single line: '260491928'
Test #67:
score: 0
Accepted
time: 95ms
memory: 4152kb
input:
1000 2248 382 666 347 2 837 157 701 489 781 221 337 467 668 568 809 416 539 582 900 41 56 273 513 432 959 891 498 65 485 424 301 974 765 120 74 780 324 622 365 158 131 167 745 964 360 725 837 576 284 934 173 789 616 71 428 594 924 344 258 739 771 507 58 605 867 550 846 288 634 360 191 38 459 658 493...
output:
352399300
result:
ok single line: '352399300'
Test #68:
score: 0
Accepted
time: 110ms
memory: 4476kb
input:
1000 2923 351 40 276 245 135 498 748 857 222 864 818 759 582 842 10 760 889 930 232 389 990 633 969 867 818 354 560 302 633 293 301 726 868 896 658 651 800 921 662 120 603 911 422 181 149 896 132 302 35 392 943 32 166 157 174 486 959 734 764 355 195 577 352 708 316 297 952 489 686 599 829 941 812 20...
output:
336860760
result:
ok single line: '336860760'
Test #69:
score: 0
Accepted
time: 117ms
memory: 4336kb
input:
999 2995 560 667 280 808 948 346 567 463 644 276 121 69 397 417 954 119 216 759 700 585 240 63 996 626 761 967 599 414 280 262 363 379 767 720 95 121 850 715 171 809 830 969 706 663 634 669 855 113 935 601 305 815 701 738 275 898 380 677 679 261 488 250 388 422 1 325 394 983 443 647 29 387 418 278 7...
output:
533867978
result:
ok single line: '533867978'
Test #70:
score: 0
Accepted
time: 101ms
memory: 4416kb
input:
1000 3000 404 867 2 646 508 289 248 657 724 336 302 565 673 715 86 925 925 105 64 898 453 886 52 563 358 456 783 77 46 732 761 397 258 773 994 140 223 421 798 54 689 371 113 469 175 539 371 802 347 77 41 584 946 491 286 117 374 892 869 977 258 823 925 105 1000 275 535 568 656 121 233 424 204 205 703...
output:
634021047
result:
ok single line: '634021047'
Test #71:
score: 0
Accepted
time: 110ms
memory: 4692kb
input:
1000 3000 832 107 242 891 857 446 640 13 265 63 90 376 781 526 441 77 127 514 308 142 621 605 804 910 902 85 879 963 169 490 682 979 665 349 761 161 677 603 265 63 224 87 70 578 46 402 492 767 394 2 100 292 178 111 462 757 653 671 388 835 198 339 18 237 256 156 680 640 239 64 321 574 376 755 582 182...
output:
572719395
result:
ok single line: '572719395'
Test #72:
score: 0
Accepted
time: 97ms
memory: 7072kb
input:
1000 1499 440 145 987 212 963 595 247 207 167 765 194 699 267 416 122 799 310 89 746 957 692 396 778 16 830 762 497 742 401 142 935 831 956 380 719 865 438 436 910 447 895 846 596 75 615 745 749 893 652 597 341 210 338 78 623 838 263 336 410 414 304 397 108 66 54 105 368 853 350 279 788 42 285 787 6...
output:
4493
result:
ok single line: '4493'
Test #73:
score: 0
Accepted
time: 103ms
memory: 5680kb
input:
1000 1499 754 321 492 250 968 724 401 934 786 524 457 101 682 810 738 221 709 133 189 771 330 392 992 565 609 925 612 452 607 618 131 144 494 758 933 55 652 463 525 796 674 354 509 744 58 225 877 784 72 474 913 398 550 613 766 62 31 848 47 830 879 373 750 288 646 258 837 958 849 144 288 588 536 40 4...
output:
4058
result:
ok single line: '4058'
Test #74:
score: 0
Accepted
time: 92ms
memory: 4288kb
input:
986 1639 879 366 740 198 355 906 324 27 667 249 922 110 792 89 216 721 572 385 323 203 816 912 535 867 294 457 659 861 881 23 887 499 754 104 154 513 498 877 182 623 812 684 928 400 104 41 468 517 856 553 563 308 910 119 925 135 254 135 985 721 442 671 223 521 321 57 841 811 327 2 284 270 902 57 559...
output:
2893481
result:
ok single line: '2893481'
Test #75:
score: 0
Accepted
time: 96ms
memory: 4408kb
input:
998 1659 491 533 348 877 957 518 981 419 49 651 870 464 588 704 973 995 761 964 609 813 213 941 615 894 961 65 374 657 241 690 539 739 434 836 784 6 567 209 171 644 959 668 501 50 77 866 678 553 593 206 950 102 389 917 998 805 794 520 74 966 725 267 548 338 983 785 660 204 33 73 43 664 496 73 804 87...
output:
2822843
result:
ok single line: '2822843'
Test #76:
score: 0
Accepted
time: 107ms
memory: 4668kb
input:
998 1659 743 360 901 592 398 324 399 936 807 643 912 168 457 37 467 88 197 390 427 843 8 797 419 463 361 534 254 834 506 926 124 133 544 153 876 406 901 690 101 822 669 297 754 910 170 218 719 667 636 357 191 510 376 132 738 469 20 395 920 915 810 127 986 238 508 443 537 757 818 894 546 977 748 794 ...
output:
2766522
result:
ok single line: '2766522'
Test #77:
score: 0
Accepted
time: 95ms
memory: 6688kb
input:
999 1662 613 460 551 477 247 707 228 8 892 445 566 460 445 203 602 445 570 933 319 445 866 444 277 35 172 987 671 558 376 110 650 572 2 354 240 298 873 44 131 90 445 441 399 878 247 227 76 51 624 916 209 397 835 894 806 460 122 87 55 882 809 725 345 879 151 632 460 564 778 660 345 797 573 306 672 77...
output:
569033
result:
ok single line: '569033'
Test #78:
score: 0
Accepted
time: 45ms
memory: 4000kb
input:
976 1497 374 236 385 806 186 314 648 139 737 249 50 808 708 77 397 20 67 328 818 338 786 489 859 776 636 332 624 265 7 159 491 516 307 526 749 852 91 501 600 192 951 945 18 310 895 592 748 230 49 278 297 299 169 23 511 759 627 729 7 690 270 742 834 815 431 851 375 679 182 330 225 670 780 783 925 850...
output:
203090614
result:
ok single line: '203090614'
Subtask #4:
score: 1
Accepted
Test #79:
score: 1
Accepted
time: 405ms
memory: 6536kb
input:
3000 10000 1462 2456 1392 440 1583 2589 2538 688 1567 2535 191 2866 2383 588 2559 2490 769 1534 412 709 2592 2349 1997 72 2716 1097 702 1512 2166 1393 2968 62 184 1684 2787 669 605 2542 340 1029 1681 1984 897 2794 2187 2410 2014 2564 476 2313 883 143 2971 2828 1494 2144 1797 1735 2055 1685 311 2511 ...
output:
848984993
result:
ok single line: '848984993'
Test #80:
score: 0
Accepted
time: 646ms
memory: 7176kb
input:
3000 10000 1026 1160 2232 980 2905 2477 1395 1586 1776 2162 675 2729 2306 1958 559 2089 551 1043 1122 1397 1871 2324 1662 27 1539 920 1178 183 333 1005 2775 1265 1034 716 142 2518 1211 918 418 1013 604 614 2236 2771 204 863 940 203 2536 1501 1530 823 268 1664 1680 367 2132 744 2429 22 1823 1743 2766...
output:
350484542
result:
ok single line: '350484542'
Test #81:
score: 0
Accepted
time: 387ms
memory: 6956kb
input:
2998 9149 2723 73 2877 1300 1841 932 1431 2571 1951 724 2203 1887 2139 1215 2730 1694 2349 413 471 1161 898 2623 1152 427 1603 147 2329 373 2179 1430 1032 1925 447 476 5 1194 2924 1878 2925 1567 1913 1111 2318 1645 380 2615 394 1866 767 902 2286 1673 2790 1587 2647 1782 2467 2065 2099 1469 303 1987 ...
output:
794269949
result:
ok single line: '794269949'
Test #82:
score: 0
Accepted
time: 662ms
memory: 7208kb
input:
2998 10000 1258 1679 2751 621 1241 2056 23 2391 2158 61 1426 1343 201 1641 1970 2574 2643 1757 1819 1635 803 1636 1612 387 543 1829 1631 741 1030 2761 2788 2367 1795 538 1444 2515 2814 833 1158 2295 1657 2465 707 1181 2516 2182 220 2825 2719 392 988 924 2484 1503 1097 438 896 1237 1886 1931 348 437 ...
output:
649634712
result:
ok single line: '649634712'
Test #83:
score: 0
Accepted
time: 458ms
memory: 4736kb
input:
3000 10000 848 2755 2804 1912 1776 1288 683 22 1224 2504 2375 834 292 2954 1700 1620 2094 1679 119 2190 196 2413 1157 2913 854 7 1985 1629 302 848 203 1653 1241 569 2735 1933 1913 2433 1924 1416 474 508 10 2676 2201 1688 306 1450 2447 1852 442 2321 398 2476 277 1220 1220 2438 1527 1637 1897 1905 121...
output:
500169597
result:
ok single line: '500169597'
Test #84:
score: 0
Accepted
time: 439ms
memory: 5200kb
input:
3000 10000 367 888 1051 1569 1070 2489 2703 950 2812 1607 2180 1965 2404 997 2314 104 2733 692 2177 1425 2580 1134 2120 631 1438 2113 1610 2622 1300 592 752 2283 2767 1663 1013 2650 2237 2403 2927 2723 2556 1598 276 2440 1172 2006 1899 411 809 87 109 1326 464 2126 2842 67 430 1644 222 2739 14 151 17...
output:
770159
result:
ok single line: '770159'
Test #85:
score: 0
Accepted
time: 346ms
memory: 10856kb
input:
3000 4500 2477 2827 2845 979 1375 937 1504 1754 2185 867 2148 2008 668 1821 2471 561 2541 2603 2693 2256 981 951 2549 2406 1202 282 946 2493 1357 137 658 1534 1370 1224 303 1883 217 2122 2632 2814 2249 682 2387 1136 140 2143 2350 2168 856 2574 2268 1086 1059 223 2605 2022 780 1446 1267 2619 2023 115...
output:
4498
result:
ok single line: '4498'
Test #86:
score: 0
Accepted
time: 360ms
memory: 17044kb
input:
3000 4500 443 1521 2611 1005 113 1880 2322 1285 2058 2789 462 2092 2106 362 2167 518 2600 40 2625 193 2163 1418 713 687 1930 2085 979 760 1028 787 1387 2543 1829 1597 1018 2815 889 2369 1289 291 119 2142 1752 489 141 385 1765 1315 1279 1073 1838 2873 298 2110 1943 1271 2680 2762 699 2245 1334 1134 1...
output:
4498
result:
ok single line: '4498'
Test #87:
score: 0
Accepted
time: 322ms
memory: 10892kb
input:
3000 4500 2013 1627 987 2831 2780 1727 1917 2787 2982 862 1791 2015 1926 2338 889 2124 255 1581 2038 1678 2889 2719 1863 1415 1548 2823 1531 209 844 2811 2285 2242 1293 208 92 1031 228 426 222 1760 2820 897 2628 1985 1182 2597 2296 1286 17 2957 1805 340 1974 443 400 223 640 272 270 1066 1952 8 851 2...
output:
4498
result:
ok single line: '4498'
Test #88:
score: 0
Accepted
time: 309ms
memory: 7376kb
input:
2999 4497 536 126 1348 737 2520 2444 1821 2721 2068 235 51 382 2392 74 287 1547 1859 2278 497 2786 1675 1401 1661 1726 2539 1730 2117 213 528 1536 263 2192 904 133 321 446 141 550 254 1032 49 2626 2635 296 554 1307 1503 2480 1210 794 2301 164 2791 1818 2678 2838 2923 1792 434 2933 715 964 1189 1663 ...
output:
58533
result:
ok single line: '58533'
Test #89:
score: 0
Accepted
time: 357ms
memory: 16932kb
input:
2999 4497 1790 282 1481 1228 2364 977 1376 102 1319 753 473 1361 1073 1259 2825 1411 381 770 1226 1547 2733 1767 1490 613 113 1073 1669 942 999 2175 2224 370 1494 1895 1136 1281 574 1200 1456 1143 477 98 2223 2688 1408 1977 2301 1256 1725 1672 2180 2304 1010 1958 708 661 134 1206 1939 356 1756 2800 ...
output:
22480
result:
ok single line: '22480'
Test #90:
score: 0
Accepted
time: 372ms
memory: 11072kb
input:
2999 4497 1137 1373 237 126 2712 2868 2056 2922 1090 462 930 958 2631 1771 1867 1856 847 755 56 2803 1048 603 434 1580 181 1328 1423 2806 646 1966 2841 357 2566 1681 2461 500 1954 2587 1074 1025 544 1696 498 2644 2340 2903 577 1875 2299 2457 679 993 1241 1061 1797 978 2852 2179 1692 2958 129 772 250...
output:
31481
result:
ok single line: '31481'
Test #91:
score: 0
Accepted
time: 328ms
memory: 10856kb
input:
3000 4500 311 2871 1161 1242 2957 104 2729 290 1873 1765 2305 2712 1316 2648 1327 298 1319 2997 1760 1389 2365 1226 1860 2756 2636 19 268 1355 310 1822 410 1066 2641 97 2886 230 2857 274 2533 1363 1301 526 814 1301 543 2351 1878 906 1107 2833 1153 2500 2595 168 548 2096 2727 692 803 487 2140 386 689...
output:
4498
result:
ok single line: '4498'
Test #92:
score: 0
Accepted
time: 219ms
memory: 4640kb
input:
2997 5331 2171 723 1973 430 2279 2344 2281 2423 1713 2195 515 110 1150 98 2354 1629 495 2141 524 2753 610 2705 2874 917 2301 2871 853 1509 2678 288 290 1016 1071 1004 2169 923 2311 181 2923 750 2983 630 1742 1774 1832 2191 1348 971 56 1128 79 1879 2096 883 2012 969 1719 2108 2777 2381 1308 1860 373 ...
output:
7028318840
result:
ok single line: '7028318840'
Test #93:
score: 0
Accepted
time: 295ms
memory: 6276kb
input:
3000 7616 1981 2729 1342 2278 96 2344 967 2741 2175 2020 382 806 867 2232 576 957 2200 906 79 183 1528 1763 2983 680 95 1149 115 2099 806 2707 951 598 1493 582 1514 1896 1993 538 2605 76 556 1745 1140 1332 1266 300 2312 720 59 1919 2703 2358 2206 1452 2582 607 479 1034 614 2009 1474 1913 772 994 236...
output:
9429421366
result:
ok single line: '9429421366'
Test #94:
score: 0
Accepted
time: 512ms
memory: 6592kb
input:
3000 9993 2352 807 2235 2186 1112 48 922 1128 407 294 1159 1450 1355 139 188 2905 199 2086 2911 665 2403 1253 2449 833 1681 883 1921 961 2094 917 2768 1860 1507 1841 1691 982 106 1525 1795 1862 1569 707 2634 1030 1051 2487 2796 288 149 1676 1377 30 2258 1303 2713 1433 980 126 545 1924 2079 302 777 1...
output:
10125518520
result:
ok single line: '10125518520'
Test #95:
score: 0
Accepted
time: 376ms
memory: 5124kb
input:
3000 10000 2808 1645 1315 807 1325 938 88 1021 1552 406 2337 208 31 72 1786 2219 1447 257 575 2509 2953 1158 243 146 615 1555 226 2541 1054 1600 1785 1825 2701 427 1995 2542 2908 1934 684 1762 1699 2551 420 2121 2527 361 2345 2313 2417 2642 596 2512 1121 1543 1397 1401 273 1518 1061 1175 1713 2528 9...
output:
14793095471
result:
ok single line: '14793095471'
Test #96:
score: 0
Accepted
time: 375ms
memory: 4712kb
input:
3000 10000 2368 2954 485 1685 2882 1645 1469 1996 221 524 172 759 2350 324 190 794 2477 2981 261 591 556 146 1885 176 975 1011 2000 2884 111 1374 1328 2954 810 2774 1465 654 2674 427 1934 2412 1239 158 1900 287 2397 1966 2945 1971 936 2539 317 2993 1352 311 356 333 2449 2307 2456 2943 1330 2865 1725...
output:
14040046478
result:
ok single line: '14040046478'
Test #97:
score: 0
Accepted
time: 373ms
memory: 5948kb
input:
2995 10000 2794 2544 1010 282 2832 1749 2016 183 1980 572 1721 1622 1985 1769 483 113 456 1041 479 80 1305 950 592 2649 2311 2642 983 2992 1638 143 2088 2642 693 2367 1654 885 1900 1141 912 2203 1921 495 400 2182 911 432 1552 1869 355 2724 2062 852 2055 2311 358 1262 208 2275 889 2403 1462 1595 2711...
output:
14275525314
result:
ok single line: '14275525314'
Test #98:
score: 0
Accepted
time: 352ms
memory: 11144kb
input:
3000 4499 918 960 464 1159 721 1248 1973 48 2638 494 176 2639 960 1274 2799 791 2926 2526 1038 212 774 803 1012 2646 2457 2910 1692 1889 910 1289 2967 2310 1209 2414 1975 2364 240 2801 2938 1187 2219 2904 2314 2976 1841 1154 193 601 2370 1614 2557 2277 975 301 2333 1206 2985 2899 861 686 2296 226 84...
output:
13493
result:
ok single line: '13493'
Test #99:
score: 0
Accepted
time: 312ms
memory: 11052kb
input:
3000 4499 2264 1470 1757 1093 917 2832 1216 2704 1930 2415 2745 705 643 814 2679 1285 553 1954 2361 1525 803 2423 1148 386 427 1275 1903 2944 2660 505 1832 2046 1313 730 2826 73 2392 1736 2109 2893 1251 2552 1391 1153 2278 744 1938 2881 2359 93 147 2736 1860 952 1972 2555 1866 1399 1603 968 788 728 ...
output:
12198
result:
ok single line: '12198'
Test #100:
score: 0
Accepted
time: 282ms
memory: 4712kb
input:
2957 4924 2903 795 1396 672 2614 2444 1491 1216 1824 755 1201 2682 1767 2830 2952 1292 2226 1098 2788 125 2132 2344 970 130 292 1842 1237 437 939 2192 1550 2133 1653 904 1262 1638 264 670 2637 643 2485 1409 1414 2614 94 60 708 715 1647 2733 2199 2024 2309 334 1258 2876 903 2095 955 2175 1890 1231 30...
output:
26236924
result:
ok single line: '26236924'
Test #101:
score: 0
Accepted
time: 298ms
memory: 4900kb
input:
2999 4994 445 967 596 2801 786 1390 86 2812 681 567 1478 1412 2004 2538 1871 2239 1597 799 195 2718 1898 2679 2033 1289 2158 1342 1096 611 2069 606 794 139 248 2748 382 1848 1248 1347 1169 2409 470 637 117 2270 2482 2889 2527 687 1431 1020 2571 1585 1205 194 140 2909 513 2353 1776 1751 1646 1810 209...
output:
25601892
result:
ok single line: '25601892'
Test #102:
score: 0
Accepted
time: 328ms
memory: 7432kb
input:
2999 4994 163 999 544 795 1825 2396 2976 1242 566 1311 1966 1023 1420 2526 2834 2311 1750 2795 612 1912 304 2818 2036 2299 382 323 651 1564 2752 2812 2233 2067 1178 2612 1916 592 2176 1932 2604 1490 2078 2438 59 1586 2654 2737 2457 1946 1183 1542 2553 1246 2557 171 2627 2513 2171 2513 1538 1895 604 ...
output:
25112735
result:
ok single line: '25112735'
Test #103:
score: 0
Accepted
time: 420ms
memory: 4500kb
input:
401 10000 306 4 109 241 319 194 140 229 365 174 91 323 337 347 127 349 52 250 96 324 205 3 34 178 84 186 303 80 235 228 89 382 225 144 391 285 309 391 216 33 283 25 397 222 170 283 23 307 322 237 139 224 321 327 158 294 254 86 310 265 226 219 93 348 279 26 354 133 392 309 331 228 252 188 70 22 251 2...
output:
1
result:
ok single line: '1'
Test #104:
score: 0
Accepted
time: 294ms
memory: 10804kb
input:
3000 4997 2998 2699 2474 1046 1959 2187 2008 1851 2328 2253 826 1635 2999 259 2760 1115 2864 1046 1306 1127 429 1224 861 283 2550 204 564 2179 1075 958 1383 791 2379 510 949 444 796 1459 1952 2696 916 470 1856 2634 946 568 1250 1513 1241 2948 771 2985 610 1509 368 1513 349 79 748 664 2012 594 1600 1...
output:
5138881
result:
ok single line: '5138881'
Subtask #5:
score: 0
Wrong Answer
Test #105:
score: 1
Accepted
time: 1354ms
memory: 39136kb
input:
50000 150000 1991 3143 21349 44702 31247 42669 25507 37965 30412 49299 42044 38756 42138 41113 1488 32434 34208 17493 20840 21536 5774 22280 23608 8775 12401 15509 10050 29833 19233 13110 33781 13775 47773 6171 33162 25107 39816 35136 36124 20728 37273 39076 3443 17847 27460 32446 44858 37844 1464 4...
output:
3906142805978
result:
ok single line: '3906142805978'
Test #106:
score: 0
Accepted
time: 948ms
memory: 37572kb
input:
50000 139087 15069 44406 20069 3304 438 43902 11142 31219 47961 16245 37250 16537 11666 30165 43892 26539 8994 32792 29109 11706 13794 49576 8196 37564 40625 14205 41279 8828 13617 6401 33916 22426 6199 48957 34107 31982 32935 19075 32876 3228 32500 49835 30501 5018 35851 14896 46242 40419 47459 184...
output:
5337586368678
result:
ok single line: '5337586368678'
Test #107:
score: 0
Accepted
time: 969ms
memory: 37340kb
input:
50000 136801 48445 5175 46095 40900 17740 18080 37071 35352 13872 7543 14568 12343 38997 8513 14870 12581 14065 29211 13169 22896 24172 36728 7955 41119 48602 7561 16317 29440 46725 6435 23571 33650 41422 11423 16852 7040 32029 27403 28065 22929 46090 30092 1009 36637 32996 17503 32820 21622 49576 6...
output:
5673534350664
result:
ok single line: '5673534350664'
Test #108:
score: 0
Accepted
time: 683ms
memory: 15368kb
input:
50000 149996 34978 12741 9300 38392 25599 18747 24913 41972 27878 42011 23935 39596 15812 24922 38085 15236 37432 39214 37556 5372 34718 34917 21418 14124 30909 46300 4318 18345 40108 20924 9500 6242 29310 41009 6851 25837 45713 49651 14495 12241 8901 37254 35810 14918 26143 16105 31564 49305 5068 3...
output:
1326612563218
result:
ok single line: '1326612563218'
Test #109:
score: -1
Wrong Answer
time: 1146ms
memory: 48080kb
input:
50000 75000 31564 20546 15391 46529 3044 10086 33651 43908 13254 3042 4773 35141 43145 31749 13895 10072 47577 19124 45949 37737 39329 7219 8800 48772 26405 17911 43352 6282 24522 14648 9221 38844 9857 4680 48373 24993 44742 10396 40696 3430 40379 27089 6904 8899 4466 40947 24848 39688 4050 49512 37...
output:
74755
result:
wrong answer 1st lines differ - expected: '74998', found: '74755'
Subtask #6:
score: 0
Wrong Answer
Test #127:
score: 1
Accepted
time: 978ms
memory: 38560kb
input:
50000 150000 14654 26345 16262 18307 45564 2940 34025 14154 7547 38896 20114 3366 31149 45513 28695 13798 6986 30707 22590 34358 5291 48712 22936 4381 32033 28140 39625 3256 42953 35299 11588 48847 30809 15894 29064 20863 13324 24272 36616 19852 34373 35937 22995 47785 48427 34086 33652 32646 13204 ...
output:
3704557253617
result:
ok single line: '3704557253617'
Test #128:
score: 0
Accepted
time: 1058ms
memory: 38480kb
input:
50000 150000 8176 122 33204 8001 28787 4955 17829 15921 42956 27417 15188 7142 10348 4895 46252 4823 20752 44428 22508 12953 7872 41773 39172 18177 42190 8046 41247 31936 27160 33756 43764 1524 4170 19783 7886 8269 29662 41453 47469 25355 9865 10830 27939 36023 13681 18066 8432 43189 41529 21867 194...
output:
4387508501166
result:
ok single line: '4387508501166'
Test #129:
score: 0
Accepted
time: 1007ms
memory: 38412kb
input:
49996 149997 16197 26113 17889 16823 38311 25444 1266 46808 46515 27227 17202 45630 40653 39518 31688 49072 43212 41130 13078 22629 28728 16668 37932 15815 36713 32255 9373 10351 16438 43598 28342 39345 26609 48957 25726 19002 33428 19517 25551 13500 49967 29924 15464 25770 36405 47805 9946 2609 362...
output:
3917188658153
result:
ok single line: '3917188658153'
Test #130:
score: 0
Accepted
time: 667ms
memory: 20540kb
input:
50000 150000 820 26518 6392 7592 1408 2694 46048 39497 23136 12793 35575 9268 20955 22571 921 5648 33260 29599 34996 31308 19576 6966 45180 9815 49833 12550 44313 21539 27196 27506 15940 3719 27849 9992 24951 34290 29382 13513 32407 38957 25422 48328 40887 7896 26641 25527 14121 12219 20956 7827 100...
output:
1052930187
result:
ok single line: '1052930187'
Test #131:
score: -1
Wrong Answer
time: 1354ms
memory: 50424kb
input:
50000 75000 37474 3219 19546 41587 28530 36790 223 43201 45158 10420 47729 1898 39384 7632 38653 1830 44391 9054 45500 42269 25031 28978 27631 29554 29060 19917 17575 25547 1867 27432 11153 21723 19522 30800 25643 27768 2536 15048 38796 14372 44462 13798 8236 975 24276 36999 42411 19933 18355 605 14...
output:
74935
result:
wrong answer 1st lines differ - expected: '74998', found: '74935'
Subtask #7:
score: 0
Wrong Answer
Test #148:
score: 1
Accepted
time: 1976ms
memory: 70332kb
input:
100000 299995 76541 36034 21821 10717 92372 13436 91177 67290 71556 36287 43424 89680 17336 89543 63537 88070 82867 44178 92429 69404 13146 91748 23872 72000 37854 97944 23163 54817 59266 1546 15026 23692 50066 78011 52457 48543 11443 92637 75907 78168 27266 11744 82645 78843 6877 87925 11409 71750 ...
output:
32232518751544
result:
ok single line: '32232518751544'
Test #149:
score: 0
Accepted
time: 1861ms
memory: 67812kb
input:
100000 276447 16983 6403 74141 60430 39653 4186 56589 64763 68560 5048 13864 73183 67327 72443 54075 61110 77440 79003 20697 69250 1908 35751 65382 93295 18421 58991 97411 38990 9799 82772 24872 28764 35625 9372 4550 99105 61069 77218 50618 91208 98024 34191 19728 78358 92443 43372 97802 61577 89732...
output:
43572298312307
result:
ok single line: '43572298312307'
Test #150:
score: 0
Accepted
time: 2116ms
memory: 70548kb
input:
100000 300000 82000 29381 80370 75500 8914 94087 32555 63646 11770 10772 9956 73439 83305 96002 40878 24028 40775 76896 69979 18967 31069 5353 28305 78970 35543 4799 10817 32572 94873 51304 2435 91127 72609 14197 31604 99019 85350 95583 78113 3384 92640 7913 78437 4296 23612 52166 84001 24674 4296 4...
output:
34203841351835
result:
ok single line: '34203841351835'
Test #151:
score: 0
Accepted
time: 836ms
memory: 26392kb
input:
100000 300000 39714 57728 14616 77302 68663 70985 85153 83292 4845 86664 30727 59101 10203 64391 64428 93942 57368 76244 44341 34525 14407 93054 5022 35558 32101 87032 8862 72878 16291 91443 29744 67583 27860 6039 15313 54459 93127 68662 34430 69143 86300 49412 87395 14900 81254 46117 51058 54167 82...
output:
10253127352593
result:
ok single line: '10253127352593'
Test #152:
score: -1
Wrong Answer
time: 1656ms
memory: 68244kb
input:
100000 150000 36129 11900 75681 95463 77063 28509 30170 76845 80274 5238 92077 94876 30539 83164 79236 75436 89898 7187 88973 59049 23996 51223 21442 39765 27549 878 28183 57361 96393 92137 2026 70750 65864 8978 49663 48041 97570 75497 63034 48675 50491 52513 65102 45470 52118 10542 81314 19122 6146...
output:
148229
result:
wrong answer 1st lines differ - expected: '149998', found: '148229'
Subtask #8:
score: 0
Wrong Answer
Test #170:
score: 1
Accepted
time: 1840ms
memory: 68828kb
input:
100000 279113 79936 98761 86614 13502 60129 57171 2595 59656 26815 73006 73210 93780 40617 228 10831 3236 55162 74636 9755 51956 77084 72230 67416 15170 70010 48350 89472 13476 82658 83842 52979 65242 76367 98517 83573 36155 54122 47171 3609 48304 49848 33193 50856 12549 66484 23383 10297 46286 5170...
output:
45963547774669
result:
ok single line: '45963547774669'
Test #171:
score: 0
Accepted
time: 1917ms
memory: 69736kb
input:
100000 300000 87730 67067 51851 37913 25147 5968 45707 73702 2073 44094 97720 78298 62278 95471 48132 83607 66539 57662 74478 60999 84608 41341 34082 29596 364 62916 15425 13585 61204 32530 69763 10334 27822 43236 48483 30294 94043 65754 70183 1088 4007 39913 37843 7663 86896 81860 71202 84718 52234...
output:
34651566895671
result:
ok single line: '34651566895671'
Test #172:
score: 0
Accepted
time: 2016ms
memory: 70796kb
input:
100000 300000 10869 62961 99655 31875 45526 13058 72426 32943 42328 6203 60434 66730 42013 24792 79795 80924 24934 90409 4398 91845 65878 15901 77325 88031 65414 21025 57486 57104 72357 76273 37601 57659 72060 10856 78608 13984 60493 86703 53018 2474 16158 25275 5848 99114 51011 87538 91051 76504 64...
output:
34159051860729
result:
ok single line: '34159051860729'
Test #173:
score: 0
Accepted
time: 838ms
memory: 36908kb
input:
100000 300000 54019 98198 34078 21644 13056 15406 21002 9068 11379 16487 69273 28192 33304 53102 71498 29122 88108 13720 95837 6484 21868 27603 89430 65312 36499 38823 95737 68261 48613 84891 90801 40512 46111 82007 46504 66059 26202 21663 34939 18005 743 19314 70212 9695 4397 30706 97382 76144 4683...
output:
9095102340
result:
ok single line: '9095102340'
Test #174:
score: -1
Wrong Answer
time: 1798ms
memory: 76120kb
input:
100000 150000 41912 44697 48906 50902 42452 44445 71930 41121 31172 60598 65637 33406 33257 45287 85661 65969 50395 67443 60144 23058 64921 62468 51544 65832 24639 97309 18756 20315 22695 10694 53680 10718 48876 9891 50263 496 14584 30514 20990 41113 55964 10313 60121 69807 42057 84752 56866 52563 3...
output:
148728
result:
wrong answer 1st lines differ - expected: '149998', found: '148728'
Subtask #9:
score: 0
Wrong Answer
Test #191:
score: 1
Accepted
time: 2935ms
memory: 121320kb
input:
200000 499996 14624 5312 87648 67591 23942 139952 90144 149693 72944 191585 172981 110212 70462 12669 60888 174228 45855 161004 187502 20151 13037 10778 108403 70474 60659 59857 101373 2903 25797 181839 178092 4148 47398 58716 33458 86598 122142 109187 84168 97778 129458 9734 155530 196813 74051 160...
output:
513716366636593
result:
ok single line: '513716366636593'
Test #192:
score: 0
Accepted
time: 3002ms
memory: 122520kb
input:
200000 500000 196141 127446 170569 6110 48544 164416 187935 115549 128222 138489 66852 67723 70416 152631 21176 156784 179618 81139 43896 78852 146902 5191 129476 10916 109068 196458 84485 124704 68993 150118 51204 93498 164414 93061 47582 118341 62968 11133 120037 87590 9518 85428 194523 102781 164...
output:
520239427759344
result:
ok single line: '520239427759344'
Test #193:
score: 0
Accepted
time: 2648ms
memory: 112720kb
input:
200000 422783 117819 69914 158560 94346 20877 28506 57092 34772 106317 135378 115553 31365 30090 6430 133826 138956 182824 28367 151895 135231 753 148001 49011 116169 175138 108496 27208 118001 46383 194359 61013 164921 22706 137468 53990 100953 108583 121282 69256 155524 73331 99942 53679 163164 18...
output:
782224432387507
result:
ok single line: '782224432387507'
Test #194:
score: 0
Accepted
time: 1057ms
memory: 46520kb
input:
200000 499997 139911 137901 64540 46041 88506 186886 10206 91681 106997 177232 142173 150506 73002 10732 81884 193827 77038 170016 174161 62702 28255 192386 15478 158067 24554 12328 176268 11725 151053 21088 196048 4736 193452 54105 188837 82730 108430 41012 116021 31537 26041 42005 88508 182272 725...
output:
131229390915888
result:
ok single line: '131229390915888'
Test #195:
score: -1
Wrong Answer
time: 2948ms
memory: 107800kb
input:
200000 300000 198740 42125 17592 91943 132595 43769 48213 55581 171731 17616 100364 120333 156122 153406 108469 4676 93559 113795 74068 181367 178176 177233 189564 153820 25850 142735 151357 55392 48123 89972 183518 106109 62391 92599 38159 35227 123576 35407 135297 2795 26515 123039 5227 189568 137...
output:
285717
result:
wrong answer 1st lines differ - expected: '299998', found: '285717'
Subtask #10:
score: 0
Wrong Answer
Test #214:
score: 1
Accepted
time: 3008ms
memory: 123376kb
input:
200000 500000 96760 112554 29323 168994 89784 103554 72230 56614 72441 184640 409 79524 137579 154258 176 98259 27225 66351 135833 195396 31261 115021 12999 157947 96082 24545 130808 58489 59300 142171 128138 77303 192454 105413 102811 151935 139420 157027 70134 188719 122103 154600 106433 9386 1513...
output:
502166260941108
result:
ok single line: '502166260941108'
Test #215:
score: 0
Accepted
time: 3269ms
memory: 111176kb
input:
200000 427739 127977 100843 89048 40499 66185 178842 828 90180 166916 28872 193049 81418 139927 33089 19724 77324 181786 868 109567 175482 140139 21345 89840 117140 11475 156660 93102 30213 82938 78658 136384 191425 81846 45118 6975 178872 97360 192225 181680 179206 124463 167229 56646 48671 83388 6...
output:
779106485728385
result:
ok single line: '779106485728385'
Test #216:
score: 0
Accepted
time: 2956ms
memory: 112948kb
input:
200000 423932 68428 195289 90165 145964 175169 150397 144535 158736 24154 23576 82934 133601 189658 129371 99728 47747 86947 64028 77875 6079 95830 59255 146656 111315 148167 151946 40391 172726 110204 50886 26946 156223 154797 102345 186588 5321 96803 134707 17137 144807 80216 171675 11503 124623 6...
output:
796082632989835
result:
ok single line: '796082632989835'
Test #217:
score: -1
Wrong Answer
time: 1100ms
memory: 65868kb
input:
200000 499999 23694 190972 53323 141164 165184 44748 37521 119931 162672 126650 78937 142838 182169 961 97596 146721 172934 124013 18762 162933 35614 168961 27147 169518 22720 17551 125559 163048 172457 162384 111773 31979 179547 9114 171005 150944 194723 7695 186393 105637 63472 64643 14440 94046 1...
output:
288069255037
result:
wrong answer 1st lines differ - expected: '288069256104', found: '288069255037'