QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#253674#7791. 通道建设 Passage Constructionhos_lyric#17 18ms5812kbC++142.5kb2023-11-17 11:25:102024-07-04 02:25:58

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 02:25:58]
  • 评测
  • 测评结果:17
  • 用时:18ms
  • 内存:5812kb
  • [2023-11-17 11:25:10]
  • 提交

answer

#include "passageconstruction.h"

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")


mt19937_64 rng(58);

int N;
vector<vector<int>> graph;
vector<pair<int, int>> ans;

int dfs(int u) {
  int ret = -1;
  for (const int v : graph[u]) {
    const int res = dfs(v);
    if (~res) {
      if (~ret) {
        ans.emplace_back(ret, res);
        ret = -1;
      } else {
        ret = res;
      }
    }
  }
  if (~ret) {
    ans.emplace_back(ret, u);
    return -1;
  } else {
    return u;
  }
}

vector<pair<int, int>> ConstructPassages(int N_, const vector<pair<int, int>> &E) {
  N = N_;
  const int rt = 1 + rng() % (2 * N);
  vector<vector<int>> uss(2 * N);
  for (int u = 1; u <= 2 * N; ++u) {
    uss[GetDistance(rt, u)].push_back(u);
  }
  for (int d = 0; d < 2 * N; ++d) {
    shuffle(uss[d].begin(), uss[d].end(), rng);
  }
// cerr<<"uss = "<<uss<<endl;
  graph.assign(2 * N + 1, {});
  for (int d = 0; d < 2 * N - 1; ++d) if (uss[d + 1].size()) {
    const int len = uss[d].size();
    assert(len);
    for (const int v : uss[d + 1]) {
      for (int j = 0; j < len; ++j) {
        const int u = uss[d][j];
        if (j == len - 1 || QueryLCA({rt}, {u, v}, u)[0]) {
// cerr<<"ae "<<u<<" "<<v<<endl;
          graph[u].push_back(v);
          break;
        }
      }
    }
  }
  dfs(rt);
  return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 0ms
memory: 4128kb

input:

1
1872884041
100 100 10000 10000
1
2294931821 2294931820

output:

Succeeded
0 2 0 0
2 1

result:

ok Accepted with 0+2 operations,sum of size(s)=0+0

Test #2:

score: 3
Accepted
time: 1ms
memory: 3932kb

input:

1
1977600624
100 100 10000 10000
5
621522394 621522399
2231003352 2231003338
464307841 464307837
1851407771 1851407768
2780336863 2780336849
314073909 314073902
1173467454 1173467430
4215033871 4215033843
2620057116 2620057098

output:

Succeeded
14 10 14 28
2 6
7 8
4 3
9 5
10 1

result:

ok Accepted with 14+10 operations,sum of size(s)=14+28

Test #3:

score: 3
Accepted
time: 1ms
memory: 3964kb

input:

1
1314992723
100 100 10000 10000
2
1174248192 1174248188
4206147071 4206147069
2894997654 2894997645

output:

Succeeded
0 4 0 0
4 2
3 1

result:

ok Accepted with 0+4 operations,sum of size(s)=0+0

Test #4:

score: 3
Accepted
time: 1ms
memory: 3960kb

input:

1
1466488642
100 100 10000 10000
3
1959342134 1959342129
3976386946 3976386946
1293201451 1293201449
4016912388 4016912383
46728190 46728181

output:

Succeeded
0 6 0 0
4 1
5 6
2 3

result:

ok Accepted with 0+6 operations,sum of size(s)=0+0

Test #5:

score: 3
Accepted
time: 1ms
memory: 3848kb

input:

1
1733551538
100 100 10000 10000
4
4255320958 4255320951
1233889267 1233889267
2022156010 2022156014
1746602236 1746602223
1796304111 1796304099
154520793 154520786
799267407 799267389

output:

Succeeded
3 8 3 6
7 3
5 2
8 4
6 1

result:

ok Accepted with 3+8 operations,sum of size(s)=3+6

Test #6:

score: 3
Accepted
time: 1ms
memory: 3948kb

input:

1
1103590331
100 100 10000 10000
4
3735090189 3735090176
179620503 179620501
1550955883 1550955882
3533004575 3533004552
2159969243 2159969227
2549716219 2549716202
1755562372 1755562356

output:

Succeeded
3 8 3 6
6 5
7 8
2 4
3 1

result:

ok Accepted with 3+8 operations,sum of size(s)=3+6

Test #7:

score: 3
Accepted
time: 1ms
memory: 3840kb

input:

1
1007922703
100 100 10000 10000
5
3347355425 3347355424
924935451 924935434
3554593528 3554593525
2830078883 2830078872
3185621515 3185621508
32902500 32902483
1057526055 1057526035
3737430162 3737430144
106424402 106424399

output:

Succeeded
5 10 5 10
8 5
9 6
3 4
7 10
2 1

result:

ok Accepted with 5+10 operations,sum of size(s)=5+10

Test #8:

score: 3
Accepted
time: 1ms
memory: 3956kb

input:

1
1401446296
100 100 10000 10000
5
4125806477 4125806476
1224445301 1224445291
1474144594 1474144597
2898586557 2898586536
879608888 879608877
3110900945 3110900930
2490037068 2490037051
422424582 422424570
1017432306 1017432295

output:

Succeeded
12 10 12 24
6 2
7 10
9 5
8 3
4 1

result:

ok Accepted with 12+10 operations,sum of size(s)=12+24

Test #9:

score: 3
Accepted
time: 1ms
memory: 3960kb

input:

1
1756894897
100 100 10000 10000
5
2081532117 2081532115
4275738287 4275738273
632146529 632146534
2424607270 2424607263
2157363450 2157363443
2463928559 2463928550
3381117807 3381117785
4186361975 4186361960
3382018566 3382018532

output:

Succeeded
7 10 7 14
7 9
8 5
10 6
3 2
4 1

result:

ok Accepted with 7+10 operations,sum of size(s)=7+14

Test #10:

score: 3
Accepted
time: 1ms
memory: 3968kb

input:

1
1465320926
100 100 10000 10000
5
2695813796 2695813789
3049323317 3049323309
231883125 231883119
3073242409 3073242392
1388430756 1388430755
183732731 183732729
1423324287 1423324267
3470698806 3470698795
354321542 354321525

output:

Succeeded
7 10 7 14
6 2
9 3
7 10
8 4
5 1

result:

ok Accepted with 7+10 operations,sum of size(s)=7+14

Subtask #2:

score: 6
Accepted

Test #11:

score: 6
Accepted
time: 1ms
memory: 3888kb

input:

2
755640766
20000 10000 200000 200000
100
4287951944 4287951892
218593589 218593610
2907028702 2907028595
100123056 100122959
3149201405 3149201229
3454414687 3454414608
1901257489 1901257490
1532337798 1532337686
836222214 836222227
187381584 187381446
1847826999 1847827071
2868544732 2868544653
41...

output:

Succeeded
2444 200 2444 4888
125 123
3 103
141 117
187 191
155 178
126 200
157 147
146 162
102 139
120 171
128 177
153 112
104 168
152 136
108 188
190 140
185 160
159 186
172 143
118 199
130 110
25 189
181 115
62 131
93 90
54 37
134 85
124 150
44 114
194 5
98 182
50 49
180 91
99 56
15 42
78 164
195 ...

result:

ok Accepted with 2444+200 operations,sum of size(s)=2444+4888

Test #12:

score: 6
Accepted
time: 1ms
memory: 4000kb

input:

2
587237803
20000 10000 200000 200000
98
217447661 217447616
2463641363 2463641406
3373538248 3373538212
3950835015 3950834997
2221322822 2221322872
146298284 146298141
531452967 531453049
3941453926 3941454046
3084946195 3084946149
1270490559 1270490368
1019372524 1019372347
2754251578 2754251434
5...

output:

Succeeded
3210 196 3210 6420
112 108
44 64
26 194
163 147
29 117
116 31
80 32
90 192
171 4
13 136
82 122
113 91
72 130
96 101
148 49
159 65
120 151
12 1
92 144
42 179
14 61
191 78
128 55
28 150
17 33
99 5
141 39
23 36
63 68
60 25
156 193
107 184
124 178
162 143
166 153
139 160
119 175
167 173
123 94...

result:

ok Accepted with 3210+196 operations,sum of size(s)=3210+6420

Test #13:

score: 6
Accepted
time: 0ms
memory: 4240kb

input:

2
184226984
20000 10000 200000 200000
99
547000384 547000355
872110096 872110116
1289538184 1289538247
3616724666 3616724569
636341527 636341600
2563522202 2563522274
2177548205 2177548137
3089489449 3089489506
3156380759 3156380856
944465184 944465231
823584265 823584499
333051247 333051023
1754238...

output:

Succeeded
2333 198 2333 4666
186 9
1 192
84 188
2 187
15 66
68 82
63 41
5 38
60 50
14 20
34 72
11 88
93 86
24 151
29 23
154 78
175 79
28 134
122 119
143 156
133 139
3 157
39 53
127 97
115 22
181 182
64 85
90 62
130 76
58 83
165 42
37 30
135 114
55 117
106 142
124 120
166 160
155 159
105 109
129 171
...

result:

ok Accepted with 2333+198 operations,sum of size(s)=2333+4666

Test #14:

score: 6
Accepted
time: 1ms
memory: 3828kb

input:

2
1727138930
20000 10000 200000 200000
99
3247483138 3247483162
4084597375 4084597429
2636905019 2636904971
946660642 946660700
902149328 902149350
2382255766 2382255865
839303047 839303137
1923325547 1923325538
653690681 653690724
4175318562 4175318731
3824454449 3824454478
2650316775 2650316587
58...

output:

Succeeded
3152 198 3152 6304
17 177
65 188
23 38
110 61
147 67
144 121
181 94
48 86
42 166
158 155
104 135
96 183
122 190
184 72
32 80
59 5
137 139
3 195
51 149
126 162
157 11
165 87
18 136
175 97
130 142
68 74
75 124
156 12
58 70
179 2
20 169
52 107
54 91
100 186
14 62
159 28
152 16
131 171
185 95
...

result:

ok Accepted with 3152+198 operations,sum of size(s)=3152+6304

Test #15:

score: 6
Accepted
time: 1ms
memory: 3940kb

input:

2
1220143324
20000 10000 200000 200000
100
693596313 693596332
62576744 62576808
1955936424 1955936264
3872655610 3872655531
1013531683 1013531829
2985331208 2985331369
2406362516 2406362582
1657349556 1657349602
1003910904 1003910721
1096398841 1096398795
1778724026 1778723842
713692268 713692342
2...

output:

Succeeded
2521 200 2521 5042
151 38
100 2
94 93
132 163
10 47
4 192
111 24
114 99
8 123
21 108
14 159
87 104
20 61
17 73
15 141
133 50
161 96
5 3
109 178
150 28
98 43
195 128
74 196
25 135
65 84
131 67
33 139
165 89
48 62
60 72
71 110
36 134
169 180
85 95
177 77
145 92
107 82
197 176
41 64
118 140
1...

result:

ok Accepted with 2521+200 operations,sum of size(s)=2521+5042

Test #16:

score: 6
Accepted
time: 0ms
memory: 3936kb

input:

2
442130601
20000 10000 200000 200000
100
3144169521 3144169542
3602466736 3602466791
26223369 26223537
866636824 866636802
1192888944 1192888905
2768179340 2768179316
992350648 992350588
1606144049 1606144118
2825460299 2825460268
2783910130 2783910118
403964521 403964517
445570315 445570360
126026...

output:

Succeeded
2402 200 2402 4804
165 78
123 103
171 153
2 47
155 175
142 116
148 73
174 120
182 150
167 195
199 159
198 107
145 127
114 10
124 184
179 110
42 88
69 161
136 197
137 95
74 22
97 3
196 87
27 104
101 25
86 66
92 59
173 188
34 135
48 162
35 113
128 121
157 37
93 177
102 16
23 5
32 90
39 62
19...

result:

ok Accepted with 2402+200 operations,sum of size(s)=2402+4804

Test #17:

score: 6
Accepted
time: 1ms
memory: 3932kb

input:

2
949343282
20000 10000 200000 200000
97
1170242583 1170242801
4247921283 4247921322
1529679099 1529679065
1051858814 1051858774
3893889966 3893889994
3958531511 3958531352
2502650796 2502650862
813064156 813064047
1048780624 1048780414
3993902928 3993902731
803344004 803343802
3547336751 3547336794...

output:

Succeeded
2616 194 2616 5232
113 83
116 86
78 147
177 55
11 27
42 185
26 14
154 151
34 180
106 167
190 12
170 169
175 134
35 104
37 168
20 105
13 149
152 67
171 59
119 61
173 126
64 47
24 74
108 15
186 52
139 131
161 93
90 188
23 7
124 38
129 71
140 41
65 107
60 194
146 53
3 178
48 125
153 184
123 5...

result:

ok Accepted with 2616+194 operations,sum of size(s)=2616+5232

Test #18:

score: 6
Accepted
time: 1ms
memory: 4004kb

input:

2
734508634
20000 10000 200000 200000
98
213911368 213911499
2488548419 2488548499
516780967 516780705
3349442602 3349442765
857297035 857297029
1348690665 1348690579
1548954171 1548954133
3605026599 3605026727
182470368 182470292
1455323224 1455323364
2179991017 2179991001
3209649930 3209649949
145...

output:

Succeeded
2275 196 2275 4550
27 38
80 156
134 45
56 65
6 51
31 62
23 83
184 152
5 194
158 144
9 77
16 93
112 64
33 12
92 175
110 119
101 186
95 75
157 100
21 36
185 190
81 14
67 89
63 171
172 26
8 39
127 128
123 155
131 170
196 174
187 182
150 104
115 167
191 169
125 108
161 133
181 168
178 183
149 ...

result:

ok Accepted with 2275+196 operations,sum of size(s)=2275+4550

Subtask #3:

score: 8
Accepted

Test #19:

score: 8
Accepted
time: 3ms
memory: 4644kb

input:

3
397960972
100000 4000 200000 200000
1000
3136131587 3136131078
3887641427 3887642253
280951546 280951198
124187343 124186744
3948118891 3948118785
2174920490 2174920140
3041102338 3041103477
489656932 489656480
3093689453 3093690199
3027233105 3027233261
967551350 967551424
215138938 215138436
251...

output:

Succeeded
367 2000 367 734
1740 1003
1560 1938
1246 1780
1573 1476
1826 1535
1031 1618
1661 1100
1527 1892
1660 1591
1354 1792
1594 1117
1097 1519
1919 1341
1846 1160
1853 1548
1863 1016
1445 1241
1481 1207
1371 1103
1646 1779
1329 1435
1162 1515
1342 1464
1756 1040
1383 1416
1724 1301
1061 1382
119...

result:

ok Accepted with 367+2000 operations,sum of size(s)=367+734

Test #20:

score: 8
Accepted
time: 3ms
memory: 4572kb

input:

3
755523510
100000 4000 200000 200000
999
837610461 837610217
209552123 209552158
2202987134 2202987346
3933843218 3933843131
2783546817 2783547323
415275024 415276142
13876082 13876176
448702939 448703028
1294393612 1294394136
3910397405 3910397094
3416630484 3416630700
3215888394 3215888948
124509...

output:

Succeeded
1969 1998 1969 3938
198 827
112 795
703 616
809 427
584 743
818 611
649 805
42 438
1863 330
1562 251
922 322
1460 130
723 928
868 579
606 701
641 761
711 339
60 786
581 237
759 256
502 651
634 368
1878 340
491 118
1638 924
6 411
437 224
529 484
1 171
617 435
828 876
893 549
160 62
364 94
7...

result:

ok Accepted with 1969+1998 operations,sum of size(s)=1969+3938

Test #21:

score: 8
Accepted
time: 3ms
memory: 4608kb

input:

3
2042812129
100000 4000 200000 200000
998
3075748308 3075748844
1569673104 1569672823
3968525693 3968524672
2108387096 2108386924
3356390455 3356391094
3372812724 3372813320
3904961007 3904958854
4029621824 4029621345
4114486509 4114486281
1387138301 1387138067
124292409 124292880
3935517019 393551...

output:

Succeeded
1345 1996 1345 2690
1325 1749
1702 1332
1114 1225
1984 1397
1723 1307
1737 1658
1495 1813
1051 1838
1316 1067
1922 1696
1402 1946
1355 1363
1886 1208
1247 1539
1072 1505
1700 1624
1499 1436
1498 1268
1759 1326
1659 1857
1293 1920
1651 1242
1523 1311
1751 1687
1336 1347
1810 1021
1366 1147
...

result:

ok Accepted with 1345+1996 operations,sum of size(s)=1345+2690

Test #22:

score: 8
Accepted
time: 3ms
memory: 4868kb

input:

3
1597029305
100000 4000 200000 200000
998
2980500284 2980500361
2247716226 2247714887
988714926 988714253
1734063960 1734064121
2359409219 2359409008
411968449 411968499
155449826 155451318
555582797 555582911
45071917 45071590
1460631113 1460629818
3059213925 3059213709
2094519932 2094519250
38721...

output:

Succeeded
269 1996 269 538
1767 345
262 528
580 38
1719 910
1612 226
1391 1016
1557 719
431 130
1537 941
1894 322
1572 1024
1713 1082
1539 697
846 1712
1100 1898
293 1595
1970 1512
119 685
748 1521
282 245
551 419
1301 1688
857 774
488 1177
1854 1558
1950 1579
1136 576
1600 219
760 1643
167 887
1717...

result:

ok Accepted with 269+1996 operations,sum of size(s)=269+538

Test #23:

score: 8
Accepted
time: 0ms
memory: 4876kb

input:

3
1564467111
100000 4000 200000 200000
1000
1236547222 1236547523
2135786902 2135787064
2523622442 2523622714
1532839693 1532838477
818219113 818220033
676117995 676118414
570037547 570036834
514220702 514220842
3399494183 3399495268
2654728241 2654729498
1495037081 1495037412
2062047312 2062048382
...

output:

Succeeded
407 2000 407 814
257 1077
429 825
365 1158
1910 1574
178 1855
1371 1318
1452 960
141 558
1666 607
37 1482
281 1130
1775 1710
1008 1257
415 1773
1409 1804
1557 519
57 1335
1163 839
389 444
431 1554
1981 757
326 1585
36 1885
1882 19
1093 1307
180 866
1774 1324
1572 1355
1058 1280
413 1397
48...

result:

ok Accepted with 407+2000 operations,sum of size(s)=407+814

Test #24:

score: 8
Accepted
time: 2ms
memory: 4660kb

input:

3
213138336
100000 4000 200000 200000
999
1130123143 1130122958
687694550 687694095
929485247 929484829
3680984473 3680983776
3074105335 3074104892
1342732123 1342731927
1364720805 1364720672
2077428724 2077428538
28510235 28511166
937776441 937776505
3414480885 3414480666
3148182306 3148181509
3485...

output:

Succeeded
515 1998 515 1030
837 581
427 276
84 423
90 646
277 760
687 28
530 444
5 895
21 141
497 458
564 381
237 27
271 465
293 231
808 524
79 104
301 755
596 482
390 998
147 498
351 951
283 580
754 246
60 884
647 412
402 398
817 1356
258 1915
363 645
138 662
967 953
379 324
543 567
492 494
961 556...

result:

ok Accepted with 515+1998 operations,sum of size(s)=515+1030

Test #25:

score: 8
Accepted
time: 2ms
memory: 4612kb

input:

3
924980045
100000 4000 200000 200000
998
1666991999 1666991279
148686690 148685590
324531768 324531788
2043725358 2043725640
1133184972 1133184631
853139746 853139683
1770837584 1770837761
1481554510 1481554714
1372084869 1372084950
1756084441 1756085236
2107756067 2107756010
3377586774 3377586312
...

output:

Succeeded
387 1996 387 774
702 874
78 412
551 608
661 662
1099 473
745 406
1850 447
28 481
746 714
411 511
738 317
1 1564
444 62
4 757
363 134
135 800
980 204
1971 184
98 611
175 967
998 775
1536 48
598 208
846 42
744 290
388 556
414 1003
762 271
99 460
139 850
512 6
509 68
839 159
790 1864
77 164
2...

result:

ok Accepted with 387+1996 operations,sum of size(s)=387+774

Test #26:

score: 8
Accepted
time: 2ms
memory: 4580kb

input:

3
774146483
100000 4000 200000 200000
999
3478842381 3478843345
606332045 606332562
2701123033 2701123563
3216754910 3216755036
1217043418 1217043429
1501603802 1501603474
1778234551 1778234769
1444790432 1444791022
2502984240 2502984288
856947428 856947122
1363006586 1363006323
1995567044 199556642...

output:

Succeeded
1753 1998 1753 3506
233 436
55 112
711 125
874 394
419 462
171 1792
184 552
271 927
608 160
470 764
397 611
165 705
819 172
978 174
153 633
937 57
128 482
971 508
940 894
1740 34
835 314
720 261
868 801
322 751
816 628
1659 717
325 961
590 51
203 760
623 339
1905 9
120 447
181 375
880 575
...

result:

ok Accepted with 1753+1998 operations,sum of size(s)=1753+3506

Test #27:

score: 8
Accepted
time: 2ms
memory: 4564kb

input:

3
82266506
100000 4000 200000 200000
999
3056998601 3056998876
1887811910 1887812134
1616045105 1616045172
1784967209 1784967615
650919784 650918837
4290024152 4290024396
154133667 154133653
754913686 754913998
3014551042 3014550770
3332698384 3332698431
304657473 304657856
1466514044 1466515029
313...

output:

Succeeded
1177 1998 1177 2354
96 486
1192 715
312 589
107 967
316 566
1406 1741
758 276
1743 283
449 762
466 189
72 30
428 376
596 26
868 235
430 208
152 638
612 341
1629 1289
1249 893
698 198
77 574
919 981
147 711
739 491
1910 773
229 1475
1960 584
274 1345
658 369
382 587
313 945
937 957
130 468
...

result:

ok Accepted with 1177+1998 operations,sum of size(s)=1177+2354

Test #28:

score: 8
Accepted
time: 2ms
memory: 4828kb

input:

3
1746021239
100000 4000 200000 200000
1000
3649747382 3649747015
3895797253 3895797184
4001365723 4001365122
564220364 564220085
362710516 362710456
2800243662 2800243024
2073687310 2073687797
145701776 145700951
492159209 492159366
3076148714 3076148148
1548738755 1548739322
3580263095 3580262700
...

output:

Succeeded
983 2000 983 1966
707 272
433 532
900 503
486 769
264 508
252 1196
108 696
656 874
924 755
1299 878
307 439
717 17
531 89
392 247
233 987
314 719
79 47
217 660
784 151
713 669
187 615
783 73
941 633
356 908
880 789
722 378
971 26
326 241
352 69
584 683
330 1202
1729 708
447 139
760 435
860...

result:

ok Accepted with 983+2000 operations,sum of size(s)=983+1966

Subtask #4:

score: 0
Wrong Answer

Test #29:

score: 5.68329
Acceptable Answer
time: 11ms
memory: 4416kb

input:

4
1084797752
100000 4000 200000 200000
1000
3456536122 3456534568
249115651 249115791
3576312078 3576312237
1880897416 1880895547
1944688480 1944688327
248846397 248847256
3567405828 3567405196
1084965392 1084965206
1435956247 1435955729
3887033767 3887032464
307260230 307260472
1476733874 147673312...

output:

Succeeded
121069 2000 121069 242138
1932 1516
1673 41
1872 1211
1560 1266
1949 1086
1644 1593
644 853
1430 977
17 91
554 424
427 354
1753 1804
1292 1648
1231 1241
448 945
766 911
578 740
971 181
1982 1092
1392 1573
308 533
1777 1731
949 944
1446 1057
1878 1375
1259 1894
1395 1702
1905 1134
1208 1884...

result:

points 0.6314765690 Accepted with 121069+2000 operations,sum of size(s)=121069+242138

Test #30:

score: 9
Accepted
time: 4ms
memory: 4444kb

input:

4
583125216
100000 4000 200000 200000
1000
1729488108 1729488695
2234303914 2234304325
546617298 546616102
842050918 842051470
1951502077 1951501331
4271815110 4271815116
761587681 761586756
2172224244 2172223957
2934428060 2934428507
1919912734 1919912263
1067575137 1067574604
3411448089 3411447166...

output:

Succeeded
26240 2000 26240 52480
1986 1733
1832 1416
1941 1167
1201 1736
1634 1684
1849 1512
1360 1013
1015 1434
1464 1145
1799 1001
1250 1080
1486 1281
1875 1600
1821 1856
1833 1890
1555 1899
1556 1917
1949 1976
1366 1038
1113 1212
1341 1392
1878 218
217 565
139 305
817 609
975 5
574 652
649 6
304 ...

result:

ok Accepted with 26240+2000 operations,sum of size(s)=26240+52480

Test #31:

score: 4.23759
Acceptable Answer
time: 10ms
memory: 4472kb

input:

4
1854731567
100000 4000 200000 200000
998
946750857 946749479
898868556 898868101
2271278746 2271277916
1796596168 1796596321
161487283 161486866
1033814116 1033814195
2395521961 2395522326
1468519383 1468519080
2816096970 2816096367
1556209002 1556208501
3292442187 3292440851
1135140030 1135140110...

output:

Succeeded
142764 1996 142764 285528
1647 1907
743 1450
1702 1557
1187 5
1835 753
1172 800
1354 1858
268 3
1744 1451
1232 1396
742 925
819 631
1243 909
628 762
263 1677
828 704
1020 1928
79 159
535 340
1526 706
1769 944
1167 349
708 844
56 506
1781 1734
610 234
1408 682
1185 1673
1645 907
781 429
362...

result:

points 0.47084299240 Accepted with 142764+1996 operations,sum of size(s)=142764+285528

Test #32:

score: 2.71963
Acceptable Answer
time: 15ms
memory: 4404kb

input:

4
2073988041
100000 4000 200000 200000
998
3168161931 3168162584
641363905 641362895
3784715137 3784714618
3548409026 3548409673
2737710699 2737710016
3324804481 3324803425
60841104 60840338
2010919705 2010919496
2362840315 2362840326
369236350 369237998
3600238093 3600237006
75182169 75182747
23418...

output:

Succeeded
170058 1996 170058 340116
1027 1735
1342 1662
1972 1614
1928 605
571 1079
1155 401
309 814
676 802
1782 386
1523 380
1970 223
99 270
1247 1547
1987 263
51 116
1667 1543
334 143
1387 1557
1337 835
536 457
961 184
1481 1031
1564 1732
1625 1415
1926 1327
1949 761
1067 750
1816 1943
1709 1158
...

result:

points 0.30218108410 Accepted with 170058+1996 operations,sum of size(s)=170058+340116

Test #33:

score: 2.1969
Acceptable Answer
time: 16ms
memory: 4408kb

input:

4
1770340944
100000 4000 200000 200000
998
619870796 619870703
3121053787 3121054050
4195183636 4195182734
3139119614 3139119172
3634777517 3634777854
3433281440 3433281395
1485638549 1485638667
1231357421 1231357552
1705009906 1705010057
3514693637 3514694012
4265358236 4265358262
964902776 9649023...

output:

Succeeded
181187 1996 181187 362374
1004 1944
1835 1222
1456 1316
1324 798
1708 177
1325 25
1823 1837
776 913
1379 1674
1068 381
1326 216
479 248
1197 163
1580 1438
1196 512
365 171
1193 1546
847 43
1292 765
1646 1134
1013 407
1322 952
1034 1275
668 346
199 3
1955 466
1706 22
1340 1577
270 599
1267 ...

result:

points 0.24410022420 Accepted with 181187+1996 operations,sum of size(s)=181187+362374

Test #34:

score: 0
Wrong Answer
time: 18ms
memory: 4316kb

input:

4
402901589
100000 4000 200000 200000
1000
1228378193 1228378597
1873458243 1873458214
2590411172 2590411391
3596693908 3596693672
442343415 442341879
1371534355 1371535333
1713867379 1713867258
2725534246 2725534433
3960722519 3960721503
1846001052 1846001387
2925453274 2925452776
1709191822 170919...

output:

Failed
Limit of S2 exceeded

result:

wrong answer Limit of S2 exceeded

Subtask #5:

score: 0
Wrong Answer

Test #39:

score: 0
Wrong Answer
time: 6ms
memory: 4240kb

input:

5
1720909858
50000 4000 200000 100000
998
195378529 195378218
2138942224 2138942028
2421726252 2421725316
2614111628 2614111784
3778296551 3778295886
3346314089 3346313971
701234060 701233448
279201944 279202119
69826850 69826766
2173156660 2173157126
2982274003 2982273048
2306106121 2306107345
2808...

output:

Failed
Limit of S2 exceeded

result:

wrong answer Limit of S2 exceeded

Subtask #6:

score: 0
Wrong Answer

Test #50:

score: 0
Wrong Answer
time: 5ms
memory: 4532kb

input:

6
889180297
25000 4000 200000 100000
998
3680334935 3680334330
2957217208 2957215867
3096097757 3096097331
2843029536 2843030717
2270437916 2270437982
1841161075 1841160444
3671823118 3671823208
2166904224 2166903071
2760262295 2760263328
880472976 880472564
3147819342 3147820514
3366602035 33666019...

output:

Failed
Limit of C1 exceeded

result:

wrong answer Limit of C1 exceeded

Subtask #7:

score: 0
Wrong Answer

Test #59:

score: 0
Wrong Answer
time: 5ms
memory: 4468kb

input:

7
1561772597
25000 4000 200000 100000
1000
834919143 834919090
162625904 162627303
1067517190 1067517712
3410644901 3410644677
2728503196 2728502622
4133685425 4133685598
976760503 976760426
2101358026 2101358499
3583017242 3583017016
1743218912 1743220527
2609984627 2609985177
3915259025 3915259188...

output:

Failed
Limit of C1 exceeded

result:

wrong answer Limit of C1 exceeded

Subtask #8:

score: 0
Wrong Answer

Test #70:

score: 0
Wrong Answer
time: 14ms
memory: 5508kb

input:

8
1311447458
50000 100000 500000 200000
4999
173190562 173182163
1078196947 1078197142
1215565665 1215571165
1186082670 1186081354
2422459084 2422459806
2626070241 2626074599
207492448 207494582
2266700305 2266695214
1679673055 1679672568
3879988278 3879982030
254940475 254941572
3919251618 39192495...

output:

Failed
Limit of C1 exceeded

result:

wrong answer Limit of C1 exceeded

Subtask #9:

score: 0
Wrong Answer

Test #81:

score: 0
Wrong Answer
time: 3ms
memory: 5812kb

input:

9
574951428
15000 10000 200000 50000
5000
1781472251 1781466624
803445324 803444785
3544280892 3544283003
3151400420 3151403948
3250864128 3250871501
4189507543 4189510374
3483519516 3483520446
1003612935 1003617460
1101934749 1101931586
1948046579 1948042301
4151407804 4151401951
424123439 42412196...

output:

Failed
Limit of C1 exceeded

result:

wrong answer Limit of C1 exceeded