CT21894

Pearl ledgers Middle Mark

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the crystal caves of Luminar, someone must map a faster supply route. This year the task falls to Sable, armed only with the ledgers register. Task: Print the lower median: the element at position floor((n-1)/2) after sorting (so for even n it is the smaller of the two middles). Input format: First line: n. Second line: n integers. Output format: Print the lower median. Constraints: 1 <= n <= 394; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 12 628968934 493116478 289767628 995726850 914382359 202053215 463733538 286908618 274249792 127056293 962140128 372501823
Output: 372501823

Example 2:

Input: 171 49177997 164392611 146914902 800874178 203856306 931408772 164046188 10928344 62456618 408929472 457386229 499313571 454624854 562944243 107510740 452868957 243349998 698269530 697763991 268710768 579419954 739323013 3824007 212399 424496896 241743170 402007987 286576015 498950726 45448362 850406796 875365388 100790157 504317315 893187576 573908519 257427665 12515069 604239941 460598074 83779545 881849192 651540892 527290516 460939793 415684107 295854903 517193482 672099930 822184807 930188022 349180233 584050143 866909332 155702960 199065573 695156293 669298433 632756675 240295254 489516121 309192236 511166530 522155847 905985265 887161052 872848269 229124964 348065919 128038467 541868389 870682580 117332491 422772706 256428929 919425331 722415901 5729424 396122321 485518593 403282558 492640825 582186108 207823627 234332072 157134463 453641784 673211520 911834426 149070012 990668479 851758679 44033617 780130841 172317885 877227789 11019024 766980865 171207874 360518884 106657973 116026675 628078112 930430361 158679630 501517494 223849166 933553947 159175647 532488405 212800405 334532082 995214061 8768536 454046111 567024894 989809721 674236729 815720574 389930381 169576755 588435292 682056314 786707541 453211347 481149126 544062454 442793799 233228189 178292748 301311099 970695557 784178642 512293819 661042992 285339769 419022708 885101429 904826690 868318879 829020471 841272622 523873585 878730187 593333354 482689027 175459671 167344443 164659526 93698298 547762634 519377619 754494223 897177645 411390899 515125370 185200971 695036913 162532678 388747505 268234859 846493801 39725621 847455881 205434633 736300258 638520527 727028523 903297194 309682241 445037680
Output: 482689027

Example 3:

Input: 43 444972425 201037903 38699918 383014359 865492428 436100237 91484645 986824120 128785952 773776049 867331029 211220384 309387023 144062264 230426000 127746030 328144692 365833793 43881957 595110378 210324041 171913666 419454916 226039756 699573782 46222492 408988608 4729477 519463085 70988332 326824390 760148598 965860556 110631531 592408899 536670679 546492979 404653898 739501626 640576877 235156419 162228020 251791512
Output: 328144692

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Pearl ledgers Middle Mark - EASY Coding Problem | CodeTikki