QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#279682 | #7807. Loops | bachbeo2007 | AC ✓ | 53ms | 21576kb | C++23 | 6.3kb | 2023-12-08 23:05:26 | 2023-12-08 23:05:26 |
Judging History
answer
/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt")
*/
#include <bits/stdc++.h>
#define taskname ""
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define i64 long long
#define pb push_back
#define ff first
#define ss second
#define isz(x) (int)x.size()
using namespace std;
const int mxN = 2e5 + 5;
const int mod = 1e9 + 7;
const i64 oo = 1e18;
bool rlt[505][505];
int n, m, a[505][505], ans[505 * 505], enc[505][505], indeg[505 * 505];
vector<int> G[505 * 505];
int encode(int x, int y) {
return (x - 1) * n + y;
}
void solve() {
cin >> n >> m;
for (int i = 1; i < n; ++i) {
for (int j = 1; j < m; ++j) {
char c; cin >> c;
a[i][j] = c - '0';
}
}
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
enc[i][j] = (i - 1) * m + j;
// cout << enc[i][j] << " \n"[j == m];
}
}
// return;
for (int i = 1; i < n; ++i)
rlt[i][1] = 0;
#define A i - 1, j - 1
#define B i - 1, j
#define C i, j - 1
#define D i, j
auto add_edge = [&](int x1, int y1, int x2, int y2) -> void {
// cout << x1 << " " << y1 << " -> " << x2 << " " << y2 << endl;
G[enc[x1][y1]].emplace_back(enc[x2][y2]);
++indeg[enc[x2][y2]];
};
for (int j = 2; j <= m; ++j) {
int cur = 1;
for (int i = 2; i <= n; ++i) {
// cout << a[i - 1][j - 1] << " " << rlt[i - 1][j - 1] << " " << cur << "\n";
if (a[i - 1][j - 1] == 1) {
if (rlt[i - 1][j - 1] == 0) {
if (cur == 0) {
add_edge(B, A);
add_edge(A, D);
add_edge(D, C);
rlt[i - 1][j] = 0;
cur = 0;
}
else {
add_edge(A, B);
add_edge(B, C);
add_edge(C, D);
rlt[i - 1][j] = 0;
cur = 1;
}
}
else {
if (cur == 0) {
add_edge(B, C);
add_edge(C, D);
add_edge(D, A);
rlt[i - 1][j] = 0;
cur = 1;
}
else {
add_edge(C, D);
add_edge(D, A);
add_edge(A, B);
rlt[i - 1][j] = 1;
cur = 1;
}
}
}
else if (a[i - 1][j - 1] == 2) {
if (rlt[i - 1][j - 1] == 0) {
if (cur == 0) {
add_edge(B, A);
add_edge(A, C);
add_edge(C, D);
rlt[i - 1][j] = 0;
cur = 1;
}
else {
add_edge(A, C);
add_edge(C, D);
add_edge(D, B);
rlt[i - 1][j] = 1;
cur = 1;
}
}
else {
if (cur == 0) {
add_edge(B, D);
add_edge(D, C);
add_edge(C, A);
rlt[i - 1][j] = 0;
cur = 0;
}
else {
add_edge(C, A);
add_edge(A, B);
add_edge(B, D);
rlt[i - 1][j] = 0;
cur = 1;
}
}
}
else {
if (rlt[i - 1][j - 1] == 0) {
if (cur == 0) {
add_edge(B, D);
add_edge(D, A);
add_edge(A, C);
rlt[i - 1][j] = 0;
cur = 0;
}
else {
add_edge(A, C);
add_edge(C, B);
add_edge(B, D);
rlt[i - 1][j] = 0;
cur = 1;
}
}
else {
if (cur == 0) {
add_edge(D, B);
add_edge(B, C);
add_edge(C, A);
rlt[i - 1][j] = 1;
cur = 0;
}
else {
add_edge(C, A);
add_edge(A, D);
add_edge(D, B);
rlt[i - 1][j] = 1;
cur = 1;
}
}
}
// cout << endl;
}
}
int cnt = 0;
queue<int> q;
for (int i = 1; i <= n * m; ++i)
if (indeg[i] == 0) q.emplace(i);
while (not q.empty()) {
int v = q.front(); q.pop();
ans[v] = ++cnt;
for (int u : G[v]) {
if (--indeg[u] == 0) {
q.emplace(u);
}
}
}
// cout << cnt << endl;
assert(cnt == n * m);
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
cout << ans[enc[i][j]] << " \n"[j == m];
}
}
}
signed main() {
#ifndef CDuongg
if(fopen(taskname".inp", "r"))
assert(freopen(taskname".inp", "r", stdin)), assert(freopen(taskname".out", "w", stdout));
#else
freopen("bai3.inp", "r", stdin);
freopen("bai3.out", "w", stdout);
auto start = chrono::high_resolution_clock::now();
#endif
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1; //cin >> t;
while(t--) solve();
#ifdef CDuongg
auto end = chrono::high_resolution_clock::now();
cout << "\n"; for(int i = 1; i <= 100; ++i) cout << '=';
cout << "\nExecution time: " << chrono::duration_cast<chrono::milliseconds> (end - start).count() << "[ms]" << endl;
#endif
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 12908kb
input:
3 4 113 231
output:
1 2 4 11 3 7 10 12 5 6 8 9
result:
ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 13536kb
input:
2 2 1
output:
1 2 3 4
result:
ok
Test #3:
score: 0
Accepted
time: 3ms
memory: 12480kb
input:
2 2 2
output:
1 4 2 3
result:
ok
Test #4:
score: 0
Accepted
time: 3ms
memory: 12852kb
input:
2 2 3
output:
1 3 2 4
result:
ok
Test #5:
score: 0
Accepted
time: 2ms
memory: 13296kb
input:
10 10 332133211 312132213 221223223 213231333 212221111 311132221 312232123 123132221 112112133
output:
1 3 7 36 40 46 50 54 57 60 2 5 9 32 34 44 48 72 75 80 4 19 20 21 29 37 51 65 69 78 6 18 22 24 26 41 55 63 73 81 8 15 17 23 31 58 61 66 76 83 10 12 14 25 28 67 88 89 94 96 11 16 27 62 64 70 87 90 91 93 13 30 43 59 68 74 77 85 92 95 33 35 39 52 56 71 79 82 97 99 38 42 45 47 49 53 84 86 98 100
result:
ok
Test #6:
score: 0
Accepted
time: 3ms
memory: 12060kb
input:
20 20 2211223333122331122 3331311131211112312 2223231233212131113 1333132112122133111 3213311331223233331 1221321331233112122 1121231321232232222 2232213321133123222 1132113323222231313 1312131323132213333 3311112222223332131 2223312233231113113 2132333222332312223 1112323111213123112 13333212331311...
output:
1 6 8 11 14 47 50 58 67 74 228 230 287 293 303 315 318 322 337 341 2 4 13 18 21 44 53 62 70 225 232 245 281 297 309 321 325 330 333 353 3 10 16 35 42 57 66 73 222 235 239 241 243 277 282 304 328 336 340 348 5 7 19 33 39 61 140 170 219 226 237 246 265 270 274 288 298 305 311 344 9 15 31 36 65 134 144...
result:
ok
Test #7:
score: 0
Accepted
time: 3ms
memory: 13008kb
input:
50 50 1332131133132323222112321123131221312233322122223 2221231213232322112331221312322112322311122221123 1123133112313113133322131132321333112332213213331 2211311121212313132213233111332323333231213213211 3213111221231131223123231131232311332333311131222 33211133322223112231133211113231232213123112...
output:
1 2 9 14 73 76 87 535 545 561 590 599 614 621 658 678 754 760 799 806 815 826 879 1327 1336 1346 1358 1415 1503 1509 1645 1653 1662 1780 1789 1832 1838 1846 2020 2034 2051 2071 2082 2241 2250 2260 2286 2294 2476 2480 3 7 11 67 69 71 80 84 528 553 571 581 607 649 667 673 747 783 791 825 844 862 871 1...
result:
ok
Test #8:
score: 0
Accepted
time: 0ms
memory: 13180kb
input:
100 100 313212312322233331312323312332132331313321221212212131211311112113112312322211333333322323131311231 312312132132131211223133231112313131131133222132323231232333112213131232133331131132133222232221333 21311321231223313122231331333213122212113312122322333111113232313312212231121333332321322113...
output:
1 3 5 11 93 97 100 108 112 209 220 227 242 247 261 643 663 787 796 825 834 968 989 998 1014 1827 1843 1909 1932 1961 1975 1992 2486 2557 2584 2838 2851 2984 2995 3018 3045 3059 3071 4445 4456 4465 4656 4673 4690 4871 4891 4908 4925 5010 5025 5348 5387 5405 5481 5769 5787 5803 5820 5834 5847 5860 600...
result:
ok
Test #9:
score: 0
Accepted
time: 10ms
memory: 13856kb
input:
200 200 1233323221211232311113332333232111313131133121323322113313331121312123331121131233131131212221212121322231231333231213122232133122122231313133221233211322111123232232323232221132223323332312332211322 21332332123232121213222231221121113212231313332313112133223111232211133133131211112113112321...
output:
1 2 18 24 34 42 47 62 122 125 128 165 191 198 205 222 282 314 327 381 401 406 418 441 457 466 1080 1106 1159 1195 1221 1237 1252 1267 1286 3739 3767 3842 3865 6070 6093 6116 6205 6310 6333 6565 6584 7914 7945 8114 8169 8820 8850 8882 8917 9013 9115 9144 9370 9428 9489 9524 9558 10941 10962 11138 111...
result:
ok
Test #10:
score: 0
Accepted
time: 15ms
memory: 16304kb
input:
300 300 3311223122331113313232133212111231323122311111231321321213311311223122233323333132332232323332312322221323323333232321123321332123331132313333121313313331312211322211311113222113233311321131311211122122313222233123221311212231212221311323332223213123221113233123111131112321222323313333321121...
output:
1 3 6 8 11 34 38 60 66 165 171 244 257 265 275 285 370 391 398 424 1008 1032 1046 1059 1100 1373 1502 1518 1534 1544 1558 1570 2849 2923 2941 2980 3006 3054 3076 3699 3726 3774 3794 3819 3841 3865 3888 5979 6088 6115 6190 6213 6238 6311 6565 6592 6619 6644 6713 10384 10422 10458 10556 10587 10621 12...
result:
ok
Test #11:
score: 0
Accepted
time: 34ms
memory: 18436kb
input:
400 400 1111113223123311131222231121323322132111222131332233123133331313321122332211312131233113332212112333322333232212133332323123223121323232113111122122321213132333132312232321123223112332221221321321132133231121331233221223332113133133223333313311331311131331131322133321121331232321232332232331...
output:
1 2 4 6 8 11 14 94 114 121 133 138 178 189 602 629 690 704 757 769 782 1115 1123 1155 1234 1249 1265 1280 1294 1660 1746 1824 1862 1882 2000 2019 2056 2074 2093 2111 2129 3839 3863 4048 4072 4363 4382 4433 6562 6590 6699 6753 6871 6897 6923 7550 7580 7703 8527 8644 8708 8742 8859 8899 9318 9399 9599...
result:
ok
Test #12:
score: 0
Accepted
time: 3ms
memory: 12216kb
input:
2 500 133313131212111213113123132322133111323331323213121233222213321221323231313331312223211231111112211313132133321112312333232313123223211131121131223122213231213122221133131113211331311111133222221111221111232332122332221121331213233333122232123122221121331232223313223111233221222121323132222311...
output:
1 2 5 7 9 10 13 14 17 18 23 24 25 26 28 30 35 36 39 41 42 45 46 47 49 50 53 56 58 59 63 64 66 69 71 73 74 76 77 79 81 83 84 87 90 92 93 94 97 98 103 104 105 107 109 112 113 116 117 118 121 123 127 128 129 133 134 136 137 139 142 145 146 149 150 152 154 157 158 161 162 163 166 167 169 173 175 176 177...
result:
ok
Test #13:
score: 0
Accepted
time: 3ms
memory: 13660kb
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:
1 2 3 5 4 7 6 8 9 10 11 14 12 13 15 18 16 17 19 21 20 24 22 23 25 28 26 27 29 31 30 33 32 35 34 37 36 39 38 41 40 42 43 48 44 46 45 52 47 50 49 53 51 54 55 57 56 58 59 64 60 62 61 66 63 65 67 72 68 70 69 73 71 83 74 81 75 79 76 78 77 80 82 98 84 96 85 94 86 92 87 90 88 89 91 93 95 99 97 101 100 103 ...
result:
ok
Test #14:
score: 0
Accepted
time: 42ms
memory: 21576kb
input:
500 500 3222313321212112132211312331222113112212133113211232222333321313232232233113321313131221133123212131231113321222331133221312322133212132213311132232133222323122322113223233122211331321213313333321113132221322312233233132121322121312131311322232232233311111333333212213232221111133111231133221...
output:
1 3 28 32 102 127 134 173 182 186 191 276 280 286 293 300 836 852 879 894 947 1014 1027 1149 1162 1175 1200 1226 1240 1328 1341 2618 2639 2657 2724 2847 2863 2876 3143 3162 3182 3203 3295 3382 3406 3432 3535 3691 4532 4560 4595 4642 4707 4732 10194 10230 10297 10361 10491 10561 12017 12063 12180 122...
result:
ok
Test #15:
score: 0
Accepted
time: 41ms
memory: 21432kb
input:
500 500 1111111111111111111111111111111111111111111311111111111111111111111131111111111112111111111111311111111311111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111211111111111111111111111111111111111111111111121111231111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 181 194 206 218 231 245 259 273 287 302 317 333 349 365 380 396 412 428 446 505 526 548 570 591 614 635 658 682 707 731 755 779 806 832 859 885 911 937 964 991 1020 1051 1083 1114 1358 1387 1416 1450 1484 1522 1561 1599 163...
result:
ok
Test #16:
score: 0
Accepted
time: 46ms
memory: 21440kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222221222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222212222222222222222222222222222222222222222222222223222222222222222222222222222222222222222222222222222222...
output:
1 421 424 1511 1521 2703 2718 2865 2882 3044 3062 4706 4733 4920 4949 6475 6512 9025 9077 9954 10007 10930 10979 12117 12166 12743 12800 13252 13306 13735 13784 14759 14809 17174 17225 18727 18780 21664 21725 21898 21957 22543 22601 23224 23271 23917 23973 24476 24532 25015 25074 25565 25613 26044 2...
result:
ok
Test #17:
score: 0
Accepted
time: 40ms
memory: 21508kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333233333333333333233333333333333333331333333333333333331333133333333333333333333333333333333333333333333333333333333333333333333333333333333333333333313333333333333333333333333333333333333333333333333...
output:
1 3 7 12 22 31 49 61 73 100 122 147 168 193 219 247 299 333 369 407 444 480 516 556 597 684 730 776 825 874 926 1032 1094 1158 1341 1406 1531 1596 1665 1734 2029 2240 2313 2387 2464 2544 2704 3070 3170 3573 3671 3765 3868 4291 4407 4521 5277 5509 5627 5749 5866 5982 6097 6215 6334 6451 6571 6690 681...
result:
ok
Test #18:
score: 0
Accepted
time: 27ms
memory: 21512kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 182 196 210 225 240 256 272 289 306 324 342 361 380 400 420 441 462 484 506 529 552 576 600 625 650 676 702 729 756 784 812 841 870 900 930 961 992 1024 1056 1089 1122 1156 1190 1225 1260 1296 1332 1369 1406 1444 1482 1521 ...
result:
ok
Test #19:
score: 0
Accepted
time: 27ms
memory: 21540kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 1000 1001 2000 2001 3000 3001 4000 4001 5000 5001 6000 6001 7000 7001 8000 8001 9000 9001 10000 10001 11000 11001 12000 12001 13000 13001 14000 14001 15000 15001 16000 16001 17000 17001 18000 18001 19000 19001 20000 20001 21000 21001 22000 22001 23000 23001 24000 24001 25000 25001 26000 26001 2700...
result:
ok
Test #20:
score: 0
Accepted
time: 38ms
memory: 21500kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
1 3 7 13 21 31 43 57 73 91 111 133 157 183 211 241 273 307 343 381 421 463 507 553 601 651 703 757 813 871 931 993 1057 1123 1191 1261 1333 1407 1483 1561 1641 1723 1807 1893 1981 2071 2163 2257 2353 2451 2551 2653 2757 2863 2971 3081 3193 3307 3423 3541 3661 3783 3907 4033 4161 4291 4423 4557 4693 ...
result:
ok
Test #21:
score: 0
Accepted
time: 2ms
memory: 11724kb
input:
5 6 31323 21231 12312 23331
output:
1 3 5 19 25 27 2 15 17 21 24 26 4 6 13 23 28 29 7 10 12 16 22 30 8 9 11 14 18 20
result:
ok
Test #22:
score: 0
Accepted
time: 2ms
memory: 13000kb
input:
13 8 2331112 3321121 2123131 1132132 1322123 1121123 1113323 2221132 2223233 1231311 1312132 2132321
output:
1 6 14 31 34 37 40 43 2 4 12 24 28 32 35 46 3 10 15 17 22 25 92 94 5 7 9 20 86 90 97 100 8 11 19 79 82 84 95 103 13 16 21 75 87 91 93 98 18 23 27 30 73 80 96 101 26 42 45 70 76 83 88 99 29 39 48 65 68 71 85 102 33 36 53 63 67 77 89 104 38 41 52 54 61 69 74 78 44 51 55 57 58 60 72 81 47 49 50 56 59 6...
result:
ok
Test #23:
score: 0
Accepted
time: 2ms
memory: 12488kb
input:
23 42 33333331332231231323231212313222133321121 31233133331232213332132321323133121233231 33133113212333331313311213313212332123311 33223113233332121231221232122122223232232 11213221333231211333312321211313313211123 31311121113113133311221123233131122213321 21213121311132111312333132122323322323131 ...
output:
1 3 7 11 21 50 63 71 75 97 268 290 295 303 309 338 365 371 382 388 423 465 479 486 492 498 639 670 673 680 683 703 709 716 732 794 800 867 890 893 897 901 2 5 9 18 47 58 68 81 92 262 280 285 299 315 330 335 341 360 377 419 457 461 470 474 503 626 632 659 665 677 686 698 722 728 791 797 804 814 863 8...
result:
ok
Test #24:
score: 0
Accepted
time: 0ms
memory: 12260kb
input:
111 78 23121233313321232121333332113113322223322232121133221311132322123321123111132 33112122333333132223313123123123312132212211231222133323123232232211113221332 31233211311332323113323122311233132332223123112321221131323122333123311323213 31233112331313231111332332332333111213233221231131313113321...
output:
1 6 12 14 16 18 166 178 194 219 226 236 251 257 262 704 735 751 770 1010 1027 1206 1240 1336 1360 1418 1435 1452 1467 1800 1815 1830 1934 2845 2939 2954 3004 3021 3389 3441 3491 3506 3581 3621 3640 3656 4391 4403 4413 4524 4545 4556 6901 6918 7054 7112 7130 7149 7182 7202 7242 7362 7372 7381 7452 74...
result:
ok
Test #25:
score: 0
Accepted
time: 19ms
memory: 15732kb
input:
239 432 1211133322222211233323123332311321322321231321333222133131213312213133113331121231223112212122131222231332223111113111321232212311121132133133231332232123332323333211131131331123332313333113211131311331213231321122333332311113112231312111223322232313213112211113231113121132331232211221332221...
output:
1 2 142 148 154 161 172 186 207 214 246 256 514 523 703 711 718 727 737 751 786 1077 1127 1143 1156 1384 1443 1470 1542 3258 3275 3295 3338 3361 3385 4379 4441 4465 4504 5997 6013 6032 6069 6084 6407 6501 6522 6565 7450 7497 7521 7662 7690 7712 7931 7974 8001 8078 8106 8300 8323 8366 8425 8445 8464 ...
result:
ok
Test #26:
score: 0
Accepted
time: 45ms
memory: 20656kb
input:
488 466 3323323332313211122332111313223213332133112332322232113231232223331223233233323111213132333321311321113231223223313233212133233332231113233332223231133112222133312112133212331311122321333332122122223323232311232222111212222233123112322332223312211233213321113111211321322112132112221333213231...
output:
1 3 25 37 45 59 63 69 84 372 611 692 700 718 729 739 751 764 988 999 1028 1047 1156 1185 1211 1224 4309 4332 4384 4412 4498 4551 4577 4605 4824 4866 4913 5369 5396 5446 5606 5633 5664 5695 5751 6004 6080 6477 6505 6594 6617 6662 6863 8485 8520 8681 8713 8787 8824 9284 9349 9380 9739 9776 10028 10099...
result:
ok
Test #27:
score: 0
Accepted
time: 34ms
memory: 21380kb
input:
498 499 3123233112131322112121113331221121123223333321122111132312112232113331311321123212131312221123211222312212131111133333313311331331312121322221111222213333333212221131113233122123232332211121111123133211113332221333213111211332322131223231321212131131322232311331113333311132122332232332132331...
output:
1 3 5 14 21 25 132 226 232 238 304 311 331 339 355 363 465 482 495 509 523 1192 1220 1233 1244 1276 1305 1900 1919 1937 2864 2912 2938 2963 2989 3013 3450 3499 3520 3584 4329 4420 4469 4528 4592 4613 4635 4658 6055 6086 6119 6150 6180 6209 8730 9056 9160 9191 9219 9246 9274 10903 10934 10996 11354 1...
result:
ok
Test #28:
score: 0
Accepted
time: 43ms
memory: 21556kb
input:
500 499 3123313312332121332313133312313232131113323131112123321322122331123121222123321222222122231223213121212232312213111113113121212313223131212212231112323111333311311223222223123113131323212233111312211222112233333113113113211232121321121131211231331331223112313333113323212112321223212323322332...
output:
1 3 5 111 120 136 142 185 206 216 225 404 419 565 575 584 592 672 734 782 931 943 992 1004 1034 1095 1232 1245 1255 1275 1287 2045 2112 2151 2171 2185 3859 3888 3918 3952 6364 6737 6884 7005 7039 7459 7517 7552 7591 7629 7666 7793 7863 7930 7963 7997 8100 9262 9299 9336 9877 9905 9971 10036 10072 10...
result:
ok
Test #29:
score: 0
Accepted
time: 53ms
memory: 21436kb
input:
499 500 2233333331322123232123323323133112221222132221213313122313133111112311222113131122122111112113313322212311133232332213322323321221112323232232112122111133213123312121321213132231331211131313133331331331312322312232232311333223213113313333111313121112313311213123131132221332231223323111332112...
output:
1 5 7 20 26 36 41 204 216 226 233 488 520 532 543 643 679 690 727 1084 1102 1120 1148 1171 1268 1301 1333 1351 3017 3037 3098 3141 3167 3192 3359 3376 3843 3867 3888 3943 3962 3981 4168 4580 4602 4717 4739 4761 4787 4864 5509 5542 5756 5776 5966 5991 6036 6058 6158 6183 10206 10313 10349 10382 10416...
result:
ok
Test #30:
score: 0
Accepted
time: 49ms
memory: 21472kb
input:
499 499 3331311322112121132231112131211232313223221112211231221332131112333233233123232331133312332213113312123123131221212321211132223131121332231133211332313321223323112323321133231311331111132232211322312112233333313111111222122233311121333223331323133311322131221123322312212221223231321131221222...
output:
1 3 7 10 12 80 84 90 327 385 392 401 409 583 592 602 614 626 1264 1353 1369 1402 1416 1432 1446 1535 1544 1735 1751 1763 1774 1789 1998 2720 2742 2783 2807 3166 3234 3249 3281 3332 3349 3365 3383 3402 4986 5002 5019 5042 5224 8245 8279 8313 8530 8567 8645 8727 8767 8807 10068 10115 10163 10210 10927...
result:
ok
Test #31:
score: 0
Accepted
time: 0ms
memory: 12708kb
input:
3 500 132123121213333113221113211321121223122233232311333232223212312313311233212212221223132231323212123121211213322123111313121132323221332222322312223211212322221211233331232121332112231332211132211312111221233131332112132232123332232311121133133232212321321233132131121321112222312313231311311211...
output:
1 2 7 13 15 17 19 21 28 30 31 32 36 39 42 45 47 49 55 59 60 61 63 65 74 79 82 84 87 88 89 91 103 105 106 109 113 115 116 120 122 124 126 131 134 136 140 141 143 147 150 154 159 162 163 167 168 171 178 179 180 183 184 191 195 197 200 204 207 209 211 215 217 223 224 225 233 235 236 239 240 241 249 251...
result:
ok
Test #32:
score: 0
Accepted
time: 3ms
memory: 13812kb
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:
1 2 14 3 7 11 4 5 9 6 12 17 8 15 49 10 18 47 13 41 44 16 35 38 19 20 33 21 26 30 22 24 28 23 31 43 25 40 46 27 32 37 29 34 72 36 39 67 42 45 64 48 61 68 50 57 59 51 55 71 52 54 66 53 56 63 58 60 73 62 69 75 65 77 85 70 74 83 76 81 86 78 79 95 80 92 98 82 90 96 84 87 89 88 91 94 93 97 121 99 101 118 ...
result:
ok
Test #33:
score: 0
Accepted
time: 2ms
memory: 12004kb
input:
5 500 323321131213321113313131221133323123222231222231233122121112131321232112111111311332123221111321311123122311131132122111211213333221111123111313311211132333212223232131332311332213213113313332133231122213211113313113133131113221121332122333321312122333211132322331223133133313123113322122311121...
output:
1 3 18 21 25 28 30 33 38 40 62 64 68 70 71 72 74 76 92 98 99 104 105 109 111 125 128 131 133 145 150 158 172 178 180 182 185 196 199 205 207 211 213 221 223 231 233 237 240 249 262 268 269 270 280 282 284 287 289 292 307 309 320 322 324 326 328 345 350 352 354 357 373 376 379 387 390 397 398 401 404...
result:
ok
Test #34:
score: 0
Accepted
time: 0ms
memory: 13572kb
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:
1 6 43 48 52 2 4 8 39 57 3 10 12 34 61 5 9 28 31 44 7 11 24 35 40 13 18 20 22 25 14 16 69 72 76 15 58 62 66 80 17 19 54 64 84 21 26 37 50 55 23 29 32 46 59 27 36 41 53 111 30 45 49 96 106 33 38 94 102 112 42 88 92 97 99 47 79 83 103 115 51 75 107 113 119 56 60 71 87 122 63 65 68 82 91 67 70 74 78 13...
result:
ok
Test #35:
score: 0
Accepted
time: 0ms
memory: 13156kb
input:
14 500 13222332332231221131213212121133132321123223111233223312222121211112111311313332333111112232111223211223222331113313212111313332331312333232311231322331221223232333233213231232132113332331132122132131221122131112212313113112131112332212311213131232231123113311123211131122222333112212333221322...
output:
1 2 6 16 19 46 54 91 95 153 163 177 180 200 204 212 215 219 223 238 241 290 294 300 303 307 372 376 379 383 387 426 449 453 464 482 499 504 509 512 575 579 582 598 612 666 670 674 678 691 697 717 721 738 748 753 801 805 835 838 841 863 867 871 873 876 879 883 930 936 1000 1003 1011 1039 1042 1052 10...
result:
ok
Test #36:
score: 0
Accepted
time: 2ms
memory: 13880kb
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:
1 3 11 14 38 42 53 61 66 222 332 347 494 518 2 5 9 30 35 45 49 57 211 324 339 456 481 508 4 7 22 24 27 52 75 204 302 316 348 444 469 495 6 16 18 20 31 60 70 196 212 295 310 358 432 482 8 10 13 37 56 65 187 223 284 303 366 375 408 421 12 17 34 41 51 71 180 197 231 275 325 386 398 433 15 19 26 29 44 4...
result:
ok
Test #37:
score: 0
Accepted
time: 3ms
memory: 13176kb
input:
42 500 22321333321323312111231223231112313233322223312223231123333132233232332323233311321322333221131311111221222233221112332333221132311321111331121321231112213133122221231322331112312323321311213113123312322113332213223321323133111122131231313122132211331123311223323311222311121123211213321321222...
output:
1 26 30 39 198 207 225 242 258 272 281 288 316 369 395 413 421 427 432 437 442 954 966 971 975 1010 1020 1026 1032 1036 1042 1049 1405 1426 1435 1449 1458 1497 1510 1521 1687 1692 1708 1714 1730 1767 1775 1804 1811 2109 2123 2133 2152 2162 2169 2483 2489 2498 2510 2585 2595 2611 2617 2650 2663 2680 ...
result:
ok
Test #38:
score: 0
Accepted
time: 3ms
memory: 14416kb
input:
500 42 11333233331131113122312231331211223323231 13131111223111221132213132223221213332121 33221122332122112222131322332122331123211 11122332312132232321211231131111113212133 12331222132321231332113212212322111211221 31231122131113133231312211232222122213112 21131211232311113331211211123113133233332...
output:
1 2 4 11 15 25 35 40 44 129 568 580 590 629 752 763 771 806 818 828 957 992 1006 1018 1055 1670 1686 1723 2249 2266 2284 2303 2324 2552 2577 2629 2721 2808 3139 3156 3191 3210 3 5 9 13 22 28 32 37 42 126 133 558 569 602 615 741 753 782 794 855 947 968 980 1038 1047 1079 1656 1703 2185 2229 2323 2481...
result:
ok
Test #39:
score: 0
Accepted
time: 11ms
memory: 14628kb
input:
132 500 1132323323231313311333232113321322332132222131331322222313323213212211313222311121333132112222311221331231221111333131232232232231112312212233132321233312211331321323322321111123213131232111121322332223332231212131312112112123121222231122231313132223213132113311121121333133121312313333323211...
output:
1 2 4 122 146 159 165 178 229 252 265 270 284 290 1007 1024 1230 1253 1266 1279 1317 1382 1482 1534 1564 1580 1595 1610 1650 2084 2205 2225 2259 2276 2503 2567 2599 2617 2633 2700 3353 3371 3420 3434 3449 5255 5275 5426 5468 5487 5727 5919 5940 6001 6020 6408 6475 6493 6568 6606 6624 6665 7808 7828 ...
result:
ok
Test #40:
score: 0
Accepted
time: 16ms
memory: 15824kb
input:
500 132 12232111232311313223132222113231223331332112121131122121311322322212111231331212321312113131332231123333233333311122213231131132313 13321311123332321112233322221332113221213112112121332311223223213123113122123213221231321223312312132322311223121132231233333113213 1331323322332322111231123132...
output:
1 2 10 13 18 57 71 76 81 85 91 345 418 500 512 545 554 573 580 602 744 755 780 793 1841 1865 2101 2121 2142 2188 2211 3007 3028 3242 3265 3313 3368 3419 3446 4175 4225 4372 4394 4416 4436 4456 5950 5981 6016 6545 6623 6657 6693 7354 7393 7430 7465 7576 7610 7646 7826 9023 9064 9459 9987 10021 10164 ...
result:
ok
Test #41:
score: 0
Accepted
time: 22ms
memory: 16592kb
input:
250 500 3331231211133131113221212112311331322312131211323111323211121112121223221123132121333221132312321213212212123331333221322212112231231312132213223323133233133122233232131131133123323131132133222331313131222221112232212311113131121333323213111122211222222233311212233311133322211231222333222131...
output:
1 3 6 11 14 308 336 347 355 364 371 377 644 669 682 952 965 977 987 1078 1481 1494 1508 1668 1681 1696 1711 1729 1988 4136 4165 4194 4253 4437 4462 4670 4692 5237 5397 5428 5459 5488 5567 5593 5983 6045 6072 6636 6651 6688 6709 6732 6752 6930 7020 7066 7088 7109 7131 7152 8557 8890 8954 8987 9019 90...
result:
ok
Test #42:
score: 0
Accepted
time: 25ms
memory: 17544kb
input:
500 250 133113133113113111233121332223232121322213133333212131312233133331111223123323132233233123313221332321122231231321323223233223131221221232123123322213133123132112322323233232332321123311233233333112223223111211122213211132312132311221232323133231211 323132231131131123231323113123213333211213...
output:
1 2 6 16 18 21 86 91 118 143 148 153 181 187 193 634 643 653 661 883 2504 2633 2654 2677 2698 2782 2824 3143 3166 3325 3370 3391 3435 4223 4249 4275 4295 4640 4773 4799 4900 4930 5529 5552 5598 5645 5688 6414 6467 6494 6518 6695 6725 7041 7075 7380 7418 7451 7655 7712 10801 10846 10937 11032 11210 1...
result:
ok
Test #43:
score: 0
Accepted
time: 39ms
memory: 19756kb
input:
400 500 3311311321233123231112321333233131232212212332122331132111122231332132313232123123122121312211221333112232121121222231333113232132123311333123321233121311122323111221113222332133312332312232311332321123321232321212112321313313131212131311231121233113213112211121122121212333322111223213222312...
output:
1 3 6 8 11 148 155 161 182 468 478 484 498 569 581 709 732 743 763 775 788 802 1151 1219 1237 1254 1323 1350 2716 2808 2850 3072 3097 3195 3216 3236 3277 3337 3361 3380 6137 6168 6195 6302 7549 7615 7649 7683 7854 7890 7957 8230 8265 8304 9385 9757 9791 10250 10282 10314 10346 10448 10485 10558 1059...
result:
ok
Test #44:
score: 0
Accepted
time: 39ms
memory: 19936kb
input:
500 400 1333112223111311312321322331211131212113113331221131323233223113223221322233133231223211313122313232111213132313212333212332111131112313233322233231331122333332231232112332333332231121122332323211221211231211222222212131113322122231323233111311333111223322222213213112132232211122213322111211...
output:
1 2 6 26 32 35 38 129 139 167 212 258 264 269 286 294 302 614 620 626 642 1028 1043 1062 1071 1106 1173 2057 2079 2098 2117 2136 2154 2239 2254 3111 3130 3149 3165 3184 3592 3611 3632 4166 4241 4285 4308 4400 4421 4444 4468 5044 5067 6556 6684 6935 6970 7035 7170 7271 7309 7379 7415 7449 10368 10634...
result:
ok
Test #45:
score: 0
Accepted
time: 37ms
memory: 21504kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 182 196 210 225 240 256 272 289 306 324 342 361 380 400 420 441 462 484 506 529 552 576 600 625 650 676 702 729 756 784 812 841 870 900 930 961 992 1024 1056 1089 1122 1156 1190 1225 1260 1296 1332 1369 1406 1444 1482 1521 ...
result:
ok
Test #46:
score: 0
Accepted
time: 45ms
memory: 21516kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 1000 1001 2000 2001 3000 3001 4000 4001 5000 5001 6000 6001 7029 7031 8313 8314 9313 9314 10313 10314 11313 11314 12313 12314 13313 13314 14313 14314 15313 15314 16313 16314 17313 17314 18313 18314 19313 19314 20313 20314 21313 21314 22313 22314 23313 23314 24313 24314 25313 25314 26313 26314 2731...
result:
ok
Test #47:
score: 0
Accepted
time: 36ms
memory: 21524kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
1 3 7 13 21 31 43 57 73 91 111 133 157 183 211 241 273 307 343 381 421 463 507 553 601 651 703 757 813 871 931 993 1057 1123 1191 1261 1333 1407 1483 1561 1641 1723 1807 1893 1981 2071 2163 2257 2353 2451 2551 2653 2757 2863 2971 3081 3193 3307 3423 3541 3661 3783 3907 4033 4161 4291 4423 4557 4693 ...
result:
ok
Test #48:
score: 0
Accepted
time: 36ms
memory: 21500kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 182 196 210 225 240 256 272 289 306 324 342 361 380 400 420 441 462 484 506 529 552 576 600 625 650 676 702 729 756 784 812 841 870 900 930 961 992 1024 1056 1089 1122 1156 1190 1225 1260 1296 1332 1369 1406 1444 1482 1521 ...
result:
ok
Test #49:
score: 0
Accepted
time: 46ms
memory: 21508kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 1000 1001 2000 2001 3000 3001 4000 4001 4642 4644 5643 5645 6968 6972 7193 7196 8009 8012 8955 8958 9876 9880 10768 10772 11660 11664 12951 12956 14206 14210 15575 15579 17073 17077 18644 18648 19759 19763 20441 20445 21315 21322 22418 22426 23530 23537 24644 24650 25804 25811 26875 26880 27943 27...
result:
ok
Test #50:
score: 0
Accepted
time: 45ms
memory: 21460kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
1 3 7 13 21 31 43 57 73 91 111 133 157 183 211 241 273 307 343 381 421 463 507 551 596 642 690 740 792 846 902 960 1020 1082 1146 1212 1306 1423 1499 1577 1657 1739 1823 1909 1997 2087 2179 2273 2369 2467 2567 2669 2773 2879 2987 3097 3209 3323 3439 3557 3677 3799 3923 4048 4174 4300 4428 4558 4690 ...
result:
ok
Test #51:
score: 0
Accepted
time: 42ms
memory: 21576kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 182 196 210 225 240 255 270 286 301 317 333 350 367 385 403 422 441 461 482 504 525 547 569 592 615 639 662 686 709 732 755 778 802 828 854 881 908 936 965 995 1025 1056 1087 1119 1151 1183 1215 1248 1282 1316 1351 1386 142...
result:
ok
Test #52:
score: 0
Accepted
time: 53ms
memory: 21456kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 397 399 601 604 1029 1034 1252 1256 1404 1409 1559 1564 1703 1707 1787 1790 1816 1818 3675 3683 3832 3841 4058 4071 4515 4527 4614 4625 4693 4702 4771 4781 5363 5374 5751 5766 6141 6151 6872 6886 7897 7914 8887 8905 10088 10110 10377 10393 13027 13057 13859 13889 15255 15287 15839 15866 15953 1598...
result:
ok
Test #53:
score: 0
Accepted
time: 46ms
memory: 21452kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 182 196 210 225 240 256 272 289 306 324 342 361 380 400 420 441 462 484 506 529 552 576 600 625 650 676 702 729 756 784 812 841 870 900 930 961 992 1024 1056 1089 1122 1156 1190 1225 1260 1296 1332 1369 1406 1444 1482 1521 ...
result:
ok
Test #54:
score: 0
Accepted
time: 41ms
memory: 21416kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 10 14 31 37 62 70 103 113 154 166 215 229 286 302 367 385 458 478 559 581 670 694 791 817 922 950 1063 1093 1214 1246 1375 1409 1546 1582 1727 1765 1918 1958 2119 2161 2330 2374 2551 2597 2782 2830 3023 3073 3274 3326 3535 3589 3806 3862 4087 4145 4378 4438 4679 4741 4990 5054 5311 5377 5642 5710 ...
result:
ok
Test #55:
score: 0
Accepted
time: 44ms
memory: 21464kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 182 196 210 225 240 256 272 289 306 324 342 361 380 400 420 441 462 484 506 529 552 576 600 625 650 676 702 729 756 784 812 841 870 900 930 961 992 1024 1056 1089 1122 1156 1190 1225 1260 1296 1332 1369 1406 1444 1482 1521 ...
result:
ok
Test #56:
score: 0
Accepted
time: 38ms
memory: 21488kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 12 16 20 25 30 36 42 49 56 64 72 81 90 100 110 121 132 144 156 169 182 196 210 225 240 256 272 289 306 324 342 361 380 400 420 441 462 484 506 529 552 576 600 625 650 676 702 729 756 784 812 841 870 900 930 961 992 1024 1056 1089 1122 1156 1190 1225 1260 1296 1332 1369 1406 1444 1482 1521 ...
result:
ok
Test #57:
score: 0
Accepted
time: 43ms
memory: 21532kb
input:
500 500 3133333333331313333313313331131333311113131133333131131113333111133311111313131133331331111131333331133113313131333331313311313313133311113113333331331133313313113133133311131331133113333333331333311333131133131333133333333311133111333333111313333333333333133133333131333133113311333113333113...
output:
1 3 5 12 19 26 33 46 53 72 88 101 115 120 141 144 159 170 190 233 250 260 339 355 363 409 424 504 514 525 573 580 681 704 726 750 763 778 790 803 933 946 1048 1062 1078 1144 1171 1295 1316 1356 1366 1473 1490 1506 1661 1679 1694 1710 2027 2061 2115 2147 2163 2179 2194 2209 2464 2594 2637 2658 2681 2...
result:
ok
Test #58:
score: 0
Accepted
time: 52ms
memory: 21456kb
input:
500 500 3331113313111333311331333331133131331333311131311311133333113331133331131131131331131133333133313311131311313333331313113133311313111131333331113111311311111311113331113111113331113113131331313131311331113333133131333111313111133111111313131311131111111113113333133333131133331131333333131111...
output:
1 3 6 9 11 14 18 45 50 54 71 74 78 82 135 145 178 188 195 203 242 251 258 295 309 325 354 374 383 394 483 498 509 542 553 617 665 673 700 716 736 760 771 783 793 1026 1042 1266 1283 1296 1334 1349 1362 1377 1442 1537 1557 1587 1720 1736 1754 1810 1844 2025 2042 2061 2204 2240 2405 2443 2464 2481 257...
result:
ok
Test #59:
score: 0
Accepted
time: 47ms
memory: 21512kb
input:
500 500 3333323333333333333233333233332333323333333333233333333333323233333333333333333333333333333333233332333333333333333223322233333233333333322333333333333333333323333233333323332323333333223333233333333333333333323233233323233332333333333333333233333333332333233333233333333333333232333333333323...
output:
1 3 7 13 28 37 95 111 238 267 284 302 379 405 456 482 726 765 838 883 908 1051 1096 1148 1220 1474 1731 1857 1915 2120 2292 2322 2381 2443 2544 2613 2799 4514 4618 5145 5241 5333 5431 5531 5627 5833 5934 5982 6081 6277 6365 6544 6639 6923 7137 7248 7352 7723 7827 7929 8137 8474 8530 8642 8748 8854 9...
result:
ok
Test #60:
score: 0
Accepted
time: 53ms
memory: 21460kb
input:
500 500 2221112221121221111121112111121111111111222122112211111111122212121111222122121121111111121111211122111112111122111111211221122212112211221121122112222111222112111111111111211121211121221111211121111122211121211121111211112112121222221111111122121122112211111111111222112112122111111121111121...
output:
1 5 7 15 19 23 26 29 151 154 158 165 226 235 244 272 277 282 286 308 314 319 323 329 336 1717 1733 1749 1766 1784 1803 1821 1842 1863 1885 1910 1933 1954 1978 2000 2025 2106 2127 2209 2229 2247 2327 2349 2369 2390 3425 3447 3472 3496 3599 3621 3644 7090 8233 8281 8326 8447 8485 8522 8977 9022 9060 9...
result:
ok
Test #61:
score: 0
Accepted
time: 45ms
memory: 21456kb
input:
500 500 3331111331111113131111131113213111131313113111313111133311111113111131111111333331331131131311331131133111131333111311111111131111111113113313311113111111111131111311111113111111313111113111111311111313313131113113113111113313113131311311111131133331331311333113131331331111111313111311311333...
output:
1 3 6 10 11 13 15 18 45 53 57 62 67 71 76 81 106 112 128 131 137 142 147 152 181 189 195 202 326 354 361 399 406 434 449 455 682 694 729 741 812 828 841 905 919 933 946 985 997 1036 1146 1159 1176 1189 1241 1269 1312 1359 1388 1418 1431 1473 1488 1507 1555 1571 1894 1910 1928 2033 2079 2124 2144 224...
result:
ok
Test #62:
score: 0
Accepted
time: 44ms
memory: 21536kb
input:
500 500 2222222222222222222222222232232222222222222222222222222222222222222322222222222222222222222222222223222222222222222222222222222222222222222222223222223222322222222222222222222232222222222222222222222222222222222232222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 106 108 254 259 541 550 686 697 846 854 1017 1028 1082 1095 1387 1400 1589 1601 1926 1940 2274 2288 2736 2761 3292 3318 3369 3885 3913 4343 4831 4858 5385 5413 5895 5928 6422 6459 7031 7073 7405 7446 7815 7865 8206 8258 8670 8718 9090 9141 9497 9551 9909 9955 10160 10210 10834 10881 11357 11404 11...
result:
ok
Test #63:
score: 0
Accepted
time: 41ms
memory: 21568kb
input:
500 500 1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231...
output:
1 2 1997 2499 2500 2501 2503 2505 4997 5499 5500 5501 5503 5505 7997 8499 8500 8501 8503 8505 10997 11499 11500 11501 11503 11505 13997 14499 14500 14501 14503 14505 16997 17499 17500 17501 17503 17505 19997 20499 20500 20501 20503 20505 22997 23499 23500 23501 23503 23505 25997 26499 26500 26501 26...
result:
ok
Test #64:
score: 0
Accepted
time: 40ms
memory: 21512kb
input:
500 500 1321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321...
output:
1 2 6 2996 2998 3000 3001 3002 3006 5996 5998 6000 6001 6002 6006 8996 8998 9000 9001 9002 9006 11996 11998 12000 12001 12002 12006 14996 14998 15000 15001 15002 15006 17996 17998 18000 18001 18002 18006 20996 20998 21000 21001 21002 21006 23996 23998 24000 24001 24002 24006 26996 26998 27000 27001 ...
result:
ok
Test #65:
score: 0
Accepted
time: 48ms
memory: 21504kb
input:
500 500 1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231...
output:
1 2 2825 2830 2832 2833 2835 2836 5825 5830 5832 5833 5835 5836 8825 8830 8832 8833 8835 8836 11825 11830 11832 11833 11835 11836 14825 14830 14832 14833 14835 14836 17825 17830 17832 17833 17835 17836 20825 20830 20832 20833 20835 20836 23825 23830 23832 23833 23835 23836 26825 26830 26832 26833 26...
result:
ok
Test #66:
score: 0
Accepted
time: 44ms
memory: 21556kb
input:
500 500 1321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321...
output:
1 2 2820 2827 2829 2833 2835 2836 5820 5827 5829 5833 5835 5836 8820 8827 8829 8833 8835 8836 11820 11827 11829 11833 11835 11836 14820 14827 14829 14833 14835 14836 17820 17827 17829 17833 17835 17836 20820 20827 20829 20833 20835 20836 23820 23827 23829 23833 23835 23836 26820 26827 26829 26833 26...
result:
ok
Test #67:
score: 0
Accepted
time: 39ms
memory: 21444kb
input:
500 500 1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231...
output:
1 2 9 2665 2666 2667 2669 2670 2678 5665 5666 5667 5669 5670 5678 8665 8666 8667 8669 8670 8678 11665 11666 11667 11669 11670 11678 14665 14666 14667 14669 14670 14678 17665 17666 17667 17669 17670 17678 20665 20666 20667 20669 20670 20678 23665 23666 23667 23669 23670 23678 26665 26666 26667 26669 ...
result:
ok
Test #68:
score: 0
Accepted
time: 45ms
memory: 21568kb
input:
500 500 1321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321321...
output:
1 2 7 2333 2334 2336 2337 2338 2347 5333 5334 5336 5337 5338 5347 8333 8334 8336 8337 8338 8347 11333 11334 11336 11337 11338 11347 14333 14334 14336 14337 14338 14347 17333 17334 17336 17337 17338 17347 20333 20334 20336 20337 20338 20347 23333 23334 23336 23337 23338 23347 26333 26334 26336 26337 ...
result:
ok
Test #69:
score: 0
Accepted
time: 35ms
memory: 21440kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 8 10 13 16 19 22 25 30 34 38 42 46 53 58 63 68 73 82 88 94 100 106 117 124 131 138 145 158 166 174 182 190 205 214 223 232 241 258 268 278 288 298 317 328 339 350 361 382 394 406 418 430 453 466 479 492 505 530 544 558 572 586 613 628 643 658 673 702 718 734 750 766 797 814 831 848 865 898 9...
result:
ok
Test #70:
score: 0
Accepted
time: 38ms
memory: 21576kb
input:
500 500 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
1 2 4 6 9 11 14 17 20 24 28 32 36 40 45 51 56 61 66 72 80 86 92 98 105 115 122 129 136 144 156 164 172 180 189 203 212 221 230 240 256 266 276 286 297 315 326 337 348 360 380 392 404 416 429 451 464 477 490 504 528 542 556 570 585 611 626 641 656 672 700 716 732 748 765 795 812 829 846 864 896 914 9...
result:
ok
Test #71:
score: 0
Accepted
time: 43ms
memory: 21472kb
input:
500 500 2312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312...
output:
1 1497 1999 2000 2001 2003 2005 4497 4999 5000 5001 5003 5005 7497 7999 8000 8001 8003 8005 10497 10999 11000 11001 11003 11005 13497 13999 14000 14001 14003 14005 16497 16999 17000 17001 17003 17005 19497 19999 20000 20001 20003 20005 22497 22999 23000 23001 23003 23005 25497 25999 26000 26001 2600...
result:
ok
Test #72:
score: 0
Accepted
time: 46ms
memory: 21476kb
input:
500 500 2132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132...
output:
1 1996 1998 2000 2001 2002 2006 4996 4998 5000 5001 5002 5006 7996 7998 8000 8001 8002 8006 10996 10998 11000 11001 11002 11006 13996 13998 14000 14001 14002 14006 16996 16998 17000 17001 17002 17006 19996 19998 20000 20001 20002 20006 22996 22998 23000 23001 23002 23006 25996 25998 26000 26001 2600...
result:
ok
Test #73:
score: 0
Accepted
time: 42ms
memory: 21444kb
input:
500 500 2312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312...
output:
1 5 2826 2828 2830 2833 2834 2839 5826 5828 5830 5833 5834 5839 8826 8828 8830 8833 8834 8839 11826 11828 11830 11833 11834 11839 14826 14828 14830 14833 14834 14839 17826 17828 17830 17833 17834 17839 20826 20828 20830 20833 20834 20839 23826 23828 23830 23833 23834 23839 26826 26828 26830 26833 26...
result:
ok
Test #74:
score: 0
Accepted
time: 47ms
memory: 21464kb
input:
500 500 2132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132...
output:
1 2823 2824 2826 2828 2830 2835 5823 5824 5826 5828 5830 5835 8823 8824 8826 8828 8830 8835 11823 11824 11826 11828 11830 11835 14823 14824 14826 14828 14830 14835 17823 17824 17826 17828 17830 17835 20823 20824 20826 20828 20830 20835 23823 23824 23826 23828 23830 23835 26823 26824 26826 26828 2683...
result:
ok
Test #75:
score: 0
Accepted
time: 36ms
memory: 21460kb
input:
500 500 2312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312...
output:
1 5 2663 2664 2665 2667 2668 2674 5663 5664 5665 5667 5668 5674 8663 8664 8665 8667 8668 8674 11663 11664 11665 11667 11668 11674 14663 14664 14665 14667 14668 14674 17663 17664 17665 17667 17668 17674 20663 20664 20665 20667 20668 20674 23663 23664 23665 23667 23668 23674 26663 26664 26665 26667 26...
result:
ok
Test #76:
score: 0
Accepted
time: 38ms
memory: 21436kb
input:
500 500 2132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132132...
output:
1 10 12 2332 2333 2334 2338 2351 2353 5332 5333 5334 5338 5351 5353 8332 8333 8334 8338 8351 8353 11332 11333 11334 11338 11351 11353 14332 14333 14334 14338 14351 14353 17332 17333 17334 17338 17351 17353 20332 20333 20334 20338 20351 20353 23332 23333 23334 23338 23351 23353 26332 26333 26334 2633...
result:
ok
Test #77:
score: 0
Accepted
time: 37ms
memory: 21468kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 5 7 15 19 31 37 53 61 81 91 115 127 155 169 201 217 253 271 311 331 375 397 445 469 521 547 603 631 691 721 785 817 885 919 991 1027 1103 1141 1221 1261 1345 1387 1475 1519 1611 1657 1753 1801 1901 1951 2055 2107 2215 2269 2381 2437 2553 2611 2731 2791 2915 2977 3105 3169 3301 3367 3503 3571 3711 ...
result:
ok
Test #78:
score: 0
Accepted
time: 36ms
memory: 21456kb
input:
500 500 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222...
output:
1 5 7 15 18 29 33 46 52 67 73 93 99 123 130 157 165 190 204 231 241 277 287 327 338 381 393 430 452 491 505 557 571 627 642 701 717 766 796 847 865 933 951 1023 1042 1117 1137 1198 1236 1299 1321 1405 1427 1515 1538 1629 1653 1726 1772 1847 1873 1973 1999 2103 2130 2237 2265 2350 2404 2491 2521 2637...
result:
ok
Test #79:
score: 0
Accepted
time: 48ms
memory: 21512kb
input:
500 500 3123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123...
output:
1 3 5 2497 2999 3000 3001 3003 3005 5497 5999 6000 6001 6003 6005 8497 8999 9000 9001 9003 9005 11497 11999 12000 12001 12003 12005 14497 14999 15000 15001 15003 15005 17497 17999 18000 18001 18003 18005 20497 20999 21000 21001 21003 21005 23497 23999 24000 24001 24003 24005 26497 26999 27000 27001 ...
result:
ok
Test #80:
score: 0
Accepted
time: 49ms
memory: 21516kb
input:
500 500 3213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213...
output:
1 3 2496 2498 2500 2501 2502 2506 5496 5498 5500 5501 5502 5506 8496 8498 8500 8501 8502 8506 11496 11498 11500 11501 11502 11506 14496 14498 14500 14501 14502 14506 17496 17498 17500 17501 17502 17506 20496 20498 20500 20501 20502 20506 23496 23498 23500 23501 23502 23506 26496 26498 26500 26501 26...
result:
ok
Test #81:
score: 0
Accepted
time: 43ms
memory: 21512kb
input:
500 500 3123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123...
output:
1 3 4 2829 2832 2834 2835 2837 2838 5829 5832 5834 5835 5837 5838 8829 8832 8834 8835 8837 8838 11829 11832 11834 11835 11837 11838 14829 14832 14834 14835 14837 14838 17829 17832 17834 17835 17837 17838 20829 20832 20834 20835 20837 20838 23829 23832 23834 23835 23837 23838 26829 26832 26834 26835 ...
result:
ok
Test #82:
score: 0
Accepted
time: 40ms
memory: 21408kb
input:
500 500 3213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213...
output:
1 3 2825 2827 2829 2831 2833 2837 5825 5827 5829 5831 5833 5837 8825 8827 8829 8831 8833 8837 11825 11827 11829 11831 11833 11837 14825 14827 14829 14831 14833 14837 17825 17827 17829 17831 17833 17837 20825 20827 20829 20831 20833 20837 23825 23827 23829 23831 23833 23837 26825 26827 26829 26831 26...
result:
ok
Test #83:
score: 0
Accepted
time: 44ms
memory: 21516kb
input:
500 500 3123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123...
output:
1 3 5 2663 2667 2668 2669 2672 2674 5663 5667 5668 5669 5672 5674 8663 8667 8668 8669 8672 8674 11663 11667 11668 11669 11672 11674 14663 14667 14668 14669 14672 14674 17663 17667 17668 17669 17672 17674 20663 20667 20668 20669 20672 20674 23663 23667 23668 23669 23672 23674 26663 26667 26668 26669 ...
result:
ok
Test #84:
score: 0
Accepted
time: 39ms
memory: 21452kb
input:
500 500 3213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213213...
output:
1 3 2331 2332 2334 2335 2336 2342 5331 5332 5334 5335 5336 5342 8331 8332 8334 8335 8336 8342 11331 11332 11334 11335 11336 11342 14331 14332 14334 14335 14336 14342 17331 17332 17334 17335 17336 17342 20331 20332 20334 20335 20336 20342 23331 23332 23334 23335 23336 23342 26331 26332 26334 26335 26...
result:
ok
Test #85:
score: 0
Accepted
time: 43ms
memory: 21500kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
1 3 6 10 15 21 27 36 44 55 65 75 90 102 119 133 147 168 184 207 225 243 270 290 319 341 363 396 420 455 481 507 546 574 615 645 675 720 752 799 833 867 918 954 1007 1045 1083 1140 1180 1239 1281 1323 1386 1430 1495 1541 1587 1656 1704 1775 1825 1875 1950 2002 2079 2133 2187 2268 2324 2407 2465 2523 ...
result:
ok
Test #86:
score: 0
Accepted
time: 46ms
memory: 21460kb
input:
500 500 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333...
output:
1 3 9 13 23 29 43 51 69 79 101 113 139 153 183 199 233 251 289 309 351 373 419 443 493 519 573 601 659 689 751 783 849 883 953 989 1063 1101 1179 1219 1301 1343 1429 1473 1563 1609 1703 1751 1849 1899 2001 2053 2159 2213 2323 2379 2493 2551 2669 2729 2851 2913 3039 3103 3233 3299 3433 3501 3639 3709...
result:
ok
Extra Test:
score: 0
Extra Test Passed