QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#743715 | #8643. Board Game | TheZone | 100 ✓ | 1771ms | 458852kb | C++20 | 13.6kb | 2024-11-13 19:52:27 | 2024-11-13 19:52:28 |
Judging History
answer
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) (int)((x).size())
#define int ll
//#define N
using namespace std;
const int N=50005;
int n,m,K;
int ss[N];
int ds[N];
poly G[N];
int vis[N];
int vs[N];
int dis[N],dis1[N],tot[N];
int X[N];
int fuck[N];
int coef;
int s[N];
int ans[N];
int f[N][1005];
const int B=250;
void BellaKira()
{
cin>>n>>m>>K;
for (int i=1;i<=m;i++)
{
int x,y;
cin>>x>>y;
G[x].push_back(y);
G[y].push_back(x);
}
for (int i=1;i<=n;i++)
{
char c;
cin>>c;
if (c=='0')
vis[i]=0;
else vis[i]=1;
}
for (int i=1;i<=K;i++)
cin>>X[i];
{
queue<int>q;
for (int i=1;i<=n;i++) dis[i]=inf;
for (int i=1;i<=n;i++)
{
for (auto u:G[i])
if (vis[u])
dis[i]=1,q.push(i);
}
while (!q.empty())
{
int u=q.front();
q.pop();
for (auto v:G[u])
if (dis[v]>dis[u]+1)
{
q.push(v);
dis[v]=dis[u]+1;
}
}
for (int i=1;i<=n;i++) dis1[i]=inf,tot[i]=0,vs[i]=0;
for (int i=1;i<=n;i++)
for (auto u:G[i])
if (vis[u]==1&&vis[i]==1) fuck[i]=1;
{
priority_queue<pa>q;
for (int i=1;i<=n;i++)
{
for (auto u:G[i])
if (fuck[u])
{
dis1[i]=1;
tot[i]=1;
q.push(mp(-dis1[i],i));
}
}
while (!q.empty())
{
auto [w,u]=q.top();
q.pop();
w=-w;
if (w!=dis1[u]) continue;
for (auto v:G[u])
{
if (dis1[v]>dis1[u]+(vis[u]^1))
{
dis1[v]=dis1[u]+(vis[u]^1);
tot[v]=tot[u]+vis[u];
q.push(mp(-dis1[v],v));
}
}
}
}
{
priority_queue<pa>q;
for (int i=1;i<=n;i++) ds[i]=inf;
ds[X[1]]=0;
q.push(mp(-ds[X[1]],X[1]));
while (!q.empty())
{
auto [w,u]=q.top();
q.pop();
w=-w;
if (w!=ds[u]) continue;
for (auto v:G[u])
{
if (ds[v]>ds[u]+(vis[v]))
{
ds[v]=ds[u]+(vis[v]);
q.push(mp(-ds[v],v));
}
}
}
}
}
for (int i=2;i<=K;i++)
{
s[1]+=dis[X[i]];s[2]-=dis[X[i]];
s[2]+=2;
if (tot[X[i]])
{
int now=dis[X[i]]+(tot[X[i]]-1)*2,now1=dis1[X[i]]+tot[X[i]]-1;
int del=now1-now;
if (del+tot[X[i]]+1<=n)
{
s[del+tot[X[i]]+1]-=1;
}
}
}
if (K>500)
{
for (int i=1;i<=n;i++) ans[i]=inf;
ans[X[1]]=0;
for (int i=1;i<=n;i++) s[i]+=s[i-1];
for (int i=1;i<=n;i++) s[i]+=s[i-1];
int lim=n/(K-1);
for (int i=1;i<=n;i++)
for (int j=0;j<=lim;j++)
f[i][j]=inf;
f[X[1]][0]=0;
static pa q[50000005];
int h=0,t=0;
q[++t]=mp(X[1],0);
while (h<t)
{
auto [u,d]=q[++h];
for (auto v:G[u])
{
int dd=ds[u]+d+vis[v]-ds[v];
if (dd<=lim&&f[v][dd]==inf)
{
f[v][dd]=f[u][d]+1;
q[++t]=mp(v,dd);
}
}
}
for (int i=1;i<=n;i++)
{
if (i==X[1])
{
continue;
}
for (int j=ds[i];j<=min(ds[i]+lim,n);j++)
{
if (f[i][j-ds[i]]==inf) continue;
ans[i]=min(ans[i],f[i][j-ds[i]]
+s[j-vis[i]]);
}
}
} else
{
// return;
for (int i=1;i<=n;i++) ans[i]=inf;
for (int i=1;i<=n;i++)
{
s[i]+=s[i-1];
if (i>1) ss[i]=ss[i-1]+s[i];
}
for (int j=1;j<=n;j++)
dis1[j]=inf;
for (int i=1;i<=n;i++)
{
priority_queue<pa>q;
q.push(mp(-0ll,-X[1]));
while (!q.empty())
{
auto [w,u]=q.top();
q.pop();
w=-w;
if (u>0&&dis1[u]!=w) continue;
if (u<0) u=-u;
for (auto v:G[u])
if (dis1[v]>w+1+vis[v]*s[1])
{
dis1[v]=w+1+vis[v]*s[1];
if (!vis[v])
{
q.push(mp(-dis1[v],v));
}
}
}
}
for (int i=1;i<=n;i++)
if (dis1[i]!=inf) ans[i]=dis1[i]-vis[i]*s[1];
for (int i=1;i<=n;i++)
if (!vis[i]) dis1[i]=inf;
ans[X[1]]=0;
int tot=0;
for (int i=2;i<=n;)
{
int nxt=i;
while (nxt<=n&&s[nxt]==s[i]) nxt++;
priority_queue<pa>q;
for (int j=1;j<=n;j++)
{
if (dis1[j]!=inf)
q.push(mp(-dis1[j],-j));
dis[j]=inf;
}
bool bl=0;
while (!q.empty())
{
auto [w,u]=q.top();
q.pop();
w=-w;
if (u>0&&dis[u]!=w) continue;
if (u<0) u=-u;
for (auto v:G[u])
if (dis[v]>w+1+vis[v]*s[i])
{
dis[v]=w+1+vis[v]*s[i];
q.push(mp(-dis[v],v));
}
}
for (int j=1;j<=n;j++)
if (j!=X[1])
{
int nw=dis[j];
if (nw==inf) continue;
nw+=ss[i-1]-s[i]*(i-2);
ans[j]=min(ans[j],nw-vis[j]*s[i]);
}
tot++;
i=nxt;
}
}
for (int i=1;i<=n;i++) cout<<ans[i]<<'\n';
}
signed main()
{
IOS;
cin.tie(0);
int T=1;
while (T--)
{
BellaKira();
}
}
/*#include<bits/stdc++.h>
#define vc vector
#define pb emplace_back
#define pii pair<int, int>
#define mkp make_pair
#define tup tuple <int, int, int>
#define mkt make_tuple
#define rep(i, a, b) for(int i = (a); i <= (b); ++i)
#define lep(i, a, b) for(int i = (a); i >= (b); --i)
#define int long long
using namespace std;
bool ST;
mt19937 gen(time(0));
inline int read() {
int x = 0, w = 0; char ch = getchar(); while(!isdigit(ch)) w |= (ch == '-'), ch = getchar();
while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar(); return w ? -x : x;
}
const int N = 5e4 + 5, B = 230, inf = 1e16;
int n, m, k, st, key[N], ans[N];
int f[N], g[N], h[N], val[N], ok[N], dp[N][B + 5];
char str[N];
vc <int> G[N], S;
set <pii> slope;
inline void init_g () {
vc <int> vis (n + 1, 0);
rep (i, 1, n) g[i] = inf;
priority_queue <pii, vc <pii>, greater <pii> > Q; Q.push (mkp (g[st] = 0, st));
while (!Q.empty ()) {
auto [d, x] = Q.top (); Q.pop ();
if (vis[x]) continue; vis[x] = 1;
d += (key[x] && x != st);
for (auto y : G[x]) if (!vis[y] && d < g[y])
Q.push (mkp (g[y] = d, y));
}
}
inline void init_f () {
vc <int> vis (n + 1, 0);
priority_queue <pii, vc <pii>, greater <pii> > Q;
rep (i, 1, n)
if (key[i]) Q.push (mkp (f[i] = 0, i));
else f[i] = inf;
while (!Q.empty ()) {
auto [d, x] = Q.top (); Q.pop ();
if (vis[x]) continue; vis[x] = 1;
for (auto y : G[x]) if (!vis[y] && d + 1 < f[y])
Q.push (mkp (f[y] = d + 1, y));
}
rep (x, 1, n) if (key[x]) {
f[x] = 2;
for (auto y : G[x]) if (key[y]) f[x] = ok[x] = 1;
}
}
inline void init_h () {
vc <int> vis (n + 1, 0);
priority_queue <pii, vc <pii>, greater <pii> > Q;
rep (i, 1, n)
if (ok[i]) Q.push(mkp (h[i] = 0, i));
else h[i] = inf;
while (!Q.empty ()) {
auto [d, x] = Q.top (); Q.pop ();
if (vis[x]) continue; vis[x] = 1;
d += (!key[x]);
for (auto y : G[x]) if (!vis[y] && d < h[y])
Q.push (mkp (h[y] = d, y));
}
}
namespace case1 {
inline void solve () {
int lmt = n / k + 1;
rep (i, 0, n) rep (j, 0, lmt) dp[i][j] = inf;
vc < vc<bool> > vis (n + 1, vc <bool> (lmt + 5, 0));
priority_queue <tup, vc <tup>, greater <tup> > Q;
Q.push (mkt (dp[st][0] = 0, st, 0));
int cnt = 0;
while (!Q.empty ()) {
auto [d, x, v] = Q.top (); Q.pop ();
if (vis[x][v]) continue; vis[x][v] = 1;
ans[x] = min (ans[x], d + val[g[x] + v]);
v += g[x] + (key[x] && x != st);
for (auto y : G[x]) if (v <= g[y] + lmt && d + 1 < dp[y][v - g[y]])
Q.push (mkt (dp[y][v - g[y]] = d + 1, y, v - g[y]));
}
}
}
namespace case2 {
inline void dij (int v, int ad, int fl = 0) {
vc< vc <int> > vis (n + 1, vc <int> (2, 0)), dis (n + 1, vc <int> (2, inf));
priority_queue <tup, vc <tup>, greater <tup> > Q;
Q.push (mkt (dis[st][0] = 0, st, 0));
while (!Q.empty ()) {
auto [d, x, u] = Q.top (); Q.pop ();
if (vis[x][u]) continue; vis[x][u] = 1;
ans[x] = min (ans[x], d + ad);
if (u) {
int z = ((key[x] && x != st) ? v : 0) + 1;
if (fl && (key[x] && x != st)) continue;
for (auto y : G[x]) if (d + z < dis[y][1])
Q.push (mkt (dis[y][1] = d + z, y, 1));
}
else {
int w = (key[x] && x != st), z = (fl ? w * val[1] : 0) + 1;
for (auto y : G[x]) if (d + z < dis[y][w])
Q.push (mkt (dis[y][w] = d + z, y, w));
}
}
}
inline void solve () {
dij (inf, 0, 1);
for (auto [u, v] : slope)
dij (v, val[u] - (u - 1) * v);
}
}
bool ED;
signed main() {
cerr << (&ED - &ST) / 1024 / 1024 << "MB ---------------------------" << endl;
n = read (); m = read (); k = read ();
rep (i, 1, n) ans[i] = inf;
for (int i = 1, u, v; i <= m; i++)
u = read (), v = read (), G[u].pb (v), G[v].pb (u);
scanf ("%s", str + 1);
rep (i, 1, n) key[i] = str[i] - '0';
rep (i, 1, k) S.pb (read ()); st = S[0];
init_g ();
init_f ();
init_h ();
// solve function
{
// y = x + h[i]
// y = 2x + f[i] - 2
auto crs = [&] (int u) -> int {
return min (n, max (1ll, h[u] - f[u] + 2));
} ;
vc <int> ad (n + 1, 0); int K = 0, sum = 0, tmp;
rep (i, 1, k - 1) {
sum += f[S[i]];
ad[1] += 2; ad[tmp = crs (S[i])] --;
}
rep (i, 1, n) {
val[i] = sum;
K += ad[i]; sum += K;
if (ad[i]) slope.insert (mkp (i, K));
}
}
if (k > B) case1 :: solve ();
else case2 :: solve ();
rep (i, 1, n) printf ("%lld\n", ans[i]);
return 0;
}
#include<bits/stdc++.h>
#define vc vector
#define pb emplace_back
#define pii pair<int, int>
#define mkp make_pair
#define tup tuple <int, int, int>
#define mkt make_tuple
#define rep(i, a, b) for(int i = (a); i <= (b); ++i)
#define lep(i, a, b) for(int i = (a); i >= (b); --i)
#define int long long
using namespace std;
bool ST;
mt19937 gen(time(0));
inline int read() {
int x = 0, w = 0; char ch = getchar(); while(!isdigit(ch)) w |= (ch == '-'), ch = getchar();
while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar(); return w ? -x : x;
}
const int N = 5e4 + 5, B = 230, inf = 1e16;
int n, m, k, st, key[N], ans[N];
int f[N], g[N], h[N], val[N], ok[N], dp[N][B + 5];
char str[N];
vc <int> G[N], S;
set <pii> slope;
inline void init_g () {
vc <int> vis (n + 1, 0);
rep (i, 1, n) g[i] = inf;
priority_queue <pii, vc <pii>, greater <pii> > Q; Q.push (mkp (g[st] = 0, st));
while (!Q.empty ()) {
auto [d, x] = Q.top (); Q.pop ();
if (vis[x]) continue; vis[x] = 1;
d += (key[x] && x != st);
for (auto y : G[x]) if (!vis[y] && d < g[y])
Q.push (mkp (g[y] = d, y));
}
}
inline void init_f () {
vc <int> vis (n + 1, 0);
priority_queue <pii, vc <pii>, greater <pii> > Q;
rep (i, 1, n)
if (key[i]) Q.push (mkp (f[i] = 0, i));
else f[i] = inf;
while (!Q.empty ()) {
auto [d, x] = Q.top (); Q.pop ();
if (vis[x]) continue; vis[x] = 1;
for (auto y : G[x]) if (!vis[y] && d + 1 < f[y])
Q.push (mkp (f[y] = d + 1, y));
}
rep (x, 1, n) if (key[x]) {
f[x] = 2;
for (auto y : G[x]) if (key[y]) f[x] = ok[x] = 1;
}
}
inline void init_h () {
vc <int> vis (n + 1, 0);
priority_queue <pii, vc <pii>, greater <pii> > Q;
rep (i, 1, n)
if (ok[i]) Q.push(mkp (h[i] = 0, i));
else h[i] = inf;
while (!Q.empty ()) {
auto [d, x] = Q.top (); Q.pop ();
if (vis[x]) continue; vis[x] = 1;
d += (!key[x]);
for (auto y : G[x]) if (!vis[y] && d < h[y])
Q.push (mkp (h[y] = d, y));
}
}
namespace case1 {
inline void solve () {
int lmt = n / k + 1;
rep (i, 0, n) rep (j, 0, lmt) dp[i][j] = inf;
vc < vc<bool> > vis (n + 1, vc <bool> (lmt + 5, 0));
priority_queue <tup, vc <tup>, greater <tup> > Q;
Q.push (mkt (dp[st][0] = 0, st, 0));
int cnt = 0;
while (!Q.empty ()) {
auto [d, x, v] = Q.top (); Q.pop ();
if (vis[x][v]) continue; vis[x][v] = 1;
ans[x] = min (ans[x], d + val[g[x] + v]);
v += g[x] + (key[x] && x != st);
for (auto y : G[x]) if (v <= g[y] + lmt && d + 1 < dp[y][v - g[y]])
Q.push (mkt (dp[y][v - g[y]] = d + 1, y, v - g[y]));
}
}
}
namespace case2 {
inline void dij (int v, int ad, int fl = 0) {
vc< vc <int> > vis (n + 1, vc <int> (2, 0)), dis (n + 1, vc <int> (2, inf));
priority_queue <tup, vc <tup>, greater <tup> > Q;
Q.push (mkt (dis[st][0] = 0, st, 0));
while (!Q.empty ()) {
auto [d, x, u] = Q.top (); Q.pop ();
if (vis[x][u]) continue; vis[x][u] = 1;
ans[x] = min (ans[x], d + ad);
if (u) {
int z = ((key[x] && x != st) ? v : 0) + 1;
if (fl && (key[x] && x != st)) continue;
for (auto y : G[x]) if (d + z < dis[y][1])
Q.push (mkt (dis[y][1] = d + z, y, 1));
}
else {
int w = (key[x] && x != st), z = (fl ? w * val[1] : 0) + 1;
for (auto y : G[x]) if (d + z < dis[y][w])
Q.push (mkt (dis[y][w] = d + z, y, w));
}
}
}
inline void solve () {
dij (inf, 0, 1);
for (auto [u, v] : slope)
dij (v, val[u] - (u - 1) * v);
}
}
bool ED;
signed main() {
cerr << (&ED - &ST) / 1024 / 1024 << "MB ---------------------------" << endl;
n = read (); m = read (); k = read ();
rep (i, 1, n) ans[i] = inf;
for (int i = 1, u, v; i <= m; i++)
u = read (), v = read (), G[u].pb (v), G[v].pb (u);
scanf ("%s", str + 1);
rep (i, 1, n) key[i] = str[i] - '0';
rep (i, 1, k) S.pb (read ()); st = S[0];
init_g ();
init_f ();
init_h ();
// solve function
{
// y = x + h[i]
// y = 2x + f[i] - 2
auto crs = [&] (int u) -> int {
return min (n, max (1ll, h[u] - f[u] + 2));
} ;
vc <int> ad (n + 1, 0); int K = 0, sum = 0, tmp;
rep (i, 1, k - 1) {
sum += f[S[i]];
ad[1] += 2; ad[tmp = crs (S[i])] --;
}
rep (i, 1, n) {
val[i] = sum;
K += ad[i]; sum += K;
if (ad[i]) slope.insert (mkp (i, K));
}
}
if (k > B) case1 :: solve ();
else case2 :: solve ();
rep (i, 1, n) printf ("%lld\n", ans[i]);
return 0;
}
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 3
Accepted
Test #1:
score: 3
Accepted
time: 0ms
memory: 36828kb
input:
3000 3000 3000 2378 2385 1560 2450 189 2980 44 1140 425 1843 167 1563 439 2010 7 951 1311 1370 1305 2085 150 1600 16 2469 431 2674 317 2191 1845 2918 2195 2917 1210 1577 125 1049 911 1160 504 2060 376 2420 1676 2969 1343 1576 284 1869 835 1989 273 1330 234 1906 1482 1524 2415 2460 388 2897 2177 2600...
output:
76 52 40 54 67 54 62 36 44 32 60 61 58 29 34 22 64 25 31 33 14 79 80 58 68 29 67 69 47 60 48 55 45 11 24 51 17 24 47 29 50 57 89 54 62 63 55 61 7 41 61 27 64 60 63 55 44 43 39 48 57 47 65 65 55 43 51 48 22 57 47 28 52 51 50 61 41 61 69 50 41 53 42 58 45 26 60 52 30 56 47 56 32 55 44 58 56 71 69 41 6...
result:
ok 3000 lines
Test #2:
score: 3
Accepted
time: 8ms
memory: 248296kb
input:
30000 30000 30000 11640 15443 5731 12870 5066 28442 11803 29263 2399 20658 4911 11282 676 1962 10390 19686 6117 6722 22155 28614 2932 14721 11403 13488 6697 22434 19113 26975 20347 20663 15743 16072 19116 25652 10891 19389 1373 27384 14607 29107 6192 29223 7196 10267 15467 16280 21828 26032 365 982 ...
output:
2610 3673 15 7659 10149 8209 878 4102 7582 10483 6418 6826 11546 12814 11394 7792 9097 7484 14575 913 5802 584 8172 961 7434 8828 14665 7642 14032 6284 8299 3040 9576 4953 47 13721 10634 3362 9103 4901 4022 11866 14548 5132 9252 13165 143 9494 2845 13149 5616 3023 13560 12315 8126 2002 5706 10657 14...
result:
ok 30000 lines
Test #3:
score: 3
Accepted
time: 28ms
memory: 404464kb
input:
50000 49999 50000 23237 38489 46903 47222 463 17722 5061 37126 21771 23294 4851 25450 408 41933 1298 5353 8952 44686 5842 17741 15835 33052 16401 17274 33117 33174 7070 24079 22424 46115 5336 6340 35165 36940 3308 36325 12014 20182 391 48629 9736 42693 5246 46582 22861 48389 3338 6669 31354 49668 11...
output:
8988 372 12633 8934 15728 15677 431 10910 20467 16345 10441 16923 12383 15090 11112 19353 21485 9819 17810 3071 41 99 8479 9616 1173 13790 1142 14800 19055 675 1086 2353 22330 18271 2373 11286 20247 21236 18133 11260 2792 19399 9049 18056 14190 3523 22890 19479 14288 9335 561 19226 12836 11409 8485 ...
result:
ok 50000 lines
Test #4:
score: 3
Accepted
time: 15ms
memory: 12204kb
input:
49900 50000 100 21419 22725 19367 26559 4942 22766 16196 32249 12443 43575 17415 32668 3559 30282 6024 31186 4553 32107 1085 24970 27857 48472 15126 48937 22784 33748 16961 18301 21066 30382 41567 46191 17677 42298 2910 32294 14609 16464 14131 44143 8413 13472 17266 18767 567 48263 2410 29825 22159 ...
output:
4729 6824 18742 805 16289 4349 1296 5007 15785 15606 18374 4228 1685 19748 16689 7552 13232 5985 19529 7256 13074 6094 12823 7464 19302 3985 5081 4794 2513 6637 10664 6726 11115 11493 10542 4882 2626 10108 17287 690 8100 6464 10436 3789 14356 11646 18179 20174 19124 1188 20268 1232 4167 127 1224 166...
result:
ok 49900 lines
Subtask #2:
score: 7
Accepted
Test #5:
score: 7
Accepted
time: 0ms
memory: 32980kb
input:
3000 3000 3000 1391 1542 299 1578 1346 1528 46 1259 1513 2261 201 1717 56 1635 199 2327 847 882 1977 2161 465 1954 1723 2580 482 2105 906 2207 747 2742 2026 2845 1565 1809 295 311 278 2408 1215 2583 520 832 464 638 1223 1346 1799 2703 1022 2717 887 2160 619 2109 165 2478 879 1343 319 2463 56 815 109...
output:
25 47 29 15 51 29 39 23 47 39 23 39 27 39 5 39 19 26 30 31 43 32 39 86790 24 13 86787 52 31 24 36 22 33 31 32 22 36 43 24 25 30 32 86793 31 49 34 31 31 39 21 33 86793 34 40 23 43 44 37 32 37 48 86790 33 86783 42 46 28 86787 15 47 43 42 41 39 38 14 34 42 33 86775 24 37 36 12 14 28 47 43 34 27 45 41 1...
result:
ok 3000 lines
Test #6:
score: 7
Accepted
time: 16ms
memory: 246180kb
input:
30000 30000 30000 15802 26734 1581 27129 4313 12830 7001 28197 5489 10268 11838 19275 11260 21410 3519 29279 932 23073 8888 28355 17227 29224 1060 5702 20326 25420 1598 14082 15716 27167 4982 19730 4497 8783 15068 19181 7588 9083 4816 21808 15694 24819 4716 27198 14003 15119 5397 11717 3612 20613 24...
output:
24 115 79 159 99 71 180 64 116 142 81 167 114 82 77 198 78 113 174 176 56 201 118 96 94 101 68 230 86 143 87 114 130 176 157 148 28 33 32 118 122 158 109 111 95 94 71 193 64 80 105 104 91 71 66 84 99 106 71 63 79 110 91 156 160 170 109 104 71 90 157 52 164 119 74 64 147 34 52 30 0 100 24 92 64 119 6...
result:
ok 30000 lines
Test #7:
score: 7
Accepted
time: 26ms
memory: 11460kb
input:
50000 49999 125 274 4495 31902 38170 22094 45892 23403 29854 4496 14675 6736 31591 19339 49660 36467 46207 33868 48663 14410 45594 9616 33814 2297 31602 18150 27372 14438 41157 43354 46408 5615 13800 22514 23053 22773 49388 19461 38226 5507 7948 11643 24820 11391 38028 7115 37842 9224 12555 13589 48...
output:
4319 150 1049596 3018 1051387 6808 1048715 1051913 2625 11955 6901 1052632 1900 3878 1049818 1022 12158 1047204 6442 5902 1047367 1049174 6510 9229 6254 1049925 5769 9246 1051028 10434 5546 10747 1049879 3140 10567 5573 4000 1047848 11408 11383 1811 8147 4195 8949 6004 1050586 11951 7123 3888 3658 2...
result:
ok 50000 lines
Test #8:
score: 7
Accepted
time: 27ms
memory: 13808kb
input:
50000 49999 2 26543 34943 12250 26278 6204 24347 36237 39171 11034 49123 7144 33180 2990 25335 2251 39474 31973 45365 33351 34163 10927 47972 3664 14721 4199 43871 27639 42806 10237 16625 1778 45127 10244 19433 35019 48812 20255 21208 5313 29153 26739 37090 11449 15687 44991 45942 4554 30455 28860 3...
output:
382 7478 11481 18981 2544 6193 6969 19085 22018 14003 12388 6715 6439 9079 21756 17912 20366 19619 17354 11694 9872 9970 6126 1758 16802 1706 3430 4090 1718 11345 7684 1093 17573 9008 21625 15160 2181 8417 18895 5862 5353 9266 539 2926 11278 10332 20648 21133 1616 4111 11289 15144 17751 4278 16583 5...
result:
ok 50000 lines
Test #9:
score: 7
Accepted
time: 27ms
memory: 403848kb
input:
49900 50000 42252 31673 34001 3171 49595 37687 48457 25040 31103 4835 47250 25324 40443 21968 40072 23116 45237 17324 31804 3492 39449 22950 37705 3268 26931 18426 38071 4309 20249 11732 38687 11281 24273 4078 5861 1111 2202 36679 39285 7779 49424 17122 41344 18695 19877 16943 36716 17973 48599 2340...
output:
35 53 59 57 59 43 48 53 63 35 32 40 43 41 49 60 67 41 28 48 51 35 43 45 50 39 37 48 61 50 20 44 40 18 39 69 37 39 60 43 27 57 61 35 60 35 59 53 62 60 37 37 40 67 59 61 47 37 65 42 33 65 59 22 47 59 52 52 56 46 68 43 45 73 68 53 45 56 38 34 58 51 58 27 70 57 48 52 35 3 41 21 23 65 42 66 39 49 38 37 6...
result:
ok 49900 lines
Test #10:
score: 7
Accepted
time: 29ms
memory: 12092kb
input:
49900 50000 5 27459 48437 7929 27017 37487 44710 6742 37163 1466 26241 37028 46027 8725 25977 27311 38528 2073 22610 6200 42391 2111 49644 5027 26543 19340 26981 1900 30112 24856 34930 21509 40917 16323 31092 5914 6994 8846 27989 24402 49150 14333 22317 5397 26426 38190 44980 25447 46186 34073 34733...
output:
60 79 48 83 23 78 38 21 71 76 62 76 53 78 62 75 65 73 80 85 88 55 83 72 53 71 78 52 45 63 67 66 75 83 59 59 72 71 42 59 67 64 79 70 73 64 55 75 91 59 66 63 72 69 69 41 77 77 61 68 85 65 84 92 74 47 72 78 89 70 27 88 66 97 68 64 64 59 73 80 72 72 80 67 84 86 48 32 51 59 65 67 14 46 61 61 68 50 86 113...
result:
ok 49900 lines
Test #11:
score: 7
Accepted
time: 20ms
memory: 11424kb
input:
40000 50000 17 3772 28831 3207 27926 16079 20924 1192 20502 4781 22932 2594 4155 6997 20560 29715 38517 16722 39329 1924 21420 23245 34020 10419 18358 27722 27895 16776 32777 27098 34509 2147 36642 6928 22403 11448 21432 14401 36406 5641 8940 11162 22282 8438 38945 13165 19750 4425 36476 9297 24093 ...
output:
3554 1115 523 2944 924 9641 622 5662 2133 8243 1589 3860 8598 9890 8224 717 2726 9149 4097 6536 7566 9219 7143 2894 8978 5611 3848 10088 2698 7656 37 1513 2518 8251 7272 7181 2505 5610 4512 5823 4456 1859 9464 7417 3349 7836 3371 3126 7945 2993 468 3666 7114 3469 5122 5241 6861 4635 10151 7798 4115 ...
result:
ok 40000 lines
Test #12:
score: 7
Accepted
time: 26ms
memory: 12116kb
input:
46732 50000 3 31430 36048 6394 23372 4223 14840 18813 32745 29061 44578 24517 31662 8035 10739 19529 43305 27761 32068 21642 35005 29410 35312 29206 34828 13301 40481 196 26877 5085 26629 5908 31213 28930 44249 30083 39590 4027 28399 348 614 9122 32468 17946 32689 3819 20872 7880 15272 13151 40160 1...
output:
7275 10341 3887 11838 2071 2170 10735 4863 7128 11457 8853 11476 4319 7779 534 4989 7668 577 4441 3542 5979 10977 10798 11562 12796 7918 3748 1869 6102 4342 5062 2595 6833 382 14247 3232 7447 8454 676 4147 2530 12869 8086 13135 1287 13189 9696 14600 13163 5143 4909 6999 3997 6043 962 11680 8044 9146...
result:
ok 46732 lines
Subtask #3:
score: 7
Accepted
Test #13:
score: 7
Accepted
time: 3ms
memory: 33036kb
input:
3000 3000 3000 997 1695 884 1068 654 1853 6 520 947 2382 787 2407 818 1795 2347 2718 46 1560 1180 2169 582 1881 1080 1766 770 2877 365 419 365 749 1315 2536 223 1867 216 545 1311 1952 1598 2796 141 620 1681 2938 301 2204 866 1710 872 961 369 466 2160 2936 2295 2359 1310 1744 1572 2088 1111 2618 1680...
output:
357 518 350 113 154 370 718 974 1389 588 1322 215 670 9 870 488 375 195 1102 149 1373 944 303 508 1217 19 920 646 699 713 1152 1247 555 751 80 50 584 1361 149 921 140 1183 989 667 455 198 180 813 472 71 112 169 331 600 666 31 860 145 1090 207 496 654 825 1330 278 112 690 1152 885 1412 94 96 771 132 ...
result:
ok 3000 lines
Test #14:
score: 7
Accepted
time: 11ms
memory: 248424kb
input:
30000 30000 30000 5947 19048 4004 18741 10068 24221 13216 23775 14185 17633 2653 21744 87 19566 5657 19635 24673 28265 5039 14021 8019 20341 7620 25285 6719 8806 15262 25748 14231 28690 21585 29569 27254 27866 12665 29102 2884 11669 2014 11831 1927 26375 9676 21506 2114 28403 18249 27263 4937 8497 6...
output:
85 57 80 39 77 77 60 56 36 92 75 63 85 80 77 67 16 70 86 82 70 63 80 58 64 54 64 29 20 26 67 74 88 18 86 99 47 60 82 100 67 32 58 59 77 69 61 30 59 61 65 58 49 17 64 24 36 63 88 57 53 78 100 107 63 58 69 66 78 81 1 79 71 48 75 57 18 75 72 82 18 71 47 57 80 45 40 71 17 86 82 72 69 73 82 10 40 75 30 1...
result:
ok 30000 lines
Test #15:
score: 7
Accepted
time: 24ms
memory: 13672kb
input:
50000 49999 441 13752 26461 12830 19173 15097 24108 15105 23445 30568 37149 29121 37388 16853 36388 2332 23106 13884 16343 21870 29420 34697 37322 4611 28878 24104 32433 845 2981 23606 39164 10978 27227 23850 45495 28376 45550 14768 19049 36431 48725 37372 44220 4070 7856 37328 38334 22032 37320 277...
output:
147 109 95 133 85 88 117 115 123 128 118 123 83 105 164 166 47 129 107 57 140 19 92 110 108 121 105 66 107 134 122 39 181 55 91 111 185 149 124 81 96 103 86 137 140 155 99 38 68 118 115 66 102 117 159 203 106 83 144 66 85 103 91 91 78 116 85 111 77 20 90 93 103 87 96 116 72 92 77 140 99 92 46 148 10...
result:
ok 50000 lines
Test #16:
score: 7
Accepted
time: 43ms
memory: 426232kb
input:
50000 49999 1819 2471 2577 9290 38110 20086 47735 9982 19388 24362 37153 24480 24904 35405 40183 10359 24769 18437 22809 36558 41038 12004 42490 14824 43127 2373 47513 13223 23738 2786 21378 18137 39439 9235 40939 11462 25171 28454 42312 7133 12894 3114 41608 15664 21152 1949 30132 27893 49158 15965...
output:
10950620 10951788 10948431 7511 2833 9182 2804 10940177 10944504 10944435 3926 10950515 112 10954024 5774 10938948 10942067 10946790 10944859 1336 10952497 7584 10949791 3377 4760 6474 4125 10953956 10942091 10946179 4328 10949418 10945573 10954282 9627 10946781 10945779 10952220 10949123 10945136 1...
result:
ok 50000 lines
Test #17:
score: 7
Accepted
time: 27ms
memory: 405108kb
input:
50000 49999 35662 26955 36218 13581 14751 24850 29443 8711 12867 2113 39368 11006 18517 27547 49796 32613 38992 736 18363 5915 21396 5976 36537 3332 10378 23828 34508 22434 25441 7039 17333 19565 36142 22079 46132 35400 48037 25620 49983 12577 37381 812 26330 44631 47109 2196 40280 34341 41961 44405...
output:
8842 197696834 197683700 197692919 197691587 3499 197693861 197698070 1657 197697926 197682957 197685669 197696670 833 197691313 5918 197696261 197689530 197697179 197682596 197698239 197692955 197690668 1488 197693440 197682331 197688325 197684863 197686521 197688065 3444 1141 197693436 197690221 1...
result:
ok 50000 lines
Test #18:
score: 7
Accepted
time: 29ms
memory: 12408kb
input:
50000 49999 3 27544 39695 1727 13261 36916 47489 133 35716 1572 16526 294 23844 25944 30678 27331 32683 1665 48942 24907 42045 12297 43901 14231 26892 13329 35892 37419 42213 26243 32826 4989 34909 38725 39667 8824 19308 27956 30610 46104 49848 18530 40063 1464 15635 11932 22836 8616 22371 1035 4056...
output:
77 130 116 174 162 145 204 156 128 134 58 187 107 219 119 150 224 154 147 143 67 167 159 222 217 172 206 140 174 168 190 157 168 155 137 203 89 89 217 173 121 160 117 116 153 203 239 166 129 149 219 148 134 203 144 81 216 203 214 144 96 56 146 168 198 74 146 149 158 148 164 203 105 196 132 204 137 1...
result:
ok 50000 lines
Test #19:
score: 7
Accepted
time: 28ms
memory: 11460kb
input:
49900 50000 14 41964 44331 13443 42333 12584 20671 19574 34793 6894 12858 12691 27150 44610 44715 4224 38194 7501 32051 8972 45912 7732 42068 7894 13851 16234 40002 25095 42385 14616 40804 11411 19931 4165 18064 40764 44230 6450 21888 13938 44908 38295 43370 18578 39073 6445 25729 252 9463 9443 4637...
output:
58 64 57 58 57 51 49 71 70 61 43 54 78 51 20 54 76 33 56 67 66 78 41 43 41 13 31 30 74 52 45 49 67 50 68 69 42 50 42 37 31 72 57 71 47 67 56 59 65 52 52 74 54 65 66 48 59 55 61 56 61 45 46 82 31 46 57 23 61 43 64 47 19 63 75 37 69 33 57 83 70 34 57 49 72 42 52 59 61 72 48 58 43 62 62 54 50 30 53 66 ...
result:
ok 49900 lines
Test #20:
score: 7
Accepted
time: 24ms
memory: 404664kb
input:
49900 50000 33833 466 31724 2149 2400 18808 43566 22463 25268 20029 22550 2926 36949 636 37271 36418 40182 4792 29770 29446 42808 4942 40003 8697 48739 10008 15875 4438 5839 996 9051 35956 48843 674 28966 8213 39747 29648 46265 29046 30440 5654 40057 1673 47256 32866 38436 5336 41720 17762 38323 316...
output:
159677292 159671932 2160 159666381 159674687 159663698 8105 159675700 6213 159672636 159675843 159674981 159675699 159664031 159665896 159674000 866 7360 159675846 159673232 159674259 159671817 1264 148 159668209 1398 159674937 159673557 159666978 2589 159672832 8269 159673787 3927 159671856 1575 20...
result:
ok 49900 lines
Test #21:
score: 7
Accepted
time: 7ms
memory: 88608kb
input:
10000 50000 8648 6340 7527 138 2772 5690 9264 1603 5328 8582 8948 3180 9235 1862 9332 4000 6468 494 4206 3292 9424 7934 8594 5246 9983 7961 9638 5857 6471 4389 8304 2096 5484 1493 3363 2584 9711 5483 6819 2416 7069 674 6191 1845 2190 3109 8571 3399 8305 4208 5776 1150 7253 4262 9573 6600 6842 1569 9...
output:
4 4 3 4 5 4 5 5 5 4 4 4 3 5 4 4 4 4 4 3 4 4 5 4 5 4 4 3 4 4 4 4 5 5 4 4 5 5 4 5 3 4 4 4 5 4 4 5 4 3 4 5 4 3 3 4 4 4 5 4 4 4 4 3 3 4 4 3 3 4 3 4 3 4 4 3 4 4 4 4 4 5 4 5 4 4 4 4 4 5 4 4 4 4 4 4 5 3 3 4 4 4 3 5 3 4 4 4 3 3 2 3 5 4 5 5 5 3 5 4 3 4 4 5 4 4 5 4 4 3 4 5 4 4 4 4 4 4 4 3 5 5 4 3 4 3 4 4 5 2 ...
result:
ok 10000 lines
Test #22:
score: 7
Accepted
time: 10ms
memory: 9768kb
input:
10000 50000 2 3513 6248 3726 6687 674 6785 1305 9942 2227 8671 3511 7167 2173 9164 1485 1875 2074 5522 529 9104 6605 8331 1794 8490 5655 7413 7500 9009 1513 8563 1118 9881 4823 8914 1273 8122 1014 2961 5750 9452 4717 7762 5219 5611 5734 6904 3236 4657 5396 8631 4887 5072 4318 8863 1632 9086 3888 530...
output:
5 4 4 5 4 4 5 4 4 5 5 3 5 4 3 5 5 4 5 4 5 5 4 4 4 4 4 4 4 5 4 4 4 4 4 4 4 4 4 4 4 5 4 4 5 5 5 4 4 4 4 5 5 4 3 5 4 4 5 4 4 5 4 4 5 4 5 5 5 4 4 5 4 5 4 5 3 4 4 4 3 4 4 4 6 5 4 4 3 5 4 5 4 3 4 5 5 5 5 5 5 5 5 5 4 5 4 4 4 4 4 5 4 5 4 5 4 5 5 5 4 4 3 4 3 4 5 4 5 4 4 5 5 5 4 3 4 5 5 4 5 4 4 5 3 4 4 5 4 3 ...
result:
ok 10000 lines
Subtask #4:
score: 19
Accepted
Test #23:
score: 19
Accepted
time: 0ms
memory: 8168kb
input:
1500 3000 2 432 1120 324 1221 37 294 50 931 588 1149 178 887 460 517 268 533 649 935 123 1291 642 1025 1145 1489 630 1375 163 1407 842 1004 155 1300 296 1049 380 840 215 1224 283 981 211 1056 75 725 325 1437 591 680 1179 1253 876 1425 382 1230 1065 1436 612 784 121 770 349 633 140 1168 443 1019 103 ...
output:
6 6 7 4 5 5 6 3 5 7 5 6 5 5 5 6 6 6 3 5 5 6 3 6 5 6 3 3 6 6 5 6 4 5 7 6 6 6 5 2 5 5 6 5 4 7 4 4 5 5 5 7 6 5 5 3 6 6 5 5 6 5 6 4 5 6 4 7 3 6 6 4 5 5 4 7 6 6 6 7 5 3 5 6 4 6 4 6 4 6 4 6 5 6 3 4 6 4 5 3 6 5 6 7 4 6 5 6 7 5 4 6 5 5 6 6 6 4 5 5 6 4 4 6 6 6 6 6 6 6 6 5 6 6 5 6 4 6 5 6 6 6 6 5 7 4 6 4 6 5 ...
result:
ok 1500 lines
Test #24:
score: 19
Accepted
time: 0ms
memory: 7976kb
input:
3000 2999 5 1183 2619 603 1077 245 1639 988 1253 70 2760 2292 2975 2483 2998 851 1914 214 968 1902 2025 1636 2835 62 2320 2082 2708 267 1972 613 2739 1273 2062 2173 2928 1028 1532 417 2184 291 899 608 2280 922 1566 670 1218 1023 1213 1193 2777 1142 2410 532 1558 67 1473 1041 1652 146 1877 727 2468 5...
output:
79 79 73 72 58 44 91 58 84 78 57 26 82 33 20 109 42 73 114 63 87 59 75 42 87 117 71 56 97 17 29 87 105 40 107 143 44 41 83 101 22 13 88 97 19 40 71 70 15 113 89 97 64 90 66 112 28 88 126 56 50 17 115 17 69 83 92 23 48 135 50 53 77 71 88 87 93 54 25 15 112 69 73 30 72 66 10 66 88 67 67 90 74 78 75 28...
result:
ok 3000 lines
Test #25:
score: 19
Accepted
time: 0ms
memory: 9932kb
input:
3000 2999 376 1269 2828 540 2100 459 2192 1176 2286 1449 1461 2568 2836 511 1436 1580 2036 1623 1837 554 2879 2222 2286 1316 2997 280 337 870 1575 77 2864 10 1424 588 2960 677 2959 254 548 691 1544 346 1337 591 2329 151 1896 305 2577 742 819 1544 2646 679 2071 219 2786 1732 2454 61 1247 1535 2704 10...
output:
684 874 611 580 355 22 246 797 0 415 770 67087 853 67274 298 68077 884 433 110 68087 67193 293 67294 323 705 221 696 67242 33 62 858 242 58 67176 67031 29 67210 67036 67136 805 267 759 28 239 67064 68055 67036 336 67107 67022 316 442 234 703 766 113 373 184 68070 29 717 59 67128 214 825 409 201 6809...
result:
ok 3000 lines
Test #26:
score: 19
Accepted
time: 4ms
memory: 8044kb
input:
2990 3000 25 926 979 752 2267 861 2664 92 2235 1338 1549 5 1674 394 2828 198 2419 328 1655 2230 2675 1946 2452 1460 2590 306 2972 27 1195 1755 2511 38 1631 1518 1734 2799 2869 54 514 1022 2346 410 845 491 2867 1604 2130 666 1955 817 1398 1738 2230 220 495 595 771 470 2755 413 2945 1437 2785 2545 276...
output:
91 109 165 96 123 129 155 223 166 164 99 195 129 276 192 6 193 256 207 105 322 245 208 268 329 251 246 240 97 223 199 97 159 328 52 61 8 160 221 244 0 216 61 309 190 119 63 276 89 226 255 100 286 12 225 224 303 171 220 107 281 84 195 66 164 93 257 131 250 151 170 248 131 98 131 93 129 7 60 280 275 9...
result:
ok 2990 lines
Test #27:
score: 19
Accepted
time: 3ms
memory: 8112kb
input:
2000 3000 14 1723 1954 51 1183 799 1742 871 1087 676 1997 1886 1899 1513 1564 707 1128 222 1168 482 1740 855 1066 550 794 273 1511 986 1515 424 1672 1610 1621 234 563 693 1022 472 624 959 1123 1145 1588 236 514 731 1361 179 608 174 1607 489 1501 945 1757 681 1911 139 1343 1542 1741 1413 1577 1122 16...
output:
1058 550 906 1731 1423 446 1329 951 1557 599 544 478 271 1549 1360 441 546 473 113 53 303 305 207 183 600 993 1404 1585 1733 1645 1427 1008 824 1552 198 1418 8 1170 957 908 162 866 341 910 737 828 1041 1252 505 1478 450 1157 1633 312 1087 1366 467 1026 273 128 385 613 132 1631 690 822 1244 112 1238 ...
result:
ok 2000 lines
Test #28:
score: 19
Accepted
time: 2ms
memory: 9964kb
input:
2000 3000 10 150 1892 195 1292 917 1351 1099 1320 173 1902 388 1264 478 1558 366 1590 1837 1981 789 1209 879 1066 930 989 658 965 238 1597 1153 1162 1061 1092 13 640 1142 1396 1885 1924 294 1959 612 1557 156 1523 409 852 973 1143 195 1368 12 1152 14 423 735 1259 586 1563 669 1266 608 1971 74 1552 26...
output:
149 350 478 4 461 288 495 454 504 316 487 341 238 517 22 84 58 454 186 201 312 465 229 259 268 283 365 239 308 158 516 47 519 240 75 180 448 30 122 23 94 278 80 463 299 130 306 216 507 339 479 487 56 6 261 239 52 377 8 257 268 81 125 10 18 75 420 24 201 312 366 43 508 131 428 31 510 125 361 233 138 ...
result:
ok 2000 lines
Test #29:
score: 19
Accepted
time: 0ms
memory: 22580kb
input:
1500 3000 2040 408 1258 481 1455 313 691 517 975 167 776 123 500 87 104 88 718 1006 1271 264 995 238 806 153 883 828 1280 550 766 1050 1208 515 1300 714 976 883 1441 812 1248 121 1267 1380 1430 1030 1145 390 895 459 541 743 1034 604 929 1080 1440 920 1002 515 1017 454 980 233 1434 669 1298 859 1077 ...
output:
4 4 5 6 6 6 6 5 7 5 3 6 5 6 4 5 7 6 6 5 5 6 4 8 7 5 6 6 5 4 4 8 6 7 5 5 5 6 5 6 6 4 5 6 5 5 4 5 5 6 7 3 7 6 6 5 5 6 4 5 3 4 6 5 5 6 6 6 5 6 6 6 6 7 6 6 5 6 6 3 4 5 4 6 5 6 6 3 4 7 7 6 6 6 4 5 6 6 4 5 8 5 6 5 6 6 5 5 6 6 5 6 7 4 5 7 6 6 6 5 6 5 6 7 6 6 6 6 7 7 5 6 7 6 7 5 6 4 8 6 7 7 6 6 7 5 4 6 5 7 ...
result:
ok 1500 lines
Test #30:
score: 19
Accepted
time: 3ms
memory: 35176kb
input:
3000 3000 3000 1528 2408 111 2158 441 1045 1694 2126 2919 2988 1756 1793 7 916 474 704 396 1861 716 2441 58 211 664 1295 325 1675 1175 1335 1564 1946 166 1623 1432 2641 129 1407 169 1865 839 2184 696 1366 640 1443 1555 1680 302 2348 1347 2113 2054 2567 2829 2881 1579 2042 298 1123 1303 2476 181 655 ...
output:
81001 138001 72001 105001 129001 93001 120001 165001 141001 135001 147001 63001 138001 60001 108001 159001 144001 60001 111001 63001 150001 138001 78001 144001 132001 138001 69001 60001 75001 66001 183001 48001 165001 75001 162001 138001 90001 84001 87001 99001 108001 171001 165001 84001 135001 4800...
result:
ok 3000 lines
Test #31:
score: 19
Accepted
time: 2ms
memory: 10316kb
input:
2244 3000 2 1428 1429 1943 1946 687 689 913 914 1454 1455 608 609 917 919 2119 2120 423 424 2021 2023 116 120 1246 1249 2042 2043 211 212 1636 1639 327 330 116 117 1637 1638 1965 1966 1873 1875 433 435 1411 1412 631 634 1719 1720 363 364 2114 2115 970 971 665 666 779 780 596 597 1757 1758 993 995 12...
output:
1373 1372 1372 1371 1370 1370 1369 1368 1368 1367 1366 1366 1364 1365 1364 1363 1362 1362 1361 1360 1360 1359 1359 1358 1358 1357 1356 1356 1355 1354 1354 1352 1353 1350 1352 1351 1350 1348 1349 1348 1347 1346 1346 1345 1344 1344 1343 1343 1342 1342 1341 1341 1340 1340 1339 1338 1338 1336 1337 1336 ...
result:
ok 2244 lines
Test #32:
score: 19
Accepted
time: 2ms
memory: 9904kb
input:
2267 3000 2 1351 1352 287 288 2202 2204 814 816 2056 2057 923 927 1757 1758 901 902 431 432 1510 1511 147 150 787 788 1192 1193 130 134 2166 2167 129 131 1062 1064 917 920 1990 1991 1948 1949 990 994 1525 1526 81 83 1652 1653 401 403 1332 1333 1485 1487 136 138 192 193 189 191 1189 1190 1853 1854 93...
output:
405 407 407 406 403 405 404 401 403 402 401 399 400 397 399 399 398 395 397 396 393 395 394 391 393 392 389 391 390 389 387 388 387 385 386 385 383 384 383 381 382 381 379 380 379 377 378 377 375 376 375 374 373 373 372 371 371 369 370 369 367 368 365 367 366 365 363 364 363 362 361 361 359 360 357 ...
result:
ok 2267 lines
Test #33:
score: 19
Accepted
time: 2ms
memory: 10088kb
input:
2403 3000 3 2375 2376 1467 1468 565 570 302 306 450 451 522 523 2333 2334 1606 1607 341 342 1684 1685 331 332 61 62 706 707 299 300 1809 1810 1062 1063 769 773 73 74 234 235 408 410 1780 1781 865 866 829 831 139 141 1542 1543 1992 1993 957 958 449 452 1944 1945 1840 1841 1486 1491 1083 1084 2071 207...
output:
1350 1352 1351 1347 1350 1349 1348 1344 1347 1346 1345 1344 1341 1343 1342 1341 1338 1340 1339 1338 1335 1337 1336 1332 1335 1334 1333 1332 1329 1331 1330 1326 1329 1329 1328 1327 1323 1326 1326 1325 1324 1320 1323 1322 1321 1320 1317 1319 1318 1317 1314 1316 1315 1311 1314 1314 1313 1312 1308 1311 ...
result:
ok 2403 lines
Test #34:
score: 19
Accepted
time: 0ms
memory: 8196kb
input:
2497 2995 4 1641 1642 1004 1005 1121 1126 1314 1315 2490 2491 2336 2338 1664 1670 565 566 1577 1578 1147 1148 1090 1091 2304 2310 2236 2238 334 336 1513 1514 1712 1713 1138 1139 1648 1649 1135 1137 1241 1245 567 568 2044 2045 2047 2048 842 843 1291 1292 124 126 1340 1344 612 614 1833 1834 453 454 86...
output:
1225 1225 1224 1223 1221 1222 1221 1220 1219 1218 1217 1217 1216 1215 1213 1214 1213 1212 1209 1211 1210 1209 1205 1208 1207 1206 1205 1201 1204 1203 1202 1201 1200 1197 1199 1198 1197 1193 1196 1195 1194 1193 1189 1192 1191 1190 1189 1185 1188 1187 1186 1185 1181 1184 1183 1182 1177 1181 1180 1179 ...
result:
ok 2497 lines
Test #35:
score: 19
Accepted
time: 0ms
memory: 9956kb
input:
2742 2991 10 1913 1914 1397 1398 2683 2684 2187 2188 1824 1825 1209 1210 834 835 2388 2389 529 530 879 881 498 499 1490 1491 202 203 854 855 1136 1137 2077 2078 1842 1843 473 483 1967 1968 253 254 2125 2126 722 723 514 515 884 885 302 313 570 571 943 944 1315 1316 1071 1072 1557 1558 32 33 93 94 837...
output:
525 527 526 525 524 523 522 521 520 519 518 517 515 516 515 514 513 512 511 510 509 508 507 506 505 505 504 503 502 501 500 499 498 497 495 496 495 494 493 492 491 490 489 488 487 486 485 485 484 483 482 481 480 479 478 477 476 475 475 474 473 472 471 470 469 468 467 466 466 465 464 463 462 461 460 ...
result:
ok 2742 lines
Test #36:
score: 19
Accepted
time: 0ms
memory: 7932kb
input:
3000 3000 2 1727 2505 72 1472 1664 2340 1703 2262 1359 2007 431 2090 191 300 91 642 1988 2803 593 602 1436 2696 568 1759 65 354 1593 1952 2052 2489 132 2894 1190 1199 526 1762 1802 1938 2226 2765 802 1357 472 1744 3 2331 1965 2578 1182 2347 1833 2280 290 2692 2476 2835 509 2202 1576 2164 249 1125 18...
output:
358 952 441 762 1006 1380 838 1391 1420 1480 1481 919 612 987 708 716 1185 1427 848 98 562 521 668 1394 207 164 13 1347 24 465 226 269 1340 944 1158 1233 700 796 834 791 1169 448 107 1449 54 136 1430 25 208 105 1322 316 919 26 831 1265 561 274 295 953 396 843 543 1106 333 399 56 1020 498 655 1447 19...
result:
ok 3000 lines
Test #37:
score: 19
Accepted
time: 6ms
memory: 10164kb
input:
3000 3000 50 1443 2318 1665 1972 245 1795 889 1012 1988 2779 2271 2403 2292 2843 290 492 722 1502 569 2100 291 1794 47 2025 1383 1461 306 1592 478 2598 1959 2440 379 856 1414 1467 1567 2322 1575 2653 2535 2884 1224 1771 1177 1706 1724 2286 795 2407 356 1284 1884 1915 1233 1853 1545 2423 74 1774 1373...
output:
1912 352 82 254 675 1143 2816 140 32 1216 1987 1582 935 1455 1759 812 189 726 343 2131 2003 1238 161 2788 1986 2109 2359 1877 235 2060 904 1028 860 2405 3103 1163 2143 259 2702 1656 336 718 2149 2397 2419 341 715 1343 1158 1460 2112 1328 463 1976 1663 593 2760 65 736 1376 27 2457 877 3101 2057 2436 ...
result:
ok 3000 lines
Test #38:
score: 19
Accepted
time: 10ms
memory: 8008kb
input:
3000 3000 100 597 660 550 1131 654 2848 1387 2474 1173 2889 33 2948 1155 1170 256 520 547 2829 1050 1252 303 746 837 1081 53 1376 1618 2769 1007 2250 2041 2328 1504 2441 213 433 314 1004 40 2766 1977 2626 527 2530 1016 1453 1327 1567 1884 2943 322 708 2474 2706 460 1872 1517 1794 1382 1880 1382 2355...
output:
2251 181 1044 426 843 31 670 329 28 2298 2038 208 147 821 1899 179 247 1396 226 2283 5172 2267 903 2032 9537 1088 6930 812 1366 892 2313 2547 2536 2169 2050 290 284 3437 2695 1759 1532 1916 223 1038 315 1749 493 2256 747 1725 4610 2095 2021 2672 10624 61 79 676 1421 1718 2643 980 1298 441 164 943 99...
result:
ok 3000 lines
Test #39:
score: 19
Accepted
time: 18ms
memory: 7972kb
input:
3000 3000 250 1528 1764 99 2184 2024 2541 1153 1885 747 2534 81 2172 2217 2878 152 2284 1703 2432 526 690 1028 1990 679 2700 154 2975 667 1915 1709 2269 340 2995 578 2992 808 2867 855 1827 567 1156 662 2289 1850 2080 2271 2852 67 784 597 1543 63 365 1852 2367 1548 2159 1642 2277 471 2604 1584 2097 8...
output:
37357 15594 619 6565 4 2092 1101 57625 4576 54572 1981 245 31219 2195 340 1383 2008 940 12 465 1802 1364 1736 387 1237 1572 30377 1703 1742 580 10519 1745 55462 236 2231 43743 1350 38222 2135 450 1265 1506 1319 356 1602 1828 1937 31691 1915 2155 1750 31 737 53681 6295 1095 55424 687 144 623 1024 436...
result:
ok 3000 lines
Test #40:
score: 19
Accepted
time: 2ms
memory: 8248kb
input:
2998 2998 2 319 860 194 1950 1556 1883 1622 2210 541 1156 868 2612 2018 2350 5 1172 259 1292 835 1272 48 134 1168 2008 1055 1840 53 1166 1386 2829 1109 2865 2195 2487 2465 2662 2049 2623 9 2385 90 1517 230 521 1711 2220 459 2917 539 1718 1100 2810 253 1451 621 2045 1082 2548 197 2866 718 2563 673 20...
output:
2051 1639 979 1613 1307 2709 1862 2205 1829 2325 1406 1982 410 1493 2739 2593 110 2253 523 359 2727 2287 467 848 965 2101 1086 1012 1852 2039 488 2742 2788 1497 2028 1390 57 2881 538 2212 427 1612 714 62 2183 2267 1098 396 15 2079 1538 2450 186 1916 2545 2821 9 1729 611 612 2893 2312 2142 1514 830 7...
result:
ok 2998 lines
Test #41:
score: 19
Accepted
time: 3ms
memory: 9924kb
input:
2998 2998 10 1337 2347 907 1782 1626 2481 1718 2400 640 2652 625 1748 464 1569 1782 2747 1495 1516 543 1034 97 2831 680 925 1722 2798 1550 2307 190 1048 618 819 2467 2656 466 1161 1912 2076 2340 2916 1907 2284 1561 1588 1037 1243 386 559 1232 1240 1539 2055 1752 2197 1047 1111 25 2884 1688 2634 626 ...
output:
555 10793 246 82 9640 9750 10039 526 1 9968 834 9233 987 9368 10381 566 10195 9085 631 112 10206 9378 10607 10839 338 10603 10032 787 9725 10326 9523 539 8971 817 9923 8970 627 9321 455 476 10791 10485 373 10347 10807 10071 10576 9396 255 10468 9990 9007 36 629 311 83 10112 10328 10175 9931 9062 935...
result:
ok 2998 lines
Test #42:
score: 19
Accepted
time: 0ms
memory: 8212kb
input:
2998 2998 100 148 1783 155 830 2527 2675 404 1784 926 951 533 2141 147 2675 691 2742 1183 2957 418 814 303 1723 2582 2643 1251 1909 1900 2532 2172 2713 767 2498 1724 2659 1764 2341 782 1616 189 421 186 1710 284 1926 1107 1426 328 1124 1503 1838 1304 1684 608 2106 1354 2008 1466 2657 1707 2478 915 97...
output:
745 98881 99463 98609 182 98728 273 97575 97961 984 98790 97585 25 731 99365 824 99180 98303 303 98253 862 98938 98453 4 494 98307 98711 99266 98714 190 99406 98317 97886 99211 98910 98862 99089 306 640 99371 97630 642 98419 424 356 750 98426 442 97767 98007 972 98535 132 98328 347 564 99205 98151 9...
result:
ok 2998 lines
Test #43:
score: 19
Accepted
time: 0ms
memory: 34852kb
input:
3000 2999 3000 1040 1690 368 2961 1699 2478 1353 1650 1707 1856 1608 2417 2760 2872 629 2691 1259 1609 853 1863 440 1894 2051 2462 368 2037 1458 1722 925 1032 697 2369 22 1102 1498 1601 285 2358 1356 2653 435 2347 1093 1783 354 2611 2257 2559 1103 1930 1308 1867 964 1084 422 1306 1421 2473 235 1051 ...
output:
8637001 1029001 5967001 8337001 3609001 3480001 8616001 2877001 3606001 4317001 1026001 7578001 8835001 4260001 2538001 153001 1698001 8970001 2292001 7281001 1887001 7200001 3045001 8538001 1746001 975001 8823001 3390001 2244001 3018001 7089001 5646001 8367001 807001 4197001 3336001 8379001 6519001...
result:
ok 3000 lines
Subtask #5:
score: 23
Accepted
Test #44:
score: 23
Accepted
time: 28ms
memory: 12308kb
input:
50000 49999 2 25634 31370 8027 24849 12312 23307 3731 32856 28725 29829 23424 44542 9950 43281 17138 22049 29393 31047 24061 46387 861 3924 12114 24868 29242 36744 5090 11267 3946 26100 7151 22151 27368 49971 43548 44917 25373 45846 4117 43120 24675 34139 9043 21081 29857 41278 37558 41510 11300 402...
output:
114 120 159 152 68 38 72 118 129 123 155 95 61 164 142 103 72 58 122 97 89 73 64 57 174 59 67 114 111 99 122 60 100 61 20 112 104 103 114 168 113 70 104 93 105 49 118 119 111 177 91 88 87 102 162 146 94 178 108 87 98 130 90 152 41 71 61 145 77 79 94 70 133 80 89 124 122 105 67 38 133 173 118 126 85 ...
result:
ok 50000 lines
Test #45:
score: 23
Accepted
time: 33ms
memory: 13808kb
input:
50000 49999 2 43895 48944 8580 43793 5509 33075 15981 49586 724 31051 32635 49692 4755 18049 14056 49273 29520 41218 6544 23864 43813 44446 9124 23567 7289 30800 4062 49229 35718 49417 2991 12579 4020 36609 33183 42312 2126 12426 1152 49261 33185 37634 42 3540 28164 28325 8375 41142 14587 25165 2779...
output:
22033 26533 379 6609 11251 5059 7698 25028 18355 28058 18344 19986 7376 1693 15178 13059 9315 26184 27508 16488 23505 3264 21131 3137 20079 27632 28801 11775 187 12780 26366 29802 26641 13180 7867 9604 23866 19475 4660 4123 13002 25059 21917 19394 28016 28672 19448 12000 20191 28263 8952 5688 28968 ...
result:
ok 50000 lines
Test #46:
score: 23
Accepted
time: 24ms
memory: 11952kb
input:
49950 50000 2 4566 37999 20188 25612 30193 43510 25668 36562 28256 43823 20772 29329 16661 37612 70 48595 33 17367 25778 37077 4934 34483 11295 15609 7376 41523 7796 45967 26467 42262 36278 46521 25896 30329 4435 24881 15142 33287 11683 35540 18305 23196 2597 34080 2122 49079 19179 35816 18617 48301...
output:
764 8452 8468 7140 7241 8980 2754 12524 1411 13960 6656 4755 4200 9225 3500 14506 1777 5644 12460 5955 2527 5071 3412 4282 738 2690 7192 316 1911 8195 3754 2194 14991 4168 4704 15389 11089 2510 8415 5640 3920 10944 13159 11051 3133 5710 10000 2214 955 7407 2225 10109 9732 4737 9027 11810 1913 10206 ...
result:
ok 49950 lines
Test #47:
score: 23
Accepted
time: 32ms
memory: 15244kb
input:
49900 50000 2 22337 34344 3402 42937 21720 34588 19022 34787 5343 18877 43238 43267 2703 20471 18279 47773 47688 48623 13892 29391 8358 23684 9414 25609 32166 34324 16261 22849 48362 48667 2505 34154 178 31736 22256 30061 20580 23750 5141 42669 22569 47226 12171 17545 3389 44447 27268 44611 20016 49...
output:
70 105 86 76 106 93 93 100 74 102 114 75 102 94 55 141 114 68 79 115 110 111 96 101 82 67 119 157 100 59 76 96 128 123 103 83 89 104 87 81 145 122 91 117 103 100 122 112 110 93 185 114 87 95 92 70 124 111 118 111 67 119 53 122 88 83 88 93 90 66 110 127 81 123 79 73 89 67 92 157 70 153 90 87 154 77 8...
result:
ok 49900 lines
Test #48:
score: 23
Accepted
time: 39ms
memory: 12412kb
input:
49900 50000 2 8945 34436 5791 11132 31531 44584 21729 40859 3593 28551 17705 23650 7484 45899 20901 44241 24239 37340 41319 48171 33711 45870 26192 48145 33147 48485 15401 17979 43789 46041 14128 23036 24414 33691 1261 9507 1602 2275 6929 33729 19562 46463 5863 25796 4545 31674 10670 39250 3973 2931...
output:
86 72 56 43 81 72 68 101 70 71 48 49 41 55 52 41 55 61 55 56 75 65 62 78 54 50 57 87 57 25 68 46 65 80 65 59 55 50 50 67 65 87 52 110 76 40 53 62 56 82 71 81 47 60 90 43 61 55 82 42 80 68 52 75 60 47 43 54 47 49 58 87 68 57 52 13 57 96 69 70 65 60 67 47 77 66 67 81 81 19 67 67 81 82 61 18 69 71 57 7...
result:
ok 49900 lines
Test #49:
score: 23
Accepted
time: 23ms
memory: 13076kb
input:
40000 50000 2 15314 17433 3269 19902 20689 23398 13792 23631 9469 35552 2011 2942 746 10547 2487 34970 10637 38858 13754 29351 4195 37154 9693 21108 16406 18812 16694 18823 18173 21541 5995 30185 27088 27533 1798 8110 5478 23675 21259 34392 17486 32860 1662 11587 13795 17385 23329 39617 5911 29267 3...
output:
2836 7313 9014 3462 7796 277 781 4615 1523 8883 1851 9220 7558 3362 6405 7328 1454 2540 4326 4869 5001 7638 8815 2451 5857 7829 5231 1596 964 8995 7490 5987 3705 8993 5950 2439 3185 3224 3959 471 1979 1740 2697 1244 5464 6605 3670 77 4659 2650 231 2274 780 3113 2665 3346 325 4842 4022 3206 5059 5000...
result:
ok 40000 lines
Test #50:
score: 23
Accepted
time: 11ms
memory: 11892kb
input:
10000 50000 2 4769 8553 3189 3302 5295 5915 3232 8063 2497 2904 6120 9199 5732 5853 5566 7061 3602 3669 2483 2996 3329 9775 4918 5767 4841 9426 707 2875 7974 9037 838 7532 7718 8738 1940 4710 5055 8052 5576 5900 2474 5642 2425 5640 4743 9451 5480 7134 3055 4504 1492 2983 3403 9933 3004 9056 5167 831...
output:
4 4 5 4 4 4 4 5 4 5 5 5 4 5 4 4 5 4 4 4 5 4 4 5 5 4 4 4 4 5 2 4 5 4 5 5 4 5 4 5 3 5 4 5 4 4 5 4 5 4 4 5 5 4 4 4 5 5 4 6 4 4 3 5 5 3 4 4 4 4 5 4 5 5 5 4 5 4 5 4 4 5 3 4 4 5 5 5 5 4 4 4 5 5 5 4 3 4 4 4 4 5 5 5 4 5 4 5 5 5 4 5 5 5 3 5 4 4 5 4 4 4 2 5 4 4 4 5 5 5 4 4 5 4 5 5 5 5 4 4 5 5 4 5 5 4 4 5 4 4 ...
result:
ok 10000 lines
Test #51:
score: 23
Accepted
time: 17ms
memory: 10096kb
input:
22501 29998 2 5690 5692 5827 5829 173 174 8464 8466 18880 18882 22428 22429 9080 9081 22110 22111 22157 22158 16632 16633 5 7 6711 6712 20632 20634 10266 10268 21350 21351 3863 3865 2829 2831 16225 16227 12326 12328 4836 4838 1402 1403 10303 10305 5283 5285 2505 2506 1842 1843 7341 7345 5889 5891 91...
output:
14069 14070 14069 14067 14068 14065 14067 14067 14066 14063 14065 14064 14061 14063 14063 14062 14059 14061 14061 14060 14057 14059 14058 14057 14055 14056 14055 14054 14053 14053 14052 14051 14051 14050 14049 14049 14048 14047 14047 14046 14045 14045 14044 14043 14043 14042 14041 14041 14040 14039 ...
result:
ok 22501 lines
Test #52:
score: 23
Accepted
time: 18ms
memory: 10456kb
input:
22475 29996 2 17831 17832 15418 15420 15454 15455 22210 22211 9271 9272 5230 5231 18530 18533 5155 5157 21425 21426 47 48 7346 7348 14784 14788 10558 10560 18455 18459 4779 4781 3942 3944 17036 17037 15669 15671 22118 22120 3529 3531 14496 14500 14059 14060 16731 16733 21240 21241 21947 21948 4637 4...
output:
11255 11254 11253 11253 11252 11251 11251 11250 11249 11249 11248 11248 11247 11246 11246 11245 11244 11244 11243 11242 11242 11241 11241 11240 11240 11239 11239 11238 11237 11237 11235 11236 11235 11234 11233 11233 11232 11231 11231 11229 11230 11227 11229 11229 11228 11225 11227 11226 11223 11225 ...
result:
ok 22475 lines
Test #53:
score: 23
Accepted
time: 31ms
memory: 13828kb
input:
37470 49998 2 4907 4908 20913 20914 16427 16428 6983 6985 20872 20874 30948 30949 9144 9148 18266 18267 7593 7594 25528 25531 15133 15135 5510 5512 17445 17446 31898 31899 27296 27298 12805 12806 25420 25421 14426 14430 24158 24160 2948 2949 8702 8703 21739 21741 1613 1614 7995 7997 11358 11362 8061...
output:
4865 4866 4863 4865 4864 4863 4861 4862 4859 4861 4860 4857 4859 4859 4858 4855 4857 4856 4855 4853 4854 4853 4852 4851 4851 4850 4849 4849 4848 4848 4847 4847 4846 4845 4845 4844 4843 4843 4842 4842 4841 4841 4840 4839 4839 4838 4838 4837 4836 4836 4835 4834 4834 4832 4833 4832 4830 4831 4828 4830 ...
result:
ok 37470 lines
Test #54:
score: 23
Accepted
time: 31ms
memory: 13508kb
input:
37481 49999 2 34641 34645 28147 28149 12052 12056 22089 22090 30513 30517 8793 8797 30972 30974 31527 31528 7549 7551 10006 10007 22323 22324 37207 37210 19294 19298 13834 13837 14068 14069 18564 18565 14266 14268 13717 13718 26291 26292 17870 17871 24145 24147 1168 1170 24437 24439 13479 13480 2334...
output:
10103 10104 10103 10102 10101 10101 10100 10099 10099 10098 10097 10097 10095 10096 10095 10093 10094 10093 10091 10092 10091 10089 10090 10087 10089 10088 10087 10085 10086 10085 10083 10084 10083 10082 10081 10081 10080 10079 10079 10078 10077 10077 10076 10075 10075 10074 10073 10073 10072 10071 ...
result:
ok 37481 lines
Test #55:
score: 23
Accepted
time: 24ms
memory: 11344kb
input:
50000 50000 2 41243 48418 13734 47293 33425 34257 5435 9078 41946 46607 17266 37688 17948 31508 20558 23277 25793 37692 22164 46169 25367 32525 19026 21353 21957 26352 7004 40150 35216 48370 15515 41672 6831 43526 9396 39229 20177 26203 1003 22442 29464 36141 6171 39694 43743 47962 21246 43607 21491...
output:
1410 7021 18935 20689 10029 12711 3882 14987 5684 6859 23335 15255 15863 17406 24374 15889 14769 20587 414 9198 1763 11054 8421 69 17977 11435 6024 22708 24494 22935 6738 24666 23610 5404 10704 11581 19104 15857 21182 14409 19961 1547 11890 21275 12446 23109 4221 15346 24836 12483 24559 21231 1797 4...
result:
ok 50000 lines
Subtask #6:
score: 9
Accepted
Dependency #5:
100%
Accepted
Test #56:
score: 9
Accepted
time: 23ms
memory: 13624kb
input:
50000 49999 9 41499 49885 25011 28285 29744 37257 16164 47167 24058 40336 8074 29642 27984 28985 9250 40655 5015 49809 18882 36899 30765 35262 27296 34609 1140 47921 598 18754 29434 45003 15862 22592 37819 38375 32275 42436 27572 47850 31725 49314 43346 49765 7185 48313 3512 43712 16772 29018 3404 8...
output:
56 215 53 157 39 178 111 185 170 160 149 45 180 160 157 204 215 181 204 77 223 155 151 119 75 157 97 185 178 150 170 56 165 204 173 163 30 62 207 125 204 45 179 139 152 187 223 109 62 155 194 174 103 170 171 160 168 144 193 185 40 211 227 171 153 152 160 155 165 176 164 59 441 164 149 171 206 166 19...
result:
ok 50000 lines
Test #57:
score: 9
Accepted
time: 42ms
memory: 14008kb
input:
50000 49999 13 9308 22118 23579 40138 10465 18293 9313 20305 1736 8028 12388 31685 14692 18691 53 3473 2038 9953 10824 45262 18237 36929 23666 35132 19262 48806 11891 21845 26801 33678 18012 24270 23807 42671 195 29980 8749 41619 5231 40362 29479 35889 10117 38735 1961 27349 26856 41414 22472 46983 ...
output:
897 647 941 640 382 504 513 359 942 554 446 570 1069 324 386 410 334 197 423 495 254 421 264 456 539 570 390 572 424 890 514 457 427 1019 95 614 702 365 724 421 506 568 674 446 651 274 678 998 467 309 383 583 410 236 328 1039 475 939 214 663 241 498 639 170 576 136 164 414 551 915 268 268 586 452 62...
result:
ok 50000 lines
Test #58:
score: 9
Accepted
time: 146ms
memory: 11964kb
input:
50000 49999 68 20735 24928 1550 17715 13560 19796 34532 36825 38961 49016 10225 25958 27860 34022 24833 27721 7559 43460 13488 35715 33113 42162 4488 48392 23786 38636 553 5145 7898 43784 18434 23270 4342 24850 33170 48268 5054 11635 25388 43620 3744 41567 31169 42365 7796 35333 12053 22835 22195 47...
output:
765 985 991 1964 1439 1516 1921 519 1002 2021 2363 254 2131 756 756 2359 1578 882 1161 1349 1734 269 1089 2202 1341 2006 874 991 1763 2123 2093 526 765 894 1181 1425 1912 1928 1768 769 1678 975 523 1925 1664 1844 1884 965 2053 768 2019 1926 2214 1065 1523 1007 992 1655 646 1087 953 2434 763 629 2049...
result:
ok 50000 lines
Test #59:
score: 9
Accepted
time: 109ms
memory: 13796kb
input:
49900 50000 73 11942 33198 43080 45131 18287 20677 34845 49755 16410 38461 15307 46063 19686 47972 22405 25113 39545 48413 7545 20377 370 6308 29540 43581 7159 9529 43051 46142 7860 14943 8969 44475 23567 44814 13713 16167 476 7223 733 23344 4155 49371 30225 39173 12288 47603 11492 16720 10129 12506...
output:
189024 97757 187415 207663 53044 144154 90827 6353 29075 226586 117364 8534 105892 154125 60688 57926 115616 180844 106993 35177 201284 205911 129383 249381 207579 252646 192203 31806 275566 208458 192203 34990 77471 7013 121056 296257 2582 5302 150977 151218 51637 255690 59371 259291 172976 107156 ...
result:
ok 49900 lines
Test #60:
score: 9
Accepted
time: 35ms
memory: 15324kb
input:
40000 50000 68 2687 24485 230 22088 13171 15075 8281 12158 24085 28396 11810 16452 4079 25219 12222 25825 17710 24338 18853 34891 23936 34104 32 10495 335 20240 19379 37227 19713 29496 699 3600 1560 18874 6075 11933 159 12831 4010 10329 17944 21765 12187 21251 19049 37888 5442 37075 10386 30922 1987...
output:
141802 87202 488337 261432 197318 528845 547397 180262 314937 248905 202561 434317 510225 505255 18176 480096 423247 49102 386592 53710 94829 154738 258954 477685 64393 45335 433432 185610 302409 234206 64869 245706 33488 349068 305066 35552 500450 185782 320593 262656 252421 212398 201742 65959 468...
result:
ok 40000 lines
Test #61:
score: 9
Accepted
time: 83ms
memory: 13336kb
input:
40000 50000 50 19018 19788 10691 27174 27287 39139 6257 10644 2123 36753 3278 3510 33117 39677 14021 14108 10105 33607 30862 33425 19161 39782 483 9007 17212 32046 2627 36559 8789 12682 4673 39876 7171 30504 14546 17664 26484 31164 32321 34542 17117 23215 27743 37323 27420 34812 8214 10183 17313 346...
output:
15 17 16 13 15 18 16 16 15 17 13 18 18 18 18 15 14 18 12 21 16 17 17 15 17 18 19 15 14 17 17 13 17 17 11 19 15 15 15 13 18 19 14 15 10 16 16 16 17 18 18 15 18 13 13 14 15 18 20 16 14 16 14 19 16 16 12 17 16 17 17 12 21 16 18 17 16 17 16 14 12 16 16 19 16 16 20 16 19 19 18 17 17 9 18 17 18 18 16 17 1...
result:
ok 40000 lines
Test #62:
score: 9
Accepted
time: 71ms
memory: 11508kb
input:
35579 50000 72 23065 24868 19215 25891 6087 20288 12747 19324 11160 21916 5410 10875 8510 20226 16394 35425 12713 23733 17833 27280 11824 27965 9272 12248 10146 17904 21294 31307 12056 21608 7602 30563 27880 31800 10146 16716 7102 25364 11509 12342 5996 22660 34652 35225 28399 30965 7979 20008 19288...
output:
12 12 12 12 14 10 13 7 13 10 9 7 13 10 10 11 11 311 13 9 9 12 12 12 11 11 13 6 11 11 11 12 13 12 12 11 9 14 11 12 11 13 13 12 10 10 11 11 12 11 12 11 11 15 12 13 12 12 13 11 11 11 10 11 13 10 11 11 13 12 11 11 14 15 12 13 11 8 12 14 14 12 10 11 13 12 13 11 14 11 11 11 9 12 12 11 10 8 11 7 13 13 11 1...
result:
ok 35579 lines
Test #63:
score: 9
Accepted
time: 41ms
memory: 13992kb
input:
49646 50000 49 9236 32279 27304 32890 32902 44211 15756 25786 29603 34530 3882 33531 13749 35997 31366 44408 9131 46664 29392 48164 7212 21593 28397 45389 41671 46492 43674 44062 21513 47461 2186 40450 21122 36586 14722 24087 2168 8262 9155 19434 15686 17546 15664 45318 16915 34863 14370 20363 26977...
output:
199252 52429 167877 200603 151221 127348 141309 254639 9846 192859 52378 236399 300228 20926 282023 237571 111183 13564 25275 71306 148742 66003 323578 107925 121815 29747 23544 270984 139928 303594 122809 53792 252891 162449 333225 99436 183941 179243 47541 205077 161466 70104 177819 103589 164107 ...
result:
ok 49646 lines
Test #64:
score: 9
Accepted
time: 17ms
memory: 10124kb
input:
23993 29996 3 12737 12738 10741 10743 14693 14694 7785 7786 3002 3003 23683 23684 12842 12843 6101 6103 11491 11492 19203 19206 6531 6532 5407 5409 519 520 13787 13788 6548 6550 1040 1041 11626 11627 14364 14365 20352 20353 16397 16399 2738 2740 7054 7055 6324 6325 2239 2241 16923 16924 6447 6452 80...
output:
16675 16675 16674 16672 16673 16672 16669 16671 16670 16669 16666 16668 16667 16666 16663 16665 16664 16663 16660 16662 16661 16657 16660 16659 16658 16657 16654 16656 16655 16654 16651 16653 16652 16648 16651 16650 16649 16645 16648 16647 16646 16642 16645 16645 16644 16643 16639 16642 16641 16640 ...
result:
ok 23993 lines
Test #65:
score: 9
Accepted
time: 7ms
memory: 10168kb
input:
29393 29968 50 13419 13420 3760 3761 1541 1542 10423 10424 25303 25304 20449 20450 16222 16223 24878 24879 1846 1847 25836 25837 21627 21628 1851 1852 11384 11385 3415 3416 6020 6022 22742 22743 14453 14454 27637 27638 6268 6269 8361 8362 2263 2264 24357 24358 20459 20460 8457 8458 16365 16366 21805...
output:
5201 5248 5247 5246 5245 5244 5243 5242 5241 5240 5239 5238 5237 5236 5235 5234 5233 5232 5231 5230 5229 5228 5227 5226 5225 5224 5223 5222 5221 5220 5219 5218 5217 5216 5215 5214 5213 5212 5211 5210 5209 5208 5207 5206 5205 5204 5203 5202 5201 5200 5199 5151 5198 5197 5196 5195 5194 5193 5192 5191 ...
result:
ok 29393 lines
Test #66:
score: 9
Accepted
time: 11ms
memory: 9904kb
input:
29613 29905 100 27599 27600 6484 6485 8559 8560 21515 21516 6158 6159 16209 16210 13878 13879 10715 10716 24478 24479 13815 13816 12942 12943 29336 29337 26243 26244 19740 19741 1895 1896 9887 9888 21192 21193 924 925 9676 9677 16580 16581 17295 17296 4184 4185 4095 4096 29326 29327 18360 18361 8245...
output:
25101 25193 25192 25191 25190 25189 25188 25187 25186 25185 25184 25183 25182 25181 25180 25179 25178 25177 25176 25175 25174 25173 25172 25171 25170 25169 25168 25167 25166 25165 25164 25163 25162 25161 25160 25159 25158 25157 25156 25155 25154 25153 25152 25151 25150 25149 25148 25147 25146 25145 ...
result:
ok 29613 lines
Test #67:
score: 9
Accepted
time: 23ms
memory: 11724kb
input:
41670 49998 4 994 995 25043 25044 30883 30884 39037 39038 32106 32108 39455 39459 31341 31342 28245 28246 31071 31072 19518 19519 35740 35742 25727 25729 29682 29683 33881 33882 2509 2510 33556 33561 3010 3011 29625 29626 36469 36471 13136 13137 4460 4464 30131 30136 29646 29647 38146 38148 23009 23...
output:
14277 14277 14276 14275 14274 14273 14273 14272 14271 14270 14269 14269 14268 14267 14266 14265 14265 14264 14263 14261 14262 14261 14260 14257 14259 14258 14257 14256 14253 14255 14254 14253 14252 14251 14249 14250 14249 14248 14245 14247 14246 14245 14241 14244 14243 14242 14241 14237 14240 14239 ...
result:
ok 41670 lines
Test #68:
score: 9
Accepted
time: 18ms
memory: 13400kb
input:
49033 49993 50 34968 34969 5674 5675 1382 1383 29062 29063 40607 40608 18831 18832 4484 4485 30203 30204 44926 44927 1358 1359 44843 44844 45317 45318 754 755 28897 28898 47543 47544 17095 17096 6684 6685 1596 1597 43203 43204 5858 5859 47567 47568 45076 45077 9886 9887 45841 45842 35532 35533 39579...
output:
451 501 501 500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 482 481 480 479 478 477 476 475 474 473 472 471 470 469 468 467 466 465 464 463 462 461 460 459 458 457 456 455 454 453 452 401 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 432 431 430 ...
result:
ok 49033 lines
Test #69:
score: 9
Accepted
time: 22ms
memory: 13656kb
input:
49442 49930 100 48524 48525 19751 19752 44241 44242 38542 38543 37577 37578 40137 40138 48726 48727 35929 35930 6977 6978 47063 47064 23831 23832 19474 19475 31445 31446 27263 27264 49287 49288 1378 1379 28337 28338 1222 1223 45414 45415 40041 40042 22789 22790 46276 46277 40908 40909 38972 38973 12...
output:
30701 30799 30798 30797 30796 30795 30794 30793 30792 30791 30790 30789 30788 30787 30786 30785 30784 30783 30782 30781 30780 30779 30778 30777 30776 30775 30774 30773 30772 30771 30770 30769 30768 30767 30766 30765 30764 30763 30762 30761 30760 30759 30758 30757 30756 30755 30754 30753 30752 30751 ...
result:
ok 49442 lines
Test #70:
score: 9
Accepted
time: 20ms
memory: 9936kb
input:
30000 30000 5 2238 23441 4784 8391 7266 14883 11182 26291 20576 21505 8308 14795 7405 14152 10291 23282 8635 10092 21013 21153 11455 15434 12227 29442 9634 12267 17216 26719 5634 11839 8499 9646 10820 25909 6382 27364 2024 19500 10396 11622 650 8332 7267 23969 14921 24880 8675 21729 7999 22606 4908 ...
output:
4133 4660 12856 14554 4858 14882 10656 1311 3851 2127 3516 5553 1241 6750 9170 7448 10339 6387 10286 1146 2504 3493 10716 3723 2154 11651 6852 12811 3510 12852 4419 14167 13475 14590 9839 4973 4534 1274 3813 13388 10587 11131 1558 1394 7968 3071 13562 6569 2869 8556 11869 4870 284 14405 6338 11926 6...
result:
ok 30000 lines
Test #71:
score: 9
Accepted
time: 91ms
memory: 11860kb
input:
30000 30000 50 24461 27183 9445 17288 22366 23495 17281 28715 2141 10415 2911 18865 19269 27253 25893 27539 13684 15008 2949 16556 27378 27815 4507 7712 9973 28947 9032 14607 14139 20426 14242 25569 23447 27108 23386 28754 6437 29075 11847 23401 23744 29976 14435 18582 9521 24764 5380 8660 7372 1294...
output:
16559 5039 12932 5665 4391 16234 14145 15658 6644 690 5542 12327 4569 6721 11784 14518 1566 6995 11594 9339 457 11421 15377 1531 15531 5540 3547 1399 184 9488 13725 17074 4536 8021 5307 4634 10401 13973 11160 7918 15762 16020 6925 7842 173 11205 7397 5008 10104 8639 9672 4655 6135 8217 3847 9842 630...
result:
ok 30000 lines
Test #72:
score: 9
Accepted
time: 178ms
memory: 9884kb
input:
30000 30000 100 20183 20381 2300 5184 4546 9059 594 28662 9457 21436 7414 18481 2296 18161 19301 21287 15956 16492 15411 18929 5480 6147 10478 28474 9887 16719 15480 27833 427 2623 4968 12950 3511 27185 1291 21637 319 2544 3226 28310 6186 12091 7638 16091 3753 19412 14953 23307 5362 22000 6492 22687...
output:
21475 2710 10797 5263 15689 5309 10728 475 13532 19891 20614 23 13316 21948 2106 12213 18381 16866 20759 19492 11285 22036 21557 3488 17689 16541 16434 11039 14065 14667 15436 5399 2881 20151 15677 7106 14677 9450 15345 19488 7569 18756 3353 1703 18148 17128 11851 12013 19944 7259 2899 17714 12921 1...
result:
ok 30000 lines
Test #73:
score: 9
Accepted
time: 32ms
memory: 13392kb
input:
50000 50000 3 38974 45300 46125 49606 7174 37590 16863 30243 14551 18832 4544 48697 16149 21340 32619 49911 33434 41895 29690 43996 8385 45343 31996 46666 28679 31871 10606 31361 1830 9813 1187 1660 43443 44783 6678 15333 10522 31723 45076 47983 3973 45134 12637 40089 5145 39963 2252 35953 14683 343...
output:
14704 10779 14946 3155 12891 19548 3926 16463 21574 24268 3305 18699 16376 520 9423 12335 6033 24398 16290 436 4495 8742 12726 7271 5500 21507 6692 3901 4043 8081 10331 13937 8855 23383 14386 13654 1304 17981 18032 20531 18148 19431 14715 4207 20088 4957 20043 4428 18566 546 6541 532 16838 18108 685...
result:
ok 50000 lines
Test #74:
score: 9
Accepted
time: 164ms
memory: 13380kb
input:
50000 50000 50 1217 20562 30060 46378 45615 47128 35637 35792 14037 17593 3406 23399 23363 46462 25537 47683 24387 25819 10015 12016 22600 36141 7621 33688 3318 34989 20721 47490 917 1155 4587 12801 4771 7175 4773 19272 20869 43309 14619 19808 18579 40027 10272 37614 13706 37420 26168 36087 20577 29...
output:
13101 8609 16928 15075 11026 21451 10019 15551 15154 22228 20443 17222 22694 10946 9971 10740 25940 1248 13716 26317 2826 10588 17861 16313 12947 22536 12196 14216 19816 16051 65 11061 11466 15768 15805 16661 26087 5134 23473 17082 24300 6163 18268 4068 10364 7273 18038 20051 26875 18244 629 17216 1...
result:
ok 50000 lines
Test #75:
score: 9
Accepted
time: 329ms
memory: 13312kb
input:
50000 50000 100 2652 6312 325 10134 41950 48884 10734 25700 31745 49122 17262 26017 7230 41230 12699 22571 48582 48592 16731 26701 19929 32965 5546 16927 8402 49571 34860 35886 12059 35856 13014 49388 11245 11994 29641 42306 28713 33933 32356 34157 39332 46406 6200 47380 4942 8026 37946 43432 5910 2...
output:
6256 10565 19397 18421 19920 19055 11992 8373 26119 21122 30042 4135 20518 1371 18049 26869 32026 24403 10674 30276 14288 5863 2458 6663 8487 25151 12165 26844 31661 29874 25040 31592 2781 27966 21108 14851 20957 31255 27889 19802 18621 28232 9992 18836 30684 18751 12822 17547 31215 27215 28272 2664...
result:
ok 50000 lines
Subtask #7:
score: 23
Accepted
Dependency #4:
100%
Accepted
Test #76:
score: 23
Accepted
time: 28ms
memory: 12172kb
input:
30000 29999 12 2644 25464 4366 18971 25226 25403 15771 26310 5933 29144 5821 27479 4386 22003 8064 13004 4528 26861 14069 18466 5281 12399 1739 24196 8097 25427 505 10828 18516 23196 9166 13176 7066 13444 10918 15868 5962 7577 17793 25920 2919 9803 3957 4476 9828 23145 16794 28102 7315 12091 10809 2...
output:
8191 14518 2027 10751 17914 13741 12394 19925 18088 16942 16264 8043 15012 6059 16050 4231 12423 7311 14805 10762 9718 7654 11155 7928 1012 4168 12137 10182 6722 15329 10121 1115 18521 6022 9312 3995 10055 9110 12948 8162 9385 12759 14708 7881 853 2879 4291 12792 9473 6751 616 3849 10527 10814 17294...
result:
ok 30000 lines
Test #77:
score: 23
Accepted
time: 108ms
memory: 12376kb
input:
30000 29999 452 23132 25620 10055 12944 4657 12518 9452 15779 26983 29708 7108 14863 8399 19140 833 8690 1474 19793 5988 21620 17931 29828 21823 29601 27441 28584 5735 17587 6254 22011 5271 13432 18478 27976 19444 22193 9016 15078 6250 19805 5270 27764 11912 15378 8749 10071 15858 16292 749 3342 856...
output:
5383 7005 7000 5934 9508 7012 2741 5928 5915 8038 5352 9007 1164 8537 7018 8051 5953 8017 10932 4111 8063 7532 8031 4733 6473 8060 7530 3474 7565 5935 8032 8529 5934 5350 5364 4772 7537 4116 6476 4763 4745 7020 9969 2724 9033 4751 3471 5907 5386 6988 7549 8052 7004 5361 7529 4777 8541 4744 6476 5929...
result:
ok 30000 lines
Test #78:
score: 23
Accepted
time: 21ms
memory: 10492kb
input:
30000 29999 5 1470 20673 9714 10747 1171 3261 9788 12413 12014 16218 12820 20722 12191 21585 3960 23156 8896 10656 1635 11640 676 8104 12572 28248 16355 20851 18768 19235 14023 22893 7051 26235 802 24271 18394 26208 3896 13643 21833 22057 14242 17549 8679 9695 8804 19622 6490 29185 6158 10263 4609 2...
output:
21474 2011 4123 2163 16270 16708 26934 4077 1658 6290 20972 10615 33801 30094 11415 18636 658 22812 7310 10956 20715 18672 21724 26859 5151 7163 33655 26794 13209 10742 30042 19771 17534 21149 26232 27050 33 26418 24922 7287 33057 25729 5346 5753 13797 12099 20627 29093 31967 3200 7124 4060 4166 449...
result:
ok 30000 lines
Test #79:
score: 23
Accepted
time: 320ms
memory: 10496kb
input:
30000 29999 214 1100 22973 20603 21540 1763 29376 16246 19506 12501 25517 23098 29740 7121 15836 13072 25652 8864 14015 7295 12426 1985 24542 25663 26892 439 25124 1615 21129 4698 29319 9336 15301 9808 20812 11544 18101 749 9485 6758 16177 417 10700 2939 17141 19642 24813 5204 12747 9091 11318 13474...
output:
15636 34508 31753 48483 130950 7308 89621 52456 22508 4909 140371 31768 116468 7500 77044 5422 72118 129580 40238 105452 45144 102754 67519 73712 13327 79919 40639 41670 105385 35335 15749 39862 47179 32495 135856 36533 49907 42931 74370 113265 41298 35395 5972 80842 68801 86300 9954 91420 40569 482...
result:
ok 30000 lines
Test #80:
score: 23
Accepted
time: 43ms
memory: 12556kb
input:
30000 29999 382 17421 19221 6215 18021 11750 16365 22712 25929 6022 19020 11529 25632 2072 7337 10 1689 472 26426 2025 13589 6266 27970 3301 6852 11656 17415 3578 14752 22498 24721 5360 8549 20043 21658 4112 12220 7572 29194 11767 13794 5851 26239 756 9484 1575 7712 1767 23931 4673 12438 7252 26910 ...
output:
1151934 168170 520264 258421 682401 222731 1186111 304544 44403 1472122 216428 146498 1234172 860259 683170 1194961 690457 202213 817998 1343363 40901 1591190 8662 1224179 50901 701590 173781 200295 682783 1488640 162393 277664 296271 745407 229853 1453691 1519383 73589 1562777 499933 487259 313197 ...
result:
ok 30000 lines
Test #81:
score: 23
Accepted
time: 24ms
memory: 248728kb
input:
29900 30000 13492 6142 13780 17629 29260 1695 4124 5095 27304 5557 12495 11585 13166 10069 17957 15123 17585 4230 24631 11895 17753 15612 18943 15325 28180 4413 20140 8416 24905 13409 14079 23189 23578 16274 25258 21075 28322 16264 19030 3121 23766 4257 27911 13320 29354 18062 28900 733 25297 645 29...
output:
250128 209668 223143 304113 169144 169145 223159 290643 114880 263624 236633 169149 479551 223151 236650 236651 263640 304101 250133 290621 182655 250135 277129 223151 155623 263636 101124 196159 182659 223151 358105 304117 155621 182649 209652 290607 169152 169143 263637 196158 182656 196162 182653...
result:
ok 29900 lines
Test #82:
score: 23
Accepted
time: 19ms
memory: 10892kb
input:
29900 30000 478 7329 21789 10024 12765 13129 25993 1073 20808 26787 28671 1474 22174 7540 12468 4589 20214 8592 19005 10239 29032 6171 18881 17891 24086 2994 13575 23701 26013 22134 25819 2257 22093 5331 6073 22899 26197 2716 29393 23229 23685 15679 18020 370 2223 7929 15996 983 18251 19966 25266 10...
output:
1009090 3943964 3467659 3287372 828808 1152565 5539273 4052996 3750771 144943 680541 4354270 1853659 374489 1732662 1321375 2666181 1545182 4834884 5468016 3129567 2122424 1847443 4632595 5875461 141121 1268298 337665 3046350 2409377 2907682 4577600 3158736 1113825 581080 3187433 3852624 3369627 128...
result:
ok 29900 lines
Test #83:
score: 23
Accepted
time: 16ms
memory: 248080kb
input:
29900 30000 26434 10691 14729 3229 16102 3044 27682 14616 18102 9335 12853 20808 26708 10825 27976 19890 20844 17309 24662 5484 17847 3373 10671 274 17943 6868 26089 22022 25079 16797 22033 27825 28605 2626 4364 12947 28477 3231 24291 13012 18122 2330 9589 14560 29473 928 12866 9209 21040 10852 1144...
output:
50539562 50536731 5108 50539251 50539690 50536062 388 5581 50529020 50534956 50528037 6163 50528926 2026 2063 50537802 50537011 3419 50539258 50528392 50539244 50528749 3002 3158 2479 50538035 7344 50529814 50528406 50537704 4082 50529705 7587 634 6029 50537028 4485 1277 50535725 50529608 258 6475 5...
result:
ok 29900 lines
Test #84:
score: 23
Accepted
time: 26ms
memory: 12392kb
input:
29900 30000 4 12638 14288 6389 28116 2754 28547 15794 20924 15050 15384 1678 16274 745 22380 1617 3099 6392 12199 9667 25528 9084 21294 10947 23649 12448 15318 4573 25591 5579 9678 5221 10330 6715 14623 6499 13127 15987 26655 5039 27878 17036 28620 4412 9764 22725 24950 2133 12873 6321 11540 8871 17...
output:
58 76 69 44 75 89 61 42 56 48 86 67 50 81 65 90 71 76 60 31 69 74 58 68 64 82 41 74 77 84 61 16 78 66 77 65 69 97 56 51 67 52 65 57 68 64 79 31 53 62 83 84 78 31 66 29 68 89 77 65 53 39 61 62 77 68 80 58 62 48 79 54 93 61 63 59 63 73 60 68 68 41 59 45 62 52 82 75 20 41 54 79 69 53 61 80 54 78 71 65 ...
result:
ok 29900 lines
Test #85:
score: 23
Accepted
time: 21ms
memory: 246588kb
input:
29900 30000 21486 15455 17942 8234 18349 1057 10038 11566 12239 22851 24884 1208 12972 21078 29369 15981 25880 3541 21014 16027 28950 20971 27136 5646 9679 17982 26684 2256 28622 5636 19741 215 12170 10353 28862 1618 2363 16976 18193 8946 17548 3965 19287 3755 20492 26338 27095 22967 28244 7971 1419...
output:
591253 634224 397871 526789 591245 548276 569756 548287 505293 462332 505284 526790 333395 526770 655719 462323 290419 483803 569757 612715 440840 462330 591254 462304 505320 591243 505308 505294 655706 698688 591251 569768 655704 483817 526783 225915 483820 612724 720178 440831 290420 741636 354876...
result:
ok 29900 lines
Test #86:
score: 23
Accepted
time: 10ms
memory: 9844kb
input:
20000 30000 247 1907 13294 1750 12080 10669 14998 2120 16988 4054 14140 1509 7320 1004 19323 7266 7717 7684 12254 6417 14233 8708 14026 5465 19482 4529 16236 12407 17019 2529 17924 2132 4709 4069 19959 8150 9457 4820 10227 969 12650 2860 11634 9518 15792 3216 19388 10615 17969 6104 16351 4728 9797 6...
output:
255 2825 206069 4093 3430 206735 2785 5631 206806 3530 2039 5877 5077 3485 4230 5263 5578 3523 5025 206888 3602 4393 206780 2978 205 1383 3989 1895 4973 4801 206604 367 1252 4317 206129 23 205317 113 205706 205838 2463 4512 462 207072 1364 577 1561 4512 5473 2543 205579 2581 205316 1520 3899 1907 10...
result:
ok 20000 lines
Test #87:
score: 23
Accepted
time: 20ms
memory: 170432kb
input:
20000 30000 2742 10197 11552 13860 16511 5073 5129 5533 8804 10227 13069 8966 13702 13327 15501 2571 11126 8395 11339 196 12138 10551 14653 1369 18967 10438 14279 12968 13084 11663 12583 6643 15176 4169 13193 15897 18988 4104 12863 1420 10053 2249 2504 10311 18977 2660 4522 3116 15134 1513 19607 153...
output:
11 11 10 10 11 11 9 9 8 8 12 9 8 10 12 10 7 10 10 8 11 11 11 11 8 8 7 9 10 10 10 11 10 9 9 7 6 11 12 8 11 12 10 10 9 11 6 10 8 11 10 11 7 9 9 9 12 5 9 12 7 9 10 10 10 10 10 11 10 10 10 10 9 11 10 11 10 9 9 11 9 11 9 10 11 10 11 10 12 9 10 9 9 11 9 10 10 11 11 10 11 7 10 10 9 9 8 10 9 10 13 10 9 9 9 ...
result:
ok 20000 lines
Test #88:
score: 23
Accepted
time: 11ms
memory: 9952kb
input:
29753 29949 150 10000 10001 15252 15253 12466 12467 1518 1519 25378 25379 15735 15736 9766 9767 6256 6257 25222 25374 11229 11230 8 9 17255 17256 27430 27431 14879 14880 25780 25781 24496 24497 9218 9219 19841 19842 10114 10115 19615 19616 19125 19126 13652 13653 26156 26157 1615 1616 27796 27797 20...
output:
28651 28799 28798 28797 28796 28795 28794 28793 28792 28791 28790 28789 28788 28787 28786 28785 28784 28783 28782 28781 28780 28779 28778 28777 28776 28775 28774 28773 28772 28771 28770 28769 28768 28767 28766 28765 28764 28763 28762 28761 28760 28759 28758 28757 28756 28755 28754 28753 28752 28751 ...
result:
ok 29753 lines
Test #89:
score: 23
Accepted
time: 10ms
memory: 10152kb
input:
29748 29895 200 16822 16823 13133 13134 10881 10882 28233 28234 2019 2020 18544 18545 14123 14124 24188 24189 20948 20949 5673 5674 4413 4414 25271 25272 21316 21317 16853 16854 19010 19011 17528 17529 1510 1511 11974 11975 7992 7993 260 261 1159 1160 28658 28659 7326 7327 2050 2051 8740 8741 26736 ...
output:
8001 8201 8200 8199 8198 8197 8196 8195 8194 8193 8192 8191 8190 8189 8188 8187 8186 8185 8184 8183 8182 8181 8180 8179 8178 8177 8176 8175 8174 8173 8172 8171 8170 8169 8168 8167 8166 8165 8164 8163 8162 8161 8160 8159 8158 8157 8156 8155 8154 8153 8152 8151 8150 8149 8148 8147 8146 8145 8144 8143 ...
result:
ok 29748 lines
Test #90:
score: 23
Accepted
time: 10ms
memory: 12192kb
input:
29800 29898 300 19248 19249 21664 21665 21671 21673 22373 22374 18926 18927 5306 5307 29434 29435 19631 19632 21160 21161 16707 16708 2152 2153 12066 12067 8388 8389 7497 7498 10367 10368 24037 24038 23526 23527 10869 10870 21036 21037 25892 25893 10528 10529 24110 24111 6749 6750 21212 21213 15541 ...
output:
5101 5400 5399 5398 5397 5396 5395 5394 5393 5392 5391 5390 5389 5388 5387 5386 5385 5384 5383 5382 5381 5380 5379 5378 5377 5376 5375 5374 5373 5372 5371 5370 5369 5368 5367 5366 5365 5364 5363 5362 5361 5360 5359 5358 5357 5356 5355 5354 5353 5352 5351 5350 5349 5348 5347 5346 5345 5344 5343 5342 ...
result:
ok 29800 lines
Test #91:
score: 23
Accepted
time: 14ms
memory: 11900kb
input:
29690 29763 400 11867 11868 6385 6386 28705 28706 9715 9716 7263 7264 14920 14921 14629 14630 3404 3405 18720 18721 13203 13204 11419 11420 20769 20770 15858 15859 26541 26542 18931 18932 13507 13508 9131 9132 15284 15285 21132 21133 11631 11633 28834 28835 5007 5008 21246 21247 11760 11761 5775 577...
output:
7201 7596 7595 7594 7593 7592 7591 7590 7589 7588 7587 7586 7585 7584 7583 7582 7581 7580 7579 7578 7577 7576 7575 7574 7573 7572 7571 7570 7569 7568 7567 7566 7565 7564 7563 7562 7561 7560 7559 7558 7557 7556 7555 7554 7553 7552 7551 7550 7549 7548 7547 7546 7545 7544 7543 7542 7541 7540 7539 7538 ...
result:
ok 29690 lines
Test #92:
score: 23
Accepted
time: 35ms
memory: 261432kb
input:
29448 29489 700 20648 20649 29276 29277 28613 28614 4011 4012 14999 15000 14748 14749 718 719 20188 20189 5 6 24926 24927 27577 27578 15867 15868 2799 2800 17927 17928 1603 1604 19318 19319 27708 27709 14415 14416 29286 29287 18851 18852 10019 10020 20067 20068 17703 17704 6777 6778 2516 2517 13791 ...
output:
1 701 701 700 699 698 697 696 695 694 693 692 691 690 689 688 687 686 685 684 683 682 681 680 679 678 677 676 675 674 673 672 671 670 669 668 667 666 665 664 663 662 661 660 659 658 657 656 655 654 653 652 651 650 649 648 647 646 645 644 643 642 641 640 639 638 637 636 635 634 633 632 631 630 629 62...
result:
ok 29448 lines
Test #93:
score: 23
Accepted
time: 284ms
memory: 12000kb
input:
30000 30000 150 11669 13130 15698 27706 655 6659 4918 20769 1273 19046 4433 10631 11321 29792 5952 17490 18343 26472 8226 12061 16778 23698 7676 12989 3731 21693 863 13660 10335 25192 5966 9590 18922 20306 682 21033 11607 15581 2802 15969 27582 27839 2467 5305 28269 28569 8039 10468 1140 5616 1908 2...
output:
8099 8981 8768 21204 14080 29524 5167 28765 24953 26304 21836 12983 24293 28962 13840 8998 19944 4958 9153 4003 21203 21582 11207 2064 11381 2049 20874 4835 18604 6427 20067 9756 25000 20017 19153 19631 24345 15861 14899 9303 7668 22509 27024 682 12924 18611 29273 12809 15849 19976 10111 19237 7796 ...
result:
ok 30000 lines
Test #94:
score: 23
Accepted
time: 378ms
memory: 10212kb
input:
30000 30000 200 989 20639 3459 22025 25193 27467 17927 19585 59 13911 1309 27437 4597 13175 689 26525 6276 15425 11269 28848 20960 25103 547 24359 8618 20915 4942 11249 11211 14930 19845 20287 3861 26648 25034 28075 7489 10411 23074 27722 5911 6694 15538 22079 2554 18007 11082 28746 4770 9894 2048 2...
output:
23769 23954 6103 13537 24799 7047 26409 13702 26030 10112 7705 9509 26592 23859 11434 7634 9392 27857 4122 26864 3674 4385 86 16599 13020 28213 25071 15412 880 18437 14752 18926 946 89 6336 27373 20411 4071 8371 29141 18292 2419 7200 6152 7930 15702 11727 14728 29231 4097 24811 16282 2230 5901 2189 ...
result:
ok 30000 lines
Test #95:
score: 23
Accepted
time: 564ms
memory: 10028kb
input:
30000 30000 300 515 16190 16905 23986 4281 13485 1953 18272 2143 29410 23252 23257 16029 18002 9452 16857 14228 24411 5735 13746 11332 15887 15729 20996 9025 25572 1747 13281 17925 22241 4506 13875 12539 28760 15527 28859 821 2357 8192 13790 2316 4568 23265 26731 16166 16444 23315 28522 22415 22928 ...
output:
12445 25818 25482 38368 3787 24021 20063 25743 22483 5479 275 4022 12512 21270 17627 1332 9385 17305 28294 4704 14175 28974 1402 27109 24802 23915 20614 22925 6284 10102 32508 35492 3974 15767 3463 2652 6192 26278 3475 5168 6876 6609 20444 40067 26598 21364 10591 3436 10943 11411 1066 2351 14409 363...
result:
ok 30000 lines
Test #96:
score: 23
Accepted
time: 896ms
memory: 9864kb
input:
30000 30000 500 624 18449 10871 19208 3060 10147 3041 17173 10617 19184 10133 25476 1686 4775 901 23623 10073 20040 2745 9389 10214 22443 20985 23932 6797 27835 8720 27491 8472 23315 6567 28885 2470 29421 5044 24329 4996 6424 16585 24885 5680 10991 17669 25079 9764 17663 1801 4196 2388 14237 13283 2...
output:
26304 2646 13264 37357 91540 26474 17237 14047 10864 225511 452 10974 4958 4714 20462 14711 10312 11930 17119 25624 21968 13262 10318 18380 23294 17105 13863 11465 18879 4973 15310 136742 24846 12007 21836 5324 13173 20419 12703 18176 8766 20312 7651 21841 6275 8027 174515 24182 5300 1198 7567 27170...
result:
ok 30000 lines
Test #97:
score: 23
Accepted
time: 31ms
memory: 266780kb
input:
30000 30000 700 20492 22039 22208 29838 905 16287 8697 22485 5853 17172 19918 27164 23668 25000 16259 26940 12112 21352 9147 14264 14712 27356 8620 29480 2386 26294 2025 29232 6947 27440 15118 21208 2420 12635 7883 22164 24760 27556 9251 18618 1434 15687 678 7519 2937 12382 19337 24889 12254 27129 4...
output:
11776 9367 18726 23616 19110 22350 8268 19647 8540 5099 24712 6503 12835 409705 18658 13606 24346 11969 4021 27655 1757 20371 21933 240918 15852 14458 8792 26593 16612 948 8270 323843 22720 1686 5910 27112 401 231898 14859 3488 7504 7492 9856 8874 118132 15097 25939 21313 436986 25403 7751 109978 27...
result:
ok 30000 lines
Test #98:
score: 23
Accepted
time: 24ms
memory: 262412kb
input:
30000 30000 1000 8305 27239 44 12437 4279 20625 964 3578 6186 22954 2371 6085 18529 27279 11341 14993 13588 26336 17795 27437 7933 23801 16681 21368 21872 23147 14749 25327 2783 15410 10999 24923 13079 16475 23798 24725 1352 11822 13026 25610 62 10211 6630 24016 28388 29451 3980 10822 13053 18508 96...
output:
18180 24634 17543 16671 10412 3373 15093 23524 10733 22155 3424 341813 20823 932590 8825 26937 865 22754 22771 18579 9687 406978 381879 467624 18176 931 12831 8242 11058 22159 25379 13264 10730 16356 1541 1034 18250 18364 22928 14021 16153 15650 330323 13325 18952 12589 20908 25491 760 19319 25781 1...
result:
ok 30000 lines
Test #99:
score: 23
Accepted
time: 28ms
memory: 258552kb
input:
30000 30000 1200 8409 18375 6694 14688 8491 9661 20891 24027 10126 17165 22218 27773 9671 19571 5419 9709 3835 5039 3299 17820 13932 21238 4623 16227 4742 11101 9171 22687 21735 22359 3820 7637 15517 16748 12550 24083 7169 12471 16260 25491 15915 23725 6328 28025 21209 26538 5505 26860 26537 29175 1...
output:
8621 669893 4212 935 7687 25217 11049 4692 6895 5577 3103 19852 21818 18599 14631 5028 11785 21081 11153 18598 15760 13118 25077 25845 514155 8756 24547 26246 8644 18300 11694 6685 215616 8303 5880 20703 12839 25297 19161 3188 11738 13271 1239723 2612 6851 25893 7034 18030 390852 16386 25009 6444 10...
result:
ok 30000 lines
Test #100:
score: 23
Accepted
time: 27ms
memory: 258980kb
input:
30000 30000 1500 5210 21800 21110 25576 12037 13643 11820 12055 25620 27699 24121 25490 349 17502 3564 13752 14497 22430 14384 14978 7538 7777 22883 29787 8342 18553 1472 21471 10212 11341 9856 26690 15380 25793 11137 12464 22865 26142 6554 24232 7583 26991 5859 10854 915 1475 8684 19866 7727 13204 ...
output:
883 1186 20472 2520 1715 20640 5849 5928 24589 396578 1970607 11585 24181 2336 15584 18555 8009 11494 13789 18131 2079112 7382 9096 18236 2026287 19082 13959 3793 22104 23081 1793 2930 12316 10556 25398 8907 8136 1755 20651 4331 8927 5732 568 21568 9147 15677 1290808 14714 1941354 3150 21998 2128 79...
result:
ok 30000 lines
Test #101:
score: 23
Accepted
time: 29ms
memory: 256668kb
input:
30000 30000 1800 7286 20105 18143 18270 11420 12880 8547 21495 26466 27268 118 11218 6983 8331 10285 13827 11308 17504 10995 17127 1645 19540 7709 22673 18593 18694 17002 24690 18418 26073 14635 19305 5576 16718 6473 25962 7857 27810 18391 18853 13007 27009 6237 29104 25456 26758 2343 11488 17614 22...
output:
7305 14051 2957263 7849 4530 23731 95314 2284 9809 1630184 5247 21248 12847 20553 19137 16589 10398 1926816 1854864 22049 1720997 17154 16688 6374 20931 3045744 10196 17775 9553 7909 10670 4519 9947 19946 5304 6240 10176 3356 617751 15531 310164 24477 14330 349263 2308821 12872 19051 20331 22279 678...
result:
ok 30000 lines
Test #102:
score: 23
Accepted
time: 23ms
memory: 253052kb
input:
30000 30000 3000 7869 12127 5347 5755 12883 29547 9977 16170 4192 21701 137 14359 9487 29735 12975 13525 2471 24972 3173 3616 20078 28542 15164 16204 6071 9412 5233 16929 3683 11537 9768 14757 15085 17125 21273 27176 4058 20769 9427 22988 21231 28114 23043 25864 16250 28827 13499 14414 1594 7408 112...
output:
14321 17574 3989502 1918 20198 3506577 15083 11284 20004 11748 16214 16844 868 7553 7775997 5144 606 16318 1783 3739969 10815 17310 3944 8599 2469 10888 7723 4290 5891507 723597 9042 7797500 5643 17909 8347 8776 11830 20852 20540 15506 19007 9838 12865 7685566 1608 13766 6030 11360 14924 464527 8191...
result:
ok 30000 lines
Test #103:
score: 23
Accepted
time: 11ms
memory: 250516kb
input:
30000 30000 5000 1721 7920 4899 19460 5180 24232 96 23057 5239 9124 4864 29488 17824 19567 14943 18970 9260 16854 23649 27035 5461 17694 11229 15772 26264 27714 27748 29355 3137 23011 18990 20950 541 16235 8189 12968 18086 22265 6865 25424 9297 24699 2596 22128 5328 12497 16265 17531 7750 15020 1142...
output:
1312405 14518402 4773916 17793363 12571339 3799 11106390 4401 3662690 8140004 4328 11541 4085 1140 8125 4589 12828 5800338 11477584 4191 11010 2699 5343594 21693409 11784032 7981164 14462919 12370 505 8320 7433538 3878515 7952382 1449 1128611 9067458 3505 4710109 11092 7833010 13702806 8125003 12935...
result:
ok 30000 lines
Test #104:
score: 23
Accepted
time: 16ms
memory: 249120kb
input:
30000 30000 9000 3045 10256 12386 19568 20032 20589 10170 25084 4759 19715 12572 27661 3365 20660 8130 26688 16172 28288 19582 21469 3957 28183 20637 25992 17173 20668 18338 27756 7924 9413 5035 12152 161 8101 19546 19789 6160 9939 5375 19416 2686 12418 5233 5568 10790 15662 19829 26733 19341 29692 ...
output:
55826920 2619729 64174665 70981130 68308219 10459492 1017 71972994 15623379 56797289 51052482 18129509 47239267 30934966 32678568 28244016 69616200 507 63667762 61422357 46056803 47638409 23079419 71500479 5246690 27125083 61848422 641662 40446572 47139438 29803978 18286896 297 60973626 63497312 481...
result:
ok 30000 lines
Test #105:
score: 23
Accepted
time: 17ms
memory: 12128kb
input:
29998 29998 2 14193 25355 11390 22412 17033 26319 16014 29867 6944 22255 3923 4688 10418 22853 8826 26111 7333 23445 2773 7205 28462 28825 7395 24509 15627 28847 10736 12680 889 27178 15369 19958 9890 28534 19559 27163 3329 24173 21790 27837 14841 21637 21591 24121 8176 20976 21982 26330 7578 15475 ...
output:
16284 14013 6931 17659 19724 19913 4239 162 28982 14591 29166 11162 23148 9592 29283 27855 5601 10641 29614 23709 12240 24247 3361 22383 10043 20023 7994 13013 7702 24870 5000 2830 9514 16240 11999 28696 16404 4196 19265 6828 2549 7139 5993 8549 9248 21400 7456 11050 9474 4351 19446 9465 28838 5998 ...
result:
ok 29998 lines
Test #106:
score: 23
Accepted
time: 22ms
memory: 10620kb
input:
29998 29998 10 5504 8168 8886 21582 11972 14268 15584 15656 2814 13194 22166 25653 23207 23639 6187 10903 5146 25797 2044 29072 16125 19289 4540 15432 17939 21093 10871 24241 8664 17241 7860 26428 17986 26580 13144 16870 18955 22132 8572 18476 2822 24954 12782 29960 8054 20114 23008 24464 15071 1750...
output:
105918 9800 98855 109711 90060 5888 5810 94720 8537 104346 94505 101533 5154 109305 5659 103462 109476 98130 95527 99655 96096 91694 97789 105469 99813 1563 95482 98089 109003 105721 105103 100225 105654 104668 1046 7207 109498 2047 94420 91263 100282 108425 94963 7988 106691 100156 106556 2798 5667...
result:
ok 29998 lines
Test #107:
score: 23
Accepted
time: 29ms
memory: 12252kb
input:
29998 29998 100 11854 26387 3968 6558 27748 29718 25965 29211 6527 16456 17247 20444 6601 16320 9740 19503 8595 13755 21533 22915 2078 7941 2412 24867 11906 28559 3168 5498 21150 22956 14488 18302 15064 29967 5204 8353 1008 27081 20596 24336 2534 28698 5846 12388 7365 28089 5478 23679 18138 27859 10...
output:
8231 993639 6812 991000 5722 6149 8287 1004300 1001280 994784 1001319 4395 999634 4796 992781 9017 993730 1006809 991358 996571 8890 1004570 2 992907 989973 1003174 1007132 1004401 4623 3934 4085 1006207 1004649 1005568 992554 2076 993583 999697 1000529 2121 994309 1002927 4878 990758 1007802 579 99...
result:
ok 29998 lines
Test #108:
score: 23
Accepted
time: 20ms
memory: 247524kb
input:
30000 29999 30000 7522 18443 16096 29264 2292 5475 3979 26247 28720 29570 12440 29239 9947 17494 3498 13790 4135 23593 331 11320 3600 29309 16867 18683 3987 21874 11699 23676 932 27129 14747 21806 11020 23700 3087 9996 314 22543 15616 17011 5802 21048 14848 19041 14728 20470 20582 24213 3187 20373 1...
output:
780750001 396900001 276090001 185130001 572550001 524940001 722790001 389910001 777930001 387090001 353100001 684750001 328140001 599400001 603300001 377130001 694260001 829560001 72990001 246300001 220950001 180780001 211140001 111660001 872910001 444930001 168840001 876600001 704460001 189930001 4...
result:
ok 30000 lines
Subtask #8:
score: 9
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Test #109:
score: 9
Accepted
time: 102ms
memory: 429620kb
input:
50000 49999 1525 24221 34662 16033 16518 18761 24540 5736 15432 27885 44528 20442 38414 6436 38905 8826 39195 14993 34448 28853 41514 4581 17230 12452 16391 39332 40213 1397 49114 7592 9126 11813 32320 4234 22006 1118 47190 13666 24880 7897 15431 13567 37832 40567 47624 23460 25429 34678 43271 27508...
output:
77 16 24738 92 18583 110 83 105 21651 18556 18570 18562 18562 21 18606 76 18584 21641 18592 81 18648 48 110 55 49 18617 105 131 77 18605 30 24 58 100 82 18553 18613 104 108 18557 18610 108 21656 18601 21654 77 18560 21 18 21697 18580 36 18564 117 18620 18596 15 18561 21661 18574 99 18637 117 34 1854...
result:
ok 50000 lines
Test #110:
score: 9
Accepted
time: 682ms
memory: 13632kb
input:
50000 49999 303 32462 48718 8830 37504 1001 16014 4730 11131 27088 49727 21259 32794 44914 49527 7902 23970 5316 15141 30438 31093 24813 48288 2305 11423 6019 34201 43953 45917 7429 28572 27503 43650 17382 28245 7852 24865 30180 47670 11535 30612 6920 33909 42344 47931 8543 20296 31405 35300 220 491...
output:
3370 4031 2739 2827 124 3362 2786 2822 35 2714 3996 3373 38 2823 50 47 2794 58 45 31 2797 2778 4043 2769 73 81 2768 2714 3359 2711 3416 95 2715 75 3370 2809 116 71 4555 2822 2821 110 48 2732 3380 2807 2710 2820 2806 2792 62 2738 2798 2777 40 2750 2779 3362 2769 97 2795 2744 129 2736 2722 16 2837 279...
result:
ok 50000 lines
Test #111:
score: 9
Accepted
time: 31ms
memory: 12656kb
input:
50000 49999 170 322 49559 12887 29615 6242 30757 9113 44131 833 47374 714 2833 17421 46762 4753 45999 12240 36496 2138 2161 16887 35568 13311 36469 3997 6964 21485 22827 5217 29562 946 45560 2635 43322 32356 42754 2295 5214 27661 48761 11644 16905 47877 49763 7686 32539 14438 16706 26159 43302 25878...
output:
7239 53 7252 7293 7221 7293 7228 25 7209 68 52 7220 132 69 7250 99 73 7277 95 79 56 7245 73 59 7240 114 34 7234 86 7239 70 7214 143 82 7277 7209 39 19 84 60 7235 7233 44 57 7238 136 130 7211 66 143 100 59 114 7223 122 7236 7258 77 63 67 73 35 135 36 7214 7213 7262 7220 151 42 7262 7213 67 7238 80 60...
result:
ok 50000 lines
Test #112:
score: 9
Accepted
time: 382ms
memory: 13692kb
input:
50000 49999 145 8854 37028 4254 49911 3335 10791 35305 47094 18842 45361 24783 32961 35945 43066 8811 14571 9089 13555 2465 38334 14710 41673 33567 35340 16529 25277 6594 22560 14756 27421 10944 14091 39401 42916 11591 42660 44607 46666 11369 16780 26250 47407 23798 26860 13401 23420 20219 42827 963...
output:
105093 173280 109520 8549 89399 120395 141723 34545 90627 163318 59933 149446 140879 28720 49458 9776 36323 53673 125908 143045 152949 87302 87339 102626 86276 72069 91111 39821 106024 31663 64213 90298 16397 28972 150753 61682 16667 16636 134964 34616 53103 77412 88676 38482 166822 39072 1463 14765...
result:
ok 50000 lines
Test #113:
score: 9
Accepted
time: 922ms
memory: 11528kb
input:
50000 49999 341 17638 21365 5281 47768 5090 47712 20149 20153 29456 49100 24961 29320 8641 11298 43422 46222 44377 46907 9733 22363 34119 45432 12753 39668 22651 38350 6970 30973 12232 16610 1557 6297 32601 38532 23900 49403 33788 43520 21301 21739 1510 41168 24699 40004 15371 20177 2489 40051 23675...
output:
75807 23807 23983 23864 30278 95994 82855 49955 36803 16513 74143 64108 51663 19805 100372 36990 45532 26 43767 96885 42746 97690 35167 16469 77291 36697 43042 85417 85480 23790 46344 86499 17545 18962 16583 36963 41379 62467 93420 103500 69569 47925 46642 36006 64902 24795 96846 39795 45443 22111 7...
result:
ok 50000 lines
Test #114:
score: 9
Accepted
time: 197ms
memory: 11928kb
input:
49900 50000 285 30753 46220 15595 31957 23746 29939 13939 35588 38307 44696 22608 26624 33574 43521 33658 33852 3939 47769 20137 31656 3670 9344 12229 22770 34102 35181 18147 31401 20053 33106 7854 38024 16629 41414 15576 27048 6390 15072 13765 43364 20613 42920 10873 35723 9602 38861 46642 47219 50...
output:
2710 2635 2168 2133 1695 3070 2177 1705 1667 1624 1608 2217 1645 1070 1628 1624 1635 3067 1663 2679 2135 2121 2631 1090 1633 2186 1107 1657 2164 1088 2659 2190 1656 2187 3575 1599 1702 1667 1055 2163 1662 2210 1591 1083 3062 2144 2688 2166 2142 1615 2148 2170 1706 2597 1624 1711 1120 2597 1053 2171 ...
result:
ok 49900 lines
Test #115:
score: 9
Accepted
time: 29ms
memory: 13636kb
input:
49900 50000 170 7561 22914 6411 24874 18073 46931 36812 47144 20200 25128 15509 17306 25527 42350 5281 36002 15194 30097 20419 32970 1126 16633 28823 38225 21462 44869 29650 32900 24405 34633 7093 42439 36131 44356 16494 29977 16889 43229 17081 32742 9803 21970 15460 27818 809 28282 15695 43459 2687...
output:
90 77 78 58 73 49 111 91 65 84 75 81 69 67 62 80 43 63 64 73 86 86 81 101 95 75 72 73 81 87 79 82 79 84 85 82 82 70 71 18 35 94 84 70 91 56 76 70 63 96 87 77 60 82 86 81 93 45 44 55 74 38 89 81 62 51 80 76 57 71 87 96 84 38 74 72 71 76 78 80 83 87 94 78 85 77 46 63 71 64 83 79 51 83 25 83 88 68 40 7...
result:
ok 49900 lines
Test #116:
score: 9
Accepted
time: 47ms
memory: 12432kb
input:
49900 50000 207 2578 46902 14806 32936 10122 25946 18796 31297 6498 22974 383 48056 3717 39729 11724 30644 68 37257 47909 49464 24129 27463 19508 32677 34439 44328 20881 32156 23801 30912 38114 42672 24012 47254 14213 30114 26682 32415 29336 31114 4310 24429 8395 35619 21029 29377 11835 16301 7025 3...
output:
669643 352556 198000 396317 330280 63157 158516 581971 226727 240670 553180 552371 1362177 1619892 67262 547553 22907 270255 1532197 280270 1070605 512754 1464059 199176 452564 1061236 516712 1625914 105657 1115583 491530 616095 379446 173380 623814 70594 286087 777340 79389 309017 226081 129146 121...
result:
ok 49900 lines
Test #117:
score: 9
Accepted
time: 39ms
memory: 13300kb
input:
40000 50000 334 9041 9606 16082 33113 16111 24851 10087 29862 3108 31569 10297 38212 15908 30094 3761 35189 15339 37864 29943 33622 12475 22979 31432 33626 5779 6818 4503 39463 16593 31191 26511 31915 30653 30910 3102 34297 10293 30024 25746 26538 16424 33538 5982 31495 14089 33231 30266 37297 21254...
output:
3348 3683 4015 3013 4685 3347 4016 4349 3683 3350 5020 4022 3683 2679 2345 3013 4021 4355 3682 4351 3681 4350 3682 4352 4350 4683 3685 4017 4352 3684 3681 3682 4016 4018 4019 3684 3347 4349 2683 3014 3683 3681 4685 4015 4018 3014 4018 3684 3683 4018 4016 4020 3683 3350 3681 4017 4683 4352 4353 2680 ...
result:
ok 40000 lines
Test #118:
score: 9
Accepted
time: 28ms
memory: 92048kb
input:
10000 50000 546 210 8909 2515 9353 2940 4140 7351 8409 4077 9687 1309 9992 1228 6828 3063 3090 6053 6532 4619 7928 6121 8409 1484 8893 4888 5880 7121 8547 1465 3466 4435 6543 3859 8155 3539 9334 274 1290 877 1934 1209 8956 5845 9330 667 6720 5568 6345 2512 4101 4799 5119 994 5566 1618 5086 1478 2570...
output:
3 4 3 5 5 4 5 5 3 3 4 4 5 4 4 4 3 5 3 5 5 3 4 4 5 5 5 4 4 4 4 4 4 3 3 5 4 3 4 4 4 4 4 3 4 4 4 3 4 4 4 3 5 4 4 5 4 4 4 4 4 4 4 4 5 4 3 4 4 4 4 4 4 3 5 5 4 5 4 4 5 5 5 4 5 5 4 4 4 3 5 3 4 4 5 4 4 4 4 4 2 4 4 5 4 4 4 5 4 3 4 4 4 4 5 4 1 4 5 4 4 4 5 5 5 4 4 5 4 5 4 4 5 4 4 4 5 5 4 4 4 5 4 4 4 5 4 3 5 4 ...
result:
ok 10000 lines
Test #119:
score: 9
Accepted
time: 17ms
memory: 11652kb
input:
10000 50000 372 2161 8629 3686 4237 1239 1961 4582 7421 902 4419 5706 8704 4967 6728 3526 9331 3236 5836 514 1820 542 2799 2191 3647 8892 9624 8741 8956 6269 9739 2575 3717 3895 8125 39 3118 2423 5395 1802 3402 2594 9137 410 5856 453 7588 222 6049 4928 9883 209 9170 5645 7815 384 4339 1650 4872 3215...
output:
5 5 5 5 4 4 3 5 3 4 4 4 4 4 3 4 3 3 5 5 5 4 4 4 4 4 4 5 3 5 5 4 5 5 3 3 3 3 4 4 4 4 5 4 5 4 4 5 4 6 3 4 5 4 4 4 4 5 5 3 4 5 5 4 4 4 5 5 4 5 5 5 4 5 5 5 5 4 5 4 5 4 5 3 5 5 4 4 4 4 4 4 4 5 4 5 5 5 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 5 4 5 5 4 4 5 5 5 5 5 4 5 4 5 4 6 5 5 5 4 4 4 3 5 5 5 4 4 4 3 4 4 4 3 5 ...
result:
ok 10000 lines
Test #120:
score: 9
Accepted
time: 77ms
memory: 324956kb
input:
37907 50000 1402 16224 29098 4535 7557 13856 24095 21572 36459 2884 14560 11037 23533 16738 22517 4430 34356 14536 34179 25277 37645 20869 32771 27546 35023 14995 17154 6741 13426 35421 37231 1889 27006 12393 17945 19973 33807 9171 15907 9305 25573 25236 33888 26148 27053 9096 22721 6502 20093 5469 ...
output:
13 11 12 9 12 12 12 14 10 15 9 13 11 13 9 12 11 14 10 12 9 9 5 12 14 11 13 11 12 15 10 6 12 15 12 5 9 11 7 13 11 11 11 12 14 12 9 9 15 7 11 9 13 13 14 13 12 13 11 10 13 10 10 7 9 13 11 8 11 13 10 10 10 11 12 12 13 10 11 10 12 12 12 10 9 9 11 6 11 12 14 11 9 11 12 12 12 13 9 11 9 11 11 12 11 13 9 13 ...
result:
ok 37907 lines
Test #121:
score: 9
Accepted
time: 40ms
memory: 405788kb
input:
50000 50000 50000 10757 24277 6053 32088 11723 39552 34315 45339 14362 35031 5508 34085 18725 49030 27330 30024 2954 31292 2577 40806 21252 30717 13301 35449 1136 5352 3071 45957 35843 43157 20089 22174 9866 42109 9110 45027 19711 26073 19387 23132 1599 28511 16359 27524 10102 10393 18284 31487 1651...
output:
827350001 654900001 85700001 257150001 552600001 641250001 863500001 946300001 268650001 32050001 71500001 254700001 46600001 819750001 66250001 826950001 401100001 422500001 747050001 937000001 29250001 606250001 24350001 377800001 635550001 518850001 155900001 933800001 139100001 724100001 2562000...
result:
ok 50000 lines
Test #122:
score: 9
Accepted
time: 21ms
memory: 13552kb
input:
49662 49908 200 26870 26871 23979 23980 31532 31533 25312 25313 16535 16536 12704 12705 25934 25935 24286 24287 42105 42106 18193 18194 606 807 28693 28694 5007 5008 35913 35914 9517 9518 6974 6975 254 255 16442 16443 48322 48323 20849 20850 9728 9729 33333 33334 6531 6532 32711 32712 6213 6214 4740...
output:
43601 43800 43799 43798 43797 43796 43795 43794 43793 43792 43791 43790 43789 43788 43787 43786 43785 43784 43783 43782 43781 43780 43779 43778 43777 43776 43775 43774 43773 43772 43771 43770 43769 43768 43767 43766 43765 43764 43763 43762 43761 43760 43759 43758 43757 43756 43755 43754 43753 43752 ...
result:
ok 49662 lines
Test #123:
score: 9
Accepted
time: 20ms
memory: 11224kb
input:
49736 49859 400 22120 22121 27713 27714 39568 39569 28915 28916 39499 39500 42799 42800 39304 39305 1888 1889 42556 42557 32961 32962 13930 13931 18044 18045 44353 44354 3109 3110 40774 40775 16305 16306 46930 46931 28747 28748 35458 35459 6874 6875 46303 46304 46238 46239 23032 23033 419 420 5485 5...
output:
36001 36400 36399 36398 36397 36396 36395 36394 36393 36392 36391 36390 36389 36388 36387 36386 36385 36384 36383 36382 36381 36380 36379 36378 36377 36376 36375 36374 36373 36372 36371 36370 36369 36368 36367 36366 36365 36364 36363 36362 36361 36360 36359 36358 36357 36356 36355 36354 36353 36352 ...
result:
ok 49736 lines
Test #124:
score: 9
Accepted
time: 20ms
memory: 13304kb
input:
49606 49704 500 33313 33314 12228 12229 48777 48778 16774 16775 2004 2005 11187 11188 20716 20717 42625 42626 35474 35475 30891 30892 31030 31031 30722 30723 17069 17070 29104 29105 2350 2351 43611 43612 22718 22719 26934 26935 9751 9752 22521 22522 26613 26614 38206 38207 5619 5620 18438 18439 5090...
output:
21501 21996 21995 21994 21993 21992 21991 21990 21989 21988 21987 21986 21985 21984 21983 21982 21981 21980 21979 21978 21977 21976 21975 21974 21973 21972 21971 21970 21969 21968 21967 21966 21965 21964 21963 21962 21961 21960 21959 21958 21957 21956 21955 21954 21953 21952 21951 21950 21949 21948 ...
result:
ok 49606 lines
Test #125:
score: 9
Accepted
time: 107ms
memory: 458852kb
input:
49778 49848 700 29106 29107 20802 20803 40289 40290 26034 26035 32600 32601 31897 31898 46967 46968 45138 45139 26991 26992 13810 13811 8854 8855 22916 22917 48977 48978 580 581 30377 30378 20768 20769 20247 20248 34735 34736 18677 18678 21666 21667 48376 48377 45595 45596 19567 19568 4577 4578 2869...
output:
7001 7701 7700 7699 7698 7697 7696 7695 7694 7693 7692 7691 7690 7689 7688 7687 7686 7685 7684 7683 7682 7681 7680 7679 7678 7677 7676 7675 7674 7673 7672 7671 7670 7669 7668 7667 7666 7665 7664 7663 7662 7661 7660 7659 7658 7657 7656 7655 7654 7653 7652 7651 7650 7649 7648 7647 7646 7645 7644 7643 ...
result:
ok 49778 lines
Test #126:
score: 9
Accepted
time: 524ms
memory: 13364kb
input:
50000 50000 150 25933 43736 37140 48029 39845 40067 28011 31948 22301 49712 13859 39127 13383 14197 4110 27327 21431 48237 15893 31562 3763 28215 2195 29603 4818 19080 42805 48880 17725 18221 17263 25249 27485 34335 1329 16077 28677 39776 3201 13386 7769 9541 9181 27491 32115 40821 7213 13831 962 38...
output:
4569 21109 7149 404 26603 24954 14065 34538 24302 24694 19266 30594 21674 37056 43374 12269 16834 42587 28151 29128 42785 12221 18676 36018 36458 1687 19300 33187 44387 32947 309 40579 40721 39871 8195 30667 424 38041 14367 2315 37539 44184 28710 43144 30049 26643 37166 17467 24572 18902 22678 30145...
result:
ok 50000 lines
Test #127:
score: 9
Accepted
time: 727ms
memory: 12104kb
input:
50000 50000 200 7815 9465 30099 47253 19856 40760 23666 41743 7201 46731 14901 44850 1695 3099 12250 20028 20327 39003 14900 26045 5851 26419 457 37784 13179 36813 29795 31704 12513 27836 25749 38638 19394 35855 16016 27317 9328 19258 23624 43002 36128 39100 647 22047 8878 28861 1803 16179 20076 393...
output:
15889 17179 10052 45379 1522 7959 44853 40735 44195 4235 18101 35418 26714 30814 26309 17146 11914 2359 22179 30126 10845 33073 6109 38761 40519 16767 9440 45577 44679 45161 37872 21464 55222 24257 27022 31934 23439 23205 5311 23663 932 11601 24903 45837 14969 48941 9489 44186 13400 31816 14642 1639...
result:
ok 50000 lines
Test #128:
score: 9
Accepted
time: 1089ms
memory: 11944kb
input:
50000 50000 300 46208 49090 15319 41529 11991 49204 1563 7319 32750 43217 31529 49587 20409 38034 744 4300 42183 46825 13613 30549 3337 34202 15999 20371 15070 44382 3513 33173 1459 18397 22054 43138 39011 46661 23877 44782 564 2624 14614 25621 11557 47898 5515 6932 33502 44072 960 26646 4710 27939 ...
output:
38196 10257 2237 20964 8380 34409 26079 36434 43451 40106 26513 44838 29528 21039 16442 28218 48927 39825 44499 21666 40209 3277 25662 10056 23146 13564 8068 12692 34946 10382 36376 13979 45423 42966 17713 658 20569 1093 37547 6264 6025 17257 1116 48123 21495 31596 39106 1178 13657 39829 25977 22368...
result:
ok 50000 lines
Test #129:
score: 9
Accepted
time: 1771ms
memory: 11208kb
input:
50000 50000 500 9660 35371 7979 40309 19384 41335 27245 32406 5782 18124 2424 23953 11558 25287 10385 11911 7670 13996 5505 7487 21683 47644 20324 42622 39333 49020 12800 13167 2277 24283 37531 43425 31524 43682 4925 43921 3122 16336 33937 37535 30509 36740 27449 34277 15820 17527 3830 15364 10559 1...
output:
5170 3081 44781 6912 32488 9148 36523 16877 16848 39826 33985 45910 11194 46548 25457 17975 33341 44007 47048 80989 5761 21415 10412 8002 23311 39743 12191 38164 13773 42996 38023 23540 34967 28408 2709 20430 6893 9067 1379 170273 18210 36230 6607 893 15020 46487 44892 1305 2021 27552 20876 44382 94...
result:
ok 50000 lines
Test #130:
score: 9
Accepted
time: 98ms
memory: 458188kb
input:
50000 50000 700 7948 33643 12772 36944 872 20182 23058 42601 11688 35280 2016 17906 32065 45648 4088 18316 26088 47283 6809 17708 38021 44147 18879 35014 12473 35651 14358 42252 44626 45156 13640 43502 24762 27548 29475 35054 8970 10972 25832 27373 17844 24637 32711 35024 23394 28886 4493 11779 224 ...
output:
40131 42783 47398 5225 22530 15443 41764 17701 26926 36733 44238 29198 3128 2799 26274 8136 43550 26511 330554 46469 39271 16507 10055 17140 298005 12908 26805 31788 4361 8514 42778 11728 30213 32762 2753 5765 17396 43167 16231 25473 35940 8224 9273 31623 26258 9219 41502 14480 4032 18578 47118 1617...
result:
ok 50000 lines
Test #131:
score: 9
Accepted
time: 68ms
memory: 441900kb
input:
50000 50000 1000 5385 28314 14349 16778 5015 28906 25906 35243 9641 34806 14675 28316 7723 40663 30209 39475 10681 15372 15765 47666 7240 37335 31154 31660 6363 21256 29621 43377 3650 29213 42603 48195 23935 36867 18453 26090 27802 43874 23865 27251 26198 49089 16678 42813 868 5153 8617 39507 29477 ...
output:
38939 43224 318809 22514 22572 26780 13174 5879 26307 7138 19696 41772 35346 21125 11191 6166 7305 37017 5099 39232 25470 1212 37343 892476 35997 34467 12342 39787 36275 15943 8953 7460 10371 46645 45700 6195 22213 30876 35664 26197 43412 15674 6361 22069 226112 3387 43108 3476 9689 45276 26602 4328...
result:
ok 50000 lines
Test #132:
score: 9
Accepted
time: 72ms
memory: 444608kb
input:
50000 50000 1000 9998 21547 13956 24122 9462 29895 37991 38097 14679 42844 19139 28261 2397 49049 31112 38094 23743 30327 14110 44126 9645 41720 9089 47865 16772 39290 4838 8943 20266 31688 5453 20128 9014 15463 4254 25793 9456 13773 18208 39261 34848 46550 19476 19807 26604 37415 19520 47819 9506 4...
output:
3285 31307 11872 38770 3656 29138 16247 26407 44994 4637 42876 743286 42539 30791 40725 25031 4966 14037 16048 14454 1785 12361 1140 10298 46416 369649 44377 38217 34514 27184 6469 33257 12684 11843 4161 4887 8050 42502 4277 38176 36569 41378 38415 20831 43256 1234 43826 40945 10627 36840 42960 7287...
result:
ok 50000 lines
Test #133:
score: 9
Accepted
time: 70ms
memory: 444236kb
input:
50000 50000 1000 31032 43273 9027 21639 21415 43727 28788 42412 9357 39236 1252 8259 17536 47907 59 3666 9761 37122 6538 16005 5523 23310 46021 47686 1240 41499 17684 24739 5751 11512 25050 35861 24846 47723 3959 16145 5981 40554 23371 24487 4548 17104 9064 23789 32508 36712 20046 39257 35929 43823 ...
output:
43332 16569 8778 11744 37778 6627 41767 26083 34939 28708 14030 40796 329229 45211 30793 1007 13150 43750 14667 12511 13821 24110 40976 4081 17437 35905 33457 32315 13291 33724 33207 42613 28111 6086 41207 19392 40609 40881 19830 29214 18190 28208 4141 26215 877 42575 13746 34954 9356 7792 3596 4339...
result:
ok 50000 lines
Test #134:
score: 9
Accepted
time: 55ms
memory: 429500kb
input:
50000 50000 1500 26152 44996 27233 42644 11580 47472 7154 33080 24458 37171 3477 26978 26993 29749 1818 8695 24641 25088 1726 8705 11143 47236 586 45928 27890 36190 1217 11650 19950 35818 10613 31082 14640 29855 28792 33200 28402 35496 496 24169 17013 40057 11839 15597 9755 33315 26507 47287 18749 4...
output:
11604 44808 2918 23441 23319 2119381 27250 32268 38647 10647 23193 12605 524 17196 1496089 44814 623919 36398 1552 28860 433 32838 16105 3637 6336 4069 40991 43814 41172 35057 19374 34443 34988 39484 29064 774 15122 43031 21535 3415 4460 24739 42945 45356 8265 30058 1504333 5237 6630 13026 42786 189...
result:
ok 50000 lines
Test #135:
score: 9
Accepted
time: 49ms
memory: 423312kb
input:
50000 50000 2000 35301 41246 17881 37383 8880 36792 6075 36407 3782 11281 8277 31635 830 38578 18498 49959 15064 19878 27685 32844 2902 3334 19516 46995 34958 44621 5944 16359 6276 16934 8352 28883 409 35942 29440 36514 644 44296 24400 48658 12251 16284 1405 22753 29887 44379 38590 46083 13906 19776...
output:
38161 22821 29563 40751 10274 26083 8648 3099 33896 11677 6201 8048 11493 35973 13353 14297 7617 35700 6078 17482 23324 2397726 221902 26286 28447 11026 12897 40326 35328 20899 408063 17748 6575 4434 1335 17117 15798 33809 569 41980 39157 3428 3787 20688 22082 13780 1383557 37053 36070 31351 2953247...
result:
ok 50000 lines
Test #136:
score: 9
Accepted
time: 48ms
memory: 417512kb
input:
50000 50000 3000 27130 39270 11235 39418 3150 37009 28706 38468 5358 49253 4586 42304 26965 47353 6897 13671 27850 36622 43358 47783 8280 11643 40677 49750 24712 31730 508 3572 4536 47999 10560 22307 31772 33949 4211 38132 41071 47722 30147 43504 23173 35309 2269 14333 39381 40980 9741 28837 29859 3...
output:
4684 34574 13130 1028189 8000 93911 31088 2999026 9775 19957 3365 29485 26386 33706 31670 12198 17477 20718 23468 18234 2717509 18226 5428748 25520 35721 11787 16109 15436 15979 1316 36048 5061 33124 17898 33332 24210 2943 28021 2821348 18716 30005 12662 332398 9114 32678 13772 6681932 28934 3921 27...
result:
ok 50000 lines
Test #137:
score: 9
Accepted
time: 40ms
memory: 413444kb
input:
50000 50000 4000 5407 7902 41900 44696 19407 35178 3984 4059 4412 28750 36784 38450 23892 46714 20431 46543 2167 32177 7010 18350 3767 41991 20141 43979 17461 49695 17095 47773 10567 47394 15232 47315 26817 42155 18034 30853 12929 20337 20549 29980 9510 39958 9794 34518 9823 34177 41944 49743 7543 3...
output:
10583 9638 32749 21303 297 23362 22022 34411 12378 3028 10554845 6358 6245465 10021057 1110 5433 10464 13320738 13806 19881 18788 11985440 269 7807992 20894 2692 29077 28056 29211 1781 11703 247 15602 11306939 24405 6496002 25346 14165 14484 25472 25548 12982 12388 7496 12450 33602 2498 10182638 156...
result:
ok 50000 lines
Test #138:
score: 9
Accepted
time: 27ms
memory: 408896kb
input:
50000 50000 8000 19135 33875 9467 38663 43017 45962 25640 29012 33940 39219 10122 25524 38933 49343 14716 15807 19442 30612 28717 40554 18622 27776 1475 13851 28427 45591 5850 18433 10370 20605 27328 32363 10568 23565 10450 36258 37720 45960 31176 34568 7733 33208 21678 24934 4588 5031 14356 46157 2...
output:
50358564 9000 47855537 48204514 4333 37972752 31336860 3518 15840 18607 45093585 17860 19092379 3072 24529879 29433179 33061289 3090 16720 5669367 20746 38813664 2452807 17334 46800911 24104 16687 28830677 28871750 16580 25680 2692 49715403 15188 16607600 49755768 6244289 42602812 22843 4499 14774 2...
result:
ok 50000 lines
Test #139:
score: 9
Accepted
time: 31ms
memory: 407244kb
input:
50000 50000 15000 1167 43227 34024 36432 10332 22737 33590 34200 19098 25118 15690 25826 14048 34254 26472 41199 34314 47138 17890 46566 12478 42824 11748 21892 48855 48902 20630 44311 19261 29821 9911 49250 26202 33834 4285 43266 362 11290 7360 27388 4308 28528 4589 41191 11074 45234 43994 44481 31...
output:
160795375 4938272 127180691 69802594 34660274 153665565 128597850 62820045 179567124 151241251 69519432 56989073 171327923 181427444 97771546 1862 748 3290 178996212 135774711 45486164 95560742 187268693 43380112 189128804 194887652 161923234 108925579 22947256 192422857 150265407 58585252 75038400 ...
result:
ok 50000 lines
Test #140:
score: 9
Accepted
time: 26ms
memory: 13596kb
input:
49999 49999 2 7899 16946 1167 46471 14365 32637 6638 29697 5576 25816 47130 49326 37052 40159 18417 38254 23039 48028 9812 42273 8258 9565 20410 35303 10848 39802 7934 36437 3551 36183 927 19184 31624 42654 31878 40043 17144 38662 4832 7477 6645 19633 38601 39183 36569 48944 43666 48606 20325 49003 ...
output:
19877 11828 36270 19499 1647 27486 9741 8986 4506 8712 6920 43788 34296 34859 1139 29739 25033 2863 35066 25141 19559 483 10116 39865 41573 8436 42399 7963 1481 4665 45660 12409 31096 28578 28990 1733 48735 25678 44721 11990 31570 49889 24039 27598 34502 21125 4038 44325 16733 43486 49435 11427 1800...
result:
ok 49999 lines
Test #141:
score: 9
Accepted
time: 31ms
memory: 11964kb
input:
49999 49999 10 3186 40399 34513 39445 27626 29677 35333 35921 28551 34584 11444 48722 21536 33842 4827 36099 14693 48457 11954 46300 25843 41002 18188 39037 1094 46959 15833 19339 2380 14944 8430 31884 3591 49922 635 23263 32843 38274 23411 43046 17792 22974 26238 41297 31815 33098 21165 37568 17752...
output:
178445 162187 154728 162442 166933 161632 156918 168730 156740 13635 150229 15271 183192 8818 7215 165083 178144 169989 172572 154066 174051 5830 327 165397 172002 4876 8377 165688 169538 182729 13893 168325 175464 173006 179336 157886 168203 157925 161729 181203 158380 163380 4112 155244 1214 15636...
result:
ok 49999 lines
Test #142:
score: 9
Accepted
time: 79ms
memory: 443516kb
input:
49999 49999 1000 4793 8533 3680 33571 37480 45247 42355 44053 2618 49752 23797 49453 603 42015 26473 40363 34543 37846 46186 48054 13170 39451 5535 48437 1010 39631 25063 27193 13263 31254 9395 15973 7683 43467 37476 49548 7359 36256 27903 33774 34740 36480 1810 33597 9934 44290 14959 28639 982 1924...
output:
16639995 16282 16658105 16652424 16645045 16654427 16654371 16650282 16645824 16640864 7878 16639256 7628 16648550 3944 16637082 16661562 7656 16647214 16636359 16660256 16664785 6911 16647069 3618 2762 16664970 16649385 16663733 6176 16637737 16638485 16647060 13004 16649906 16663020 16657728 16661...
result:
ok 49999 lines
Test #143:
score: 9
Accepted
time: 39ms
memory: 404156kb
input:
50000 49999 50000 28602 43532 10942 39232 23399 41114 46369 47975 3905 5030 7192 31116 8828 10397 3339 24532 2327 17341 27234 46183 23105 36709 19326 42009 23468 49170 5857 18018 1422 40233 33309 36914 18106 28480 28125 48264 30028 37697 16907 38023 8353 40564 34607 46446 22750 30805 27730 31959 264...
output:
983000001 451400001 1050500001 1243800001 1413150001 1184900001 233500001 2300050001 340850001 1183600001 2168850001 336200001 2199450001 2282700001 1942350001 1347250001 2260100001 636850001 2061800001 2451000001 231200001 1418600001 2086450001 492150001 572000001 2375550001 1455400001 1524550001 3...
result:
ok 50000 lines
Extra Test:
score: 0
Extra Test Passed