CT21795

Rohan Counts the shelves

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The cartographer Rohan has been asked to verify the ledger before the auditors arrive. On the desk lies a long table of shelves readings. 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 <= 729; -1000000000 <= a[i],x <= 1000000.

Example 1:

Input: 175 604 -994035609 -990738298 -987852441 -979936533 -976632701 -965011616 -964578005 -964215738 -960636052 -955903427 -950547175 -942950831 -934895038 -927498171 -918976872 -912271946 -900372901 -898859287 -896998190 -896854954 -894980773 -893350158 -891039982 -873725135 -870492509 -867859613 -867773952 -860638049 -853913824 -851410528 -851004871 -849038601 -839543957 -837996193 -835209805 -833204841 -832769465 -822770257 -821190000 -818208681 -813322397 -810631882 -799022686 -798252869 -795574635 -789781114 -785408640 -785111787 -784109616 -774450065 -763801415 -760386151 -754163793 -751772239 -748865560 -744996933 -736137518 -735457983 -731444883 -729650658 -725069631 -719493530 -707660490 -701964015 -701438151 -694818369 -686811744 -678350255 -668596133 -666615048 -664095539 -662766742 …
Output: -999916871 -998956813 -997274536 -996015405 -994035609 -993031064 -992442166 -992398970 -991325952 -990738298 -990555120 -989430896 -987959229 -987852441 -985219844 -985132893 -984307187 -981756662 -981109647 -980517724 -980048162 -979936533 -979609180 -979498686 -976632701 -975041994 -971574083 -971296751 -968400029 -968047473 -966491751 -965867444 -965250258 -965011616 -964578005 -964215738 -963198765 -963040139 -962597091 -960636052 -960165491 -957303020 -955903427 -953387626 -953323381 -952932248 -950918013 -950547175 -950281455 -949423075 -948251486 -945119988 -942950831 -940497423 -935387144 -935179095 -934959575 -934912896 -934895038 -933965529 -932542857 -931391726 -930488077 -928939134 -927498171 -925717921 -924904939 -922053054 -920497235 -920468577 -918976872 -917857637 -9144931…

Example 2:

Input: 225 555 -994672711 -994123952 -986560196 -984198703 -977684005 -974352289 -965041319 -948695571 -947637503 -942762061 -941516442 -933327158 -930573919 -925162710 -918266460 -917260506 -916175129 -914384888 -908234197 -899648371 -898511277 -879809161 -876532651 -873575269 -864128783 -862287365 -858473002 -850931092 -843263601 -837258224 -832829336 -832001031 -827771189 -823026878 -821896083 -810702003 -810206352 -806902952 -799602583 -795323741 -793208303 -786218309 -785705548 -783853653 -781694814 -777263191 -775905013 -765641924 -764832031 -763989286 -753805121 -749929218 -748590603 -742255935 -739903120 -734203390 -730610419 -723888731 -714427131 -713700946 -712174273 -700126621 -678114852 -661255099 -656334724 -653472030 -639255626 -637763839 -637085441 -636177317 -633642469 -632963716 …
Output: -999102820 -997369839 -995526077 -994672711 -994123952 -993433816 -993294702 -990246048 -990088408 -988393949 -986560196 -986016127 -985018261 -984198703 -982598290 -981301056 -980409728 -978930856 -978738030 -977684005 -975521170 -974352289 -973669950 -969617865 -968776935 -968635183 -967279510 -965804759 -965041319 -963192134 -962308858 -960472443 -959639144 -958117656 -958023829 -957378775 -952226687 -951017399 -950407537 -948881046 -948695571 -947637503 -945320370 -944455201 -942762061 -941516442 -938083685 -935869165 -935614073 -934094181 -933327158 -933313103 -932977933 -930573919 -929901780 -927548069 -927502377 -925162710 -924919937 -922280178 -920575162 -919699343 -918266460 -917260506 -916175129 -915408059 -914384888 -914183715 -913388878 -908234197 -906111424 -905835335 -9013291…

Example 3:

Input: 237 220 -996456112 -995523077 -990753619 -990292335 -989516257 -987281682 -986126915 -981381528 -967792315 -957306341 -954196475 -952240138 -940952021 -940560675 -935339324 -934098925 -924969070 -922452002 -922083418 -919769790 -904433092 -894789180 -894705729 -894168516 -891065268 -890685557 -883824814 -881989437 -881954795 -881417352 -881185627 -877742691 -876950108 -873743155 -873434210 -869803208 -855605492 -844622870 -844244796 -843482953 -843185577 -840213374 -838873433 -836026777 -823694378 -819602169 -818824912 -818303547 -815940347 -815209884 -807125952 -804493205 -804085762 -802391220 -799743217 -795164142 -794252947 -785595918 -784149381 -778979623 -773585048 -771657809 -770583877 -767662208 -765812256 -765585084 -761799165 -756818974 -753589158 -752259025 -752006843 -750925448 …
Output: -996502827 -996456112 -995523077 -994276145 -990753619 -990352813 -990292335 -989890203 -989516257 -987281682 -986695514 -986126915 -985450471 -984691534 -981381528 -968439625 -967792315 -963333168 -957306341 -954196475 -952240138 -943467595 -940952021 -940560675 -935339324 -934098925 -932698716 -924969070 -922452002 -922083418 -921417067 -919769790 -918615847 -918304410 -917099285 -912814450 -906438064 -904819907 -904433092 -900465600 -894789180 -894705729 -894168516 -892199095 -891535208 -891065268 -890685557 -884247620 -883824814 -881989437 -881954795 -881417352 -881185627 -879290455 -877742691 -876950108 -874345832 -873743155 -873434210 -869803208 -861954089 -857447128 -855605492 -849034227 -848718750 -846568621 -844622870 -844244796 -843482953 -843185577 -840213374 -839793716 -8388734…

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Rohan Counts the shelves - EASY Coding Problem | CodeTikki