QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#112411#3520. Historical Mathslmq26052003 AC ✓779ms3644kbC++202.1kb2023-06-11 16:46:252023-06-11 16:46:26

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 2 0
1 2
3 1 0 0

output:

4

result:

ok 

Test #2:

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

input:

3 5 1 2
2 11 3
5 4 5 1 12 6

output:

13

result:

ok 

Test #3:

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

input:

2 3 2
2 3 2
3 10 12 4

output:

impossible

result:

ok 

Test #4:

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

input:

1 1
1 1
1 1

output:

1152921504606846977

result:

ok 

Test #5:

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

input:

2 4 2
4 1 3 3 7
5 4 14 18 34 14

output:

1152921504606846993

result:

ok 

Test #6:

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

input:

1 1
1000 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 10737...

output:

1152921505143717888

result:

ok 

Test #7:

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

input:

16 1073741824 0 0 0 0 0 1073741824 0 0 1073741824 0 0 0 0 0 1073741824
20 1 1 0 1 1 0 0 0 0 1073741824 1073741824 0 0 0 0 1 1 0 1 1
35 1073741824 1073741824 0 1073741824 1073741824 0 1073741824 1073741824 1 14 13 0 1073741824 1073741824 1 14 13 1 14 13 0 1073741824 1073741824 1 14 13 0 1073741824 10...

output:

1152921506754330611

result:

ok 

Test #8:

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

input:

500 1053769864 1063083799 1068959834 1066376710 1057314114 1051220360 1064050739 1054131030 1054538512 1057835298 1057250095 1066063947 1063658726 1063280989 1060823855 1067802178 1051120212 1051590925 1064189545 1059743725 1058489091 1049906084 1066826226 1067934228 1060995481 1054608392 1051979428...

output:

1070208569

result:

ok 

Test #9:

score: 0
Accepted
time: 192ms
memory: 3564kb

input:

500 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824...

output:

1152921504606846883

result:

ok 

Test #10:

score: 0
Accepted
time: 197ms
memory: 3564kb

input:

500 772925951 485375825 880734454 1020926606 632335013 443257542 810616888 1036018100 52866679 138959419 372810043 197582216 119529851 583661627 481111964 329526584 984603972 1058466777 132764196 639415952 633328797 430077993 657660002 767260576 397029568 362696566 740604209 261292810 81125825 89693...

output:

1070208571

result:

ok 

Test #11:

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

input:

1 10
1 5
2 5 0

output:

impossible

result:

ok 

Test #12:

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

input:

2 2 0
1 7
3 2 0 0

output:

impossible

result:

ok 

Test #13:

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

input:

2 2 2
2 4 0
4 1 0 8 0

output:

impossible

result:

ok 

Test #14:

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

input:

1 17
2 3 3
3 3 9 6

output:

impossible

result:

ok 

Test #15:

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

input:

5 1 0 0 0 0
5 1 0 0 0 0
4 1 0 0 0

output:

impossible

result:

ok 

Test #16:

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

input:

18 1073741824 0 0 0 0 0 1073741824 0 0 1073741824 0 0 0 0 0 1073741824 0 0
20 1 1 0 1 1 0 0 0 0 1073741824 1073741824 0 0 0 0 1 1 0 1 1
37 1073741824 1073741824 0 1073741824 1073741824 0 1073741824 1073741824 1 1 0 0 1073741824 1073741824 1 1 0 1 1 0 0 1073741824 1073741824 1 1 0 0 1073741824 107374...

output:

1152921506754330624

result:

ok 

Test #17:

score: 0
Accepted
time: 779ms
memory: 3404kb

input:

1000 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 1073741824 107374182...

output:

impossible

result:

ok 

Test #18:

score: 0
Accepted
time: 181ms
memory: 3548kb

input:

501 1073741824 0 0 0 1073741824 0 1073741824 0 0 0 1073741824 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

5029274250

result:

ok 

Test #19:

score: 0
Accepted
time: 184ms
memory: 3644kb

input:

501 749004541 0 0 0 749004541 0 749004541 0 0 0 749004541 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

8380280220

result:

ok 

Test #20:

score: 0
Accepted
time: 174ms
memory: 3568kb

input:

501 875620159 0 0 0 875620159 0 875620159 0 0 0 875620159 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

383355332044284600

result:

ok 

Test #21:

score: 0
Accepted
time: 187ms
memory: 3564kb

input:

500 749004542 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

5376418866000

result:

ok 

Test #22:

score: 0
Accepted
time: 192ms
memory: 3608kb

input:

500 875620160 875620160 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

10953009486979560

result:

ok 

Test #23:

score: 0
Accepted
time: 194ms
memory: 3428kb

input:

501 749004541 0 0 0 749004541 0 749004541 0 0 0 749004541 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

impossible

result:

ok 

Test #24:

score: 0
Accepted
time: 183ms
memory: 3472kb

input:

500 875620160 875620160 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

impossible

result:

ok 

Test #25:

score: 0
Accepted
time: 188ms
memory: 3488kb

input:

500 1014162209 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

impossible

result:

ok 

Test #26:

score: 0
Accepted
time: 4ms
memory: 3584kb

input:

20 1073539902 605011365 586318250 293050302 535863546 749865576 949343278 452907284 391206583 618193446 930106825 107822692 262734835 472327554 703543396 40760749 213853671 569195590 735316175 696695898
169 762566451 289115913 557964538 737691857 347183478 755603818 630250719 751194063 770214608 601...

output:

1073624089

result:

ok 

Test #27:

score: 0
Accepted
time: 38ms
memory: 3584kb

input:

187 297480882 371197350 13084558 621142138 738015937 540673583 193511067 939524147 1014146509 99486293 847328547 258617911 288134675 274579086 1004243059 614203614 551243076 176204394 861787571 265734320 787877421 154037445 35638296 995106184 599183655 760722501 238987656 257735216 201751348 1003754...

output:

1073037329

result:

ok 

Test #28:

score: 0
Accepted
time: 42ms
memory: 3560kb

input:

129 165503218 237572685 605109401 198863201 649270746 893448723 872461896 944862277 78451536 562687337 1021850073 857341940 310194204 64998940 229008933 962099680 488922203 650765692 159895766 703253667 677655165 444356121 690973090 538101507 769260417 869518310 756756031 1035115599 794517072 781843...

output:

1071965178

result:

ok 

Test #29:

score: 0
Accepted
time: 143ms
memory: 3608kb

input:

242 650801163 230558717 336296239 646812189 941254429 742964484 862142058 988610010 215637604 47553424 474277451 811287833 430348970 838166290 35047483 435053214 1044683375 69510250 744717100 206198723 639433345 92908254 2720374 534371455 969585265 508354515 285726685 586665761 277637061 900693477 1...

output:

1072475886

result:

ok 

Test #30:

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

input:

215 881600989 626574599 949424976 597191620 391954622 519949733 391155287 277396529 374444815 82941111 430329139 185203194 1068435209 965167759 523249379 624200064 639191216 703295122 500650598 664324905 334799557 49202852 956021269 852394851 29892914 404705913 1040865105 316198839 483363267 8081692...

output:

1073603039

result:

ok 

Test #31:

score: 0
Accepted
time: 68ms
memory: 3460kb

input:

376 899159660 467002951 695021975 290272540 814382696 519358772 379348400 43598097 471032703 142383060 625619718 642576080 824821584 290997856 338093786 379972931 874901976 962933699 93580352 235266063 4477919 911330711 434587414 239500459 632366902 250002695 93295221 1025933989 463350508 835858910 ...

output:

impossible

result:

ok 

Test #32:

score: 0
Accepted
time: 41ms
memory: 3476kb

input:

583 660494718 687174682 88992271 134221835 152409967 792624271 623750590 794869615 223465070 105895593 532016028 936217194 545360724 68728230 430608871 277238551 919068737 1030110800 923164330 97243939 886973548 219586013 480044489 678075425 469831022 21522753 615360278 1070228691 955573119 41614206...

output:

impossible

result:

ok 

Test #33:

score: 0
Accepted
time: 58ms
memory: 3460kb

input:

516 992483801 111214739 701055639 95586655 810249401 198921997 794512310 83734943 29072573 76870094 1071092845 813943408 668237377 974064631 191648193 18523643 483095975 436428028 429669019 509891240 285128703 386918671 606836474 385990599 890431479 23121002 672209740 1012010670 961385861 808569616 ...

output:

impossible

result:

ok 

Test #34:

score: 0
Accepted
time: 112ms
memory: 3536kb

input:

349 265378125 873765675 89105704 602340550 901736182 329691856 556675292 736554604 366262385 480383009 786472401 471433421 169219829 584940419 329506090 923375125 767626158 649117693 836849375 451965008 282757313 1015512905 735694329 569009262 152910065 228588730 501548026 551086932 538482592 240992...

output:

impossible

result:

ok 

Test #35:

score: 0
Accepted
time: 5ms
memory: 3468kb

input:

31 522526973 587453840 648355084 599307032 474437416 574672038 907634514 612622607 837312458 1061000391 100199902 169381971 779115779 878957906 54572926 124870616 14450172 215863233 7178138 907141327 890504612 134833824 752469003 112227946 61021357 252741996 445855558 596800917 753476202 815575218 8...

output:

impossible

result:

ok 

Test #36:

score: 0
Accepted
time: 42ms
memory: 3476kb

input:

86 526337835 679098926 369779271 630769999 116151403 535237792 157615274 801255102 208631345 202580603 535862639 662418900 243863470 500660990 953343163 16661129 406189010 577061524 560343371 884868427 69947712 373111489 934636940 757010985 53873416 728870586 1015216683 113814417 65784905 229591094 ...

output:

impossible

result:

ok 

Test #37:

score: 0
Accepted
time: 49ms
memory: 3464kb

input:

83 457333454 217332334 246490079 833656497 868703114 512306142 44459916 146070473 355784179 234073459 282172830 55160825 1024787484 466736088 228955283 915234984 258580365 352346682 174173563 712733997 301550578 954006870 35865392 154673057 1061734458 278007530 7741384 640310968 1011560922 788665426...

output:

impossible

result:

ok 

Test #38:

score: 0
Accepted
time: 59ms
memory: 3472kb

input:

871 453600466 432583469 299856119 50423145 576982492 65525563 273875441 420696824 213519664 900723862 1019617086 140047139 63361679 185135162 547271574 802554855 225328411 369679525 6535451 732317651 264271559 889060682 49345929 613089522 1040832103 421683103 808498155 13227372 762658064 493221797 6...

output:

impossible

result:

ok 

Test #39:

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

input:

2 1 1
2 1 1
5 1 1 0 0 1

output:

impossible

result:

ok 

Test #40:

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

input:

120 330910637 66429154 190430887 429269469 811142176 180470152 429679097 218718057 707341833 649912646 1019198387 450936438 739851563 991142359 801027396 635427663 225007505 802078626 410341325 1004581440 312439755 614888222 1017929461 723551579 641618047 55230174 435075140 180054564 785609802 72429...

output:

impossible

result:

ok 

Test #41:

score: 0
Accepted
time: 398ms
memory: 3504kb

input:

684 554480081 707612473 50913040 477569147 70132391 762641511 740794303 582113767 689867500 531396298 218445613 583030463 28486362 1061760711 1001117736 86099421 975060810 406634972 986514665 110926721 404750146 974349789 141086511 959745429 353776072 462074558 629743081 951098235 210503247 43363329...

output:

impossible

result:

ok 

Test #42:

score: 0
Accepted
time: 190ms
memory: 3560kb

input:

267 871683452 224552400 1013258093 1031444682 298536677 1064676533 828420610 614433115 644060840 503979513 689002793 36890461 1056728402 831491505 7068100 269666101 700009515 660402363 256796322 236993193 1035469622 790199456 523282145 358739265 227484557 852722934 456985752 845945547 359781487 7549...

output:

impossible

result:

ok 

Test #43:

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

input:

6 1 0 0 1073741824 0 1
6 1 0 1073741824 0 0 1
11 1 0 1073741824 1073741824 1 0 0 1073741824 1073741824 0 1

output:

1152921504606846978

result:

ok