QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#834144 | #1349. Towns and Roads | Rong7 | AC ✓ | 162ms | 54676kb | C++17 | 5.6kb | 2024-12-27 12:00:07 | 2024-12-27 12:00:08 |
Judging History
answer
// Go in my style.
// Not afraid to dark.
#include <bits/stdc++.h>
using namespace std;
clock_t sttime;
#define STCLOCK sttime = clock ();
#define TIMENOW fprintf (stderr, "\nNOW TIME COSSEMED: %0.4lf\n", 1.0 * (clock () - sttime) / CLOCKS_PER_SEC);
#define inline __inline__ __attribute__ ((always_inline))
#define ll long long
namespace io {
int read_pos, read_dt; char read_char;
inline int read (int &p = read_pos){
p = 0, read_dt = 1; read_char = getchar ();
while (! isdigit (read_char)){
if (read_char == '-')
read_dt = - 1;
read_char = getchar ();
}
while (isdigit (read_char)){
p = (p << 1) + (p << 3) + read_char - 48;
read_char = getchar ();
}
return p = p * read_dt;
}
int write_sta[65], write_top;
inline void write (int x){
if (x < 0)
putchar ('-'), x = - x;
write_top = 0;
do
write_sta[write_top ++] = x % 10, x /= 10;
while (x);
while (write_top)
putchar (write_sta[-- write_top] + 48);
}
}
const int N = 2e5;
int n, df[N + 5], rp[N + 5], cnt, fa[N + 5], fl[N + 5], root, sz[N + 5];
array < int , 3 > eg[N + 5];
int firs[N + 5], nex[N * 2 + 5], to[N * 2 + 5], w[N * 2 + 5], tot;
ll dep[N + 5];
bool vis[N + 5];
inline void Add (int u, int v, int l){
nex[++ tot] = firs[u], firs[u] = tot, to[tot] = v, w[tot] = l;
nex[++ tot] = firs[v], firs[v] = tot, to[tot] = u, w[tot] = l;
}
void init (int u, int father){
fa[u] = father;
rp[df[u] = ++ cnt] = u;
sz[u] = 1;
for (int e = firs[u], v;e;e = nex[e]){
v = to[e];
if (v == father) continue;
dep[v] = dep[u] + w[e];
fl[v] = w[e];
init (v, u);
sz[u] += sz[v];
}
}
namespace ds {
namespace sgt {
#define lson(qb) ((qb) << 1)
#define rson(qb) ((qb) << 1 | 1)
const int P = N << 2;
int lt[P], rt[P];
int dwn[P];
ll mxd[P], dtag[P];
inline void put_tag (int p, int x){ mxd[p] += x; dtag[p] += x; }
inline void push_up (int p){
mxd[p] = - 0x3f3f3f3f3f3f3f3fll;
if (! dwn[lson (p)]) mxd[p] = max (mxd[p], mxd[lson (p)]);
if (! dwn[rson (p)]) mxd[p] = max (mxd[p], mxd[rson (p)]);
}
inline void push_down (int p){
if (dtag[p]){
put_tag (lson (p), dtag[p]);
put_tag (rson (p), dtag[p]);
dtag[p] = 0;
}
}
void Build (int p, int l, int r){
tie (lt[p], rt[p]) = {l, r};
dwn[p] = mxd[p] = dtag[p] = 0;
if (l == r) return mxd[p] = dep[rp[l]], void ();
int mid = (l + r) >> 1;
Build (lson (p), l, mid), Build (rson (p), mid + 1, r);
push_up (p);
}
void updm (int p, int l, int r, int x){
if (l <= lt[p] && rt[p] <= r) return put_tag (p, x), void ();
push_down (p);
int mid = (lt[p] + rt[p]) >> 1;
if (l <= mid) updm (lson (p), l, r, x);
if (r > mid) updm (rson (p), l, r, x);
push_up (p);
}
void updd (int p, int l, int r, int x){
if (l <= lt[p] && rt[p] <= r) return dwn[p] += x, void ();
push_down (p);
int mid = (lt[p] + rt[p]) >> 1;
if (l <= mid) updd (lson (p), l, r, x);
if (r > mid) updd (rson (p), l, r, x);
push_up (p);
}
void que (int p, ll d, vector < int > &ans){
if (lt[p] == rt[p]) return ans.push_back (rp[lt[p]]);
push_down (p);
if (! dwn[lson (p)] && mxd[lson (p)] == d) que (lson (p), d, ans);
if (! dwn[rson (p)] && mxd[rson (p)] == d) que (rson (p), d, ans);
}
#undef lson
#undef rson
}
} using namespace ds::sgt;
signed main (){
STCLOCK
io::read (n);
for (int i = 1, u, v, l;i < n;++ i){
io::read (u), io::read (v), io::read (l);
Add (u, v, l);
eg[i] = {u, v, l};
}
init (1, 0); Build (1, 1, n);
for (int T = io::read (), o, x, u, v, l;T --;){
io::read (o), io::read (x);
if (o == 2){
u = eg[x][0], v = eg[x][1], l = eg[x][2];
if (u != fa[v]) swap (u, v);
if (! vis[v]) updd (1, df[v], df[v] + sz[v] - 1, 1);
else {
if (df[v] > 1) updd (1, 1, df[v] - 1, 1);
if (df[v] + sz[v] <= n) updd (1, df[v] + sz[v], n, 1);
}
} else
if (o == 3){
u = eg[x][0], v = eg[x][1], l = eg[x][2];
if (u != fa[v]) swap (u, v);
if (! vis[v]) updd (1, df[v], df[v] + sz[v] - 1, - 1);
else {
if (df[v] > 1) updd (1, 1, df[v] - 1, - 1);
if (df[v] + sz[v] <= n) updd (1, df[v] + sz[v], n, - 1);
}
} else {
if (x == fa[root]){
vis[root] = false;
updm (1, 1, n, - fl[root]);
updm (1, df[root], df[root] + sz[root] - 1, fl[root] << 1);
} else {
vis[x] = true;
updm (1, 1, n, fl[x]);
updm (1, df[x], df[x] + sz[x] - 1, - fl[x] << 1);
}
root = x;
}
vector < int > ans;
que (1, mxd[1], ans); sort (ans.begin (), ans.end ());
io::write ((int) ans.size ());
for (int x : ans) putchar (' '), io::write (x);
puts ("");
}
TIMENOW
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 18520kb
input:
6 2 4 1 1 2 1 4 6 1 2 3 1 4 5 1 5 2 5 2 3 1 2 3 5 1 4
output:
1 6 2 3 4 3 1 3 4 1 5 2 1 3
result:
ok 14 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 18304kb
input:
5 3 4 1 2 1 1 4 5 1 3 2 1 6 2 2 3 2 1 2 1 3 2 4 1 4
output:
1 1 1 5 1 5 2 1 5 1 5 2 3 5
result:
ok 14 numbers
Test #3:
score: 0
Accepted
time: 120ms
memory: 54676kb
input:
200000 1 2 1000000 2 3 1000000 3 4 1000000 4 5 1000000 5 6 1000000 6 7 1000000 7 8 1000000 8 9 1000000 9 10 1000000 10 11 1000000 11 12 1000000 12 13 1000000 13 14 1000000 14 15 1000000 15 16 1000000 16 17 1000000 17 18 1000000 18 19 1000000 19 20 1000000 20 21 1000000 21 22 1000000 22 23 1000000 23...
output:
1 1 1 200000 1 200000 1 200000 1 170743 1 200000 1 200000 1 156064 1 200000 1 4407 1 200000 1 123236 1 123236 1 123236 1 97973 1 97973 1 97973 1 97973 1 97973 1 97973 1 52374 1 52374 1 52374 1 52374 1 52374 1 52374 1 91736 1 200000 1 22931 1 200000 1 200000 1 138184 1 138184 1 138184 1 200000 1 2000...
result:
ok 400067 numbers
Test #4:
score: 0
Accepted
time: 162ms
memory: 47228kb
input:
200000 54340 164290 752262 101006 68369 156415 138158 67183 499315 38218 93999 360356 167213 63082 908617 36325 38422 770786 128454 133854 75788 137217 195995 766454 108528 38646 604749 26460 30586 348531 91754 74043 969156 16281 121161 541171 137144 114596 852489 19649 94749 743933 180707 42780 257...
output:
1 95859 1 91946 1 125723 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 91946 1 24508 1 24508 1 24508 1 24508 1 24508 1 24508 1 78462 1 24508 1 24508 1 24508 1 24508 1 24508 1 24508 1 33812 1 33812 1 33812 1 12113 1 12113 1 1...
result:
ok 400000 numbers
Test #5:
score: 0
Accepted
time: 145ms
memory: 47572kb
input:
200000 14462 168775 971357 58824 62680 889335 32833 57656 63206 155084 89453 819259 145949 126279 831632 193887 139048 854318 145229 112281 873698 168440 71751 535065 164661 190079 46247 13556 87977 470022 53102 16989 879441 176063 120154 754402 30367 49479 487828 138334 52077 344183 14977 9357 3157...
output:
1 77399 1 46936 1 46936 1 46936 1 46936 1 46936 1 161194 1 161194 1 98090 1 161194 1 161194 1 161194 1 161194 1 161194 1 161194 1 88871 1 88871 1 88871 1 88871 1 88871 1 182283 1 182283 1 182283 1 182283 1 118098 1 118098 1 118098 1 118098 1 118098 1 118098 1 118098 1 118098 1 118098 1 118098 1 1180...
result:
ok 400000 numbers
Test #6:
score: 0
Accepted
time: 27ms
memory: 20404kb
input:
12 10 12 198418 3 10 441226 7 8 768030 5 2 211516 6 4 220687 3 9 870027 11 4 672742 2 1 887871 5 7 395630 11 8 892074 12 1 267996 200000 1 12 1 1 2 5 2 9 1 12 3 9 3 5 1 10 2 3 2 10 2 6 3 10 1 3 1 10 2 11 2 2 3 11 2 11 1 12 3 11 1 1 1 2 3 2 2 9 3 9 2 2 3 3 2 1 3 1 2 10 1 5 3 6 3 2 2 5 3 5 1 7 1 5 3 1...
output:
1 6 1 6 1 4 1 9 1 9 1 4 1 6 1 6 1 7 1 7 1 7 1 7 1 7 1 7 1 3 1 12 1 7 1 12 1 10 1 7 1 7 1 10 1 3 1 3 1 3 1 10 1 6 1 6 1 6 1 8 1 10 1 10 1 9 1 9 1 9 1 9 1 9 1 6 1 9 1 9 1 2 1 5 1 2 1 2 1 2 1 5 1 2 1 5 1 2 1 5 1 5 1 2 1 5 1 5 1 5 1 5 1 2 1 2 1 2 1 2 1 2 1 2 1 11 1 11 1 11 1 11 1 2 1 2 1 12 1 12 1 12 1 ...
result:
ok 400000 numbers
Test #7:
score: 0
Accepted
time: 18ms
memory: 18548kb
input:
5 3 4 849085 3 5 939478 2 1 900938 4 2 472161 200000 2 3 3 3 2 4 3 4 2 2 2 3 2 1 3 2 3 1 2 2 2 4 3 2 3 3 2 3 2 1 3 1 3 3 3 4 1 2 1 1 1 2 2 2 2 4 3 4 1 4 3 2 1 3 2 1 2 4 1 5 2 3 3 3 3 4 1 3 2 4 2 3 1 5 3 3 3 4 2 4 3 4 3 1 1 3 1 4 1 2 2 4 2 2 1 1 1 2 1 1 3 2 1 2 2 3 3 4 1 4 3 3 1 3 2 2 1 4 1 2 2 3 2 1...
output:
1 1 1 5 1 2 1 5 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 5 1 5 1 5 1 5 1 3 1 1 1 3 1 1 1 5 1 1 1 5 1 5 1 3 1 3 1 3 1 3 1 5 1 5 1 5 1 3 1 3 1 3 1 3 1 3 1 1 1 1 1 5 1 5 1 1 1 1 1 2 1 1 1 2 1 2 1 1 1 2 1 5 1 5 1 5 1 1 1 1 1 1 1 3 1 3 1 4 1 2 1 4 1 4 1 5 1 5 1 5 1 4 1 3 1 4 1 3 1 3 1 5 1 3 ...
result:
ok 400000 numbers
Test #8:
score: 0
Accepted
time: 27ms
memory: 30316kb
input:
48449 8210 37596 972731 42166 28721 953280 3190 8112 597860 47759 24755 398259 39295 19993 946938 1345 27569 406829 5044 27495 209975 23252 9575 549333 48003 13659 473679 25305 25762 982268 26749 44179 802211 24446 27088 150412 32002 6440 409711 31480 12578 317275 43709 32490 31536 4926 47550 750660...
output:
1 21717 1 38099 1 38099 1 38099 1 38099 1 38099 1 38099 1 38099 1 21717 1 38099 1 38099 1 38099 1 38099 1 21717 1 21717 1 21717 1 21717 1 21717 1 14632 1 21717 1 2024 1 38099 1 38099 1 38099 1 38099 1 38099 1 38099 1 38099 1 38099 1 2024 1 21717 1 28260 1 28260 1 21717 1 21717 1 21717 1 17953 1 1795...
result:
ok 85268 numbers
Test #9:
score: 0
Accepted
time: 64ms
memory: 22196kb
input:
28747 4117 9776 479901 11090 5575 466390 20537 4571 728614 28116 20862 155567 5991 4320 90172 2629 13324 981526 14445 25779 989285 55 24360 925603 506 8267 644960 313 18159 30465 19541 20747 94273 783 17946 529278 1926 14163 513851 1259 12466 297895 16228 18126 940040 9367 3271 372474 7654 1932 4824...
output:
1 23545 1 14271 1 14271 1 13631 1 13631 1 27177 1 27177 1 27177 1 13631 1 3332 1 9416 1 788 1 788 1 788 1 6914 1 6914 1 6914 1 6914 1 6914 1 973 1 13631 1 1811 1 1811 1 1811 1 1811 1 14995 1 14995 1 13631 1 13631 1 18109 1 18109 1 18109 1 18109 1 18109 1 18109 1 18109 1 18109 1 18109 1 18109 1 18109...
result:
ok 299128 numbers
Test #10:
score: 0
Accepted
time: 128ms
memory: 38768kb
input:
200000 22266 158897 745256 113291 92171 339647 117598 141456 686154 161313 29311 621244 170887 49268 396804 155606 107616 420263 103818 40701 317399 106741 51500 431643 40151 11209 457861 162507 12274 5995 94141 100601 562524 49328 137733 752257 45578 158844 804698 169304 57842 174507 50308 183777 6...
output:
1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155 1 4155...
result:
ok 400000 numbers
Test #11:
score: 0
Accepted
time: 121ms
memory: 38212kb
input:
200000 174494 145226 436200 79654 5063 581299 109642 49083 928956 179752 147856 209084 129064 87037 367953 60885 59428 103601 154533 107687 764749 96216 161214 763936 114369 22209 389959 74954 123962 468201 192538 85053 718912 178676 5036 994982 171708 64569 300407 78958 158708 829871 128333 89804 5...
output:
1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53938 1 53...
result:
ok 400000 numbers
Test #12:
score: 0
Accepted
time: 20ms
memory: 18192kb
input:
6 2 5 397181 6 5 776539 1 4 338713 3 1 862094 5 3 841391 200000 1 4 1 1 2 1 3 1 2 1 3 1 1 3 1 5 2 3 3 3 2 1 1 3 2 2 3 2 2 4 2 3 2 2 1 5 2 5 3 5 1 3 2 5 3 3 3 5 2 3 2 5 3 5 3 1 2 1 2 5 3 1 2 1 3 1 2 1 3 4 3 3 1 1 2 3 1 3 2 4 3 2 3 4 3 1 3 5 3 3 2 1 1 1 1 4 2 5 3 5 3 1 2 3 3 3 2 3 2 5 3 3 1 1 2 1 1 3 ...
output:
1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 4 1 1 1 4 1 4 1 6 1 4 1 6 1 6 1 6 1 5 1 3 1 5 1 3 1 5 1 3 1 3 1 5 1 5 1 3 1 5 1 2 1 5 1 3 1 3 1 3 1 3 1 3 1 1 1 4 1 3 1 3 1 1 1 3 1 3 1 1 1 1 1 6 1 6 1 6 1 6 1 6 1 3 1 6 1 6 1 4 1 6 1 4 1 4 1 3 1 3 1 3 1 4 1 1 1 1 1 6 1 1 1 4 1 4 1 4 1 4 1 4 1 6 1 6 1 6 1 6 1 1 1 4 1 1 ...
result:
ok 400000 numbers
Test #13:
score: 0
Accepted
time: 22ms
memory: 16288kb
input:
9 1 5 462434 5 2 265429 1 9 94726 4 1 809917 9 8 120421 3 6 483880 2 3 953852 7 3 275952 200000 2 1 1 9 2 8 1 8 1 9 3 1 1 8 3 8 1 9 1 8 2 2 2 8 3 2 1 9 2 1 3 1 3 8 1 1 1 5 1 2 2 1 2 4 3 4 3 1 2 7 3 7 2 2 1 3 1 7 1 3 3 2 1 2 2 3 2 8 1 5 1 2 2 6 1 5 2 4 1 1 3 3 1 9 2 1 2 5 3 8 2 3 3 1 3 6 3 5 1 8 2 6 ...
output:
1 4 1 4 1 4 1 4 1 4 1 6 1 6 1 6 1 6 1 6 1 4 1 4 1 6 1 6 1 4 1 6 1 6 1 6 1 6 1 4 1 6 1 6 1 6 1 4 1 4 1 4 1 6 1 2 1 2 1 2 1 4 1 4 1 4 1 4 1 6 1 4 1 4 1 4 1 3 1 3 1 3 1 3 1 8 1 1 1 1 1 9 1 9 1 9 1 8 1 9 1 9 1 8 1 9 1 8 1 8 1 9 1 9 1 9 1 8 1 8 1 8 1 9 1 9 1 9 1 8 1 9 1 8 1 8 1 8 1 8 1 8 1 9 1 9 1 6 1 6 ...
result:
ok 400000 numbers
Test #14:
score: 0
Accepted
time: 48ms
memory: 37960kb
input:
191473 51810 189919 801278 129258 162541 277425 186073 173706 623147 98359 47012 87392 162093 163300 527085 49682 167689 660272 47407 48210 547487 126444 1630 337308 112931 40705 500983 123768 59171 142751 165513 114206 423386 98730 161122 3247 11065 57157 513136 37105 149628 486997 85726 109963 514...
output:
1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82640 1 82...
result:
ok 64042 numbers
Test #15:
score: 0
Accepted
time: 43ms
memory: 28712kb
input:
49859 1676 26493 279075 42045 1400 304947 17677 26745 746632 35797 32140 619503 40218 13804 171423 37616 27106 248847 7995 44986 66439 33126 1214 114066 29930 48830 865656 12431 362 262680 14532 37029 760029 22409 42639 133309 32113 21738 124136 2644 28679 263095 9617 22783 955692 38636 10959 906892...
output:
1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487 1 3487...
result:
ok 201562 numbers
Test #16:
score: 0
Accepted
time: 0ms
memory: 18456kb
input:
6 2 4 1 1 2 1 4 6 1 2 3 1 4 5 1 5 2 5 2 3 1 2 3 5 1 4
output:
1 6 2 3 4 3 1 3 4 1 5 2 1 3
result:
ok 14 numbers
Test #17:
score: 0
Accepted
time: 0ms
memory: 20228kb
input:
5 3 4 1 2 1 1 4 5 1 3 2 1 6 2 2 3 2 1 2 1 3 2 4 1 4
output:
1 1 1 5 1 5 2 1 5 1 5 2 3 5
result:
ok 14 numbers
Test #18:
score: 0
Accepted
time: 121ms
memory: 38464kb
input:
200000 143577 180700 768861 7088 66603 224940 132504 15800 460424 88664 139803 526830 109606 133835 587340 109124 140721 394854 167436 12942 863937 162093 150584 212192 116078 152201 375446 70215 37141 622681 39096 161987 395109 114910 123 669734 155511 141422 959505 117207 161890 396424 169068 8268...
output:
1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 189049 1 1...
result:
ok 400000 numbers
Test #19:
score: 0
Accepted
time: 123ms
memory: 39096kb
input:
200000 185597 184377 171916 60977 91470 805870 189977 192951 78437 176635 96998 40114 80591 24764 320454 118073 142449 799719 46372 54815 965454 28145 34669 68033 196375 42388 717815 132961 35957 548410 77358 184681 214089 40837 199499 808156 29566 92767 484074 13410 54278 755691 47693 1477 379924 4...
output:
1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21823 1 21...
result:
ok 400000 numbers
Test #20:
score: 0
Accepted
time: 13ms
memory: 18300kb
input:
3 2 3 43648 2 1 670658 200000 1 2 1 1 1 2 2 2 2 1 3 1 1 3 1 2 2 1 3 1 3 2 1 1 1 2 2 1 2 2 3 1 1 3 3 2 1 2 2 2 1 3 3 2 1 2 2 2 3 2 2 2 3 2 1 3 1 2 1 1 2 1 3 1 1 2 1 1 1 2 2 2 1 3 1 2 2 1 3 2 2 2 3 1 1 3 2 1 3 2 2 2 3 2 3 1 2 2 2 1 3 2 2 2 3 1 2 1 3 1 1 2 2 1 3 1 2 1 3 2 1 1 1 2 2 2 3 2 1 1 1 2 1 1 2 ...
output:
1 1 1 3 1 1 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 1 1 3 1 1 1 1 1 2 1 3 1 2 1 1 1 1 1 3 1 2 1 1 1 1 1 3 1 1 1 3 1 1 1 1 1 1 1 3 1 2 1 3 1 1 1 3 1 1 1 3 1 2 1 3 1 2 1 1 1 2 1 3 1 2 1 3 1 3 1 3 1 3 1 1 1 2 1 3 1 3 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 3 1 2 ...
result:
ok 400000 numbers
Test #21:
score: 0
Accepted
time: 24ms
memory: 20356kb
input:
7 6 1 148151 7 3 868907 2 6 387349 3 4 854971 5 6 430387 1 3 449223 200000 1 6 2 3 3 3 1 2 1 6 2 2 1 1 2 5 1 6 3 5 2 5 2 6 2 3 3 6 2 1 3 5 1 5 2 6 1 6 3 1 3 6 1 5 3 3 3 2 2 5 3 5 1 6 2 4 2 3 2 2 1 5 3 4 1 6 3 3 1 2 1 6 1 5 3 2 2 3 2 5 3 5 1 6 1 5 3 3 2 1 1 6 3 1 2 4 3 4 1 1 1 3 1 1 2 1 2 5 2 4 3 1 1...
output:
1 7 1 7 1 7 1 7 1 7 1 4 1 4 1 4 1 4 1 4 1 4 1 2 1 1 1 4 1 6 1 5 1 6 1 6 1 5 1 5 1 4 1 4 1 4 1 7 1 5 1 7 1 7 1 7 1 7 1 3 1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 7 1 7 1 5 1 7 1 7 1 7 1 7 1 2 1 5 1 7 1 7 1 7 1 7 1 5 1 7 1 7 1 7 1 7 1 7 1 2 1 2 1 7 1 4 1 3 1 4 1 3 1 2 1 6 1 4 1 4 1 4 1 4 1 3 1 6 1 1 1 1 1 1 1 3 ...
result:
ok 400000 numbers
Test #22:
score: 0
Accepted
time: 40ms
memory: 25308kb
input:
36674 28886 24800 286160 26392 22517 653449 33099 5443 395558 13306 5342 744767 33196 31995 190140 5886 33007 702054 350 24741 931564 33225 31455 228142 32258 29908 68564 29247 19310 553623 31581 33197 393508 10900 16917 689037 7038 10959 486649 33550 28593 311321 30868 19204 408193 28408 30797 1597...
output:
1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16975 1 16...
result:
ok 197194 numbers
Test #23:
score: 0
Accepted
time: 58ms
memory: 19792kb
input:
17231 5245 12437 255000 13704 6715 326876 1844 5037 894809 11886 1416 570559 3032 6533 813925 2482 7856 683437 8298 13469 611449 5415 14855 975474 15633 16706 329769 13961 8145 759610 5989 9031 539654 11480 11916 93874 13114 12445 655491 12678 9340 654992 11824 13692 866322 5421 13476 576117 2634 43...
output:
1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227 1 7227...
result:
ok 397320 numbers
Test #24:
score: 0
Accepted
time: 57ms
memory: 36148kb
input:
200000 162928 118768 281233 113479 47079 281233 2512 150595 281233 182464 97888 281233 104184 24698 281233 174739 28934 281233 175458 30618 281233 15987 181798 281233 130429 15467 281233 24124 98536 281233 155750 23409 281233 61138 127734 281233 126280 196197 281233 74681 185981 281233 63950 197220 ...
output:
3393 75 117 145 195 404 424 579 673 680 711 726 806 882 917 975 1026 1032 1099 1104 1123 1188 1250 1302 1306 1384 1386 1390 1413 1455 1563 1583 1662 1768 1796 1805 1852 1892 1940 2012 2072 2095 2175 2228 2307 2333 2459 2599 2601 2610 2708 2793 2878 2937 2962 2993 3091 3151 3176 3204 3213 3356 3390 3...
result:
ok 397097 numbers
Test #25:
score: 0
Accepted
time: 68ms
memory: 38280kb
input:
200000 118025 113420 226280 148028 148708 226280 39170 53468 226280 173373 69928 226280 18644 183331 226280 96199 140268 226280 1042 125125 226280 74294 28292 226280 130621 152843 226280 84350 41824 226280 76491 61282 226280 140950 136297 226280 66373 7334 226280 76334 97120 226280 87339 154625 2262...
output:
65535 3 6 10 11 12 19 28 29 35 38 39 48 49 51 53 55 56 57 58 59 62 65 68 74 82 89 93 95 98 99 102 106 108 115 119 121 126 127 130 131 132 135 136 137 140 147 151 153 155 160 168 173 179 182 183 184 185 188 190 193 203 206 207 209 211 212 215 216 219 220 222 223 228 232 238 239 242 251 254 257 258 26...
result:
ok 393211 numbers
Test #26:
score: 0
Accepted
time: 32ms
memory: 18296kb
input:
13 11 2 848147 5 10 848147 8 2 848147 1 9 848147 7 9 848147 9 2 848147 12 5 848147 12 13 848147 8 4 848147 3 12 848147 6 8 848147 5 11 848147 200000 1 9 2 10 2 6 3 10 2 4 2 8 3 8 3 6 1 7 2 11 1 9 3 11 3 4 2 3 3 3 1 2 2 4 1 8 2 12 2 6 2 7 3 7 3 6 2 3 2 5 2 10 1 6 2 6 3 12 2 7 3 3 3 7 3 6 2 3 2 8 3 8 ...
output:
2 3 13 1 13 2 1 7 2 1 7 1 7 1 7 1 7 2 3 13 2 3 13 2 3 13 2 3 13 2 3 13 2 3 13 2 3 13 2 3 13 2 3 13 2 3 13 2 3 13 1 7 1 11 1 11 1 11 1 7 2 4 6 2 4 6 2 4 6 1 4 1 4 1 4 1 4 1 10 1 13 1 13 1 4 1 4 1 4 2 4 6 2 4 6 2 4 6 1 10 1 10 1 10 1 4 1 4 1 4 2 4 6 2 4 6 1 5 1 10 1 5 1 5 1 11 1 11 1 11 1 5 1 4 1 4 2 ...
result:
ok 540658 numbers
Test #27:
score: 0
Accepted
time: 28ms
memory: 20280kb
input:
11 11 10 611285 4 8 611285 8 7 611285 2 4 611285 10 3 611285 10 2 611285 6 9 611285 5 9 611285 8 1 611285 9 2 611285 200000 1 8 2 5 2 4 2 6 3 5 2 3 2 1 3 4 2 8 3 1 1 4 2 7 3 7 1 8 2 10 3 3 1 4 2 1 2 4 1 8 2 7 2 3 3 8 3 4 1 1 3 3 3 10 3 6 3 7 3 1 2 8 2 6 2 2 3 6 3 8 1 8 3 2 2 2 2 4 1 7 1 8 1 1 3 4 1 ...
output:
4 3 5 6 11 3 5 6 11 3 1 4 7 3 1 4 7 3 1 4 7 2 1 4 2 1 4 2 5 6 1 6 1 6 1 6 2 1 9 1 6 1 6 1 2 1 2 2 1 7 2 1 7 2 1 7 3 1 4 7 3 1 4 7 2 1 4 2 1 4 1 2 1 2 1 2 1 5 2 3 5 3 3 5 6 4 3 5 6 11 3 3 6 11 1 6 1 7 1 7 1 7 2 1 7 4 3 5 6 11 2 1 7 2 1 7 1 1 2 1 7 1 7 1 7 2 1 7 2 1 7 2 5 6 1 2 1 2 2 3 11 2 3 11 1 11 ...
result:
ok 530124 numbers
Test #28:
score: 0
Accepted
time: 51ms
memory: 36972kb
input:
161275 34772 93310 481815 69120 95371 481815 52691 95888 481815 122804 9394 481815 25389 126068 481815 85927 27754 481815 134281 77343 481815 19161 64116 481815 47818 74337 481815 66364 76683 481815 23704 151928 481815 94961 20821 481815 61100 126757 481815 117321 147789 481815 145858 105423 481815 ...
output:
30204 3 6 9 10 12 19 27 38 41 47 50 51 54 63 64 69 75 76 77 89 90 100 102 103 105 106 111 117 121 124 127 128 134 135 138 147 156 158 165 176 178 183 191 193 196 198 199 205 220 227 240 259 269 272 276 279 281 283 284 285 286 289 296 301 305 310 312 314 324 326 329 331 332 334 335 336 346 360 374 38...
result:
ok 392661 numbers
Test #29:
score: 0
Accepted
time: 40ms
memory: 27696kb
input:
63241 62115 35096 245395 60327 39653 245395 21699 52064 245395 11932 53809 245395 2238 57096 245395 5729 27886 245395 11468 51724 245395 15511 5407 245395 12086 52779 245395 26461 21639 245395 17461 29252 245395 8114 33309 245395 41105 11122 245395 10894 61626 245395 3238 12628 245395 24833 32964 24...
output:
14090 3 8 9 10 23 26 29 34 37 42 50 56 63 67 68 69 74 78 82 84 88 89 101 115 116 122 123 126 127 129 130 137 140 145 150 152 156 181 190 193 194 195 199 201 202 203 209 215 234 242 244 247 252 253 254 258 267 268 271 280 282 283 289 299 301 307 327 328 334 338 362 364 372 378 381 382 384 385 387 390...
result:
ok 394387 numbers
Test #30:
score: 0
Accepted
time: 135ms
memory: 38212kb
input:
200000 158485 157943 187225 104503 107187 365870 54719 54443 65126 188623 138706 170274 142178 73158 235544 189988 151381 992013 183750 46628 925628 21622 113121 723688 144543 110577 477718 144195 138648 951627 68005 19795 607760 171653 42026 606629 58059 158947 323603 108749 157766 312784 4714 1038...
output:
1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 194651 1 1...
result:
ok 400000 numbers
Test #31:
score: 0
Accepted
time: 124ms
memory: 35984kb
input:
200000 42037 46268 190857 113037 140594 747386 176149 161859 95281 165604 68865 286716 55439 70436 907189 12426 2760 787127 123696 171960 361929 37794 19916 610568 100824 136552 103482 51154 106773 749175 164178 63881 152463 74211 172274 90203 61035 144412 300852 89383 124418 710967 171382 198969 37...
output:
1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33826 1 33...
result:
ok 400000 numbers
Test #32:
score: 0
Accepted
time: 23ms
memory: 18268kb
input:
8 4 8 376739 3 2 376739 5 4 376739 1 7 376739 6 7 376739 4 6 376739 7 3 376739 200000 2 7 2 4 2 6 2 2 3 6 2 5 3 7 3 4 2 6 1 7 2 1 2 4 3 2 2 7 3 4 2 2 1 1 1 7 1 1 1 7 3 2 3 1 1 1 3 7 3 5 1 7 1 3 1 7 2 5 1 3 2 7 3 5 2 2 3 7 1 7 2 7 2 5 1 1 3 7 1 7 3 5 1 6 2 3 2 5 3 2 3 5 3 3 3 6 1 4 2 7 2 3 2 6 1 8 3 ...
output:
2 5 8 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 2 1 3 2 1 3 1 3 1 2 1 7 1 1 1 1 1 7 1 1 1 7 1 1 1 1 1 1 1 7 1 2 1 2 1 2 2 1 6 1 2 1 2 1 1 1 2 1 2 1 3 2 1 6 3 1 3 6 2 1 6 1 1 1 7 1 3 2 1 3 3 1 3 6 2 1 3 2 1 3 1 6 1 6 1 2 1 2 1 2 1 2 1 1 1 1 1 8 1 4 1 4 1 5 1 2 2 1 3 1 2 1 8 1 2 1 2 2 1 3 2 1 3 1 2 1 2 1 2 1 2 ...
result:
ok 464161 numbers
Test #33:
score: 0
Accepted
time: 23ms
memory: 20504kb
input:
8 7 3 83242 7 1 83242 2 3 83242 5 4 83242 4 6 83242 3 8 83242 4 2 83242 200000 1 7 2 1 3 1 1 1 2 5 1 7 2 6 3 6 3 5 2 7 2 2 3 7 3 2 1 1 1 7 2 3 1 3 3 3 2 7 1 7 2 4 3 7 1 3 3 4 1 8 2 5 3 5 1 3 1 2 1 3 1 7 1 3 2 6 1 7 2 7 1 3 1 7 1 3 2 2 3 2 3 6 3 7 2 2 1 7 3 2 1 1 2 2 3 2 1 7 2 7 2 4 3 7 1 1 3 4 1 7 2...
output:
2 5 6 1 1 2 5 6 2 5 6 1 5 1 5 1 5 1 5 2 5 6 2 2 8 2 2 8 2 5 6 2 5 6 2 5 6 2 5 6 1 8 1 1 2 5 6 1 1 2 2 8 2 2 8 1 6 1 6 2 5 6 2 5 6 1 5 2 5 6 2 5 6 1 1 2 5 6 2 5 6 2 5 6 2 5 6 2 5 6 1 2 1 1 1 2 1 1 2 2 7 1 1 1 1 2 5 6 2 5 6 2 5 6 2 5 6 2 5 6 1 1 2 5 6 2 5 6 2 2 8 2 2 8 1 6 1 6 2 5 6 2 5 6 1 5 1 1 1 5 ...
result:
ok 464225 numbers
Test #34:
score: 0
Accepted
time: 31ms
memory: 16420kb
input:
16 5 14 764470 9 14 764470 8 15 764470 10 11 764470 14 3 764470 15 4 764470 1 12 764470 1 6 764470 7 1 764470 12 13 764470 13 9 764470 10 16 764470 12 15 764470 9 10 764470 11 2 764470 200000 1 12 2 10 2 7 2 6 2 9 2 8 2 11 2 4 3 6 1 15 1 4 3 9 2 9 1 15 1 8 3 10 2 15 1 15 3 11 2 13 1 4 2 5 2 14 1 15 ...
output:
1 2 4 4 6 7 8 2 4 8 1 8 1 8 1 8 1 8 1 8 2 4 8 3 4 8 12 2 8 12 2 8 12 2 8 12 3 4 8 12 2 4 12 1 13 1 13 1 13 3 3 5 16 2 4 8 1 8 1 8 1 8 2 4 8 2 4 8 2 4 8 1 8 1 4 1 4 1 4 1 4 1 4 1 4 1 15 1 4 1 15 1 15 1 15 1 15 1 15 1 15 1 4 1 4 1 4 1 15 2 6 7 2 6 7 1 7 1 7 1 12 2 4 12 1 12 1 15 1 15 1 4 1 4 1 4 1 4 1...
result:
ok 535850 numbers
Test #35:
score: 0
Accepted
time: 33ms
memory: 20160kb
input:
16 10 6 451815 8 5 451815 1 9 451815 7 8 451815 2 9 451815 16 11 451815 3 16 451815 4 12 451815 6 13 451815 11 14 451815 9 12 451815 8 12 451815 10 11 451815 15 6 451815 10 4 451815 200000 2 10 2 7 1 9 1 12 1 9 3 7 2 13 2 6 2 9 2 5 3 6 3 5 3 13 1 2 1 9 3 9 2 15 3 10 3 15 1 1 1 9 1 1 2 1 3 1 1 9 1 12...
output:
1 3 3 13 15 16 3 13 15 16 3 13 15 16 3 13 15 16 1 3 2 13 15 2 13 15 1 15 1 15 1 15 1 15 1 3 1 3 1 3 1 3 2 5 7 2 5 7 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 3 13 14 15 1 14 1 14 4 1 2 7 10 4 1 2 7 10 3 1 2 10 1 10 3 1 2 12 2 1 12 3 1 2 12 1 10 1 10 3 1 2 10 2 1 2 1 2 2 2 10 2 2 10 2 2 10 1 2 1 2 ...
result:
ok 535207 numbers
Test #36:
score: 0
Accepted
time: 37ms
memory: 20344kb
input:
32 5 9 707606 21 11 707606 18 27 707606 15 22 707606 14 9 707606 30 18 707606 14 4 707606 2 14 707606 29 18 707606 13 17 707606 8 26 707606 23 4 707606 1 11 707606 31 9 707606 28 22 707606 30 28 707606 23 28 707606 19 15 707606 25 32 707606 2 8 707606 25 22 707606 1 16 707606 10 16 707606 3 15 70760...
output:
8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 2 21 24 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 8 3 6 7 13 19 27 29 32 7 3 6 13 19 27 2...
result:
ok 564568 numbers
Test #37:
score: 0
Accepted
time: 30ms
memory: 16412kb
input:
32 18 3 514814 30 12 514814 32 27 514814 18 15 514814 9 24 514814 24 12 514814 10 16 514814 7 1 514814 13 22 514814 6 13 514814 14 13 514814 15 30 514814 2 18 514814 31 7 514814 10 23 514814 26 24 514814 23 11 514814 16 19 514814 20 23 514814 29 15 514814 7 12 514814 25 22 514814 16 22 514814 19 30 ...
output:
1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 31 1 31 1 4 1 4 4 8 11 20 27 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 2 9 26 3 1 12 31 2 12 31 2 12 31 2 12 31 2 12 31 3 1 12 31 2 9 26 2 9 26 2 9 26 2 9 26 2 9 26 2 9 26 2 9 26 2 9 26 1 1 1 31 1 31 1 31 1 1 2 1 31 1 1 1 1 2 1 31 2 1 31 2 1 31 2 1 31 2 1 31 2...
result:
ok 559440 numbers
Test #38:
score: 0
Accepted
time: 26ms
memory: 20404kb
input:
64 29 45 982891 63 1 982891 13 21 982891 46 52 982891 42 5 982891 15 59 982891 37 15 982891 62 16 982891 38 62 982891 27 44 982891 64 23 982891 5 3 982891 32 11 982891 43 33 982891 63 60 982891 16 52 982891 62 17 982891 12 64 982891 28 6 982891 9 41 982891 30 57 982891 21 35 982891 3 26 982891 29 8 ...
output:
16 4 7 19 25 28 31 36 39 42 47 48 50 53 56 58 61 16 4 7 19 25 28 31 36 39 42 47 48 50 53 56 58 61 15 4 7 19 25 28 31 36 39 47 48 50 53 56 58 61 16 4 7 19 25 28 31 36 39 42 47 48 50 53 56 58 61 16 4 7 19 25 28 31 36 39 42 47 48 50 53 56 58 61 16 4 7 19 25 28 31 36 39 42 47 48 50 53 56 58 61 16 4 7 19...
result:
ok 507102 numbers
Test #39:
score: 0
Accepted
time: 28ms
memory: 20348kb
input:
64 7 27 909655 10 26 909655 59 39 909655 35 34 909655 58 29 909655 28 63 909655 7 10 909655 51 59 909655 42 50 909655 27 53 909655 34 33 909655 11 49 909655 7 29 909655 40 20 909655 14 18 909655 55 29 909655 56 40 909655 14 16 909655 8 22 909655 50 6 909655 47 26 909655 54 17 909655 6 38 909655 22 2...
output:
1 1 1 41 1 41 1 41 1 41 1 41 1 41 1 41 1 41 1 41 14 4 9 11 13 15 19 23 32 36 42 43 48 52 64 15 4 9 11 13 15 19 23 32 36 42 43 45 48 52 64 1 41 1 41 1 41 1 41 1 41 15 4 9 11 13 15 19 23 32 36 42 43 45 48 52 64 15 4 9 11 13 15 19 23 32 36 42 43 45 48 52 64 15 4 9 11 13 15 19 23 32 36 42 43 45 48 52 64...
result:
ok 500145 numbers
Test #40:
score: 0
Accepted
time: 18ms
memory: 16252kb
input:
128 126 64 951425 88 102 951425 41 98 951425 104 96 951425 87 27 951425 55 66 951425 27 125 951425 4 116 951425 114 39 951425 80 53 951425 124 99 951425 47 94 951425 26 56 951425 24 115 951425 17 90 951425 16 48 951425 41 3 951425 34 46 951425 40 21 951425 1 18 951425 16 29 951425 22 11 951425 11 66...
output:
1 60 1 60 1 60 1 60 1 60 1 60 1 60 1 60 1 60 31 2 3 19 20 25 32 33 38 39 42 49 52 54 70 78 79 84 86 91 93 95 97 98 99 105 108 112 116 118 122 128 2 37 62 31 2 3 19 20 25 32 33 38 39 42 49 52 54 70 78 79 84 86 91 93 95 97 98 99 105 108 112 116 118 122 128 31 2 3 19 20 25 32 33 38 39 42 49 52 54 70 78...
result:
ok 449417 numbers
Test #41:
score: 0
Accepted
time: 23ms
memory: 20208kb
input:
128 127 9 863048 55 97 863048 23 90 863048 88 98 863048 28 91 863048 13 27 863048 15 126 863048 35 1 863048 90 111 863048 84 46 863048 73 80 863048 5 4 863048 77 105 863048 19 36 863048 110 106 863048 34 104 863048 125 106 863048 70 9 863048 63 92 863048 20 99 863048 3 88 863048 22 65 863048 109 105...
output:
32 2 5 10 12 16 18 25 26 28 37 41 44 49 52 56 58 59 63 64 66 84 85 86 87 101 113 114 118 123 124 126 127 32 2 5 10 12 16 18 25 26 28 37 41 44 49 52 56 58 59 63 64 66 84 85 86 87 101 113 114 118 123 124 126 127 32 2 5 10 12 16 18 25 26 28 37 41 44 49 52 56 58 59 63 64 66 84 85 86 87 101 113 114 118 1...
result:
ok 453845 numbers
Test #42:
score: 0
Accepted
time: 27ms
memory: 20380kb
input:
11 3 6 158678 4 9 715569 7 11 308784 1 7 230424 2 11 449537 11 3 725926 8 3 623305 4 5 337848 7 10 654029 2 4 108562 200000 2 6 1 7 1 11 3 6 1 3 1 8 1 3 1 6 2 8 1 3 1 8 3 8 1 3 2 3 2 10 1 8 1 3 3 10 1 8 1 3 1 8 1 3 3 3 2 7 3 7 1 11 2 9 2 8 1 3 2 10 2 1 2 6 2 3 3 3 3 8 3 10 1 8 3 6 2 2 3 1 2 10 3 9 1...
output:
1 9 1 9 1 9 1 8 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 2 1 2 1 2 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 9 1 8 1 8 1 8 1 9 1 1 1 1 1 8 1 8 1 8 1 8 1 8 1 3 1 9 1 5 1 5 1 1 1 10 1 10 1 10 1 9 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 9 1 1 1 8 1 8 1 7 1 1 1 1 1 1 1 9 1 9 1 9 1 9 1 9 1 8 1 8 1 9 1 9 1 9 1 9 1...
result:
ok 400000 numbers
Test #43:
score: 0
Accepted
time: 17ms
memory: 20416kb
input:
256 162 58 327415 181 254 327415 60 79 327415 137 241 327415 19 214 327415 19 109 327415 65 204 327415 159 116 327415 108 56 327415 224 247 327415 239 12 327415 155 214 327415 112 102 327415 105 133 327415 131 191 327415 41 82 327415 130 56 327415 104 189 327415 249 225 327415 20 44 327415 139 15 32...
output:
1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 1 186 2 66 227 2 66 227 1 227 1 227 1 227 1 227 1 227 2 66 227 2 66 227 1 186 1 186 1 186 1 186 ...
result:
ok 426053 numbers
Test #44:
score: 0
Accepted
time: 14ms
memory: 20580kb
input:
256 168 73 530250 68 104 530250 170 207 530250 58 202 530250 253 127 530250 130 223 530250 1 182 530250 119 164 530250 69 78 530250 125 249 530250 85 142 530250 237 34 530250 215 197 530250 67 122 530250 232 34 530250 105 132 530250 127 112 530250 5 99 530250 38 132 530250 180 208 530250 40 99 53025...
output:
64 2 6 7 12 14 16 25 26 27 33 38 45 48 50 51 55 56 64 66 68 76 79 82 88 92 96 100 101 107 110 112 115 118 119 121 125 126 129 130 141 153 154 156 157 160 162 165 179 185 193 196 202 203 206 227 231 238 240 243 245 248 251 253 255 64 2 6 7 12 14 16 25 26 27 33 38 45 48 50 51 55 56 64 66 68 76 79 82 8...
result:
ok 421209 numbers
Test #45:
score: 0
Accepted
time: 18ms
memory: 20480kb
input:
512 485 372 345772 237 31 345772 394 98 345772 445 252 345772 324 12 345772 376 56 345772 405 146 345772 429 400 345772 9 285 345772 444 72 345772 277 54 345772 196 147 345772 251 151 345772 170 157 345772 53 331 345772 166 401 345772 497 65 345772 476 352 345772 185 64 345772 214 487 345772 89 33 3...
output:
1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 1 397 ...
result:
ok 424329 numbers
Test #46:
score: 0
Accepted
time: 18ms
memory: 18392kb
input:
512 342 276 110813 388 56 110813 192 372 110813 153 441 110813 47 358 110813 240 168 110813 76 142 110813 458 20 110813 112 146 110813 356 53 110813 80 126 110813 239 44 110813 105 214 110813 172 77 110813 456 161 110813 86 11 110813 282 417 110813 146 98 110813 484 63 110813 86 124 110813 363 72 11...
output:
128 3 4 6 8 10 14 23 24 31 32 33 36 37 40 41 42 44 49 54 55 57 62 83 85 87 91 95 97 114 115 118 120 122 125 135 137 138 139 158 161 169 180 181 190 201 202 205 208 209 210 211 220 224 229 230 231 233 236 237 238 246 248 253 255 256 261 262 276 277 278 280 282 286 288 295 305 307 309 317 319 321 327 ...
result:
ok 406061 numbers
Test #47:
score: 0
Accepted
time: 18ms
memory: 20504kb
input:
1024 454 965 504725 711 797 504725 369 288 504725 224 671 504725 111 189 504725 998 570 504725 221 808 504725 135 119 504725 923 827 504725 486 423 504725 434 617 504725 757 983 504725 552 709 504725 246 419 504725 536 890 504725 80 949 504725 361 211 504725 865 758 504725 633 599 504725 437 876 504...
output:
255 2 9 10 11 15 22 23 27 29 34 44 56 57 61 65 73 77 95 98 102 107 112 115 122 135 142 160 161 164 168 173 177 183 187 188 192 204 205 210 216 225 226 228 229 230 233 235 244 248 253 254 256 258 262 264 267 268 269 270 274 275 278 285 290 292 296 298 310 313 317 319 321 322 328 335 336 337 338 339 3...
result:
ok 401765 numbers
Test #48:
score: 0
Accepted
time: 14ms
memory: 20332kb
input:
1024 903 449 543576 568 108 543576 899 1001 543576 777 406 543576 846 76 543576 405 229 543576 52 290 543576 386 358 543576 866 333 543576 892 561 543576 436 59 543576 192 646 543576 264 175 543576 112 867 543576 435 192 543576 986 352 543576 476 782 543576 328 55 543576 122 904 543576 845 616 54357...
output:
248 2 6 12 22 25 31 32 35 42 44 60 61 62 63 71 72 73 78 79 80 83 84 93 116 128 130 136 143 146 147 148 152 157 161 162 169 170 181 186 189 195 199 201 202 208 211 214 223 224 227 239 244 247 249 253 255 256 268 278 282 283 288 293 301 315 327 337 338 340 343 349 351 354 355 356 359 362 371 373 374 3...
result:
ok 401703 numbers
Test #49:
score: 0
Accepted
time: 17ms
memory: 20532kb
input:
2048 1685 949 633529 1399 1172 633529 1268 1122 633529 1582 1837 633529 1943 1760 633529 1394 357 633529 1266 2009 633529 1690 1304 633529 725 919 633529 1824 185 633529 574 710 633529 1439 1721 633529 2043 769 633529 1499 988 633529 377 1287 633529 893 789 633529 1638 122 633529 1776 916 633529 197...
output:
1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768 1 1768...
result:
ok 411696 numbers
Test #50:
score: 0
Accepted
time: 16ms
memory: 20532kb
input:
2048 840 853 263758 214 1829 263758 488 1933 263758 1408 1799 263758 1968 1773 263758 1170 1041 263758 1461 430 263758 1578 625 263758 2017 202 263758 253 801 263758 1203 1863 263758 990 278 263758 161 1174 263758 494 218 263758 581 970 263758 477 850 263758 1440 1021 263758 2019 426 263758 121 1574...
output:
1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475 1 1475...
result:
ok 405103 numbers
Test #51:
score: 0
Accepted
time: 17ms
memory: 20564kb
input:
4096 1040 1102 311946 3245 2539 311946 2626 1906 311946 3437 134 311946 1220 3978 311946 2167 714 311946 2935 1207 311946 61 4039 311946 580 495 311946 2276 529 311946 765 2465 311946 2610 3720 311946 2489 400 311946 701 3807 311946 1287 2371 311946 1312 2114 311946 281 3075 311946 3797 304 311946 1...
output:
1023 3 19 20 21 22 24 25 28 30 31 40 52 53 57 58 64 65 66 67 69 70 72 73 74 76 79 89 92 95 96 108 109 115 119 121 124 126 134 135 142 145 148 156 164 165 170 172 174 177 183 184 186 197 202 203 206 209 210 214 216 222 226 229 233 234 241 244 246 257 260 261 262 264 265 271 282 284 285 295 300 306 30...
result:
ok 399623 numbers
Test #52:
score: 0
Accepted
time: 20ms
memory: 20564kb
input:
4096 2602 3564 348743 1789 738 348743 3440 2535 348743 3442 2881 348743 4047 385 348743 3693 3415 348743 1262 637 348743 3064 2851 348743 1397 1623 348743 3663 842 348743 2856 1616 348743 1382 1200 348743 884 2217 348743 2962 544 348743 2211 835 348743 2984 1331 348743 2632 917 348743 72 1569 348743...
output:
1024 3 5 11 14 20 30 31 38 42 43 45 50 51 56 64 65 74 79 84 87 88 100 101 102 104 106 116 118 130 131 136 141 147 148 158 159 161 162 168 169 173 174 181 183 185 188 189 204 212 217 224 227 234 237 242 245 248 254 257 265 266 270 274 275 277 279 283 285 287 294 297 302 310 312 314 315 324 325 326 34...
result:
ok 400308 numbers
Test #53:
score: 0
Accepted
time: 19ms
memory: 20400kb
input:
6 1 6 241368 5 6 833936 5 4 318703 2 1 668095 5 3 281940 200000 1 2 2 3 1 1 2 4 1 6 2 5 2 2 1 1 1 6 2 1 3 3 3 2 3 5 3 4 1 5 1 6 3 1 2 4 2 5 1 1 3 4 2 4 1 6 3 5 1 1 2 5 1 6 2 2 3 5 1 1 1 6 1 1 2 3 2 5 1 6 2 1 3 4 3 1 2 4 1 1 3 2 3 4 3 5 2 4 3 3 1 6 2 3 1 1 3 3 1 6 2 3 1 5 2 5 3 4 1 6 3 3 2 1 1 5 2 3 ...
output:
1 4 1 3 1 3 1 3 1 3 1 5 1 1 1 6 1 1 1 6 1 6 1 4 1 4 1 4 1 6 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 1 1 1 1 6 1 1 1 6 1 6 1 6 1 1 1 6 1 6 1 2 1 1 1 6 1 5 1 5 1 3 1 3 1 4 1 4 1 3 1 3 1 4 1 4 1 3 1 1 1 1 1 2 1 2 1 4 1 4 1 6 1 6 1 5 1 6 1 5 1 6 1 5 1 2 1 2 1 2 1 5 1 1 1 5 1 5 1 6 1 6 1 1 1 4 ...
result:
ok 400000 numbers
Test #54:
score: 0
Accepted
time: 25ms
memory: 18684kb
input:
8192 5237 1172 919903 1891 2362 919903 4934 5250 919903 3597 4971 919903 5264 4039 919903 2976 7236 919903 3418 3843 919903 6191 2019 919903 3467 6249 919903 226 5835 919903 2568 4458 919903 4563 3988 919903 7597 7073 919903 7256 1505 919903 7084 7367 919903 1436 5075 919903 6230 2464 919903 2237 47...
output:
2048 3 5 9 12 16 17 31 35 36 37 41 45 46 48 54 61 66 68 69 70 71 73 76 78 79 80 83 88 90 95 101 103 104 106 107 108 112 113 115 119 123 127 140 141 142 147 148 151 152 158 159 173 175 183 184 185 189 191 197 199 200 201 202 209 213 214 218 221 222 227 228 244 248 250 251 253 256 257 258 260 261 263 ...
result:
ok 398240 numbers
Test #55:
score: 0
Accepted
time: 20ms
memory: 20844kb
input:
8192 7016 2726 925535 385 158 925535 890 3573 925535 6109 7215 925535 1394 26 925535 4876 1977 925535 8070 2108 925535 1242 6026 925535 7838 3060 925535 5510 1411 925535 579 1337 925535 4880 1820 925535 8051 5892 925535 5528 5089 925535 7504 7173 925535 3104 5379 925535 5190 2961 925535 1531 2361 92...
output:
1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597 1 7597...
result:
ok 403527 numbers
Test #56:
score: 0
Accepted
time: 22ms
memory: 23020kb
input:
16384 2606 2594 27259 8704 12182 27259 12921 13763 27259 5987 9108 27259 11810 8138 27259 6858 14242 27259 8828 4394 27259 15775 14884 27259 3471 12858 27259 6556 13371 27259 2191 7045 27259 8116 14030 27259 12849 10633 27259 9259 4119 27259 3186 13165 27259 9922 13602 27259 15964 1804 27259 6289 58...
output:
1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14387 1 14...
result:
ok 402823 numbers
Test #57:
score: 0
Accepted
time: 30ms
memory: 19264kb
input:
16384 16192 16125 514596 5527 8374 514596 5927 5623 514596 13460 13094 514596 12042 3456 514596 11664 3709 514596 3250 4487 514596 12149 1433 514596 4976 896 514596 9010 14548 514596 5892 15461 514596 14601 1606 514596 9028 3263 514596 10506 4126 514596 9934 1475 514596 10039 15680 514596 9291 7114 ...
output:
1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13483 1 13...
result:
ok 404761 numbers
Test #58:
score: 0
Accepted
time: 30ms
memory: 25396kb
input:
32768 30099 30230 810860 19642 18982 810860 27074 28937 810860 27703 1196 810860 10758 16412 810860 31371 20049 810860 18645 11802 810860 8712 31415 810860 24420 10150 810860 6821 1912 810860 12010 32305 810860 5629 21749 810860 24004 16272 810860 4128 16594 810860 32471 17698 810860 5045 1285 81086...
output:
8192 3 8 10 11 16 32 46 47 54 55 59 65 66 70 76 77 87 92 93 98 99 105 108 109 117 119 122 132 140 143 144 152 158 160 164 166 167 169 170 174 181 187 191 196 199 201 208 210 218 219 222 223 228 229 240 245 251 252 253 254 258 262 263 268 271 276 287 288 290 295 297 303 307 308 310 313 317 318 319 32...
result:
ok 392925 numbers
Test #59:
score: 0
Accepted
time: 33ms
memory: 22108kb
input:
32768 8795 5860 585349 24131 5127 585349 12734 15148 585349 13539 2122 585349 23877 28491 585349 658 21375 585349 24331 3559 585349 5173 12297 585349 23102 24288 585349 15503 12294 585349 9374 28373 585349 10288 24685 585349 16867 13632 585349 18100 4769 585349 7373 24673 585349 6213 2848 585349 691...
output:
1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 1 19652 8128 3 14 19 21 37 39 46 50 52 54 56 57 62 70 71 72 79 84 91 97 104 106 108 111 114 ...
result:
ok 414671 numbers
Test #60:
score: 0
Accepted
time: 39ms
memory: 24296kb
input:
65536 19539 35197 945923 18109 24191 945923 57781 9277 945923 65270 44456 945923 36203 47921 945923 29532 25422 945923 36136 50905 945923 46484 51001 945923 63188 10736 945923 59476 59161 945923 62271 55860 945923 29275 13638 945923 22742 14590 945923 50404 15889 945923 22094 19049 945923 1923 32843...
output:
16384 2 3 4 12 13 15 16 17 21 27 28 36 42 48 50 52 55 59 60 62 63 64 65 66 70 82 83 85 91 93 96 99 105 109 113 114 144 149 152 155 158 159 160 163 165 174 175 185 188 196 199 200 201 202 214 220 223 232 233 237 238 244 249 259 262 263 264 266 271 275 278 283 285 286 292 304 312 317 319 322 323 324 3...
result:
ok 393112 numbers
Test #61:
score: 0
Accepted
time: 50ms
memory: 29092kb
input:
65536 41187 15509 489578 60216 41964 489578 29923 1205 489578 18498 33384 489578 50900 52061 489578 13089 32862 489578 61615 60486 489578 55540 20815 489578 36276 55198 489578 33115 61118 489578 25875 30608 489578 35959 23876 489578 9813 61505 489578 61115 19029 489578 44867 52030 489578 26397 8243 ...
output:
1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31616 1 31...
result:
ok 437627 numbers
Test #62:
score: 0
Accepted
time: 49ms
memory: 33140kb
input:
131072 103317 62326 655693 92250 56612 655693 36589 15525 655693 15780 107541 655693 19356 61968 655693 55846 91343 655693 60701 9516 655693 78367 124760 655693 29125 31500 655693 45211 85697 655693 80011 40807 655693 42378 73599 655693 26481 64008 655693 68592 113397 655693 51630 44248 655693 3497 ...
output:
32768 2 5 6 8 9 10 12 15 20 23 31 34 41 46 47 48 50 52 57 59 60 62 67 70 75 76 86 90 96 102 106 108 109 118 119 120 123 124 127 129 134 135 141 150 152 156 164 169 175 182 184 185 189 190 194 195 205 206 207 210 213 216 225 228 233 234 245 246 251 253 255 257 258 259 266 267 269 272 274 275 278 280 ...
result:
ok 393227 numbers
Test #63:
score: 0
Accepted
time: 48ms
memory: 32288kb
input:
131072 86302 3689 194687 123168 108805 194687 109656 128593 194687 5377 120273 194687 117921 88272 194687 56936 90609 194687 80843 46442 194687 35330 87651 194687 25945 42719 194687 98224 40747 194687 93733 80922 194687 57189 14574 194687 100434 93358 194687 126129 51834 194687 121030 93135 194687 6...
output:
32766 3 7 11 13 20 22 28 33 38 40 41 57 60 63 64 65 67 71 72 77 79 83 84 89 91 100 101 108 114 118 119 132 133 134 139 140 141 152 157 158 159 173 176 180 182 188 189 192 193 197 198 204 208 210 212 217 218 222 224 225 237 238 241 250 258 259 266 278 280 281 283 289 293 295 297 301 307 310 313 321 3...
result:
ok 393218 numbers
Test #64:
score: 0
Accepted
time: 116ms
memory: 34880kb
input:
145739 84041 7053 226808 136161 131559 385292 123342 136714 788452 44552 56584 504632 72087 116953 75489 44858 108756 575500 58398 6968 392951 84546 14049 454177 89655 74556 546948 74713 71158 258775 33287 91625 326229 46278 115479 354686 90832 92241 289579 19366 8548 873676 93987 51354 396405 10789...
output:
1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 101452 1 1...
result:
ok 399508 numbers
Test #65:
score: 0
Accepted
time: 107ms
memory: 36988kb
input:
161076 151676 14389 918331 100183 127664 467146 8421 151044 737627 47163 27154 68391 140805 29001 596899 69949 62201 788660 4760 98203 8031 87124 123170 624949 86696 121979 121309 57035 87057 392372 21258 83374 767277 42942 83405 42028 95015 104172 759015 61932 107302 440421 157917 68457 330312 9103...
output:
1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31835 1 31...
result:
ok 351490 numbers
Test #66:
score: 0
Accepted
time: 11ms
memory: 16256kb
input:
2 1 2 266275 200000 1 2 2 1 3 1 1 1 1 2 1 1 1 2 2 1 3 1 2 1 3 1 1 1 1 2 2 1 3 1 2 1 3 1 2 1 3 1 1 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 1 2 2 1 3 1 2 1 3 1 1 1 2 1 3 1 1 2 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 1 1 1 2 2 1 3 1 1 1 2 1 3 1 1 2 1 1 2 1 3 1 1 2 2 1 3 1 2 1 3 1 1 1 2 1 3 1 2 1 3 1 1 2 2 1 ...
output:
1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 ...
result:
ok 400000 numbers
Test #67:
score: 0
Accepted
time: 14ms
memory: 20376kb
input:
2 1 2 527252 200000 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 1 2 2 1 3 1 1 1 1 2 1 1 2 1 3 1 1 2 1 1 2 1 3 1 2 1 3 1 2 1 3 1 2 1 3 1 1 2 1 1 1 2 1 1 2 1 3 1 2 1 3 1 2 1 3 1 1 2 1 1 1 2 2 1 3 1 2 1 3 1 1 1 1 2 2 1 3 1 1 1 1 2 2 1 3 1 2 1 3 1 1 1 2 1 3 1 2 1 3 1 2 1 3 1 1 2 1 1 2 1 3 1 1 2 1 1 1 2 2 1 3 1 1 1 ...
output:
1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 ...
result:
ok 400000 numbers
Test #68:
score: 0
Accepted
time: 12ms
memory: 18300kb
input:
4 4 2 263306 3 1 263306 2 1 263306 200000 1 3 1 1 2 3 3 3 1 3 2 3 2 2 3 2 2 1 3 1 3 3 1 1 2 1 1 2 3 1 1 4 2 3 2 2 3 2 3 3 2 1 3 1 1 2 1 1 2 2 1 2 3 2 2 2 1 4 1 2 1 4 3 2 2 2 2 3 1 2 2 1 3 2 3 3 1 1 3 1 1 2 1 4 2 1 3 1 2 3 1 2 3 3 1 1 1 3 2 3 3 3 2 1 3 1 1 1 2 2 2 1 3 1 3 2 2 3 3 3 1 2 2 1 2 2 2 3 3 ...
output:
1 4 1 4 1 3 1 4 1 4 1 1 1 3 1 1 1 1 1 1 1 4 1 4 2 2 3 1 3 1 3 1 3 1 2 1 2 1 2 1 3 1 4 1 3 1 3 1 4 1 4 2 1 4 1 3 2 1 4 1 1 2 1 4 1 1 1 3 1 1 1 2 1 4 1 2 1 2 1 3 2 2 3 1 4 1 3 1 3 1 4 1 3 1 2 1 4 1 3 1 4 1 4 1 1 1 4 1 2 1 4 1 4 1 4 1 2 1 4 1 4 1 3 1 4 1 3 1 3 1 1 1 2 1 4 1 2 1 1 1 2 1 4 1 2 1 1 2 1 4 ...
result:
ok 417795 numbers
Test #69:
score: 0
Accepted
time: 15ms
memory: 18300kb
input:
4 3 1 795989 2 1 795989 4 3 795989 200000 1 3 2 3 2 1 2 2 3 2 2 2 3 2 3 3 2 2 2 3 3 2 3 3 2 3 3 3 1 4 2 3 3 3 3 1 2 2 1 3 1 1 1 3 1 4 1 3 1 4 1 3 2 3 2 1 3 1 3 3 2 1 3 2 2 3 3 3 2 3 2 2 3 2 2 2 3 2 3 1 3 3 1 4 1 3 1 4 2 2 2 3 2 1 3 1 3 2 3 3 1 3 1 4 1 3 2 1 2 2 2 3 3 1 3 3 2 3 3 2 1 1 2 1 1 2 3 3 3 ...
output:
1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 4 1 4 1 3 1 3 1 4 1 3 1 4 1 3 1 4 1 3 1 2 1 1 2 1 4 1 4 2 1 4 1 1 2 1 4 1 1 2 1 4 1 1 1 3 1 1 2 1 4 1 4 1 4 1 3 1 4 1 3 1 3 1 3 1 3 1 3 1 2 1 2 1 2 1 2 1 2 1 1 1 4 1 4 1 4 1 4 1 2 1 2 1 2 1 2 1 4 1 4 1 3 1 1 2 1 4 1 1 1 2 2 2 3 1 2 1 1 1 1 1 4 1 4 1 2 1 2 1 1 2 1 4 1 1 ...
result:
ok 417826 numbers
Test #70:
score: 0
Accepted
time: 129ms
memory: 38092kb
input:
200000 45945 10214 214029 156712 45945 638873 26469 45945 964958 45945 96406 738887 49989 45945 276392 45945 37556 806695 57465 45945 732371 166172 45945 901299 139617 45945 660894 164283 45945 587273 48296 45945 450188 60321 45945 383361 16360 45945 797516 103230 45945 32988 45945 59958 176012 3548...
output:
1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 187640 1 1...
result:
ok 400000 numbers
Test #71:
score: 0
Accepted
time: 126ms
memory: 38396kb
input:
200000 6017 62512 678622 6017 41027 449272 6017 64835 33873 159132 6017 278394 194450 6017 393612 6017 17342 785322 99130 6017 832907 153429 6017 257945 117966 6017 904403 6017 43109 418349 6017 107649 352167 16618 6017 846982 6017 124900 123407 192981 6017 389696 6017 76005 667504 160524 6017 29747...
output:
1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65239 1 65...
result:
ok 400000 numbers
Test #72:
score: 0
Accepted
time: 21ms
memory: 16132kb
input:
9 8 6 305008 8 2 925370 8 1 790943 7 8 461048 3 8 254305 8 4 813076 8 9 690534 8 5 623160 200000 1 8 2 3 2 4 1 5 1 8 2 8 2 7 3 8 1 4 3 4 1 8 1 2 1 8 1 3 1 8 1 4 2 1 1 8 1 3 1 8 1 5 2 6 2 8 3 3 2 4 3 8 1 8 2 2 1 5 2 3 2 8 3 4 3 2 2 2 3 2 3 3 3 7 3 6 3 8 3 1 1 8 2 3 1 2 2 5 2 4 3 4 1 8 3 5 3 3 1 3 1 8...
output:
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 4 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 5 1 5 1 5 1 2 1 2 1 1 1 1 1 3 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 2 1 2 1 2 1 2 1 4 1 4 1 4 1 4 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 4 1 2 ...
result:
ok 400000 numbers
Test #73:
score: 0
Accepted
time: 19ms
memory: 18520kb
input:
15 11 7 856313 7 12 209317 14 7 405326 7 10 194387 15 7 705398 3 7 924182 8 7 83695 4 7 304723 7 6 247292 9 7 840968 13 7 272495 1 7 721328 7 2 909095 7 5 54851 200000 2 11 2 5 3 11 1 7 2 9 3 9 3 5 1 6 2 2 3 2 2 14 1 7 1 8 2 8 2 5 1 7 1 1 1 7 3 5 2 13 2 2 1 9 2 10 2 1 3 10 2 6 3 14 3 8 1 7 3 2 1 8 3...
output:
1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 9 1 9 1 3 1 1 1 1 1 1 1 9 1 9 1 9 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 ...
result:
ok 400000 numbers
Test #74:
score: 0
Accepted
time: 78ms
memory: 37176kb
input:
136584 124649 128108 380487 84560 128108 589002 69062 128108 774065 123408 128108 429455 51643 128108 618350 14766 128108 191834 69155 128108 946592 128108 56444 172474 128108 76018 430624 128108 14537 690474 128108 121299 108503 128108 61629 28275 97397 128108 899641 128108 121755 570743 128108 149...
output:
2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 2 62060 132133 ...
result:
ok 331899 numbers
Test #75:
score: 0
Accepted
time: 30ms
memory: 37888kb
input:
174244 134205 164666 552521 47664 164666 874241 164666 170186 307504 164666 129066 800008 164666 128818 345004 91155 164666 255768 164666 139461 446354 166811 164666 210710 164666 119676 943610 92033 164666 33957 164666 76569 681639 47670 164666 540557 136069 164666 933375 101600 164666 472336 64774...
output:
1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963 1 7963...
result:
ok 66212 numbers
Test #76:
score: 0
Accepted
time: 117ms
memory: 54560kb
input:
200000 1 2 1000000 2 3 1000000 3 4 1000000 4 5 1000000 5 6 1000000 6 7 1000000 7 8 1000000 8 9 1000000 9 10 1000000 10 11 1000000 11 12 1000000 12 13 1000000 13 14 1000000 14 15 1000000 15 16 1000000 16 17 1000000 17 18 1000000 18 19 1000000 19 20 1000000 20 21 1000000 21 22 1000000 22 23 1000000 23...
output:
1 1 1 200000 1 138337 1 138337 1 125345 1 125345 1 125345 1 125345 1 138337 1 138337 1 138337 1 138337 1 138337 1 104043 1 104043 1 28531 1 104043 1 77475 1 77475 1 104043 1 104043 1 104043 1 33500 1 33500 1 17260 1 17260 1 17260 1 17260 1 17260 1 17260 1 5747 1 5747 1 5747 1 5747 1 5747 1 5747 1 57...
result:
ok 400399 numbers
Test #77:
score: 0
Accepted
time: 109ms
memory: 53780kb
input:
200000 1 2 1000000 2 3 1000000 3 4 1000000 4 5 1000000 5 6 1000000 6 7 1000000 7 8 1000000 8 9 1000000 9 10 1000000 10 11 1000000 11 12 1000000 12 13 1000000 13 14 1000000 14 15 1000000 15 16 1000000 16 17 1000000 17 18 1000000 18 19 1000000 19 20 1000000 20 21 1000000 21 22 1000000 22 23 1000000 23...
output:
1 1 1 1 1 1 1 1 1 167723 1 200000 1 200000 1 53241 1 53241 1 53241 1 53241 1 53241 1 53241 1 108209 1 108209 1 108209 1 200000 1 200000 1 200000 1 70411 1 200000 1 176241 1 87620 1 176241 1 176241 1 176241 1 200000 1 144621 1 96994 1 87186 1 87186 1 96994 1 96994 1 96994 1 96994 1 96994 1 96994 1 12...
result:
ok 400221 numbers