CT24687

Corwin's Ledger of weights

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the dune sea of Caravanrest; Corwin weighs the day's weights manifests and starts the calculations. 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 <= 528; -1000000 <= a[i],x <= 1000000.

Example 1:

Input: 276 12 -997803 -997250 -996490 -995803 -991006 -988625 -979924 -975864 -968033 -963003 -951984 -948800 -936272 -935017 -931803 -925929 -899130 -898120 -892989 -885191 -880393 -864634 -859818 -848812 -844183 -826389 -822112 -822000 -811384 -801071 -782699 -780746 -777445 -773566 -744782 -728374 -723116 -697165 -685742 -682017 -678204 -676404 -675279 -671047 -656487 -644533 -640951 -635326 -626234 -619151 -597772 -589967 -587639 -583898 -577289 -572373 -568014 -567871 -566942 -555903 -549831 -549580 -542010 -538151 -537410 -517573 -508802 -503862 -498824 -490047 -472603 -471129 -467084 -464200 -459200 -449450 -445939 -438506 -437159 -399516 -392777 -392234 -391578 -386891 -384346 -380549 -369915 -359242 -351550 -349381 -336870 -330519 -327856 -326571 -311842 -311723 -308813 -297735 -293430 -…
Output: -997803 -997250 -996490 -995803 -991006 -988625 -979924 -975864 -968033 -963003 -951984 -948800 -936272 -935017 -931803 -925929 -899130 -898120 -892989 -885191 -880393 -864634 -859818 -848812 -845332 -844183 -826389 -822112 -822000 -811384 -801071 -782699 -780746 -777445 -773566 -744782 -728374 -723116 -697165 -685742 -682017 -678204 -676404 -675279 -671047 -656487 -644533 -640951 -635326 -626234 -619151 -597772 -589967 -587639 -583898 -577289 -572373 -568014 -567871 -566942 -555903 -549831 -549580 -549066 -542010 -538151 -537410 -517573 -508802 -503862 -498824 -490047 -472603 -471129 -467084 -464200 -459200 -449450 -445939 -438506 -437159 -414453 -399516 -392777 -392234 -391578 -386891 -384346 -380549 -369915 -359242 -351550 -349381 -336870 -330519 -327856 -326571 -311842 -311723 -308813 …

Example 2:

Input: 199 373 -973895 -964958 -955052 -953393 -952695 -945064 -943445 -936817 -935010 -932540 -912320 -910905 -898143 -896516 -890123 -889713 -889485 -877619 -825695 -824007 -811218 -800077 -789120 -785550 -781280 -770891 -753140 -748339 -740829 -731392 -718364 -716539 -716537 -708520 -669372 -668361 -667937 -661382 -653366 -632215 -596452 -588232 -584894 -581132 -575850 -564167 -560929 -550240 -543716 -540150 -538028 -534494 -533078 -514585 -514209 -485164 -453404 -440634 -430275 -425244 -413110 -410898 -410422 -410145 -386528 -385910 -362280 -348118 -330777 -328645 -320067 -316276 -303796 -298959 -294039 -288157 -283281 -272382 -271545 -250420 -240970 -230851 -225548 -225019 -200276 -168884 -167770 -160302 -157445 -155424 -149847 -142350 -131968 -122719 -87592 -60429 -46103 -40969 -2768 3890 8…
Output: -998773 -997943 -985555 -980036 -978572 -973895 -964958 -955052 -953393 -952695 -945064 -943445 -936817 -935010 -933724 -932804 -932540 -930772 -924685 -921831 -918936 -917864 -912320 -910905 -904998 -903315 -898143 -896516 -891163 -890123 -889713 -889485 -887263 -877619 -866608 -862730 -860291 -842319 -840299 -830756 -828008 -825695 -824007 -817900 -817765 -815881 -815158 -814035 -811218 -800077 -794297 -790812 -789120 -788609 -785550 -781280 -776482 -770891 -753140 -752241 -748339 -742324 -741480 -740829 -731785 -731392 -718364 -717296 -716722 -716539 -716537 -710399 -708520 -702910 -697625 -694238 -693536 -678382 -677890 -676962 -674106 -669372 -669040 -669033 -668361 -668352 -667937 -667519 -666909 -661382 -653366 -648371 -646172 -644920 -636305 -636245 -633036 -632215 -631026 -627575 …

Example 3:

Input: 255 30 -996650 -993341 -976197 -969524 -951062 -939202 -922084 -921782 -918281 -910939 -906075 -901549 -896848 -886252 -879745 -871100 -869931 -856816 -822007 -816154 -809220 -808194 -805183 -803104 -786921 -786742 -785911 -784667 -784612 -783337 -782983 -780673 -764135 -756728 -734960 -731694 -726629 -689226 -689013 -667715 -655148 -649483 -598485 -595522 -525406 -521558 -513910 -512702 -502912 -494107 -485891 -481914 -475635 -475148 -474400 -472993 -470028 -468361 -467710 -446226 -445469 -444249 -435744 -430112 -421497 -413069 -399829 -399106 -396941 -392596 -388650 -373519 -373172 -369580 -366166 -342461 -341217 -336641 -336132 -328219 -317509 -307936 -302033 -296239 -276251 -272717 -264993 -262894 -248521 -229718 -226772 -220160 -217782 -203676 -200782 -197590 -158532 -141295 -132104 -…
Output: -997469 -996650 -993341 -976197 -969524 -951062 -949490 -939202 -922084 -921782 -918281 -910939 -906075 -901549 -896848 -887544 -886252 -879745 -871100 -869931 -856816 -822007 -816154 -809220 -808194 -805183 -803104 -789463 -788674 -786921 -786742 -785911 -784667 -784612 -783337 -782983 -780673 -764135 -756728 -734960 -731694 -726629 -698624 -689226 -689013 -667715 -656967 -655148 -649483 -598485 -595522 -536886 -525406 -521558 -513910 -512702 -502912 -494107 -485891 -481914 -475635 -475148 -474400 -472993 -470028 -468361 -467710 -446226 -445469 -444249 -438155 -435744 -430112 -427281 -421497 -413069 -399829 -399106 -396941 -392596 -388650 -373519 -373172 -369580 -366166 -353725 -351519 -342461 -341634 -341217 -336641 -336132 -328219 -317509 -307936 -302033 -296239 -276251 -272717 -264993 …

Constraints:

1 <= n <= 528; -1000000 <= a[i],x <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Corwin's Ledger of weights - EASY Coding Problem | CodeTikki