QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#334001 | #7807. Loops | yhk1001 | AC ✓ | 104ms | 9844kb | C++14 | 5.9kb | 2024-02-20 22:58:00 | 2024-02-20 22:58:00 |
Judging History
answer
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
// #define Debug
// #define LOCAL
// #define TestCases
const int N = 500, SZ = N * N;
int n, m;
int type[N + 5][N + 5];
namespace Splay
{
struct Node
{
int ch[2], fa;
int sz;
} node[SZ + 5];
int root, tot;
#define ls(p) node[p].ch[0]
#define rs(p) node[p].ch[1]
#define fa(p) node[p].fa
#define sz(p) node[p].sz
int newnode()
{
int p = ++tot;
sz(p) = 1;
return p;
}
void pushup(int p)
{
sz(p) = sz(ls(p)) + 1 + sz(rs(p));
return ;
}
int sontype(int p)
{
return rs(fa(p)) == p;
}
void rotate(int p)
{
int f = fa(p), type = sontype(p);
int son = node[p].ch[!type];
node[f].ch[type] = son;
if (son)
fa(son) = f;
fa(p) = fa(f);
if (fa(f))
node[fa(f)].ch[sontype(f)] = p;
node[p].ch[!type] = f;
fa(f) = p;
pushup(f);
pushup(p);
return ;
}
void splay(int p)
{
for (int f = fa(p); f = fa(p); rotate(p))
if (fa(f))
rotate(sontype(p) == sontype(f) ? f : p);
root = p;
return ;
}
int get_rank(int p)
{
splay(p);
return sz(ls(p)) + 1;
}
bool is_max(int p)
{
splay(p);
return !rs(p);
}
void add_left(int p, int lst)
{
if (!lst)
{
root = p;
return ;
}
splay(lst);
if (!ls(lst))
{
ls(lst) = p, fa(p) = lst;
pushup(lst);
splay(p);
return ;
}
sz(lst)++;
lst = ls(lst);
while (rs(lst))
{
sz(lst)++;
lst = rs(lst);
}
rs(lst) = p, fa(p) = lst;
pushup(lst);
splay(p);
return ;
}
void add_right(int p, int lst)
{
if (!lst)
{
root = p;
return ;
}
splay(lst);
if (!rs(lst))
{
rs(lst) = p, fa(p) = lst;
pushup(lst);
splay(p);
return ;
}
sz(lst)++;
lst = rs(lst);
while (ls(lst))
{
sz(lst)++;
lst = ls(lst);
}
ls(lst) = p, fa(p) = lst;
pushup(lst);
splay(p);
return ;
}
#ifdef Debug
void print(int u)
{
if (ls(u) && fa(ls(u)) != u)
cout << "left son err" << endl, exit(0);
if (rs(u) && fa(rs(u)) != u)
cout << "right son err" << endl, exit(0);
if (ls(u))
print(ls(u));
printf("(%d, sz = %d, ls = %d, rs = %d)\n", u, sz(u), ls(u), rs(u));
if (rs(u))
print(rs(u));
return ;
}
void print()
{
print(root);
cout << endl;
return ;
}
#endif
}
int id[N + 5][N + 5];
int cmp(double x, double y)
{
if (x < y)
return -1;
return 1;
}
bool check(double p, double A, double B, double C, int type)
{
if (type == 1)
{
return (cmp(p, A) == cmp(A, C) && cmp(A, C) == cmp(C, B)) ||
(cmp(A, C) == cmp(C, B) && cmp(C, B) == cmp(B, p)) ||
(cmp(C, B) == cmp(B, p) && cmp(B, p) == cmp(p, A)) ||
(cmp(B, p) == cmp(p, A) && cmp(p, A) == cmp(A, C));
}
if (type == 2)
{
return (cmp(p, A) == cmp(A, B) && cmp(A, B) == cmp(B, C)) ||
(cmp(A, B) == cmp(B, C) && cmp(B, C) == cmp(C, p)) ||
(cmp(B, C) == cmp(C, p) && cmp(C, p) == cmp(p, A)) ||
(cmp(C, p) == cmp(p, A) && cmp(p, A) == cmp(A, B));
}
return (cmp(p, B) == cmp(B, A) && cmp(B, A) == cmp(A, C)) ||
(cmp(B, A) == cmp(A, C) && cmp(A, C) == cmp(C, p)) ||
(cmp(A, C) == cmp(C, p) && cmp(C, p) == cmp(p, B)) ||
(cmp(C, p) == cmp(p, B) && cmp(p, B) == cmp(B, A));
}
void solve()
{
scanf("%d%d", &n, &m);
for (int i = 1; i < n; i++)
for (int j = 1; j < m; j++)
scanf("%1d", &type[i][j]);
for (int j = 1; j <= m; j++)
{
id[n][j] = Splay :: newnode();
Splay :: add_right(id[n][j], id[n][j - 1]);
#ifdef Debug
// Splay :: print();
#endif
}
for (int i = n - 1; i > 0; i--)
{
id[i][m] = Splay :: newnode();
Splay :: add_right(id[i][m], id[i + 1][m]);
}
#ifdef Debug
// Splay :: print();
#endif
#ifdef Debug
#endif
for (int i = n - 1; i > 0; i--)
for (int j = m - 1; j > 0; j--)
{
/*
(i, j) A
C B
*/
int A = Splay :: get_rank(id[i][j + 1]);
#ifdef Debug
cout << "calc A: " << id[i][j + 1] << endl;
Splay :: print();
#endif
int B = Splay :: get_rank(id[i + 1][j + 1]);
#ifdef Debug
cout << "calc B: " << id[i + 1][j + 1] << endl;
Splay :: print();
#endif
int C = Splay :: get_rank(id[i + 1][j]);
int p = Splay :: newnode(), ty = type[i][j];
id[i][j] = p;
#ifdef Debug
cout << "before " << i << " " << j << endl;
Splay :: print();
cout << "p = " << p << " A = " << A << " B = " << B << " C = " << C << endl;
cout << id[i][j + 1] << " " << id[i + 1][j + 1] << " " << id[i + 1][j] << endl;
cout << endl;
#endif
if (check(A - 0.5, A, B, C, ty))
{
Splay :: add_left(p, id[i][j + 1]);
continue;
}
if (check(A + 0.5, A, B, C, ty))
{
Splay :: add_right(p, id[i][j + 1]);
#ifdef Debug
cout << "A + 0.5" << endl;
Splay :: print();
#endif
continue;
}
if (check(B - 0.5, A, B, C, ty))
{
Splay :: add_left(p, id[i + 1][j + 1]);
continue;
}
if (check(B + 0.5, A, B, C, ty))
{
Splay :: add_right(p, id[i + 1][j + 1]);
continue;
}
if (check(C - 0.5, A, B, C, ty))
{
Splay :: add_left(p, id[i + 1][j]);
continue;
}
if (check(C + 0.5, A, B, C, ty))
{
Splay :: add_right(p, id[i + 1][j]);
continue;
}
#ifdef Debug
cout << "!!!" << endl;
exit(0);
#endif
}
#ifdef Debug
Splay :: print();
cout << Splay :: tot << endl;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
cout << id[i][j] << " ";
cout << endl;
}
cout << endl;
#endif
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
printf("%d ", Splay :: get_rank(id[i][j]));
printf("\n");
}
return ;
}
int main()
{
#ifdef LOCAL
freopen("data.in", "r", stdin);
freopen("mycode.out", "w", stdout);
#endif
int T = 1;
#ifdef TestCases
scanf("%d", &T);
#endif
while (T--)
solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3960kb
input:
3 4 113 231
output:
9 8 10 12 4 3 7 11 1 2 5 6
result:
ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 5808kb
input:
2 2 1
output:
3 4 1 2
result:
ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 5928kb
input:
2 2 2
output:
4 3 1 2
result:
ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
2 2 3
output:
2 4 1 3
result:
ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
10 10 332133211 312132213 221223223 213231333 212221111 311132221 312232123 123132221 112112133
output:
67 69 93 92 94 90 98 99 97 100 75 68 70 71 72 91 89 88 87 96 76 74 77 73 78 66 84 85 83 95 60 61 59 55 54 65 79 52 81 86 58 57 56 62 63 53 64 80 51 82 32 41 40 39 38 47 48 49 46 50 13 33 31 30 29 42 37 36 43 45 12 14 11 19 20 34 35 28 27 44 15 16 17 10 18 21 9 22 24 26 1 2 3 4 5 6 7 8 23 25
result:
ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3888kb
input:
20 20 2211223333122331122 3331311131211112312 2223231233212131113 1333132112122133111 3213311331223233331 1221321331233112122 1121231321232232222 2232213321133123222 1132113323222231313 1312131323132213333 3311112222223332131 2223312233231113113 2132333222332312223 1112323111213123112 13333212331311...
output:
339 340 338 337 341 342 336 334 375 377 382 381 383 380 372 397 398 399 396 400 263 261 265 347 348 343 344 335 333 376 378 374 373 379 384 371 385 394 395 393 262 264 260 266 346 349 354 353 352 332 360 361 359 362 363 387 386 370 388 392 189 188 191 273 259 258 350 345 351 355 331 330 329 328 3...
result:
ok
Test #7:
score: 0
Accepted
time: 1ms
memory: 4124kb
input:
50 50 1332131133132323222112321123131221312233322122223 2221231213232322112331221312322112322311122221123 1123133112313113133322131132321333112332213213331 2211311121212313132213233111332323333231213213211 3213111221231131223123231131232311332333311131222 33211133322223112231133211113231232213123112...
output:
2016 2015 2018 2035 2034 2033 2029 2030 2028 2004 2157 2156 2187 2186 2189 2190 2327 2326 2325 2328 2329 2330 2331 2291 2292 2293 2290 2289 2399 2400 2432 2433 2431 2430 2429 2484 2483 2485 2482 2480 2478 2493 2492 2494 2495 2496 2497 2498 2491 2500 2014 2013 2017 2019 2020 2012 2032 2036 2031 2027...
result:
ok
Test #8:
score: 0
Accepted
time: 5ms
memory: 4436kb
input:
100 100 313212312322233331312323312332132331313321221212212131211311112113112312322211333333322323131311231 312312132132131211223133231112313131131133222132323231232333112213131232133331131132133222232221333 21311321231223313122231331333213122212113312122322333111113232313312212231121333332321322113...
output:
8321 8318 8317 8343 8342 8341 8340 8361 8362 8360 8613 8612 8614 8615 8617 8611 8609 8606 8605 8582 8581 8583 8719 8718 8716 8695 8696 8694 8691 8912 8913 8914 8918 8919 8924 8927 8928 8903 8904 8906 9652 9653 9654 9655 9656 9651 9650 9657 9649 9658 9648 9647 9659 9628 9627 9626 9629 9630 9458 9459 ...
result:
ok
Test #9:
score: 0
Accepted
time: 16ms
memory: 5216kb
input:
200 200 1233323221211232311113332333232111313131133121323322113313331121312123331121131233131131212221212121322231231333231213122232133122122231313133221233211322111123232232323232221132223323332312332211322 21332332123232121213222231221121113212231313332313112133223111232211133133131211112113112321...
output:
34304 34303 34302 34351 34349 34330 34331 33594 33593 33592 33595 33596 33591 33590 33589 33585 33586 33571 33572 33573 33570 33574 33577 33568 33359 33360 33362 33357 33364 33365 33337 33338 33339 33340 33341 33344 33343 33347 33346 33299 33298 33297 33301 35101 35102 35100 35103 35109 35108 36252 ...
result:
ok
Test #10:
score: 0
Accepted
time: 31ms
memory: 6480kb
input:
300 300 3311223122331113313232133212111231323122311111231321321213311311223122233323333132332232323332312322221323323333232321123321332123331132313333121313313331312211322211311113222113233311321131311211122122313222233123221311212231212221311323332223213123221113233123111131112321222323313333321121...
output:
76613 76611 76547 76548 76546 76549 76545 76562 76561 76563 76564 76492 76484 76485 76483 76486 76481 76498 76497 76502 76501 78648 78647 78646 78650 78713 78712 78711 78710 78714 78709 78715 78708 78705 78704 78699 78698 78615 78614 78616 78617 81649 81648 81650 81647 81651 81652 81653 81656 81657 ...
result:
ok
Test #11:
score: 0
Accepted
time: 62ms
memory: 9364kb
input:
400 400 1111113223123311131222231121323322132111222131332233123133331313321122332211312131233113332212112333322333232212133332323123223121323232113111122122321213132333132312232321123223112332221221321321132133231121331233221223332113133133223333313311331311131331131322133321121331232321232332232331...
output:
136922 136923 136924 136921 136925 136926 136927 136939 136938 136937 137506 137507 137505 137509 137496 137495 137494 137497 137929 137928 137930 137931 137932 137927 137947 137946 137945 137944 137948 137942 137941 137950 137964 137963 137962 137965 135779 135780 135781 135782 135778 135783 135777...
result:
ok
Test #12:
score: 0
Accepted
time: 1ms
memory: 5832kb
input:
2 500 133313131212111213113123132322133111323331323213121233222213321221323231313331312223211231111112211313132133321112312333232313123223211131121131223122213231213122221133131113211331311111133222221111221111232332122332221121331213233333122232123122221121331232223313223111233221222121323132222311...
output:
3 4 6 8 11 12 15 16 30 31 29 32 28 33 34 35 27 36 40 41 42 47 48 46 51 52 56 55 63 62 61 64 66 71 72 73 74 78 77 80 82 85 86 90 89 95 94 96 104 105 103 106 102 108 119 118 117 116 115 120 122 132 131 133 130 129 134 138 137 142 141 145 146 149 150 152 154 157 158 167 168 166 165 164 176 175 177 178 ...
result:
ok
Test #13:
score: 0
Accepted
time: 2ms
memory: 7600kb
input:
500 2 1 3 3 1 1 2 1 2 1 3 2 1 2 1 3 3 3 3 3 3 1 2 3 2 3 3 1 3 1 2 3 2 1 2 3 3 2 2 2 3 1 2 2 2 2 2 1 1 3 3 3 3 1 3 1 2 2 3 1 3 1 3 2 2 3 2 2 3 2 3 2 2 2 2 3 3 3 2 3 3 3 2 2 1 2 1 3 1 1 2 2 1 3 2 3 1 1 1 3 1 2 2 1 2 1 2 1 2 1 1 3 3 2 2 1 1 1 3 3 3 2 1 1 1 3 1 2 2 2 1 1 3 3 3 3 1 1 2 2 1 2 2 2 3 1 2 2 ...
output:
999 1000 996 998 994 997 993 995 991 992 989 990 988 987 986 985 983 984 980 982 979 981 978 977 976 975 973 974 970 972 968 971 966 969 964 967 962 965 960 963 961 959 958 957 954 956 955 953 950 952 948 951 947 949 944 946 945 943 942 941 938 940 937 939 936 935 93...
result:
ok
Test #14:
score: 0
Accepted
time: 94ms
memory: 9752kb
input:
500 500 3222313321212112132211312331222113112212133113211232222333321313232232233113321313131221133123212131231113321222331133221312322133212132213311132232133222323122322113223233122211331321213313333321113132221322312233233132121322121312131311322232232233311111333333212213232221111133111231133221...
output:
206944 206952 206951 206953 206950 206924 206923 206921 210237 210236 210238 210239 210240 210235 210241 210242 210234 210243 210251 210250 210249 210252 210253 210265 210266 210267 210262 210216 210217 210215 210214 210218 210219 210220 219990 219991 219989 219992 219988 219993 219994 219995 219998...
result:
ok
Test #15:
score: 0
Accepted
time: 82ms
memory: 9680kb
input:
500 500 1111111111111111111111111111111111111111111311111111111111111111111131111111111112111111111111311111111311111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111211111111111111111111111111111111111111111111121111231111...
output:
247014 247013 247015 247012 247011 247010 247016 247017 247009 247018 247019 247008 247020 247007 247021 247022 247006 247005 247004 247023 247024 247025 247003 247002 247026 247027 247028 247001 247029 247030 247000 247031 247032 246999 247033 247034 246998 246997 246996 246995 246994 246993 246992...
result:
ok
Test #16:
score: 0
Accepted
time: 82ms
memory: 9644kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222221222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222212222222222222222222222222222222222222222222222223222222222222222222222222222222222222222222222222222222...
output:
248671 248672 248673 248674 248675 248670 248669 248668 248676 248667 248677 248666 248678 248679 248680 248681 248665 248682 248683 248664 248684 248685 248663 248662 248686 248661 248687 248688 248689 248660 248690 248659 248658 248657 248691 248692 248656 248655 248693 248694 248654 248653 248652...
result:
ok
Test #17:
score: 0
Accepted
time: 94ms
memory: 9756kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333233333333333333233333333333333333331333333333333333331333133333333333333333333333333333333333333333333333333333333333333333333333333333333333333333313333333333333333333333333333333333333333333333333...
output:
128661 128663 128655 128607 128613 128571 130524 130504 130534 130548 130384 130256 131604 131663 136115 136055 136042 136060 136189 136919 136908 136893 136921 138389 138300 138318 140428 140420 140373 139693 139660 145311 145316 143935 143933 143931 143991 143867 143855 144110 146485 146495 146334...
result:
ok
Test #18:
score: 0
Accepted
time: 60ms
memory: 9680kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249501 249502 249503 249504 249505 249506 249507 249508 249509 249510 249511 249512 249513 249514 249515 249516 249517 249518 249519 249520 249521 249522 249523 249524 249525 249526 249527 249528 249529 249530 249531 249532 249533 249534 249535 249536 249537 249538 249539 249540 249541 249542 249543...
result:
ok
Test #19:
score: 0
Accepted
time: 57ms
memory: 9740kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
250000 249999 249998 249997 249996 249995 249994 249993 249992 249991 249990 249989 249988 249987 249986 249985 249984 249983 249982 249981 249980 249979 249978 249977 249976 249975 249974 249973 249972 249971 249970 249969 249968 249967 249966 249965 249964 249963 249962 249961 249960 249959 249958...
result:
ok
Test #20:
score: 0
Accepted
time: 93ms
memory: 9768kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
124751 125251 125750 126248 126745 127241 127736 128230 128723 129215 129706 130196 130685 131173 131660 132146 132631 133115 133598 134080 134561 135041 135520 135998 136475 136951 137426 137900 138373 138845 139316 139786 140255 140723 141190 141656 142121 142585 143048 143510 143971 144431 144890...
result:
ok
Test #21:
score: 0
Accepted
time: 0ms
memory: 5928kb
input:
5 6 31323 21231 12312 23331
output:
23 20 19 27 28 30 22 24 21 18 29 26 10 9 8 17 25 16 4 3 6 11 14 15 1 2 5 7 12 13
result:
ok
Test #22:
score: 0
Accepted
time: 0ms
memory: 4004kb
input:
13 8 2331112 3321121 2123131 1132132 1322123 1121123 1113323 2221132 2223233 1231311 1312132 2132321
output:
97 96 94 101 102 103 100 104 75 77 95 93 98 99 92 91 74 76 78 79 86 87 90 89 68 67 69 80 73 81 88 85 61 60 66 70 71 72 82 84 63 62 59 58 57 64 56 83 41 40 39 42 37 53 54 65 45 44 43 46 38 36 55 52 20 21 22 19 49 48 35 51 27 26 25 18 23 47 50 34 7 6 24 28 29 17 33 32 5 4 8 12 11 30 16 31 ...
result:
ok
Test #23:
score: 0
Accepted
time: 1ms
memory: 5920kb
input:
23 42 33333331332231231323231212313222133321121 31233133331232213332132321323133121233231 33133113212333331313311213313212332123311 33223113233332121231221232122122223232232 11213221333231211333312321211313313211123 31311121113113133311221123233131122213321 21213121311132111312333132122323322323131 ...
output:
601 599 602 568 574 572 724 721 722 737 750 751 752 745 746 747 810 811 894 895 889 890 918 917 919 916 915 910 911 939 940 941 938 937 934 943 964 965 966 963 962 961 593 600 598 603 569 573 571 723 726 720 738 736 735 749 753 748 744 808 812 896 893 892 888 887 882 881 883 914 920 909 908 906 936...
result:
ok
Test #24:
score: 0
Accepted
time: 4ms
memory: 4520kb
input:
111 78 23121233313321232121333332113113322223322232121133221311132322123321123111132 33112122333333132223313123123123312132212211231222133323123232232211113221332 31233211311332323113323122311233132332223123112321221131323122333123311323213 31233112331313231111332332332333111213233221231131313113321...
output:
7881 7882 7890 7891 7889 7892 7888 7894 7879 7898 7897 7910 7829 7830 7831 7832 8253 8252 8254 8251 8250 8256 8265 8263 8261 8141 8140 8142 8139 8134 8133 8132 8165 8190 8189 8188 8191 8187 8185 8197 8196 8195 8198 8394 8395 8393 8392 8391 8396 8387 8528 8529 8527 8526 8488 8489 8487 8490 8496 8497 ...
result:
ok
Test #25:
score: 0
Accepted
time: 37ms
memory: 8472kb
input:
239 432 1211133322222211233323123332311321322321231321333222133131213312213133113331121231223112212122131222231332223111113111321232212311121132133133231332232123332323333211131131331123332313333113211131311331213231321122333332311113112231312111223322232313213112211113231113121132331232211221332221...
output:
73407 73408 73409 73410 73406 73405 73417 73419 68801 68802 68800 68799 68803 68798 68804 68797 68805 68796 68807 68811 68833 68834 71104 71105 71106 71102 71107 71152 71151 71147 71146 71148 71141 71142 71140 71137 71136 71135 77693 77692 77691 77694 77697 77696 77700 77701 77702 77687 77682 77631 ...
result:
ok
Test #26:
score: 0
Accepted
time: 84ms
memory: 9792kb
input:
488 466 3323323332313211122332111313223213332133112332322232113231232223331223233233323111213132333321311321113231223223313233212133233332231113233332223231133112222133312112133212331311122321333332122122223323232311232222111212222233123112322332223312211233213321113111211321322112132112221333213231...
output:
192327 192329 192346 192347 192344 192340 192341 192455 192462 192549 192548 192558 192559 192526 192525 192524 192523 192522 192527 192521 192519 192587 192586 192585 192584 192583 200191 200190 200193 200194 200195 200183 200184 200182 200202 200200 199715 199716 199717 199719 199723 199724 199722...
result:
ok
Test #27:
score: 0
Accepted
time: 95ms
memory: 9760kb
input:
498 499 3123233112131322112121113331221121123223333321122111132312112232113331311321123212131312221123211222312212131111133333313311331331312121322221111222213333333212221131113233122123232332211121111123133211113332221333213111211332322131223231321212131131322232311331113333311132122332232332132331...
output:
209456 209430 209431 209432 209436 209435 209438 209386 209387 209385 209388 209384 209381 209382 209274 209275 209273 209272 209271 209270 209276 209277 209269 209268 209278 209281 209283 217218 217217 217216 217219 217215 217220 217214 217213 217212 217221 217205 217204 217203 217207 217202 217191...
result:
ok
Test #28:
score: 0
Accepted
time: 93ms
memory: 9832kb
input:
500 499 3123313312332121332313133312313232131113323131112123321322122331123121222123321222222122231223213121212232312213111113113121212313223131212212231112323111333311311223222223123113131323212233111312211222112233333113113113211232121321121131211231331331223112313333113323212112321223212323322332...
output:
207770 207766 207767 207765 207763 207754 207755 207752 207676 207677 207675 207686 208052 208051 208050 208053 208054 208056 208046 208047 208066 208065 208072 208071 208103 208101 208110 208111 208109 211974 211975 211972 211971 211953 211952 211951 212020 212021 212019 212022 212025 212014 212015...
result:
ok
Test #29:
score: 0
Accepted
time: 92ms
memory: 9644kb
input:
499 500 2233333331322123232123323323133112221222132221213313122313133111112311222113131122122111112113313322212311133232332213322323321221112323232232112122111133213123312121321213132231331211131313133331331331312322312232232311333223213113313333111313121112313311213123131132221332231223323111332112...
output:
211153 211152 211154 211150 211156 211148 211146 211144 211142 211139 211138 211133 211132 211131 211134 211135 211170 211169 215332 215331 215333 215334 215329 215325 215326 215323 215335 215336 215319 215320 215339 215309 215310 215311 215308 215312 215307 215313 215306 215314 215305 215315 214996...
result:
ok
Test #30:
score: 0
Accepted
time: 91ms
memory: 9636kb
input:
499 499 3331311322112121132231112131211232313223221112211231221332131112333233233123232331133312332213113312123123131221212321211132223131121332231133211332313321223323112323321133231311331111132232211322312112233333313111111222122233311121333223331323133311322131221123322312212221223231321131221222...
output:
205351 205349 205346 205300 205301 205296 205297 205298 213108 213107 213106 213109 213110 213111 213112 213113 213105 213104 213100 213101 213099 213197 213198 213199 213196 213195 213200 213417 213418 213419 213420 213416 213415 213376 213375 213379 213378 213383 213384 213382 213303 213302 213304...
result:
ok
Test #31:
score: 0
Accepted
time: 1ms
memory: 5940kb
input:
3 500 132123121213333113221113211321121223122233232311333232223212312313311233212212221223132231323212123121211213322123111313121132323221332222322312223211212322221211233331232121332112231332211132211312111221233131332112132232123332232311121133133232212321321233132131121321112222312313231311311211...
output:
7 6 24 23 22 25 36 35 37 34 33 38 40 43 46 61 60 59 71 70 69 68 72 73 89 88 87 86 106 107 105 108 104 109 103 102 127 128 126 125 129 123 135 136 138 139 150 151 149 146 154 162 161 172 173 171 170 183 182 184 181 193 194 192 198 199 211 215 216 217 218 209 249 248 250 247 251 252 246 253 245 244 24...
result:
ok
Test #32:
score: 0
Accepted
time: 0ms
memory: 5864kb
input:
500 3 12 23 11 33 32 32 21 21 12 23 31 33 21 33 12 12 13 21 22 23 32 13 13 31 23 13 22 13 23 21 11 11 12 32 21 21 31 32 31 11 33 11 12 12 12 32 32 12 13 31 22 32 33 11 33 21 13 31 33 23 31 33 31 33 21 21 32 13 31 31 21 13 12 23 31 22 32 21 22 33 33 32 12 22 21 22 23 33 13 31 11 11 23 11 31 22 31 12 ...
output:
1499 1500 1498 1494 1495 1497 1493 1492 1496 1490 1488 1491 1484 1489 1487 1482 1485 1486 1483 1481 1480 1478 1479 1477 1476 1475 1474 1471 1470 1473 1465 1469 1472 1463 1466 1468 1464 1462 1467 1457 1459 1461 1456 1458 1460 1454 1455 1453 1448 1449 1452 1450 1451 1447 1446 1445 14...
result:
ok
Test #33:
score: 0
Accepted
time: 0ms
memory: 5984kb
input:
5 500 323321131213321113313131221133323123222231222231233122121112131321232112111111311332123221111321311123122311131132122111211213333221111123111313311211132333212223232131332311332213213113313332133231122213211113313113133131113221121332122333321312122333211132322331223133133313123113322122311121...
output:
32 29 28 19 55 54 56 57 84 83 85 82 80 106 105 107 108 104 102 123 122 119 120 186 187 185 188 189 184 191 193 195 196 181 182 180 229 228 227 230 231 249 248 250 251 247 252 274 273 272 270 343 344 345 342 346 341 340 339 338 337 347 334 335 327 328 329 330 393 392 391 394 395 396 390 389 397 388 3...
result:
ok
Test #34:
score: 0
Accepted
time: 2ms
memory: 7032kb
input:
500 5 2312 3122 2223 3222 1211 2211 3212 2132 1211 3232 3133 3132 2233 1231 2121 2213 2112 1233 1122 1113 2222 1221 2312 2311 2211 1311 1123 1123 2331 1313 2233 1113 2211 3223 1232 2122 1111 2211 2123 3213 3122 2122 2133 2231 2121 3231 1221 3212 3123 3132 1323 1131 3331 1223 3312 3113 2121 1312 2313...
output:
2495 2496 2499 2498 2500 2487 2497 2494 2493 2492 2488 2486 2485 2489 2491 2479 2483 2484 2482 2490 2480 2478 2477 2481 2476 2473 2472 2474 2475 2471 2461 2469 2468 2470 2467 2460 2462 2463 2465 2466 2458 2457 2459 2464 2456 2451 2448 2447 2455 2454 2439 2450 2452 2446 2453 2435 2440 2441...
result:
ok
Test #35:
score: 0
Accepted
time: 3ms
memory: 5952kb
input:
14 500 13222332332231221131213212121133132321123223111233223312222121211112111311313332333111112232111223211223222331113313212111313332331312333232311231322331221223232333233213231232132113332331132122132131221122131112212313113112131112332212311213131232231123113311123211131122222333112212333221322...
output:
387 386 389 390 391 392 394 401 400 398 370 371 369 716 715 714 717 718 713 705 704 706 707 628 627 626 629 625 630 624 631 633 636 635 638 639 613 612 614 615 611 845 846 844 837 836 838 839 840 850 833 832 831 980 1335 1336 1334 1337 1333 1332 1338 1331 1339 1340 1330 1329 1341 1328 1327 1342 1326...
result:
ok
Test #36:
score: 0
Accepted
time: 3ms
memory: 6032kb
input:
500 14 3222223233323 3321211322233 3212323311313 2121333133121 1132223313222 3213132123121 1311132231313 1223111333213 3223131333131 2323331311321 1212213213121 3321213132113 2213112232332 3323312212221 2331233131212 3132332323231 3233312212322 2232231321233 3221121322311 3312213311221 3123221232132...
output:
6924 6983 6984 6985 6982 6986 6987 6969 6970 6972 6974 6998 6997 7000 6926 6923 6991 6990 6992 6989 6988 6981 6971 6968 6973 6975 6995 6999 6932 6925 6922 6927 6928 6956 6955 6953 6980 6993 6979 6976 6967 6996 6931 6933 6934 6935 6930 6921 6939 6954 6952 6963 6994 6978 6977 6966 6888 6887 6889 6...
result:
ok
Test #37:
score: 0
Accepted
time: 8ms
memory: 4384kb
input:
42 500 22321333321323312111231223231112313233322223312223231123333132233232332323233311321322333221131311111221222233221112332333221132311321111331121321231112213133122221231322331112312323321311213113123312322113332213223321323133111122131231313122132211331123311223323311222311121123211213321321222...
output:
3253 3254 3255 3245 3244 3246 3259 3295 3293 3288 3289 3290 3069 3070 3072 2970 2971 2972 2973 2969 2968 2974 2963 2962 2964 2961 2867 2866 3896 3897 3898 3895 3894 3891 3890 3886 3887 3873 3871 4700 4701 4699 4702 4698 4693 4681 4680 4682 4679 4683 5005 5004 5011 5010 5009 5008 4915 4918 4913 4922 ...
result:
ok
Test #38:
score: 0
Accepted
time: 9ms
memory: 7648kb
input:
500 42 11333233331131113122312231331211223323231 13131111223111221132213132223221213332121 33221122332122112222131322332122331123211 11122332312132232321211231131111113212133 12331222132321231332113212212322111211221 31231122131113133231312211232222122213112 21131211232311113331211211123113133233332...
output:
20517 20518 20519 20870 20872 20876 20875 20878 20880 20869 20857 20856 20855 20850 20851 20849 20852 20893 20892 20891 20890 20961 20960 20959 20958 20964 20963 20966 20934 20933 20932 20935 20931 20930 20936 20927 20994 20995 20992 20991 20999 21000 20522 20523 20516 20520 20871 20873 20874 20877...
result:
ok
Test #39:
score: 0
Accepted
time: 21ms
memory: 5424kb
input:
132 500 1132323323231313311333232113321322332132222131331322222313323213212211313222311121333132112222311221331231221111333131232232232231112312212233132321233312211331321323322321111123213131232111121322332223332231212131312112112123121222231122231313132223213132113311121121333133121312313333323211...
output:
28741 28740 28742 28717 28718 28722 28721 28715 28724 28725 28710 28711 28707 28708 28729 28730 28675 28793 28794 28795 28797 28791 28805 28804 28088 28089 28090 28091 28086 28121 28122 28120 32036 32037 32035 32033 32039 32040 32041 32019 32020 32021 32018 32022 32017 32049 32050 32014 32058 32057 ...
result:
ok
Test #40:
score: 0
Accepted
time: 26ms
memory: 6884kb
input:
500 132 12232111232311313223132222113231223331332112121131122121311322322212111231331212321312113131332231123333233333311122213231131132313 13321311123332321112233322221332113221213112112121332311223223213123113122123213221231321223312312132322311223121132231233333113213 1331323322332322111231123132...
output:
62935 62936 62934 62933 63243 63244 63242 63241 63245 63246 63262 63261 63185 63186 63187 63190 63189 63194 63193 63195 63199 63198 63149 63150 63148 63151 63147 63146 63152 64384 64383 64356 64357 64355 64354 64352 64350 64359 64358 64361 64458 64459 64457 64456 64455 64460 64461 64454 64453 64781 ...
result:
ok
Test #41:
score: 0
Accepted
time: 48ms
memory: 8956kb
input:
250 500 3331231211133131113221212112311331322312131211323111323211121112121223221123132121333221132312321213212212123331333221322212112231231312132213223323133233133122233232131131133123323131132133222331313131222221112232212311113131121333323213111122211222222233311212233311133322211231222333222131...
output:
83165 83161 83142 83137 83138 83139 83212 83213 83214 83211 83215 83216 83218 83209 83208 83199 83198 83197 83196 87249 87250 87248 87247 87251 87246 87245 87244 87252 87253 87263 87262 87264 87632 87626 87625 87616 87617 87615 87589 87588 87587 87586 89133 89134 89135 89132 89136 89078 89079 89090 ...
result:
ok
Test #42:
score: 0
Accepted
time: 49ms
memory: 9588kb
input:
500 250 133113133113113111233121332223232121322213133333212131312233133331111223123323132233233123313221332321122231231321323223233223131221221232123123322213133123132112322323233232332321123311233233333112223223111211122213211132312132311221232323133231211 323132231131131123231323113123213333211213...
output:
113552 113551 113558 113531 113532 113530 113524 113523 113521 113652 113653 113651 113443 113442 113444 113332 113331 113330 113333 113334 113336 116999 117000 117001 117002 117004 117098 117097 117099 117096 117092 117093 117165 117166 117164 117163 117167 117143 117144 117145 117146 117147 117150...
result:
ok
Test #43:
score: 0
Accepted
time: 72ms
memory: 9316kb
input:
400 500 3311311321233123231112321333233131232212212332122331132111122231332132313232123123122121312211221333112232121121222231333113232132123311333123321233121311122323111221113222332133312332312232311332321123321232321212112321313313131212131311231121233113213112211121122121212333322111223213222312...
output:
156263 156261 154390 154391 154389 154400 154401 154402 155004 155005 155006 155007 155009 155016 155015 155017 162801 162800 162818 162819 162820 162817 162821 162838 162839 162840 162836 162844 162768 162769 162771 162755 162756 162960 162959 162958 162978 162979 162977 162980 162981 162982 162976...
result:
ok
Test #44:
score: 0
Accepted
time: 78ms
memory: 9168kb
input:
500 400 1333112223111311312321322331211131212113113331221131323233223113223221322233133231223211313122313232111213132313212333212332111131112313233322233231331122333332231232112332333332231121122332323211221211231211222222212131113322122231323233111311333111223322222213213112132232211122213322111211...
output:
174043 174042 174003 174015 172885 172886 172884 172883 172882 172881 172823 172824 172822 172825 172818 172819 172817 172830 172829 172831 173341 173340 173339 173331 173330 173332 175633 175668 175667 175669 175666 175670 175665 181942 181943 181944 181945 181946 181941 181947 181923 181924 181922...
result:
ok
Test #45:
score: 0
Accepted
time: 65ms
memory: 9780kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249502 249503 249504 249505 249506 249507 249508 249509 249510 249511 249512 249513 249514 249515 249516 249517 249518 249519 249520 249521 249522 249523 249524 249525 249526 249527 249528 249529 249530 249531 249532 249533 249534 249535 249536 249537 249538 249539 249540 249541 249542 249543 249544...
result:
ok
Test #46:
score: 0
Accepted
time: 62ms
memory: 9836kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
249998 249997 249996 249995 249994 249993 249992 249991 249990 249989 249988 249987 249986 249999 249985 249984 249983 249982 249981 249980 249979 249978 249977 249976 249975 249974 249973 249972 249971 249970 249969 249968 249967 249966 249965 249964 249963 249962 249961 249960 249959 249958 249957...
result:
ok
Test #47:
score: 0
Accepted
time: 92ms
memory: 9764kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
124751 125251 125750 126248 126745 127241 127736 128230 128723 129215 129706 130196 130685 131173 131660 132146 132631 133115 133598 134080 134561 135041 135520 135998 136475 136951 137426 137900 138373 138845 139316 139786 140255 140723 141190 141656 142121 142585 143048 143510 143971 144431 144890...
result:
ok
Test #48:
score: 0
Accepted
time: 66ms
memory: 9752kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249513 249514 249515 249516 249517 249518 249519 249520 249521 249522 249523 249524 249525 249526 249527 249528 249529 249530 249531 249532 249533 249534 249535 249536 249537 249538 249539 249540 249541 249542 249543 249544 249545 249546 249512 249547 249548 249549 249550 249511 249551 249552 249553...
result:
ok
Test #49:
score: 0
Accepted
time: 58ms
memory: 9644kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
249969 249968 249967 249966 249965 249964 249963 249962 249961 249960 249959 249958 249970 249957 249956 249955 249954 249953 249952 249951 249950 249949 249948 249947 249946 249945 249944 249943 249942 249941 249940 249939 249971 249938 249937 249936 249935 249934 249933 249932 249931 249930 249972...
result:
ok
Test #50:
score: 0
Accepted
time: 89ms
memory: 9688kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
124751 125315 125750 126580 126745 128004 127735 128314 128723 129449 129706 130196 130685 131173 131660 132245 132780 133115 133598 134080 134561 135041 135908 135998 136475 136951 137426 137900 138780 138845 139648 139786 141449 141500 141138 141793 142121 142585 143048 143510 143971 144431 144890...
result:
ok
Test #51:
score: 0
Accepted
time: 68ms
memory: 9680kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249582 249583 249584 249585 249586 249587 249588 249589 249590 249591 249581 249592 249593 249594 249595 249596 249597 249598 249599 249600 249601 249580 249602 249603 249604 249605 249606 249607 249608 249609 249610 249611 249612 249613 249614 249615 249616 249617 249618 249619 249620 249621 249622...
result:
ok
Test #52:
score: 0
Accepted
time: 77ms
memory: 9756kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
249615 249616 249614 249617 249618 249613 249619 249612 249620 249611 249610 249609 249608 249621 249607 249606 249605 249604 249622 249603 249623 249624 249602 249601 249600 249625 249626 249599 249598 249597 249627 249596 249595 249594 249628 249593 249629 249592 249630 249631 249632 249591 249633...
result:
ok
Test #53:
score: 0
Accepted
time: 63ms
memory: 9676kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
250000 249999 249998 249997 249996 249995 249994 249993 249992 249991 249990 249989 249988 249987 249986 249985 249984 249983 249982 249981 249980 249979 249978 249977 249976 249975 249974 249973 249972 249971 249970 249969 249968 249967 249966 249965 249964 249963 249962 249961 249960 249959 249958...
result:
ok
Test #54:
score: 0
Accepted
time: 87ms
memory: 9756kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
249999 250000 249998 249997 249996 249995 249994 249993 249992 249991 249990 249989 249988 249987 249986 249985 249984 249983 249982 249981 249980 249979 249978 249977 249976 249975 249974 249973 249972 249971 249970 249969 249968 249967 249966 249965 249964 249963 249962 249961 249960 249959 249958...
result:
ok
Test #55:
score: 0
Accepted
time: 70ms
memory: 9728kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249999 249998 249997 249996 249995 249994 249993 249992 249991 249990 249989 249988 249987 249986 249985 249984 249983 249982 249981 249980 249979 249978 249977 249976 249975 249974 249973 249972 249971 249970 249969 249968 249967 249966 249965 249964 249963 249962 249961 249960 249959 249958 249957...
result:
ok
Test #56:
score: 0
Accepted
time: 68ms
memory: 9688kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249501 249502 249503 249504 249505 249506 249507 249508 249509 249510 249511 249512 249513 249514 249515 249516 249517 249518 249519 249520 249521 249522 249523 249524 249525 249526 249527 249528 249529 249530 249531 249532 249533 249534 249535 249536 249537 249538 249539 249540 249541 249542 249543...
result:
ok
Test #57:
score: 0
Accepted
time: 89ms
memory: 9764kb
input:
500 500 3133333333331313333313313331131333311113131133333131131113333111133311111313131133331331111131333331133113313131333331313311313313133311113113333331331133313313113133133311131331133113333333331333311333131133131333133333333311133111333333111313333333333333133133333131333133113311333113333113...
output:
174864 174869 174870 174878 174880 174887 174889 174896 174900 174910 174912 174914 174991 174992 174995 174996 175000 175025 175027 175029 175040 175041 175043 175583 175584 175590 175600 175629 175630 175631 182807 182808 182810 182812 182816 182872 182873 182874 182875 182876 182956 182957 183123...
result:
ok
Test #58:
score: 0
Accepted
time: 89ms
memory: 9648kb
input:
500 500 3331113313111333311331333331133131331333311131311311133333113331133331131131131331131133333133313311131311313333331313113133311313111131333331113111311311111311113331113111113331113113131331313131311331113333133131333111313111133111111313131311131111111113113333133333131133331131333333131111...
output:
183172 183174 183176 183197 183198 183199 183200 183203 183673 183674 196324 196325 196326 196327 196330 196333 196337 196348 196349 196350 196353 197104 197105 197107 197116 197118 197120 197144 197145 197146 197148 197178 197179 197319 197320 197322 197325 197326 197328 197330 197346 197352 197353...
result:
ok
Test #59:
score: 0
Accepted
time: 104ms
memory: 9768kb
input:
500 500 3333323333333333333233333233332333323333333333233333333333323233333333333333333333333333333333233332333333333333333223322233333233333333322333333333333333333323333233333323332323333333223333233333333333333333323233233323233332333333333333333233333333332333233333233333333333333232333333333323...
output:
144141 144165 144163 150942 150939 150917 150918 150923 150997 150991 150571 150482 150484 150481 155666 155674 155672 155685 155041 155039 155038 155044 155155 155170 155166 155117 155118 155124 154700 154694 154818 154819 154815 158790 158806 158801 158802 158798 158810 158768 158770 166024 166029...
result:
ok
Test #60:
score: 0
Accepted
time: 70ms
memory: 9836kb
input:
500 500 2221112221121221111121112111121111111111222122112211111111122212121111222122121121111111121111211122111112111122111111211221122212112211221121122112222111222112111111111111211121211121221111211121111122211121211121111211112112121222221111111122121122112211111111111222112112122111111121111121...
output:
249759 249758 249760 249761 249757 249762 249756 249763 249755 249764 249754 249753 249752 249765 249766 249751 249750 249749 249748 249747 249767 249768 249746 249745 249744 249769 249743 249770 249771 249742 249772 249773 249741 249774 249775 249740 249739 249776 249738 249777 249737 249778 249736...
result:
ok
Test #61:
score: 0
Accepted
time: 83ms
memory: 9644kb
input:
500 500 3331111331111113131111131113213111131313113111313111133311111113111131111111333331331131131311331131133111131333111311111111131111111113113313311113111111111131111311111113111111313111113111111311111313313131113113113111113313113131311311111131133331331311333113131331331111111313111311311333...
output:
214243 214245 214247 220714 220715 220716 220717 220718 220712 220700 220701 220702 220699 220703 220704 220705 220691 220692 220674 220673 220672 220671 220675 220676 220882 220883 220884 220885 220873 220872 220874 220917 220918 220919 220916 220915 220928 220929 220824 220825 220839 220840 220841...
result:
ok
Test #62:
score: 0
Accepted
time: 86ms
memory: 9776kb
input:
500 500 2222222222222222222222222232232222222222222222222222222222222222222322222222222222222222222222222223222222222222222222222222222222222222222222223222223222322222222222222222222232222222222222222222222222222222222232222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
246407 246406 246408 246405 246409 246404 246403 246410 246402 246401 246411 246412 246413 246414 246400 246415 246416 246417 246399 246418 246398 246419 246397 246420 246421 246396 246422 246380 246381 246379 247714 247713 247715 247716 247717 247712 247711 247710 247709 247718 247708 247707 247706...
result:
ok
Test #63:
score: 0
Accepted
time: 76ms
memory: 9836kb
input:
500 500 1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231...
output:
208167 208168 208166 208667 208668 208666 209163 209164 209162 209657 209658 209656 210147 210148 210146 210635 210636 210634 211119 211120 211118 211601 211602 211600 212079 212080 212078 212555 212556 212554 213027 213028 213026 213497 213498 213496 213963 213964 213962 214427 214428 214426 214887...
result:
ok
Test #64:
score: 0
Accepted
time: 77ms
memory: 9644kb
input:
500 500 1321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321...
output:
208001 208002 208501 208500 208502 208999 208998 209000 209493 209492 209494 209985 209984 209986 210473 210472 210474 210959 210958 210960 211441 211440 211442 211921 211920 211922 212397 212396 212398 212871 212870 212872 213341 213340 213342 213809 213808 213810 214273 214272 214274 214735 214734...
result:
ok
Test #65:
score: 0
Accepted
time: 78ms
memory: 9756kb
input:
500 500 1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231...
output:
187584 187583 187585 188415 188414 188416 189073 189072 189074 189896 189895 189897 190544 190543 190545 191359 191358 191360 191997 191996 191998 192804 192803 192805 193432 193431 193433 194231 194230 194232 194849 194848 194850 195640 195639 195641 196248 196247 196249 197031 197030 197032 197629...
result:
ok
Test #66:
score: 0
Accepted
time: 80ms
memory: 9836kb
input:
500 500 1321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321...
output:
125002 125001 126496 126495 126497 127984 127983 127982 129460 129461 129459 130927 130928 130929 132388 132387 132389 133840 133839 133838 135280 135281 135279 136711 136712 136713 138136 138135 138137 139552 139551 139550 140956 140957 140955 142351 142352 142353 143740 143739 143741 145120 145119...
result:
ok
Test #67:
score: 0
Accepted
time: 78ms
memory: 9644kb
input:
500 500 1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231...
output:
125501 125500 125499 126992 126991 126993 128475 128476 128477 129951 129952 129950 131417 131416 131415 132872 132871 132873 134319 134320 134321 135759 135760 135758 137189 137188 137187 138608 138607 138609 140019 140020 140021 141423 141424 141422 142817 142816 142815 144200 144199 144201 145575...
result:
ok
Test #68:
score: 0
Accepted
time: 79ms
memory: 9692kb
input:
500 500 1321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321...
output:
187335 187334 188165 188166 188164 188826 188827 188825 189649 189650 189648 190300 190301 190299 191115 191116 191114 191756 191757 191755 192563 192564 192562 193194 193195 193193 193993 193994 193992 194614 194615 194613 195405 195406 195404 196016 196017 196015 196799 196800 196798 197400 197401...
result:
ok
Test #69:
score: 0
Accepted
time: 70ms
memory: 9836kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249584 249585 249586 249587 249588 249589 249590 249591 249592 249593 249594 249595 249596 249597 249598 249599 249600 249601 249602 249603 249604 249605 249606 249607 249608 249609 249610 249611 249612 249613 249614 249615 249616 249617 249618 249619 249620 249621 249622 249623 249624 249625 249626...
result:
ok
Test #70:
score: 0
Accepted
time: 67ms
memory: 9684kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
249584 249585 249586 249587 249588 249589 249590 249591 249592 249593 249594 249595 249596 249597 249598 249599 249600 249601 249602 249603 249604 249605 249606 249607 249608 249609 249610 249611 249612 249613 249614 249615 249616 249617 249618 249619 249620 249621 249622 249623 249624 249625 249626...
result:
ok
Test #71:
score: 0
Accepted
time: 67ms
memory: 9680kb
input:
500 500 2312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312...
output:
208002 208001 208501 208502 208500 208999 209000 208998 209493 209494 209492 209985 209986 209984 210473 210474 210472 210959 210960 210958 211441 211442 211440 211921 211922 211920 212397 212398 212396 212871 212872 212870 213341 213342 213340 213809 213810 213808 214273 214274 214272 214735 214736...
result:
ok
Test #72:
score: 0
Accepted
time: 72ms
memory: 9676kb
input:
500 500 2132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132...
output:
208168 208167 208169 208667 208666 208668 209164 209163 209165 209657 209656 209658 210148 210147 210149 210635 210634 210636 211120 211119 211121 211601 211600 211602 212080 212079 212081 212555 212554 212556 213028 213027 213029 213497 213496 213498 213964 213963 213965 214427 214426 214428 214888...
result:
ok
Test #73:
score: 0
Accepted
time: 82ms
memory: 9756kb
input:
500 500 2312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312...
output:
187418 187419 188082 188081 188083 188911 188910 188912 189565 189564 189566 190386 190385 190387 191030 191029 191031 191843 191842 191844 192477 192476 192478 193282 193281 193283 193906 193905 193907 194703 194702 194704 195317 195316 195318 196106 196105 196107 196710 196709 196711 197491 197490...
result:
ok
Test #74:
score: 0
Accepted
time: 82ms
memory: 9844kb
input:
500 500 2132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132...
output:
125500 125501 125499 126991 126992 126993 128476 128475 128477 129952 129951 129950 131416 131417 131415 132871 132872 132873 134320 134319 134321 135760 135759 135758 137188 137189 137187 138607 138608 138609 140020 140019 140021 141424 141423 141422 142816 142817 142815 144199 144200 144201 145576...
result:
ok
Test #75:
score: 0
Accepted
time: 81ms
memory: 9640kb
input:
500 500 2312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312...
output:
125000 125001 126495 126496 126497 127983 127984 127982 129461 129460 129459 130928 130927 130929 132387 132388 132389 133839 133840 133838 135281 135280 135279 136712 136711 136713 138135 138136 138137 139551 139552 139550 140957 140956 140955 142352 142351 142353 143739 143740 143741 145119 145120...
result:
ok
Test #76:
score: 0
Accepted
time: 79ms
memory: 9684kb
input:
500 500 2132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132...
output:
187667 187668 187666 188330 188331 188329 189157 189158 189156 189810 189811 189809 190629 190630 190628 191272 191273 191271 192083 192084 192082 192716 192717 192715 193519 193520 193518 194142 194143 194141 194937 194938 194936 195550 195551 195549 196337 196338 196336 196940 196941 196939 197719...
result:
ok
Test #77:
score: 0
Accepted
time: 70ms
memory: 9752kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
249917 249916 249915 249914 249913 249912 249911 249910 249909 249908 249907 249906 249905 249904 249903 249902 249901 249900 249899 249898 249897 249896 249895 249894 249893 249892 249891 249890 249889 249888 249887 249886 249885 249884 249883 249882 249881 249880 249879 249878 249877 249876 249875...
result:
ok
Test #78:
score: 0
Accepted
time: 66ms
memory: 9760kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
249917 249916 249915 249914 249913 249912 249911 249910 249909 249908 249907 249906 249905 249904 249903 249902 249901 249900 249899 249898 249897 249896 249895 249894 249893 249892 249891 249890 249889 249888 249887 249886 249885 249884 249883 249882 249881 249880 249879 249878 249877 249876 249875...
result:
ok
Test #79:
score: 0
Accepted
time: 76ms
memory: 9656kb
input:
500 500 3123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123...
output:
207834 208334 208335 208333 208833 208834 208832 209328 209329 209327 209821 209822 209820 210310 210311 210309 210797 210798 210796 211280 211281 211279 211761 211762 211760 212238 212239 212237 212713 212714 212712 213184 213185 213183 213653 213654 213652 214118 214119 214117 214581 214582 214580...
result:
ok
Test #80:
score: 0
Accepted
time: 80ms
memory: 9676kb
input:
500 500 3213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213...
output:
207834 208334 208333 208335 208833 208832 208834 209328 209327 209329 209821 209820 209822 210310 210309 210311 210797 210796 210798 211280 211279 211281 211761 211760 211762 212238 212237 212239 212713 212712 212714 213184 213183 213185 213653 213652 213654 214118 214117 214119 214581 214580 214582...
result:
ok
Test #81:
score: 0
Accepted
time: 79ms
memory: 9836kb
input:
500 500 3123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123...
output:
187085 187917 187916 187918 188579 188578 188580 189404 189403 189405 190056 190055 190057 190873 190872 190874 191515 191514 191516 192324 192323 192325 192956 192955 192957 193757 193756 193758 194379 194378 194380 195172 195171 195173 195784 195783 195785 196569 196568 196570 197171 197170 197172...
result:
ok
Test #82:
score: 0
Accepted
time: 79ms
memory: 9768kb
input:
500 500 3213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213...
output:
124503 126000 125999 125998 127488 127489 127487 128967 128968 128969 130440 130439 130441 131904 131903 131902 133356 133357 133355 134799 134800 134801 136236 136235 136237 137664 137663 137662 139080 139081 139079 140487 140488 140489 141888 141887 141889 143280 143279 143278 144660 144661 144659...
result:
ok
Test #83:
score: 0
Accepted
time: 79ms
memory: 9688kb
input:
500 500 3123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123...
output:
124502 125999 126000 125998 127489 127488 127487 128968 128967 128969 130439 130440 130441 131903 131904 131902 133357 133356 133355 134800 134799 134801 136235 136236 136237 137663 137664 137662 139081 139080 139079 140488 140487 140489 141887 141888 141889 143279 143280 143278 144661 144660 144659...
result:
ok
Test #84:
score: 0
Accepted
time: 79ms
memory: 9772kb
input:
500 500 3213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213...
output:
187167 187833 187834 187832 188662 188663 188661 189319 189320 189318 190140 190141 190139 190787 190788 190786 191600 191601 191599 192237 192238 192236 193042 193043 193041 193669 193670 193668 194466 194467 194465 195083 195084 195082 195872 195873 195871 196479 196480 196478 197260 197261 197259...
result:
ok
Test #85:
score: 0
Accepted
time: 67ms
memory: 9680kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
249168 249170 249172 249174 249176 249178 249180 249182 249184 249186 249188 249190 249192 249194 249196 249198 249200 249202 249204 249206 249208 249210 249212 249214 249216 249218 249220 249222 249224 249226 249228 249230 249232 249234 249236 249238 249240 249242 249244 249246 249248 249250 249252...
result:
ok
Test #86:
score: 0
Accepted
time: 62ms
memory: 9836kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
249168 249170 249172 249174 249176 249178 249180 249182 249184 249186 249188 249190 249192 249194 249196 249198 249200 249202 249204 249206 249208 249210 249212 249214 249216 249218 249220 249222 249224 249226 249228 249230 249232 249234 249236 249238 249240 249242 249244 249246 249248 249250 249252...
result:
ok
Extra Test:
score: 0
Extra Test Passed