CT25090

The Smoky Two-Ledger Merge

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The inventory keeper Tina has been asked to track the breeding season. On the desk lies a long table of ledgers 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 <= 277; 0 <= a[i],x <= 1000000000.

Example 1:

Input: 187 109 2241133 2920754 6312480 9378131 18350942 30655341 31218251 34187597 52335259 55236562 55323440 56016051 65398411 73013508 77035575 81552765 81855420 85358939 112870387 113901740 124636765 125418099 127356200 131770883 133342813 139036729 165885117 168170062 170118730 171020171 178214678 179677413 196917183 198244081 199642917 200650603 207290866 208699281 215083306 241335250 246164343 248135186 248740681 254852970 260943305 262537667 271044528 276183343 286596160 288238137 289074444 294677220 301599699 306942893 312697052 313198026 316828177 321496979 325136712 330197756 346242224 353512173 364839153 367272592 381400029 385536803 386220070 391872946 391949670 392546173 394976363 397040975 402211424 403658743 412728306 416655957 416902400 417909205 427116488 431506891 431983328 4335…
Output: 2241133 2920754 5826610 6312480 9378131 9847302 10999108 18350942 20925644 24312010 26713669 30655341 31218251 34187597 36618788 52335259 53336667 55236562 55323440 55583407 56016051 63289520 65398411 69441778 73013508 76091017 77035575 81552765 81855420 82671258 85358939 101917342 112870387 113901740 124636765 125418099 127356200 129070152 131257017 131770883 133342813 136943714 138330400 139036729 149616758 164009510 165885117 165976403 166623562 168170062 170118730 171020171 175463065 178214678 179677413 196389380 196917183 198244081 199642917 200650603 207290866 207492999 208699281 210586057 214806556 214965220 215083306 235593536 241335250 246164343 248135186 248740681 250205192 250940842 254852970 257158019 259091371 260943305 262537667 271044528 276183343 283320837 286596160 2869063…

Example 2:

Input: 145 14 3662386 5153093 8658494 28523677 33138652 39798276 47229568 47503326 55978466 88755115 89213807 94890188 104605408 108677967 110193391 115116928 123689304 124820750 130545094 138172548 153347294 155514066 159662310 160878276 163087967 165839361 168467564 184214912 191947841 217284736 225527981 233676788 233747948 241642507 256335836 260751879 278760705 286325756 286555162 299562687 302059199 320760046 325680544 327001709 340931764 345921255 350119678 353135447 373447209 395501563 397450391 401565233 404276790 409919253 411633891 414107080 423742900 428570448 434555847 434730922 451806911 457705946 487640513 489424820 492893379 495712542 517761819 527530156 545726318 548933326 550979764 557765514 560996940 561332035 563606764 563819090 565206724 583404605 595994975 604466045 60886005…
Output: 3662386 5153093 8658494 28523677 33138652 39798276 47229568 47503326 55978466 88645463 88755115 89213807 94890188 104605408 108677967 110193391 115116928 123689304 124820750 130545094 138172548 153347294 155514066 159662310 160878276 163087967 165839361 168467564 168524848 184214912 191947841 206572204 212418806 217284736 225527981 233676788 233747948 241642507 256335836 260751879 278760705 286325756 286555162 299562687 302059199 311816426 320760046 325680544 327001709 340931764 345921255 350119678 353135447 356960658 373447209 395501563 397450391 401565233 404276790 405573341 409919253 411633891 414107080 423742900 428570448 434555847 434730922 451806911 457705946 487640513 489424820 492893379 495712542 517761819 527530156 528245030 545726318 548933326 550979764 557765514 560996940 561332…

Example 3:

Input: 70 227 2145921 37358179 63504631 68037180 70819125 75123164 75869503 76614378 109923367 118364212 172449310 197552209 199800224 199833955 220890964 254884555 269986491 278210280 294821790 312527955 325784893 325999795 342884664 357690517 372272802 386030855 400895171 410347869 420903861 439819359 440017868 440159144 447069347 450605944 476767300 485129706 490104278 494759938 500065316 500381230 510713498 522955042 540847808 560322536 580788765 586579484 601168959 612493755 614743457 615492277 627423650 666887435 670286766 690950350 715880176 719857819 752543837 788082029 827277919 842013015 844634212 845087229 878848661 894387554 897073029 900085687 922456561 926393313 929133929 980921971 4468893 4608550 11580260 14968185 18224207 24513409 26822512 34275991 42779596 45447902 45919405 61714…
Output: 2145921 4468893 4608550 11580260 14968185 18224207 24513409 26822512 34275991 37358179 42779596 45447902 45919405 61714951 63504631 64696873 66363452 68037180 70819125 75123164 75869503 75979610 76614378 85790924 91928214 95111258 97369562 98847799 99441061 102257579 104413011 106497293 109923367 118364212 118807541 119937544 122235913 122815066 125224355 125326415 128709380 131061658 136296546 136333844 141983828 142649946 146423769 157631156 159133730 164753549 170672517 172449310 179120783 189595762 197552209 199800224 199833955 207113020 210739939 214405043 220890964 225950732 227162040 229874533 231729899 234609312 239145481 247016785 249875093 252972921 254036456 254674832 254884555 261695425 269986491 278210280 279292707 280272291 281001605 287886240 288147625 289755707 293290019 29…

Constraints:

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

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