CT22817

The Two-Ledger Merge of Scrollkeep

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Amara runs the chandlery at the archive halls of Scrollkeep. Today the books show a list of vials, and the numbers must be worked out before sundown. Task: Two arrays are each sorted non-decreasing. Print one sorted array containing all of their elements. Input format: First line: n and m. Second line: n sorted integers. Third line: m sorted integers. Output format: Print n+m sorted values space-separated. Constraints: 1 <= n <= 743; 0 <= a[i],x <= 1000000000.

Example 1:

Input: 691 412 36489 1306824 6502272 7300441 8338940 8789281 9376844 10404442 11001552 11851458 17238243 18628368 20579190 22123439 23002170 24510108 25324955 30696359 31539443 32225344 32991191 35126757 35636659 38091184 39172181 44271528 44861367 46781500 47908588 52447130 52948855 54036957 54468266 55367797 56377193 59117853 61204285 61498148 62238349 63976356 64223388 71264664 71503640 72010828 72494637 73961699 74043723 74468396 74705091 75720744 79083290 79518117 79864772 81575533 82770371 82958722 84959185 87145247 87221809 89532385 89916867 91976166 93500036 96286709 96912619 96917594 96932365 98194637 98200532 99622876 101922452 104766546 105580308 106443574 108259365 108814429 109049987 111634243 116003989 118988651 119435108 120630074 121412694 122108950 122381096 123025109 124291973 1…
Output: 36489 1306824 4215253 6502272 7300441 7746009 8338940 8789281 9376844 10404442 11001552 11851458 14889122 15159946 15716386 15747847 16431945 17238243 18628368 20579190 22123439 23002170 24510108 24915952 25324955 25900234 28028401 28722009 30696359 31539443 31762432 32225344 32991191 34882753 35126757 35636659 35639530 35763679 38091184 38487588 39172181 43457700 44271528 44861367 45499212 46570327 46781500 47874757 47908588 48145261 50161624 50853457 50949433 51238766 52447130 52948855 54036957 54468266 55367797 55845316 56377193 59117853 59184593 60777853 61204285 61449534 61498148 62238349 62948289 63976356 64223388 64605689 66904788 67292264 71264664 71503640 72010828 72208939 72494637 73961699 74043723 74468396 74705091 75196711 75447233 75720744 79083290 79518117 79864772 81575533 8…

Example 2:

Input: 113 230 1323443 2646600 10036627 20730746 25537723 29490720 31374915 35008245 37187322 45073069 76754778 78989770 100111315 101542190 104024866 110237283 112220965 117288690 133495951 158124103 162198471 184367742 184395698 212081995 214280645 215116713 226962628 233510211 237458073 238892823 241699752 248954056 255688778 271857497 281448700 283533513 314011300 328179183 331288368 338917603 339501801 343909112 346437539 348122829 348147286 362957153 362970383 368746676 372744915 377367260 383027362 387203013 395198686 408846433 428392140 430328554 441816765 450644060 461175569 463493701 477192085 488182532 489582707 509084348 527427941 559346211 561289222 563308054 569252693 578152744 585182164 588818020 638749712 645120704 652770070 669439346 679281719 684413145 690346845 694676212 707487…
Output: 1323443 2646600 8867694 10036627 11130255 13663462 20360103 20730746 25537723 25999417 27450984 28597775 29490720 31374915 33369863 35008245 37187322 38335355 45073069 46281511 47041884 50664138 51430419 57769567 61142452 65750372 76280646 76754778 78989770 80177378 91867399 93316347 94987425 97592538 100111315 101542190 102508605 103190839 104024866 108985646 110237283 111933671 112220965 117288690 126558595 126587171 131804918 133495951 134331255 135056987 141441738 147121681 156097428 158124103 159305597 160387045 161412501 161949776 162198471 164786183 171060120 174722905 179857164 181300388 184367742 184395698 192787451 195494431 202547459 209492064 212081995 213531274 213730147 214280645 215116713 223327615 226962628 229242472 233510211 235146850 237458073 238892823 239857997 2399134…

Example 3:

Input: 158 69 8172245 15656210 18727460 18898054 22643877 39684251 50975628 60986706 60995740 69759108 73075001 73409840 73435124 73760504 90504053 97369887 108317083 122433896 123416539 126970189 129531238 129772741 138484444 142537477 154829609 154935121 157575867 157946076 159016949 160510785 163078444 169590491 176521166 182911352 184714190 186566647 207473278 213851434 240565919 248783911 252797080 254872350 257449766 266489295 280051068 282074589 282803271 292213113 298552454 298863355 311788244 321109055 326620195 328504568 338516114 339177656 342586508 348052117 359385534 369455093 377562441 378697849 387912325 390155020 397934217 397999174 433762319 441084966 444387592 446358600 455811923 455882033 461744613 470064787 471165996 478099448 498112605 503920480 507019366 523998715 524638225 …
Output: 8172245 10540389 15656210 18727460 18898054 22643877 24534772 25654397 31458145 39684251 50975628 57420503 60986706 60995740 62185376 69759108 73075001 73409840 73435124 73760504 77041000 84576888 90504053 97369887 108317083 122433896 123416539 126970189 129531238 129772741 134096062 138484444 140932033 142537477 142875045 145835218 154829609 154935121 157575867 157946076 159016949 160397076 160510785 163078444 169590491 176521166 182911352 184714190 186566647 207473278 210425710 212346223 213851434 216868677 240480060 240565919 248783911 252797080 254872350 257449766 264664753 266489295 268730122 271960050 280051068 282074589 282803271 292213113 298552454 298863355 311788244 321109055 326620195 327545118 328504568 338516114 339177656 342586508 348052117 358747954 359385534 369455093 37530…

Constraints:

1 <= n <= 743; 0 <= a[i],x <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.