CT22441

The K-th Mark Beneath Hammerfall

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Deep in the anvil district of Hammerfall, Rekha studies rows of shelves entries. One clean number will settle the guild's oldest argument. Task: Print the k-th smallest element (1-based; duplicates count separately). Input format: First line: n and k. Second line: n integers. Output format: Print the k-th smallest value. Constraints: 1 <= k <= n <= 316; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 123 44 916088369 677999831 439885074 64207943 765999455 906567999 997087582 69056754 225066875 501917514 654734265 900334988 219625344 582850605 706831263 641587699 680527507 993895703 451642302 185045258 767816438 397529586 193096674 787894898 295070932 422255372 282414151 906255289 920943503 748681455 78387035 560121217 102852342 296601466 23739135 856544236 801054115 480365148 591233893 648961528 812427614 116674576 30379732 698372314 413770466 168330313 449775875 981268084 403545671 81609371 317026608 280846270 245983927 904657122 491342906 448051363 516526913 678390331 277816836 987038714 203884472 985842567 145969599 360680369 6440806 416586104 996066197 255186281 286490935 580102099 196585570 908281094 361686698 421200019 853296141 313887343 42613262 930562629 338254993 741468394 874126050 156838189 554853681 617363213 70141888 10064994 777131764 7951452 451512167 611049633 993052680 955605826 44075448 484120263 489330923 924533281 484075988 75973926 572070952 328232604 944939947 45118857 437815021 620021741 617210308 792960572 105408863 24597180 94174824 162317461 48481049 812354496 425143680 251401434 442093844 335161708 -124616 812720773 867481158 820697796 94546310 112933290 639818304
Output: 317026608

Example 2:

Input: 222 92 429421752 614474892 35739956 807753271 837567688 278855198 250727498 359857392 855836552 64699841 369315537 413195041 599264433 107750788 834987026 505270252 790594873 820054769 308044688 876002044 241424008 156702012 449328257 561809349 464432171 489675347 341911611 505478333 978431312 7673297 228632100 198728901 678050770 853130258 818913114 596188648 133883014 194149577 805524691 78643183 422381294 644386343 321418380 380651981 356711953 414333363 639142864 467053384 949960748 146344532 438315033 5705108 703396369 760606743 492140569 944491209 484546151 273978764 969309488 295239695 443136736 677905162 748991491 586017533 655494908 69787901 351284180 376765016 68007109 818272015 566097906 678181347 446148294 644156193 993932618 377528818 189688163 458496691 430831633 22367407 335580716 478512052 506095436 807622050 605033156 418234747 392289149 672351177 607426852 938909448 503461226 961996543 162049740 335129845 911089473 942817485 636813947 162963981 660881248 101144934 968136876 89664275 291535716 964753499 928373563 326371712 754094687 258913537 829407303 481685458 730605968 965983504 759072189 46283329 398591102 742800444 105894773 504486018 145001538 305910643 742326444 735624055 987781319 507236205 309583636 698235319 794062022 1468869 771741945 855535098 842340839 232353403 320378685 86635095 786684460 294498557 207087141 175977447 20918878 438172997 382236677 857720778 434488830 275597088 17459476 619423316 875486535 16080233 50210835 612922536 580689335 119897248 938310517 110106864 562159582 500318244 379490609 132956666 667160982 958134205 218396069 716368459 105262648 830463521 20554411 678424888 425583363 713853156 276785260 533349263 727825008 321585218 617496538 363770575 407892847 237973168 724483055 315656668 354729600 960630821 98172561 529753171 462626523 919681689 753644537 459750546 460543189 504061351 828194552 894541868 445157085 863731098 465800038 920931227 463244452 481782586 515452042 241549682 233274023 611176483 341783176 703434886 861943914 606204684 640408681 256886938 342763630 549122435 981209104 218938698 641845063 965578488 535759395 562003920 828371573 723991250 455589699 819611860 758864002 571235522 670438327 184124762
Output: 438315033

Example 3:

Input: 116 41 175441722 7838942 448326231 416747901 434906424 861030355 752227437 151936248 981491271 727739358 356622019 192626496 412587147 389554521 493818153 895976896 937190049 526914905 374385982 382747039 426308274 879940050 720614961 426616272 551917664 880976855 31698933 845541672 615083963 400139392 591058231 149425813 37881477 872299483 842496971 476915943 319258200 324674880 597859865 781108295 969609350 57107543 763910635 340261181 659211573 876811878 932344416 254234467 978808691 109168501 129585401 16617464 818493487 568527248 633304742 191311779 922586164 186355969 678550414 683319921 460387727 289059258 151668198 177422701 66597911 424169070 559038865 268069604 375720945 686403786 515364883 985004294 224653696 839018245 838881491 937641200 823604367 126559482 263613129 434245873 785934217 544950080 881806519 992399436 643372036 101896719 910847537 928522405 298684252 246394121 31192875 321623783 259656734 631671574 224391830 961059768 757503112 264049651 721867619 185836329 311481218 152249309 391674073 44976893 818676110 300458876 480780620 791089152 343821917 49459264 798224682 992594783 288956673 755874408 124457562 989654762
Output: 340261181

Constraints:

1 <= k <= n <= 316; -1000000 <= a[i] <= 1000000000.

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