QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#326754#6441. Ancient Magic Circle in TeyvatKalenistAC ✓339ms26616kbC++202.6kb2024-02-13 22:45:412024-02-13 22:45:41

Judging History

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

  • [2024-02-13 22:45:41]
  • 评测
  • 测评结果:AC
  • 用时:339ms
  • 内存:26616kb
  • [2024-02-13 22:45:41]
  • 提交

answer

#include<bits/stdc++.h>
#define N 100010
#define For(i,a,b) for(register int i=a;i<=b;i++)
#define Down(i,a,b) for(register int i=a;i>=b;i--)
using namespace std;
int n,m,d[N],a[N],occ[N],id[N],in[N<<1];
int c[10]={1,-1,1,1,-1,-1,-1,1,1,-1};
long long ans[10],tot;
bool mark[N];
struct E1{int t,x;};
struct E2{int x,y;}ed[N<<1];
vector<E1> go[N],big[N],small[N];
inline long long C2(long long x){return x*(x-1)>>1;}
inline long long C3(long long x){return x*(x-1)*(x-2)/6;}
inline void solve1(){ans[1]=1ll*m*C2(n-2);}
inline void solve2(){For(i,1,m) ans[2]+=m-(d[ed[i].x]+d[ed[i].y]-1);ans[2]>>=1;}
inline void solve3(){For(i,1,n) ans[3]+=C2(d[i])*(n-3);}
inline void solve6(){For(i,1,n) ans[6]+=C3(d[i]);}
inline int read()
{
    register int x=0,c=getchar();
    while(!isdigit(c)) c=getchar();
    while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
    return x;
}

inline void solve4579()
{
    long long cir=0;
    For(i,1,m)
    {
        int x=ed[i].x,y=ed[i].y;
        ans[4]+=1ll*(d[x]-1)*(d[y]-1);
    }
    For(i,1,n)
    {
        for(E1 e:big[i]) mark[e.t]=true,id[e.t]=e.x;
        for(E1 e:big[i]) for(E1 v:big[e.t]) if(mark[v.t])
        {
            cir++,ans[7]+=d[i]+d[e.t]+d[v.t]-6;
            in[id[v.t]]++,in[e.x]++,in[v.x]++;
        }for(E1 e:big[i]) mark[e.t]=false;
    }ans[4]-=cir*3,ans[5]=cir*(n-3);
    For(i,1,m) ans[9]+=C2(in[i]);
    return;
}

inline void solve8()
{
    long long del=0;
    For(i,1,n)
    {
        int cnt=0;
        for(E1 e:big[i])
            for(E1 v:go[e.t]) if(v.t^i)
                {if(!occ[v.t]) a[++cnt]=v.t;occ[v.t]++;}
        For(j,1,cnt) ans[8]+=C2(occ[a[j]]),occ[a[j]]=0;
    }
    For(i,1,n)
    {
        int cnt=0;
        for(E1 e:big[i])
            for(E1 v:small[e.t]) if(v.t^i)
                {if(!occ[v.t]) a[++cnt]=v.t;occ[v.t]++;}
        For(j,1,cnt) del+=C2(occ[a[j]]),occ[a[j]]=0;
    }ans[8]-=del>>1;
    return;
}

int main()
{
    n=read(),m=read();
    For(i,1,m)
    {
        int x=read(),y=read();
        ed[i]=(E2){x,y};
        go[x].push_back((E1){y,i}),d[x]++;
        go[y].push_back((E1){x,i}),d[y]++;
    }ans[0]=(__int128)n*(n-1)*(n-2)*(n-3)/24;
    For(i,1,n) for(E1 e:go[i])
        if(d[i] > d[e.t] || d[i] == d[e.t] && i > e.t)
            big[i].push_back(e);
    For(i,1,n) for(E1 e:go[i])
        if(d[i] < d[e.t] || d[i] == d[e.t] && i < e.t)
            small[i].push_back(e);
    solve1(),solve2(),solve3();
    solve4579(),solve6(),solve8();
    For(i,0,9) tot+=ans[i]*c[i];
    printf("%lld\n",abs(tot));
    return 0;
}
/*
4 6
1 2
2 3
3 4
4 1
1 3
2 4
*/

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 7892kb

input:

7 6
1 2
1 3
1 4
2 3
2 4
3 4

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: 0
Accepted
time: 1ms
memory: 5860kb

input:

4 0

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 0
Accepted
time: 1ms
memory: 5808kb

input:

4 1
1 2

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 2ms
memory: 7856kb

input:

4 2
1 2
1 3

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 2ms
memory: 7892kb

input:

4 2
1 2
3 4

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 2ms
memory: 8044kb

input:

4 3
1 2
1 3
1 4

output:

0

result:

ok 1 number(s): "0"

Test #7:

score: 0
Accepted
time: 2ms
memory: 7860kb

input:

4 3
1 2
2 3
3 4

output:

0

result:

ok 1 number(s): "0"

Test #8:

score: 0
Accepted
time: 0ms
memory: 7864kb

input:

4 3
1 2
2 3
1 3

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: 0
Accepted
time: 0ms
memory: 7852kb

input:

4 4
1 2
2 3
1 3
1 4

output:

0

result:

ok 1 number(s): "0"

Test #10:

score: 0
Accepted
time: 0ms
memory: 7860kb

input:

4 4
1 2
2 3
3 4
1 4

output:

0

result:

ok 1 number(s): "0"

Test #11:

score: 0
Accepted
time: 2ms
memory: 7892kb

input:

4 5
1 2
1 3
1 4
2 3
3 4

output:

0

result:

ok 1 number(s): "0"

Test #12:

score: 0
Accepted
time: 0ms
memory: 7916kb

input:

4 6
1 2
1 3
1 4
2 3
2 4
3 4

output:

1

result:

ok 1 number(s): "1"

Test #13:

score: 0
Accepted
time: 1ms
memory: 5856kb

input:

633 0

output:

6626427570

result:

ok 1 number(s): "6626427570"

Test #14:

score: 0
Accepted
time: 2ms
memory: 7980kb

input:

633 100
284 424
27 560
19 484
92 558
59 385
440 577
11 420
341 543
285 330
430 569
88 259
13 499
444 557
418 483
167 220
185 497
175 489
246 400
387 577
125 303
99 336
152 437
116 324
229 472
200 338
46 197
368 399
345 386
92 439
121 132
50 310
444 525
454 631
174 337
276 337
476 597
405 557
99 263
...

output:

6606576764

result:

ok 1 number(s): "6606576764"

Test #15:

score: 0
Accepted
time: 0ms
memory: 7976kb

input:

633 200
147 540
247 463
502 553
168 519
24 395
126 170
417 437
77 94
453 466
104 400
32 145
231 496
199 360
391 597
492 599
526 627
384 481
219 238
115 508
74 112
239 243
96 480
31 164
119 467
96 578
275 574
66 364
80 409
18 527
97 462
552 570
7 350
344 473
221 621
174 613
167 181
61 474
45 320
64 4...

output:

6586769859

result:

ok 1 number(s): "6586769859"

Test #16:

score: 0
Accepted
time: 2ms
memory: 7944kb

input:

633 500
193 462
116 450
462 486
197 295
471 593
189 220
484 576
143 415
256 588
132 543
46 363
18 184
105 395
243 529
36 188
83 588
127 339
184 415
182 193
123 341
176 427
446 484
143 525
76 473
161 519
126 386
234 418
119 181
28 94
543 569
333 448
206 588
103 563
499 536
131 263
614 632
478 489
284...

output:

6527638886

result:

ok 1 number(s): "6527638886"

Test #17:

score: 0
Accepted
time: 0ms
memory: 8016kb

input:

633 1000
213 614
307 555
146 543
262 297
35 351
99 562
92 222
270 390
102 483
591 597
358 543
40 129
157 466
134 438
288 456
49 535
250 316
24 536
93 585
341 550
66 110
185 330
146 434
131 496
68 413
414 625
4 96
19 460
5 444
35 589
118 245
30 387
249 325
65 390
177 572
216 499
309 608
155 486
509 6...

output:

6430135035

result:

ok 1 number(s): "6430135035"

Test #18:

score: 0
Accepted
time: 2ms
memory: 7996kb

input:

633 2000
37 314
132 319
127 409
37 579
573 594
107 149
144 337
108 618
259 515
6 596
145 201
152 263
488 512
290 294
542 578
157 311
577 590
517 536
529 539
61 260
100 374
224 626
479 564
36 548
46 242
190 592
27 88
30 181
125 351
17 604
214 428
255 388
90 201
126 430
109 384
238 534
191 197
160 502...

output:

6238668674

result:

ok 1 number(s): "6238668674"

Test #19:

score: 0
Accepted
time: 0ms
memory: 8152kb

input:

633 5000
151 587
351 429
271 387
271 398
213 560
167 483
531 596
79 260
532 571
167 179
158 623
26 194
450 515
346 583
30 217
316 551
27 234
208 449
272 397
50 318
105 229
458 526
145 301
17 306
114 159
163 177
169 608
61 211
204 477
43 311
109 509
535 539
78 588
177 280
64 142
305 593
418 444
453 5...

output:

5692706944

result:

ok 1 number(s): "5692706944"

Test #20:

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

input:

633 10000
44 377
191 460
198 226
32 599
312 406
414 564
52 508
203 319
319 376
428 629
99 589
53 228
586 590
21 443
12 155
25 400
147 369
27 374
394 489
118 548
70 397
242 278
245 257
509 522
82 372
39 233
182 264
246 588
511 570
349 418
168 339
137 615
419 420
66 461
182 462
260 538
4 604
99 494
15...

output:

4870867167

result:

ok 1 number(s): "4870867167"

Test #21:

score: 0
Accepted
time: 11ms
memory: 9024kb

input:

633 20000
25 130
270 612
2 361
228 277
106 138
45 207
12 291
36 450
336 589
293 586
7 331
13 94
182 244
21 293
109 446
142 406
311 439
68 423
372 383
172 453
283 311
196 438
249 400
391 562
232 538
539 553
357 607
24 257
171 336
422 430
472 576
47 501
531 574
72 237
14 428
56 163
386 592
220 627
62 ...

output:

3521002107

result:

ok 1 number(s): "3521002107"

Test #22:

score: 0
Accepted
time: 27ms
memory: 8376kb

input:

633 50000
5 605
325 341
407 507
349 401
369 461
70 297
228 518
241 244
58 563
59 459
153 480
101 606
13 140
312 336
396 456
307 607
94 413
129 340
21 456
153 452
419 575
322 411
313 617
160 310
426 430
444 594
214 335
33 175
32 41
257 540
424 462
39 582
181 190
62 238
50 262
181 269
22 289
251 331
6...

output:

1177969809

result:

ok 1 number(s): "1177969809"

Test #23:

score: 0
Accepted
time: 62ms
memory: 11548kb

input:

633 80000
234 361
181 425
481 538
145 313
188 308
69 423
250 607
192 320
472 626
119 219
361 612
186 191
52 144
28 320
238 472
206 439
318 445
252 341
10 517
376 442
209 213
82 181
69 458
224 487
494 624
207 395
183 621
487 599
166 213
245 490
45 292
131 592
175 544
2 464
62 468
7 332
336 420
277 56...

output:

282030903

result:

ok 1 number(s): "282030903"

Test #24:

score: 0
Accepted
time: 84ms
memory: 12488kb

input:

633 90000
271 596
308 446
104 300
269 632
434 537
101 609
47 239
32 565
232 468
171 477
128 575
206 352
459 563
8 252
203 546
135 549
23 389
252 261
17 215
23 581
130 429
332 577
461 536
429 520
415 540
250 577
51 583
475 625
299 592
208 372
47 442
170 425
183 187
184 512
103 277
463 540
32 310
169 ...

output:

128519898

result:

ok 1 number(s): "128519898"

Test #25:

score: 0
Accepted
time: 107ms
memory: 12800kb

input:

633 100000
100 486
30 184
85 561
22 569
22 517
89 461
61 369
178 324
178 255
281 414
295 553
492 506
14 351
63 202
44 222
64 86
64 598
7 28
191 343
592 620
303 502
46 427
383 614
593 632
278 479
35 631
264 373
95 561
215 279
290 370
201 206
179 533
322 602
138 149
373 569
7 302
163 566
93 276
374 47...

output:

38486

result:

ok 1 number(s): "38486"

Test #26:

score: 0
Accepted
time: 116ms
memory: 13076kb

input:

633 110000
22 203
608 632
35 555
42 237
264 608
157 266
206 578
92 568
18 93
245 427
601 618
10 443
137 214
121 243
342 601
46 344
112 132
35 427
252 313
11 547
394 565
389 391
161 246
352 417
224 525
122 201
508 561
488 628
82 218
99 136
70 250
271 321
69 337
560 588
166 579
92 554
68 583
169 414
9...

output:

128079474

result:

ok 1 number(s): "128079474"

Test #27:

score: 0
Accepted
time: 137ms
memory: 13284kb

input:

633 120000
185 542
7 14
27 592
224 569
98 352
448 543
105 123
134 210
91 413
93 393
29 132
283 501
190 275
380 603
103 557
449 489
44 623
2 551
43 573
547 579
52 354
97 378
309 502
147 405
57 375
98 488
195 522
3 6
224 411
163 577
213 368
197 260
140 341
13 578
19 510
155 603
447 501
93 476
250 340
...

output:

281577985

result:

ok 1 number(s): "281577985"

Test #28:

score: 0
Accepted
time: 179ms
memory: 13724kb

input:

633 150000
592 604
140 354
185 631
165 483
349 356
539 609
113 115
240 398
426 576
53 200
353 378
416 534
228 427
117 327
140 410
66 324
180 432
442 568
175 546
50 145
171 528
81 447
47 327
258 377
225 568
475 489
136 449
29 548
568 630
238 321
278 468
526 629
81 123
324 372
310 339
298 523
446 489
...

output:

1176277456

result:

ok 1 number(s): "1176277456"

Test #29:

score: 0
Accepted
time: 214ms
memory: 17364kb

input:

633 180000
387 421
280 528
273 412
212 561
1 582
219 457
190 503
464 605
56 625
223 240
87 146
178 335
456 624
311 353
108 273
349 601
384 544
91 240
172 549
21 58
439 479
62 157
102 428
374 575
469 473
173 181
97 448
209 225
132 440
116 591
348 412
40 225
440 507
155 611
7 361
211 550
105 369
469 6...

output:

3518581095

result:

ok 1 number(s): "3518581095"

Test #30:

score: 0
Accepted
time: 231ms
memory: 17540kb

input:

633 190000
11 536
414 607
96 155
390 561
403 474
100 629
56 92
464 472
410 618
329 474
153 169
520 543
192 314
173 509
422 465
75 131
449 567
97 254
195 276
286 511
67 573
3 216
82 198
283 593
94 267
149 429
58 449
70 546
248 575
194 248
244 482
133 607
439 577
267 316
63 228
400 419
469 540
19 469
...

output:

4866760887

result:

ok 1 number(s): "4866760887"

Test #31:

score: 0
Accepted
time: 234ms
memory: 17588kb

input:

633 195000
348 436
145 467
483 526
226 347
13 106
448 534
267 508
533 615
466 551
40 128
382 589
150 293
207 225
312 589
307 373
39 525
108 191
154 211
155 223
334 485
121 561
14 479
335 590
401 464
24 327
183 440
423 628
226 615
10 298
504 602
552 597
124 558
311 549
47 537
85 632
176 364
405 528
3...

output:

5687918187

result:

ok 1 number(s): "5687918187"

Test #32:

score: 0
Accepted
time: 258ms
memory: 18052kb

input:

633 198000
221 331
330 409
172 587
132 161
157 283
139 437
225 562
314 573
50 250
242 603
454 514
248 466
402 535
27 606
32 365
189 452
166 427
75 78
11 301
553 618
195 589
399 434
406 432
20 29
576 594
381 444
8 629
426 595
404 430
545 557
382 469
277 596
282 406
160 368
362 388
237 443
83 514
359 ...

output:

6233483213

result:

ok 1 number(s): "6233483213"

Test #33:

score: 0
Accepted
time: 244ms
memory: 17720kb

input:

633 199000
77 409
18 73
36 132
78 571
53 515
64 147
495 498
69 289
235 620
159 326
15 596
203 617
520 541
231 246
8 519
542 568
120 585
338 421
283 622
327 372
155 289
198 590
507 584
347 473
91 390
176 481
362 401
484 595
44 298
114 433
403 476
327 480
176 488
217 349
18 198
514 546
126 528
435 469...

output:

6424675566

result:

ok 1 number(s): "6424675566"

Test #34:

score: 0
Accepted
time: 246ms
memory: 17708kb

input:

633 199500
512 543
136 386
4 600
95 598
241 506
178 527
72 453
353 378
341 417
294 321
26 604
185 514
253 414
368 476
152 326
320 418
82 429
226 365
383 527
303 607
501 593
185 531
262 515
344 509
4 38
196 438
391 547
321 623
24 28
322 339
393 631
38 520
244 500
18 173
300 382
62 134
24 157
129 190
...

output:

6522157271

result:

ok 1 number(s): "6522157271"

Test #35:

score: 0
Accepted
time: 244ms
memory: 17792kb

input:

633 199800
191 583
72 157
357 539
103 358
293 582
19 84
314 445
62 388
195 524
29 366
227 600
158 510
378 588
250 380
234 544
114 524
39 337
462 486
230 632
235 242
74 272
208 447
51 239
367 531
309 461
6 224
134 244
329 520
128 351
224 555
245 516
370 586
229 447
336 519
304 630
235 628
405 480
3 3...

output:

6581228607

result:

ok 1 number(s): "6581228607"

Test #36:

score: 0
Accepted
time: 243ms
memory: 17780kb

input:

633 199900
42 520
108 550
129 489
250 392
293 485
257 311
450 471
288 388
572 599
209 282
32 521
239 328
301 564
76 107
23 374
125 506
57 321
122 240
365 380
138 587
317 364
55 331
410 594
154 441
441 546
183 495
390 564
61 351
244 543
418 538
365 426
4 237
105 291
157 505
432 484
113 595
179 278
45...

output:

6601027717

result:

ok 1 number(s): "6601027717"

Test #37:

score: 0
Accepted
time: 252ms
memory: 18152kb

input:

633 200000
152 218
163 263
349 518
482 568
27 476
235 532
58 229
334 338
249 327
171 337
150 477
201 583
438 601
449 512
160 470
535 589
294 620
344 617
519 588
254 422
79 506
28 47
268 543
185 226
37 68
66 172
92 210
358 459
13 546
176 384
233 462
200 563
581 612
332 362
2 394
323 605
176 521
13 29...

output:

6620862528

result:

ok 1 number(s): "6620862528"

Test #38:

score: 0
Accepted
time: 283ms
memory: 22312kb

input:

100000 200000
21414 38956
23290 37981
22420 43565
29518 86702
39041 69075
18922 22263
29518 91286
16526 87951
32319 37127
37289 79294
14890 70945
74535 79294
1188 89898
16768 89742
6825 41001
29490 92496
26840 55489
76921 99018
1496 34503
43045 65599
14273 26688
34369 63201
55489 88446
53799 85460
2...

output:

4165425107246812221

result:

ok 1 number(s): "4165425107246812221"

Test #39:

score: 0
Accepted
time: 294ms
memory: 22292kb

input:

100000 200000
21343 22419
5741 39884
5137 33301
53428 99878
46855 51659
43684 70578
76054 95903
41057 74941
68179 85206
14686 89758
42 55975
5780 85208
71928 83355
29905 80239
27343 85596
2075 21343
21043 36233
41057 63410
78408 79894
70066 83879
24150 59506
2075 80259
47850 65528
15643 91709
27379 ...

output:

4165425106505904469

result:

ok 1 number(s): "4165425106505904469"

Test #40:

score: 0
Accepted
time: 306ms
memory: 22608kb

input:

100000 200000
16246 51776
78398 90022
42499 84043
43483 77873
2281 35852
26018 85233
19468 38288
57889 75109
31359 83291
60136 82862
15310 38689
3273 10945
38161 73790
17273 47863
50912 61387
23306 77873
17412 90846
21805 51776
27014 37045
48991 57972
86320 94952
18568 99548
85015 97143
19048 38288
...

output:

4165425100479611749

result:

ok 1 number(s): "4165425100479611749"

Test #41:

score: 0
Accepted
time: 312ms
memory: 22644kb

input:

100000 200000
26171 60981
67319 75376
10720 70660
29358 91186
139 83048
2656 27169
4669 97429
8809 20695
17795 33908
4376 89357
63033 91834
31153 55976
70999 81328
19040 52972
31039 39260
65443 73265
57628 79928
60786 98331
53568 95639
63321 95363
24170 34900
65609 71091
28405 70999
27991 86251
1327...

output:

4165425089110316258

result:

ok 1 number(s): "4165425089110316258"

Test #42:

score: 0
Accepted
time: 312ms
memory: 22460kb

input:

100000 200000
20597 96081
5962 39446
82038 85969
7926 75166
31747 77412
76129 82038
31035 85921
62567 91347
64189 81891
27279 46877
27133 57538
45330 85641
3996 57070
12499 30370
35908 65554
45726 95326
45143 81891
20622 60623
39159 66937
13220 48572
11374 65723
5962 6824
61910 92075
5962 65883
8139...

output:

4165425073087136299

result:

ok 1 number(s): "4165425073087136299"

Test #43:

score: 0
Accepted
time: 314ms
memory: 22804kb

input:

100000 200000
24340 78016
67971 82054
13539 19027
16579 58214
20091 43996
20410 88616
49969 88600
80002 81177
79245 87943
30536 36021
51976 74601
63553 93013
3447 53094
59034 72274
23826 99904
12462 22222
80382 84330
15747 29184
19027 59373
2019 40042
70595 87923
13360 98371
48877 89826
27373 46117
...

output:

4165425052736102420

result:

ok 1 number(s): "4165425052736102420"

Test #44:

score: 0
Accepted
time: 330ms
memory: 22948kb

input:

100000 200000
40968 98038
2352 19493
8174 31547
26532 41947
44033 94514
16255 93865
23922 56309
50411 92447
80127 94558
7902 24328
59780 99175
64922 97095
11861 90864
22926 79249
16279 46003
741 68011
837 50236
12745 19124
55234 58580
14788 46293
37840 42862
26100 63321
70740 99359
57178 80928
47018...

output:

4165425028748822709

result:

ok 1 number(s): "4165425028748822709"

Test #45:

score: 0
Accepted
time: 318ms
memory: 23096kb

input:

100000 200000
48223 77254
28851 79988
11776 92489
52745 86280
24929 68891
12738 44235
4268 12738
5835 29831
62370 88635
71763 97137
59273 77208
21805 23708
8827 26245
9016 67127
51004 66380
61857 79761
8262 80807
33836 65515
47476 85302
41911 90578
36857 87433
6800 86539
72754 91672
12489 38126
8996...

output:

4165425001253882512

result:

ok 1 number(s): "4165425001253882512"

Test #46:

score: 0
Accepted
time: 334ms
memory: 23144kb

input:

100000 200000
27152 49826
20900 64721
72725 76330
48102 84404
87457 95663
18897 67770
15011 46582
29668 41645
81328 85480
17192 92092
6087 70539
28268 62120
32680 77103
12898 15305
37561 90566
28179 33388
41142 54508
72980 89177
58930 77060
56687 74257
20442 94036
60225 88184
52400 91802
25684 72235...

output:

4165424825284110597

result:

ok 1 number(s): "4165424825284110597"

Test #47:

score: 0
Accepted
time: 339ms
memory: 20992kb

input:

100000 200000
59025 63388
7905 18511
66236 92739
48376 65914
30414 55347
17516 86165
99076 99206
37232 92484
47060 76135
7475 71841
24433 37975
18738 51867
45649 50110
23039 81222
34690 86318
11141 80363
86973 92693
13888 60325
18112 97748
76157 88624
6622 59889
19841 81729
7165 79581
40642 91050
46...

output:

4165424607771946511

result:

ok 1 number(s): "4165424607771946511"

Test #48:

score: 0
Accepted
time: 329ms
memory: 21228kb

input:

100000 200000
23440 81130
410 87800
15037 86695
8343 41188
70393 71247
61647 67880
7123 95951
2461 44103
41166 71189
91093 98441
75587 94271
8359 56025
11193 79919
1564 30012
38115 67049
21140 30245
6551 23181
4809 50887
32436 74244
27070 61112
10630 22575
68247 99076
22482 53907
69206 82472
59535 6...

output:

4165424369657315092

result:

ok 1 number(s): "4165424369657315092"

Test #49:

score: 0
Accepted
time: 323ms
memory: 21604kb

input:

100000 200000
1379 87023
35051 58489
57472 93074
9815 83869
27543 55453
23062 35051
77428 96512
17105 31423
31002 53517
36935 44147
28458 29205
27931 35051
62271 86348
40873 78831
23676 99829
2956 6811
22399 45369
16891 17267
38821 78133
5189 30804
62271 67114
40714 81516
66178 70398
65916 73248
397...

output:

4165424123956368450

result:

ok 1 number(s): "4165424123956368450"

Test #50:

score: 0
Accepted
time: 298ms
memory: 21796kb

input:

100000 200000
80658 81293
17788 96254
25394 99029
79532 89705
6027 83417
44776 63154
13478 22784
19327 98797
5183 55751
2375 5655
34876 71920
70124 88636
9025 93604
29143 62595
32208 49761
89705 91380
28767 68837
19327 41596
23304 79400
17171 23185
68992 77019
40321 71745
49544 81614
70184 70884
173...

output:

4165423877835269076

result:

ok 1 number(s): "4165423877835269076"

Test #51:

score: 0
Accepted
time: 276ms
memory: 22344kb

input:

100000 200000
81830 97384
34651 88320
48072 95153
87196 96396
27732 65409
12559 23762
35306 54334
62548 64170
10463 17892
10531 52812
20293 38303
35326 74773
3978 77865
7482 83692
17876 56868
6367 72228
43178 72042
49221 62909
18518 53765
79044 95594
38214 61130
60513 65928
34369 54334
57233 67193
2...

output:

4165423637049205818

result:

ok 1 number(s): "4165423637049205818"

Test #52:

score: 0
Accepted
time: 252ms
memory: 22852kb

input:

100000 200000
18968 85336
42112 56677
18130 64150
2899 44132
10371 25290
17746 77380
24362 44132
15418 76863
44067 55147
54489 95491
30827 87947
71200 82821
20356 27414
54489 87793
14147 85332
18856 64173
82020 99599
5813 85032
15595 40981
19610 33653
35303 94020
27967 88885
25784 26367
65679 94174
...

output:

4165423180224344028

result:

ok 1 number(s): "4165423180224344028"

Test #53:

score: 0
Accepted
time: 228ms
memory: 23468kb

input:

100000 200000
16262 31188
31393 81158
42296 65724
43211 98130
7019 57086
80412 92273
13792 65379
6191 63018
7426 44020
69278 82922
33965 85086
17770 92960
37750 69717
4661 69968
1413 32564
19584 66104
56516 77750
48039 66549
65379 70554
25154 99004
32284 41343
50285 82540
6502 62187
19852 21477
1946...

output:

4165422762015158242

result:

ok 1 number(s): "4165422762015158242"

Test #54:

score: 0
Accepted
time: 209ms
memory: 24112kb

input:

100000 200000
36984 93304
25888 80128
14654 51765
80147 84259
44511 80128
35848 59994
29968 58914
52113 87315
31516 61516
59810 83587
5830 37609
7373 79053
46401 66992
56056 56574
33376 73374
1041 3303
39130 59748
37580 97331
872 43387
23149 65358
67104 91479
17797 97533
77063 98439
33344 46376
3187...

output:

4165422383927964406

result:

ok 1 number(s): "4165422383927964406"

Test #55:

score: 0
Accepted
time: 207ms
memory: 23860kb

input:

100000 200000
38947 44247
30171 49872
82143 93478
49093 54673
13357 43639
55911 59611
3254 3991
7734 27157
39828 68060
21457 62635
2091 30553
10292 57883
17174 77556
86854 90029
27032 44886
69493 83866
52486 60013
63635 81573
44909 58157
74764 78918
21442 54892
13488 52092
40629 76419
8405 76156
215...

output:

4165422045159833180

result:

ok 1 number(s): "4165422045159833180"

Test #56:

score: 0
Accepted
time: 195ms
memory: 23704kb

input:

100000 200000
29570 79988
70440 82861
56554 74476
32123 97425
48714 92714
3072 71314
15847 51537
60895 99632
48655 55736
2642 48294
32280 89781
3318 66700
8600 10000
937 89934
8688 84196
20390 99975
19656 55113
23622 48507
92157 97098
66917 69982
71529 82284
26742 50027
55929 71641
2280 16070
36158 ...

output:

4165421738545148004

result:

ok 1 number(s): "4165421738545148004"

Test #57:

score: 0
Accepted
time: 180ms
memory: 23364kb

input:

100000 200000
66973 86857
7560 63909
89300 95272
11322 16558
14293 18917
96386 99094
75018 98533
7051 13321
54333 74448
28868 64652
7051 42683
24475 71200
5220 61635
17501 54259
46333 83168
3162 83168
10131 89791
9461 70395
28226 99144
12204 30112
52597 93239
52833 65205
633 37809
20379 38020
19921 ...

output:

4165420595534458613

result:

ok 1 number(s): "4165420595534458613"

Test #58:

score: 0
Accepted
time: 198ms
memory: 24072kb

input:

100000 200000
15774 46216
2109 14700
62132 77210
63242 80788
16133 80678
847 71105
23718 67229
39163 40764
61200 67848
74414 97293
72990 82315
47347 78434
52211 90476
10177 45078
37489 43871
57932 66269
23482 45855
68167 72441
24080 34913
20905 42779
9497 15262
46226 49560
22520 93798
19529 30810
84...

output:

4165419362950547644

result:

ok 1 number(s): "4165419362950547644"

Test #59:

score: 0
Accepted
time: 186ms
memory: 23560kb

input:

100000 200000
42169 70119
34666 51812
64981 85043
7573 97928
11271 35213
3989 85732
41782 61106
20351 35951
58136 87749
40748 44168
1739 86161
1417 48671
68327 74691
11361 81106
49607 74991
44586 90240
67001 99175
80998 99296
10055 98014
41649 73779
14220 41332
571 7957
31100 41493
12839 71474
43021...

output:

4165418721662456267

result:

ok 1 number(s): "4165418721662456267"

Test #60:

score: 0
Accepted
time: 169ms
memory: 23972kb

input:

100000 200000
6587 23304
4883 75201
26198 32571
36275 58400
56441 63675
56955 61788
77196 92309
48235 51350
28914 36968
26664 40796
14181 34172
14956 58932
90440 90850
29165 50721
50483 72709
47634 79023
16867 93724
29705 65970
16500 77197
4601 21385
40108 48245
239 95948
23938 97820
27499 63348
271...

output:

4165418330968675713

result:

ok 1 number(s): "4165418330968675713"

Test #61:

score: 0
Accepted
time: 94ms
memory: 24224kb

input:

100000 200000
12251 67346
36883 52895
7429 8190
97826 99584
30613 45589
16904 21725
2046 18385
33551 60941
17261 82790
49643 88957
21079 68191
24578 59035
53863 87302
12240 71897
6861 64469
18253 38793
62763 89264
24558 76103
6998 57781
41578 65921
15517 75285
23624 32367
32858 40061
1018 26629
1668...

output:

4165417539788021551

result:

ok 1 number(s): "4165417539788021551"

Test #62:

score: 0
Accepted
time: 70ms
memory: 23936kb

input:

100000 200000
62256 66122
51213 70925
8726 14905
31133 85923
74784 94180
70884 88280
8505 93643
52089 81573
38193 62214
67423 88790
33704 54972
40806 70429
70239 85937
29684 35010
51070 93725
58702 75528
36419 37076
61642 78383
7941 82807
15704 58702
22793 24678
14281 26543
23912 84785
73778 80898
8...

output:

4165417141050183978

result:

ok 1 number(s): "4165417141050183978"

Test #63:

score: 0
Accepted
time: 85ms
memory: 24468kb

input:

100000 200000
46728 67163
11215 66738
26360 45414
9849 21327
76232 82882
21499 24083
56111 84884
33277 94912
62281 70815
74094 84125
48460 63051
4452 87341
31161 84546
51591 55997
38098 78598
51120 81381
1182 97064
16325 27718
32341 41782
10154 42861
38089 57062
2965 60418
60495 87665
29175 46888
29...

output:

4165417007630915125

result:

ok 1 number(s): "4165417007630915125"

Test #64:

score: 0
Accepted
time: 92ms
memory: 24616kb

input:

100000 200000
14892 68447
7557 41029
45621 58463
8106 71756
4267 43141
66751 85012
16462 24105
31813 73480
60349 71350
48848 64770
11188 78088
83728 84537
34772 36441
63095 65893
21349 56809
7694 95030
49265 88139
58977 81209
5406 55377
61299 72285
9208 66155
25844 53879
55503 82935
10478 94983
3595...

output:

4165416941133440808

result:

ok 1 number(s): "4165416941133440808"

Test #65:

score: 0
Accepted
time: 86ms
memory: 25480kb

input:

100000 200000
15098 89618
62722 94625
61073 92562
61118 95475
36494 56973
41622 57631
37583 46597
42436 48153
12506 96872
62591 78794
16183 81521
17771 52178
1189 40091
65386 78938
47332 85616
74260 81002
49662 75417
16331 78987
27418 70193
1010 21194
38092 47901
34091 88539
22045 54123
2085 79300
6...

output:

4165416901260399818

result:

ok 1 number(s): "4165416901260399818"

Test #66:

score: 0
Accepted
time: 2ms
memory: 5796kb

input:

100000 0

output:

4166416671249975000

result:

ok 1 number(s): "4166416671249975000"

Test #67:

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

input:

100000 1000
55305 94725
3981 90901
51418 73997
1430 90608
5966 45364
78491 92141
17763 97964
11924 67670
41345 46247
6989 91024
91673 99189
18428 95961
32846 66076
80040 80134
34744 37079
56830 89105
56188 90423
7790 34518
24338 61481
66327 74604
11232 66380
5168 16185
48981 92551
20517 99286
50751 ...

output:

4166411671503071396

result:

ok 1 number(s): "4166411671503071396"

Test #68:

score: 0
Accepted
time: 7ms
memory: 15084kb

input:

100000 5000
61502 78075
84229 91759
10063 33243
9928 91409
4096 10567
59047 96416
76331 93977
11983 47480
11362 77533
21884 50735
5317 49273
39513 74003
20365 91713
68008 79171
64524 68598
31902 54067
19059 57831
26844 87252
147 79943
3752 68152
6405 58987
10387 38289
15857 24831
45977 69963
69304 7...

output:

4166391672564555349

result:

ok 1 number(s): "4166391672564555349"

Test #69:

score: 0
Accepted
time: 13ms
memory: 15564kb

input:

100000 10000
65889 81426
39441 62323
8381 20175
32155 49255
14539 93658
10338 51018
35552 53221
2129 15919
244 57159
17053 74661
811 40659
31614 41980
12910 85056
60683 66132
64017 82272
61213 94092
7808 34584
16713 40341
51750 58642
77524 95667
61172 70655
61635 67189
32017 87677
26720 63021
9244 9...

output:

4166366673998431545

result:

ok 1 number(s): "4166366673998431545"

Test #70:

score: 0
Accepted
time: 28ms
memory: 19380kb

input:

100000 50000
3269 8918
33620 52586
72197 95301
17671 41957
43875 92981
8288 61145
74617 91709
28131 96470
66057 73073
9330 15572
33235 48787
49987 96933
38039 73196
65605 95426
19562 80054
60658 95657
63700 82017
45406 91552
31538 90706
5445 66032
16223 95028
59555 93067
60564 74528
33924 67605
3556...

output:

4166166689989534322

result:

ok 1 number(s): "4166166689989534322"

Test #71:

score: 0
Accepted
time: 48ms
memory: 21384kb

input:

100000 100000
29866 92243
10302 85293
55601 97539
28294 90374
1212 98887
70074 89758
56290 69010
13812 75593
32045 58508
31813 55470
22666 50722
48853 79683
39541 79833
26611 28189
48800 70445
15997 94830
70710 88769
32407 95369
66208 83209
21489 59002
17017 23179
7020 58761
31738 93976
2124 39357
4...

output:

4165916721205895047

result:

ok 1 number(s): "4165916721205895047"

Test #72:

score: 0
Accepted
time: 90ms
memory: 26616kb

input:

100000 200000
46916 58381
12944 85022
2956 36044
11223 97042
57975 82862
38813 62924
61938 73662
4128 29052
73580 81392
31315 84483
70662 77962
13520 81093
44463 72849
15468 82067
50394 75944
43770 85574
32949 75686
24235 82178
7511 58651
24247 94318
34852 54388
5086 23951
13321 89182
14451 92989
12...

output:

4165416821248109914

result:

ok 1 number(s): "4165416821248109914"

Test #73:

score: 0
Accepted
time: 84ms
memory: 25388kb

input:

100000 200000
74032 84618
4005 84618
25707 84618
53283 58590
75266 84618
32751 84618
11618 79246
21911 84618
43171 84618
32326 88020
71903 84618
84618 93107
79885 84618
23065 84618
14912 32970
39353 84618
75295 84618
69303 84618
31954 84618
67908 92767
31759 84618
37147 84618
28996 84618
84509 84618...

output:

4165750069524798758

result:

ok 1 number(s): "4165750069524798758"

Test #74:

score: 0
Accepted
time: 79ms
memory: 25560kb

input:

100000 200000
4238 45952
6343 82621
16374 72024
13043 60203
13315 16374
23558 84809
30529 74968
22525 63736
76775 84809
16374 86534
16374 55864
59925 96441
64570 92243
29725 84809
46191 68466
9404 71154
33307 78564
16374 61856
23808 44279
32979 77546
45717 93779
31077 36261
617 9314
52277 76665
1637...

output:

4165625090820042353

result:

ok 1 number(s): "4165625090820042353"