CT25819

Wasim's Ledger of ledgers

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the ember mines of Cindercrag as Wasim unrolls the day's manifest of ledgers. The tally will decide the next shipment. Task: Sort the array by absolute value ascending; for equal |x|, the smaller value comes first. Print the sorted array. Input format: First line: n. Second line: n integers. Output format: Print the sorted values space-separated. Constraints: 1 <= n <= 281; -1000000 <= a[i],x <= 1000000.

Example 1:

Input: 182 -79487 -111839 -25575 123000 -816164 -248818 141620 352557 -157130 61193 -784824 -790648 914749 573170 -314621 630102 -926744 794576 -183633 540577 617104 -338621 572463 75991 -626663 675184 -639061 -145992 -218512 -190740 -681200 572367 671583 32190 720898 542272 952644 65887 822529 736753 -705187 -855316 -648923 1477 342698 294647 -356289 -801747 -164057 -524923 672706 991083 -337710 -560823 -669380 -206523 247083 46657 -236241 -617856 -560646 -930674 -120401 -650152 -26534 -969125 -153093 69384 615878 552926 413449 729487 -796914 -105376 -80854 -675456 -460760 419613 529471 -825943 -716328 516353 -296349 43897 888497 608446 86577 402484 689243 -618726 -369917 515743 554072 -296681 957317 -170719 -567768 -520741 493206 670330 -560647 352097 -519652 -431418 876010 -634340 -157115 5455…
Output: 531 1477 24140 -25575 -26534 -27864 32190 36265 43897 46657 -48601 -48651 -54756 -56507 60843 61193 65887 66561 69384 75991 -79487 -80854 86577 -92673 -96200 -105376 -111839 -120401 123000 -125911 -129465 133290 141620 -145992 -153093 -157115 -157130 -164057 -164104 165882 -170719 170872 171039 -182615 -183098 -183633 -190740 197194 -202198 -206523 208827 213871 -216279 -218512 225533 -236241 237930 247083 -248818 267831 268874 269709 -272907 289008 294647 -294829 -296349 -296681 304037 -314621 321148 328421 -337710 -338621 342698 352097 352557 -356289 -369917 -375346 402484 409876 413449 419613 422172 -427652 -431418 -448481 -460760 -486506 -487599 493206 493554 -508187 -514013 515743 516353 -519652 -520741 -524923 529471 -538722 540577 542272 545509 552926 554072 554705 -560646 -560647 -…

Example 2:

Input: 126 915637 -752399 107201 -275628 -664488 -158588 -569653 -457910 407995 317111 275069 930356 59555 487385 -746127 402939 810207 485386 -517900 -888210 -612592 -401715 -738606 188970 -472725 -642525 66239 -212784 -91582 806340 471630 13007 -748775 41075 -959840 541381 -137827 -75449 -222188 790533 408982 841371 -713353 -750442 642208 997620 -212054 -54388 -671386 388887 325400 735918 -204401 -655954 -638160 -16764 -323499 -777428 496160 877294 -381874 635312 -586295 -279334 -832825 -725581 714221 297986 -197980 990772 78069 -567170 283260 509923 976589 -210224 -579990 761252 436554 167332 -706160 809777 222334 -405179 86575 501761 -777921 -356292 -277115 -232264 474061 -523301 -649644 -597880 601780 243018 -935335 118647 688055 613326 851761 380761 272185 91520 535514 -889608 -905252 -5598…
Output: -10893 13007 -16764 41075 -43671 -54388 59555 66239 72018 -75449 78069 86575 91520 -91582 107201 118647 -137827 -158588 167332 188970 -197980 -204401 -210224 -212054 -212784 -222188 222334 -232264 243018 -248725 -261344 272185 275069 -275628 -277115 -279334 283260 297986 317111 319291 -323499 325400 -356292 380761 -381874 388887 -401715 402939 -405179 407995 408982 436554 -457910 471630 -472725 474061 485386 487385 496160 -496341 501761 509923 -517900 -523301 -524115 535514 541381 -559853 -567170 -569653 -579990 -586295 588233 -597880 601780 -612592 613326 635312 -638160 642208 -642525 -649644 -655954 -664488 -671386 672901 688055 -706160 -713353 714221 -725581 735918 -738606 -746127 -748775 -750442 -752399 761252 -777428 -777921 787400 790533 -799844 806340 809777 810207 -832825 841371 85…

Example 3:

Input: 26 761311 1311 837281 -916409 -904461 262639 447202 -42982 713983 580413 -284956 -709071 529701 -607925 989558 -350763 -304491 -470744 447859 939984 215496 331631 -31090 -991874 959678 268092
Output: 1311 -31090 -42982 215496 262639 268092 -284956 -304491 331631 -350763 447202 447859 -470744 529701 580413 -607925 -709071 713983 761311 837281 -904461 -916409 939984 959678 989558 -991874

Constraints:

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

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