node_ids
listlengths
4
1.4k
edge_index
listlengths
1
2.22k
text
listlengths
4
1.4k
source
stringlengths
14
427k
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 14, 2, 13, 17, 29, 13, 29, 4, 13, 2, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 2, 13, 13, 4, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 11, 1, 41, 13, 2, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 18, 13, 13, 2, 13, 18, 13, 13, 0, 13, 4, 18, 13, 13, 13, 29, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 20, 17, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 23, 13, 12, 13, 30, 14, 2, 13, 40, 17, 37, 20, 14, 2, 13, 13, 30, 0, 13, 17, 38, 5, 13, 30, 37, 20, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 29, 40, 17, 29, 18, 13, 40, 13, 12, 13, 30, 41, 13, 20, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 2, 40, 4, 13, 13, 2, 13, 17, 30, 14, 2, 2, 13, 17, 2, 13, 17, 29, 2, 13, 4, 18, 13, 17, 4, 13, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 14, 2, 13, 17, 30, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 29, 2, 13, 4, 18, 13, 17, 4, 13, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 2, 13, 17, 13, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 29, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 20, 42, 40, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 14, 2, 13, 17, 29, 4, 18, 13, 13, 29, 2, 2, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 23, 13, 6, 13, 12, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 0, 18, 36, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 8, 2, 13, 17, 17, 2, 4, 18, 13, 17, 8, 2, 13, 17, 17, 4, 18, 13, 12, 13, 30, 14, 2, 36, 13, 29, 17, 14, 2, 2, 13, 17, 2, 4, 13, 4, 18, 13, 29, 17, 41, 13, 13, 29, 2, 8, 2, 13, 17, 2, 18, 13, 13, 17, 4, 18, 13, 18, 13, 13, 8, 2, 13, 17, 2, 18, 13, 13, 17, 4, 18, 13, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 13, 18, 13, 13, 29, 8, 2, 13, 17, 13, 4, 18, 13, 18, 13, 13, 23, 13, 12, 13, 30, 29, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 800, 11 ], [ 800, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 16, 17 ], [ 16, 18 ], [ 15, 19 ], [ 19, 20 ], [ 14, 21 ], [ 21, 22 ], [ 22, 23 ], [ 22, 24 ], [ 24, 25 ], [ 24, 26 ], [ 22, 27 ], [ 12, 28 ], [ 28, 29 ], [ 12, 30 ], [ 30, 31 ], [ 800, 32 ], [ 32, 33 ], [ 32, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 36, 40 ], [ 40, 41 ], [ 40, 42 ], [ 40, 43 ], [ 32, 44 ], [ 44, 45 ], [ 32, 46 ], [ 46, 47 ], [ 800, 48 ], [ 48, 49 ], [ 48, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 53, 55 ], [ 50, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 58, 60 ], [ 50, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 65, 67 ], [ 61, 68 ], [ 68, 69 ], [ 68, 70 ], [ 61, 71 ], [ 71, 72 ], [ 72, 73 ], [ 61, 74 ], [ 75, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 78, 81 ], [ 81, 82 ], [ 81, 83 ], [ 78, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 86, 88 ], [ 75, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 92, 93 ], [ 91, 94 ], [ 91, 95 ], [ 50, 96 ], [ 96, 97 ], [ 48, 98 ], [ 98, 99 ], [ 48, 100 ], [ 100, 101 ], [ 48, 102 ], [ 102, 103 ], [ 800, 104 ], [ 104, 105 ], [ 104, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 109, 111 ], [ 106, 112 ], [ 112, 113 ], [ 112, 114 ], [ 114, 115 ], [ 114, 116 ], [ 106, 117 ], [ 117, 118 ], [ 117, 119 ], [ 106, 120 ], [ 120, 121 ], [ 120, 122 ], [ 106, 123 ], [ 123, 124 ], [ 123, 125 ], [ 125, 126 ], [ 126, 127 ], [ 106, 128 ], [ 128, 129 ], [ 128, 130 ], [ 130, 131 ], [ 131, 132 ], [ 106, 133 ], [ 133, 134 ], [ 133, 135 ], [ 106, 137 ], [ 137, 138 ], [ 137, 139 ], [ 106, 140 ], [ 140, 141 ], [ 141, 142 ], [ 142, 143 ], [ 142, 144 ], [ 140, 145 ], [ 145, 146 ], [ 145, 147 ], [ 140, 148 ], [ 148, 149 ], [ 149, 150 ], [ 140, 151 ], [ 152, 152 ], [ 152, 153 ], [ 153, 154 ], [ 154, 155 ], [ 154, 156 ], [ 153, 157 ], [ 157, 158 ], [ 158, 159 ], [ 106, 160 ], [ 160, 161 ], [ 161, 162 ], [ 160, 163 ], [ 106, 164 ], [ 164, 165 ], [ 165, 166 ], [ 166, 167 ], [ 166, 168 ], [ 164, 169 ], [ 169, 170 ], [ 169, 171 ], [ 164, 172 ], [ 172, 173 ], [ 173, 174 ], [ 164, 175 ], [ 176, 176 ], [ 176, 177 ], [ 177, 178 ], [ 177, 179 ], [ 179, 180 ], [ 179, 181 ], [ 106, 182 ], [ 182, 183 ], [ 183, 184 ], [ 182, 185 ], [ 106, 186 ], [ 186, 187 ], [ 187, 188 ], [ 104, 189 ], [ 189, 190 ], [ 800, 191 ], [ 191, 192 ], [ 191, 193 ], [ 193, 194 ], [ 191, 195 ], [ 195, 196 ], [ 195, 197 ], [ 191, 199 ], [ 199, 200 ], [ 191, 201 ], [ 201, 202 ], [ 191, 203 ], [ 203, 204 ], [ 191, 205 ], [ 205, 206 ], [ 205, 207 ], [ 207, 208 ], [ 208, 209 ], [ 209, 210 ], [ 209, 211 ], [ 208, 212 ], [ 205, 213 ], [ 213, 214 ], [ 191, 215 ], [ 215, 216 ], [ 215, 217 ], [ 217, 218 ], [ 218, 219 ], [ 219, 220 ], [ 219, 221 ], [ 221, 222 ], [ 218, 223 ], [ 223, 224 ], [ 217, 225 ], [ 225, 226 ], [ 226, 227 ], [ 226, 228 ], [ 225, 229 ], [ 229, 230 ], [ 230, 231 ], [ 230, 232 ], [ 229, 233 ], [ 233, 234 ], [ 234, 235 ], [ 234, 236 ], [ 236, 237 ], [ 237, 238 ], [ 233, 239 ], [ 239, 240 ], [ 240, 241 ], [ 240, 242 ], [ 242, 243 ], [ 243, 244 ], [ 242, 245 ], [ 229, 246 ], [ 246, 247 ], [ 247, 248 ], [ 247, 249 ], [ 246, 250 ], [ 250, 251 ], [ 251, 252 ], [ 217, 253 ], [ 253, 254 ], [ 254, 255 ], [ 254, 256 ], [ 256, 257 ], [ 191, 258 ], [ 258, 259 ], [ 258, 260 ], [ 260, 261 ], [ 261, 262 ], [ 261, 263 ], [ 260, 264 ], [ 264, 265 ], [ 264, 266 ], [ 260, 267 ], [ 267, 268 ], [ 268, 269 ], [ 268, 270 ], [ 270, 271 ], [ 271, 272 ], [ 272, 273 ], [ 267, 274 ], [ 274, 275 ], [ 275, 276 ], [ 275, 277 ], [ 277, 278 ], [ 278, 279 ], [ 260, 280 ], [ 280, 281 ], [ 191, 282 ], [ 282, 283 ], [ 282, 284 ], [ 284, 285 ], [ 285, 286 ], [ 285, 287 ], [ 287, 288 ], [ 284, 289 ], [ 289, 290 ], [ 290, 291 ], [ 290, 292 ], [ 289, 293 ], [ 293, 294 ], [ 293, 295 ], [ 295, 296 ], [ 284, 297 ], [ 297, 298 ], [ 297, 299 ], [ 284, 300 ], [ 300, 301 ], [ 301, 302 ], [ 301, 303 ], [ 300, 304 ], [ 304, 305 ], [ 305, 306 ], [ 305, 307 ], [ 307, 308 ], [ 304, 309 ], [ 309, 310 ], [ 309, 311 ], [ 311, 312 ], [ 284, 313 ], [ 313, 314 ], [ 313, 315 ], [ 284, 316 ], [ 316, 317 ], [ 317, 318 ], [ 318, 319 ], [ 318, 320 ], [ 316, 321 ], [ 321, 322 ], [ 322, 323 ], [ 323, 324 ], [ 324, 325 ], [ 324, 326 ], [ 323, 327 ], [ 327, 328 ], [ 327, 329 ], [ 322, 330 ], [ 330, 331 ], [ 321, 332 ], [ 332, 333 ], [ 332, 334 ], [ 321, 335 ], [ 335, 336 ], [ 335, 337 ], [ 337, 338 ], [ 337, 339 ], [ 321, 340 ], [ 340, 341 ], [ 340, 342 ], [ 342, 343 ], [ 284, 344 ], [ 344, 345 ], [ 345, 346 ], [ 345, 347 ], [ 191, 348 ], [ 348, 349 ], [ 348, 350 ], [ 350, 351 ], [ 351, 352 ], [ 351, 353 ], [ 353, 354 ], [ 350, 355 ], [ 355, 356 ], [ 356, 357 ], [ 356, 358 ], [ 355, 359 ], [ 359, 360 ], [ 359, 361 ], [ 361, 362 ], [ 350, 363 ], [ 363, 364 ], [ 363, 365 ], [ 350, 366 ], [ 366, 367 ], [ 367, 368 ], [ 367, 369 ], [ 366, 370 ], [ 370, 371 ], [ 371, 372 ], [ 371, 373 ], [ 373, 374 ], [ 370, 375 ], [ 375, 376 ], [ 375, 377 ], [ 377, 378 ], [ 350, 379 ], [ 379, 380 ], [ 379, 381 ], [ 350, 382 ], [ 382, 383 ], [ 383, 384 ], [ 384, 385 ], [ 384, 386 ], [ 382, 387 ], [ 387, 388 ], [ 388, 389 ], [ 389, 390 ], [ 390, 391 ], [ 390, 392 ], [ 389, 393 ], [ 393, 394 ], [ 393, 395 ], [ 388, 396 ], [ 396, 397 ], [ 387, 398 ], [ 398, 399 ], [ 398, 400 ], [ 387, 401 ], [ 401, 402 ], [ 401, 403 ], [ 403, 404 ], [ 403, 405 ], [ 387, 406 ], [ 406, 407 ], [ 406, 408 ], [ 408, 409 ], [ 350, 410 ], [ 410, 411 ], [ 411, 412 ], [ 411, 413 ], [ 191, 414 ], [ 414, 415 ], [ 414, 416 ], [ 416, 417 ], [ 417, 418 ], [ 417, 419 ], [ 419, 420 ], [ 416, 421 ], [ 421, 422 ], [ 422, 423 ], [ 422, 424 ], [ 421, 425 ], [ 425, 426 ], [ 425, 427 ], [ 427, 428 ], [ 416, 429 ], [ 429, 430 ], [ 429, 431 ], [ 416, 432 ], [ 432, 433 ], [ 433, 434 ], [ 433, 435 ], [ 432, 436 ], [ 436, 437 ], [ 437, 438 ], [ 437, 439 ], [ 439, 440 ], [ 436, 441 ], [ 441, 442 ], [ 441, 443 ], [ 443, 444 ], [ 416, 445 ], [ 445, 446 ], [ 445, 447 ], [ 416, 448 ], [ 448, 449 ], [ 449, 450 ], [ 450, 451 ], [ 451, 452 ], [ 451, 453 ], [ 449, 454 ], [ 454, 455 ], [ 454, 456 ], [ 448, 457 ], [ 457, 458 ], [ 458, 459 ], [ 459, 460 ], [ 460, 461 ], [ 460, 462 ], [ 459, 463 ], [ 463, 464 ], [ 463, 465 ], [ 458, 466 ], [ 466, 467 ], [ 467, 468 ], [ 467, 469 ], [ 469, 470 ], [ 470, 471 ], [ 469, 472 ], [ 469, 473 ], [ 473, 474 ], [ 457, 475 ], [ 475, 476 ], [ 476, 477 ], [ 477, 478 ], [ 477, 479 ], [ 476, 480 ], [ 480, 481 ], [ 480, 482 ], [ 475, 483 ], [ 483, 484 ], [ 457, 485 ], [ 485, 486 ], [ 485, 487 ], [ 457, 488 ], [ 488, 489 ], [ 488, 490 ], [ 490, 491 ], [ 490, 492 ], [ 457, 493 ], [ 493, 494 ], [ 493, 495 ], [ 495, 496 ], [ 416, 497 ], [ 497, 498 ], [ 498, 499 ], [ 498, 500 ], [ 497, 501 ], [ 501, 502 ], [ 502, 503 ], [ 502, 504 ], [ 504, 505 ], [ 501, 506 ], [ 506, 507 ], [ 506, 508 ], [ 501, 509 ], [ 509, 510 ], [ 510, 511 ], [ 511, 512 ], [ 511, 513 ], [ 509, 514 ], [ 514, 515 ], [ 515, 516 ], [ 516, 517 ], [ 517, 518 ], [ 517, 519 ], [ 516, 520 ], [ 520, 521 ], [ 520, 522 ], [ 515, 523 ], [ 523, 524 ], [ 524, 525 ], [ 524, 526 ], [ 526, 527 ], [ 527, 528 ], [ 526, 529 ], [ 526, 530 ], [ 530, 531 ], [ 514, 532 ], [ 532, 533 ], [ 533, 534 ], [ 534, 535 ], [ 534, 536 ], [ 533, 537 ], [ 537, 538 ], [ 537, 539 ], [ 532, 540 ], [ 540, 541 ], [ 514, 542 ], [ 542, 543 ], [ 542, 544 ], [ 514, 545 ], [ 545, 546 ], [ 545, 547 ], [ 547, 548 ], [ 548, 549 ], [ 548, 550 ], [ 547, 551 ], [ 514, 552 ], [ 552, 553 ], [ 552, 554 ], [ 554, 555 ], [ 416, 556 ], [ 556, 557 ], [ 557, 558 ], [ 557, 559 ], [ 191, 560 ], [ 560, 561 ], [ 560, 562 ], [ 562, 563 ], [ 563, 564 ], [ 563, 565 ], [ 565, 566 ], [ 562, 567 ], [ 567, 568 ], [ 568, 569 ], [ 568, 570 ], [ 567, 571 ], [ 571, 572 ], [ 571, 573 ], [ 573, 574 ], [ 562, 575 ], [ 575, 576 ], [ 191, 577 ], [ 577, 578 ], [ 577, 579 ], [ 579, 580 ], [ 580, 581 ], [ 580, 582 ], [ 582, 583 ], [ 579, 584 ], [ 584, 585 ], [ 585, 586 ], [ 585, 587 ], [ 584, 588 ], [ 588, 589 ], [ 588, 590 ], [ 590, 591 ], [ 579, 592 ], [ 592, 593 ], [ 592, 594 ], [ 579, 595 ], [ 595, 596 ], [ 596, 597 ], [ 597, 598 ], [ 597, 599 ], [ 595, 600 ], [ 600, 601 ], [ 601, 602 ], [ 602, 603 ], [ 601, 604 ], [ 600, 605 ], [ 605, 606 ], [ 605, 607 ], [ 607, 608 ], [ 579, 609 ], [ 609, 610 ], [ 610, 611 ], [ 611, 612 ], [ 191, 613 ], [ 613, 614 ], [ 613, 615 ], [ 615, 616 ], [ 616, 617 ], [ 617, 618 ], [ 617, 619 ], [ 616, 620 ], [ 620, 621 ], [ 621, 622 ], [ 622, 623 ], [ 621, 624 ], [ 615, 625 ], [ 625, 626 ], [ 629, 627 ], [ 639, 628 ], [ 636, 629 ], [ 629, 630 ], [ 630, 631 ], [ 630, 632 ], [ 629, 633 ], [ 633, 634 ], [ 633, 635 ], [ 636, 636 ], [ 636, 637 ], [ 636, 638 ], [ 639, 639 ], [ 639, 640 ], [ 639, 641 ], [ 629, 642 ], [ 642, 643 ], [ 642, 644 ], [ 644, 645 ], [ 613, 646 ], [ 646, 647 ], [ 191, 648 ], [ 648, 649 ], [ 648, 650 ], [ 650, 651 ], [ 650, 652 ], [ 652, 653 ], [ 800, 654 ], [ 654, 655 ], [ 654, 656 ], [ 656, 657 ], [ 654, 658 ], [ 658, 659 ], [ 654, 660 ], [ 660, 661 ], [ 660, 662 ], [ 662, 663 ], [ 663, 664 ], [ 664, 665 ], [ 664, 666 ], [ 663, 667 ], [ 662, 668 ], [ 668, 669 ], [ 669, 670 ], [ 669, 671 ], [ 668, 672 ], [ 660, 673 ], [ 673, 674 ], [ 660, 675 ], [ 675, 676 ], [ 654, 677 ], [ 677, 678 ], [ 677, 679 ], [ 679, 680 ], [ 680, 681 ], [ 681, 682 ], [ 682, 683 ], [ 683, 684 ], [ 683, 685 ], [ 682, 686 ], [ 682, 687 ], [ 687, 688 ], [ 688, 689 ], [ 689, 690 ], [ 687, 691 ], [ 681, 692 ], [ 692, 693 ], [ 693, 694 ], [ 693, 695 ], [ 692, 696 ], [ 692, 697 ], [ 697, 698 ], [ 698, 699 ], [ 654, 700 ], [ 700, 701 ], [ 700, 702 ], [ 702, 703 ], [ 703, 704 ], [ 704, 705 ], [ 704, 706 ], [ 703, 707 ], [ 707, 708 ], [ 702, 709 ], [ 709, 710 ], [ 710, 711 ], [ 711, 712 ], [ 711, 713 ], [ 710, 714 ], [ 714, 715 ], [ 715, 716 ], [ 714, 717 ], [ 717, 718 ], [ 718, 719 ], [ 709, 720 ], [ 720, 721 ], [ 702, 722 ], [ 722, 723 ], [ 722, 724 ], [ 702, 725 ], [ 725, 726 ], [ 726, 727 ], [ 727, 728 ], [ 728, 729 ], [ 728, 730 ], [ 727, 731 ], [ 731, 732 ], [ 732, 733 ], [ 732, 734 ], [ 731, 735 ], [ 727, 736 ], [ 736, 737 ], [ 737, 738 ], [ 736, 739 ], [ 739, 740 ], [ 739, 741 ], [ 726, 742 ], [ 742, 743 ], [ 743, 744 ], [ 743, 745 ], [ 742, 746 ], [ 746, 747 ], [ 747, 748 ], [ 747, 749 ], [ 746, 750 ], [ 742, 751 ], [ 751, 752 ], [ 752, 753 ], [ 751, 754 ], [ 754, 755 ], [ 754, 756 ], [ 700, 757 ], [ 757, 758 ], [ 654, 759 ], [ 759, 760 ], [ 759, 761 ], [ 761, 762 ], [ 762, 763 ], [ 762, 764 ], [ 764, 765 ], [ 765, 766 ], [ 764, 767 ], [ 767, 768 ], [ 767, 769 ], [ 761, 770 ], [ 770, 771 ], [ 771, 772 ], [ 772, 773 ], [ 772, 774 ], [ 771, 775 ], [ 771, 776 ], [ 776, 777 ], [ 777, 778 ], [ 776, 779 ], [ 779, 780 ], [ 779, 781 ], [ 759, 782 ], [ 782, 783 ], [ 654, 784 ], [ 784, 785 ], [ 784, 786 ], [ 786, 787 ], [ 787, 788 ], [ 788, 789 ], [ 789, 790 ], [ 788, 791 ], [ 788, 792 ], [ 792, 793 ], [ 793, 794 ], [ 788, 795 ], [ 795, 796 ], [ 796, 797 ], [ 654, 798 ], [ 0, 799 ], [ 799, 800 ], [ 799, 801 ] ]
[ "\nimport java.io.*;\nimport java.util.*;\nimport java.lang.*;\n\npublic class Main{\n public static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n public String nextLine() {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n while(isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n public char nextChar() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n return (char)c;\n }\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n return res.toString();\n }\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n \n public static void main(String args[])\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader sc = new FastReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n \n int sum = 0;\n for(int i = 0; i < n; i++)\n {\n \ta[i] = sc.nextInt();\n }\n \n Arrays.sort(a);\n for(int i = 0; i < k; i++)\n {\n \tsum += a[i];\n }\n \n w.println(sum);\n w.close();\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "public class Main{\n public static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n public String nextLine() {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n while(isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n public char nextChar() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n return (char)c;\n }\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n return res.toString();\n }\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n \n public static void main(String args[])\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader sc = new FastReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n \n int sum = 0;\n for(int i = 0; i < n; i++)\n {\n \ta[i] = sc.nextInt();\n }\n \n Arrays.sort(a);\n for(int i = 0; i < k; i++)\n {\n \tsum += a[i];\n }\n \n w.println(sum);\n w.close();\n }\n}", "Main", "static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }", "gcd", "{\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }", "if (a == 0)\n return b;", "a == 0", "a", "0", "return b;", "b", "return gcd(b % a, a);", "gcd(b % a, a)", "gcd", "b % a", "b", "a", "a", "long a", "a", "long b", "b", "static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }", "lcm", "{\n return (a*b)/gcd(a, b); \n }", "return (a*b)/gcd(a, b);", "(a*b)/gcd(a, b)", "(a*b)", "a", "b", "gcd(a, b)", "gcd", "a", "b", "long a", "a", "long b", "b", "static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }", "func", "{\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }", "long max1=a[s];", "max1", "a[s]", "a", "s", "long maxc=a[s];", "maxc", "a[s]", "a", "s", "for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }", "int i=s+1;", "int i=s+1;", "i", "s+1", "s", "1", "i<size", "i", "size", "i++", "i++", "i", "{\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }", "{\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }", "maxc=Math.max(a[i],maxc+a[i])", "maxc", "Math.max(a[i],maxc+a[i])", "Math.max", "Math", "a[i]", "a", "i", "maxc+a[i]", "maxc", "a[i]", "a", "i", "max1=Math.max(maxc,max1)", "max1", "Math.max(maxc,max1)", "Math.max", "Math", "maxc", "max1", "return max1;", "max1", "long a[]", "a", "long size", "size", "int s", "s", "public static void main(String args[])\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader sc = new FastReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n \n int sum = 0;\n for(int i = 0; i < n; i++)\n {\n \ta[i] = sc.nextInt();\n }\n \n Arrays.sort(a);\n for(int i = 0; i < k; i++)\n {\n \tsum += a[i];\n }\n \n w.println(sum);\n w.close();\n }", "main", "{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader sc = new FastReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n \n int sum = 0;\n for(int i = 0; i < n; i++)\n {\n \ta[i] = sc.nextInt();\n }\n \n Arrays.sort(a);\n for(int i = 0; i < k; i++)\n {\n \tsum += a[i];\n }\n \n w.println(sum);\n w.close();\n }", "InputStream inputStream = System.in;", "inputStream", "System.in", "System", "System.in", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "FastReader sc = new FastReader(inputStream);", "sc", "new FastReader(inputStream)", "PrintWriter w = new PrintWriter(outputStream);", "w", "new PrintWriter(outputStream)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int a[] = new int[n];", "a", "new int[n]", "n", "int sum = 0;", "sum", "0", "for(int i = 0; i < n; i++)\n {\n \ta[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n \ta[i] = sc.nextInt();\n }", "{\n \ta[i] = sc.nextInt();\n }", "a[i] = sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "for(int i = 0; i < k; i++)\n {\n \tsum += a[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n \tsum += a[i];\n }", "{\n \tsum += a[i];\n }", "sum += a[i]", "sum", "a[i]", "a", "i", "w.println(sum)", "w.println", "w", "sum", "w.close()", "w.close", "w", "String args[]", "args", "public static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n public String nextLine() {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n while(isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n public char nextChar() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n return (char)c;\n }\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n return res.toString();\n }\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }", "FastReader", "private InputStream stream;", "stream", "private byte[] buf = new byte[1024];", "buf", "new byte[1024]", "1024", "private int curChar;", "curChar", "private int numChars;", "numChars", "private SpaceCharFilter filter;", "filter", "public FastReader(InputStream stream) {\n this.stream = stream;\n }", "FastReader", "{\n this.stream = stream;\n }", "this.stream = stream", "this.stream", "this", "this.stream", "stream", "InputStream stream", "stream", "public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "read", "{\n if (numChars==-1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "if (numChars==-1)\n throw new InputMismatchException();", "numChars==-1", "numChars", "-1", "1", "throw new InputMismatchException();", "new InputMismatchException()", "if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }", "curChar >= numChars", "curChar", "numChars", "{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }", "curChar = 0", "curChar", "0", "try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }", "catch (IOException e) {\n throw new InputMismatchException();\n }", "IOException e", "{\n throw new InputMismatchException();\n }", "throw new InputMismatchException();", "new InputMismatchException()", "{\n numChars = stream.read(buf);\n }", "numChars = stream.read(buf)", "numChars", "stream.read(buf)", "stream.read", "stream", "buf", "if(numChars <= 0)\n return -1;", "numChars <= 0", "numChars", "0", "return -1;", "-1", "1", "return buf[curChar++];", "buf[curChar++]", "buf", "curChar++", "curChar", "public String nextLine() {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "BufferedReader br=new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "String str = \"\";", "str", "\"\"", "try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public int nextInt() {\n int c = read();\n while(isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "nextInt", "{\n int c = read();\n while(isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while(isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "int res = 0;", "res", "0", "do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if(c<'0'||c>'9')\n throw new InputMismatchException();", "c<'0'||c>'9'", "c<'0'", "c", "'0'", "c>'9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "nextLong", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "long res = 0;", "res", "0", "do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }", "nextDouble", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "double res = 0;", "res", "0", "while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "!isSpaceChar(c) && c != '.'", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "c != '.'", "c", "'.'", "{\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());", "c == 'e' || c == 'E'", "c == 'e'", "c", "'e'", "c == 'E'", "c", "'E'", "return res * Math.pow(10, nextInt());", "res * Math.pow(10, nextInt())", "res", "Math.pow(10, nextInt())", "Math.pow", "Math", "10", "nextInt()", "nextInt", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }", "c == '.'", "c", "'.'", "{\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }", "c = read()", "c", "read()", "read", "double m = 1;", "m", "1", "while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }", "if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());", "c == 'e' || c == 'E'", "c == 'e'", "c", "'e'", "c == 'E'", "c", "'E'", "return res * Math.pow(10, nextInt());", "res * Math.pow(10, nextInt())", "res", "Math.pow(10, nextInt())", "Math.pow", "Math", "10", "nextInt()", "nextInt", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "m /= 10", "m", "10", "res += (c - '0') * m", "res", "(c - '0') * m", "(c - '0')", "c", "'0'", "m", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public char nextChar() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n return (char)c;\n }", "nextChar", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n return (char)c;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "return (char)c;", "(char)c", "public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n return res.toString();\n }", "next", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n return res.toString();\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "StringBuilder res = new StringBuilder();", "res", "new StringBuilder()", "do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n res.appendCodePoint(c);\n c = read();\n }", "res.appendCodePoint(c)", "res.appendCodePoint", "res", "c", "c = read()", "c", "read()", "read", "return res.toString();", "res.toString()", "res.toString", "res", "public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "isSpaceChar", "{\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "if (filter != null)\n return filter.isSpaceChar(c);", "filter != null", "filter", "null", "return filter.isSpaceChar(c);", "filter.isSpaceChar(c)", "filter.isSpaceChar", "filter", "c", "return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == '\\t'", "c == '\\r'", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == ' '", "c", "' '", "c == '\\n'", "c", "'\\n'", "c == '\\r'", "c", "'\\r'", "c == '\\t'", "c", "'\\t'", "c == -1", "c", "-1", "1", "int c", "c", "public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }", "SpaceCharFilter", "public boolean isSpaceChar(int ch);", "isSpaceChar", "int ch", "ch", "public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }", "Pair", "public U x;", "x", "public V y;", "y", "public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }", "Pair", "{\n this.x = x;\n this.y = y;\n }", "this.x = x", "this.x", "this", "this.x", "x", "this.y = y", "this.y", "this", "this.y", "y", "U x", "x", "V y", "y", "public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }", "hashCode", "{\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }", "return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());", "(x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode())", "(x == null ? 0 : x.hashCode() * 31)", "x == null", "x", "null", "0", "x.hashCode() * 31", "x.hashCode()", "x.hashCode", "x", "31", "(y == null ? 0 : y.hashCode())", "y == null", "y", "null", "0", "y.hashCode()", "y.hashCode", "y", "public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }", "equals", "{\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }", "if (this == o)\n return true;", "this == o", "this", "o", "return true;", "true", "if (o == null || getClass() != o.getClass())\n return false;", "o == null || getClass() != o.getClass()", "o == null", "o", "null", "getClass() != o.getClass()", "getClass()", "getClass", "o.getClass()", "o.getClass", "o", "return false;", "false", "Pair<U, V> p = (Pair<U, V>) o;", "p", "(Pair<U, V>) o", "return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));", "(x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y))", "(x == null ? p.x == null : x.equals(p.x))", "x == null", "x", "null", "p.x == null", "p.x", "p", "p.x", "null", "x.equals(p.x)", "x.equals", "x", "p.x", "p", "p.x", "(y == null ? p.y == null : y.equals(p.y))", "y == null", "y", "null", "p.y == null", "p.y", "p", "p.y", "null", "y.equals(p.y)", "y.equals", "y", "p.y", "p", "p.y", "Object o", "o", "public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }", "compareTo", "{\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }", "int cmpU = x.compareTo(b.x);", "cmpU", "x.compareTo(b.x)", "x.compareTo", "x", "b.x", "b", "b.x", "return cmpU != 0 ? cmpU : y.compareTo(b.y);", "cmpU != 0 ? cmpU : y.compareTo(b.y)", "cmpU != 0", "cmpU", "0", "cmpU", "y.compareTo(b.y)", "y.compareTo", "y", "b.y", "b", "b.y", "Pair<U, V> b", "b", "public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }", "toString", "{\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }", "return String.format(\"(%s, %s)\", x.toString(), y.toString());", "String.format(\"(%s, %s)\", x.toString(), y.toString())", "String.format", "String", "\"(%s, %s)\"", "x.toString()", "x.toString", "x", "y.toString()", "y.toString", "y", "Comparable", "public class Main{\n public static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n public String nextLine() {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n while(isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n public char nextChar() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n return (char)c;\n }\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n return res.toString();\n }\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n \n public static void main(String args[])\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader sc = new FastReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n \n int sum = 0;\n for(int i = 0; i < n; i++)\n {\n \ta[i] = sc.nextInt();\n }\n \n Arrays.sort(a);\n for(int i = 0; i < k; i++)\n {\n \tsum += a[i];\n }\n \n w.println(sum);\n w.close();\n }\n}", "public class Main{\n public static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n public String nextLine() {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n while(isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c))\n {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n public char nextChar() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n return (char)c;\n }\n public String next() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n return res.toString();\n }\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n \n public static void main(String args[])\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader sc = new FastReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n \n int sum = 0;\n for(int i = 0; i < n; i++)\n {\n \ta[i] = sc.nextInt();\n }\n \n Arrays.sort(a);\n for(int i = 0; i < k; i++)\n {\n \tsum += a[i];\n }\n \n w.println(sum);\n w.close();\n }\n}", "Main" ]
import java.io.*; import java.util.*; import java.lang.*; public class Main{ public static class FastReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; public FastReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars==-1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if(numChars <= 0) return -1; } return buf[curChar++]; } public String nextLine() { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } public int nextInt() { int c = read(); while(isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if(c<'0'||c>'9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public double nextDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public char nextChar() { int c = read(); while (isSpaceChar(c)) c = read(); return (char)c; } public String next() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } static long gcd(long a, long b){ if (a == 0) return b; return gcd(b % a, a); } static long lcm(long a, long b) { return (a*b)/gcd(a, b); } static long func(long a[],long size,int s){ long max1=a[s]; long maxc=a[s]; for(int i=s+1;i<size;i++){ maxc=Math.max(a[i],maxc+a[i]); max1=Math.max(maxc,max1); } return max1; } public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> { public U x; public V y; public Pair(U x, V y) { this.x = x; this.y = y; } public int hashCode() { return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode()); } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Pair<U, V> p = (Pair<U, V>) o; return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y)); } public int compareTo(Pair<U, V> b) { int cmpU = x.compareTo(b.x); return cmpU != 0 ? cmpU : y.compareTo(b.y); } public String toString() { return String.format("(%s, %s)", x.toString(), y.toString()); } } public static void main(String args[]) { InputStream inputStream = System.in; OutputStream outputStream = System.out; FastReader sc = new FastReader(inputStream); PrintWriter w = new PrintWriter(outputStream); int n = sc.nextInt(); int k = sc.nextInt(); int a[] = new int[n]; int sum = 0; for(int i = 0; i < n; i++) { a[i] = sc.nextInt(); } Arrays.sort(a); for(int i = 0; i < k; i++) { sum += a[i]; } w.println(sum); w.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 4, 18, 4, 18, 13, 4, 18, 13, 13, 17, 13, 29, 23, 13, 6, 13, 41, 13, 2, 17, 17, 41, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 12, 13, 30, 0, 13, 20, 0, 13, 20, 13, 0, 13, 0, 13, 17, 23, 13, 12, 13, 30, 14, 2, 13, 13, 4, 13, 29, 18, 13, 40, 13, 12, 13, 30, 14, 2, 13, 17, 29, 4, 18, 13, 12, 13, 30, 0, 13, 4, 18, 13, 13, 0, 13, 17, 13, 14, 2, 13, 40, 17, 0, 18, 13, 17, 40, 17, 12, 13, 30, 41, 13, 4, 13, 42, 4, 18, 13, 13, 30, 0, 13, 4, 13, 29, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 18, 13, 13, 30, 0, 13, 4, 13, 41, 13, 20, 4, 18, 13, 13, 0, 13, 4, 13, 42, 40, 4, 18, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 17, 41, 13, 17, 41, 13, 4, 13, 42, 2, 13, 17, 0, 13, 4, 13, 41, 13, 2, 13, 17, 14, 13, 0, 13, 4, 13, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 2, 13, 17, 13, 17, 14, 2, 13, 17, 30, 42, 2, 2, 0, 13, 4, 13, 17, 2, 13, 17, 30, 0, 13, 2, 2, 13, 17, 0, 13, 17, 14, 13, 29, 40, 13, 29, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 506, 8 ], [ 506, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 27, 28 ], [ 28, 29 ], [ 27, 30 ], [ 11, 31 ], [ 31, 32 ], [ 32, 33 ], [ 31, 34 ], [ 11, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 35, 40 ], [ 40, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 42, 45 ], [ 45, 46 ], [ 46, 47 ], [ 45, 48 ], [ 45, 49 ], [ 45, 50 ], [ 11, 51 ], [ 9, 52 ], [ 52, 53 ], [ 506, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 58, 60 ], [ 54, 61 ], [ 61, 62 ], [ 54, 63 ], [ 63, 64 ], [ 54, 65 ], [ 65, 66 ], [ 54, 67 ], [ 67, 68 ], [ 54, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 71, 75 ], [ 75, 76 ], [ 75, 77 ], [ 71, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 54, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 90, 91 ], [ 90, 92 ], [ 86, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 96, 98 ], [ 84, 99 ], [ 99, 100 ], [ 54, 101 ], [ 101, 102 ], [ 101, 103 ], [ 103, 104 ], [ 104, 105 ], [ 105, 106 ], [ 105, 107 ], [ 104, 108 ], [ 108, 109 ], [ 103, 110 ], [ 110, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 54, 115 ], [ 115, 116 ], [ 115, 117 ], [ 117, 118 ], [ 118, 119 ], [ 119, 120 ], [ 119, 121 ], [ 118, 122 ], [ 117, 123 ], [ 123, 124 ], [ 124, 125 ], [ 54, 126 ], [ 126, 127 ], [ 126, 128 ], [ 128, 129 ], [ 129, 130 ], [ 129, 131 ], [ 131, 132 ], [ 132, 133 ], [ 131, 134 ], [ 131, 135 ], [ 135, 136 ], [ 135, 137 ], [ 131, 138 ], [ 128, 139 ], [ 139, 140 ], [ 140, 141 ], [ 140, 142 ], [ 142, 143 ], [ 139, 144 ], [ 144, 145 ], [ 145, 146 ], [ 145, 147 ], [ 144, 148 ], [ 148, 149 ], [ 54, 150 ], [ 150, 151 ], [ 150, 152 ], [ 152, 153 ], [ 153, 154 ], [ 153, 155 ], [ 155, 156 ], [ 152, 157 ], [ 157, 158 ], [ 158, 159 ], [ 159, 160 ], [ 158, 161 ], [ 157, 162 ], [ 162, 163 ], [ 163, 164 ], [ 163, 165 ], [ 165, 166 ], [ 152, 167 ], [ 167, 168 ], [ 54, 169 ], [ 169, 170 ], [ 169, 171 ], [ 171, 172 ], [ 172, 173 ], [ 172, 174 ], [ 174, 175 ], [ 171, 176 ], [ 176, 177 ], [ 177, 178 ], [ 178, 179 ], [ 177, 180 ], [ 176, 181 ], [ 181, 182 ], [ 182, 183 ], [ 182, 184 ], [ 184, 185 ], [ 171, 186 ], [ 186, 187 ], [ 186, 188 ], [ 171, 189 ], [ 189, 190 ], [ 190, 191 ], [ 189, 192 ], [ 171, 193 ], [ 193, 194 ], [ 193, 195 ], [ 195, 196 ], [ 171, 197 ], [ 197, 198 ], [ 198, 199 ], [ 199, 200 ], [ 200, 201 ], [ 199, 202 ], [ 197, 203 ], [ 203, 204 ], [ 204, 205 ], [ 205, 206 ], [ 204, 207 ], [ 203, 208 ], [ 208, 209 ], [ 208, 210 ], [ 210, 211 ], [ 171, 212 ], [ 212, 213 ], [ 213, 214 ], [ 214, 215 ], [ 54, 216 ], [ 216, 217 ], [ 216, 218 ], [ 218, 219 ], [ 219, 220 ], [ 219, 221 ], [ 218, 222 ], [ 222, 223 ], [ 222, 224 ], [ 224, 225 ], [ 218, 226 ], [ 226, 227 ], [ 227, 228 ], [ 227, 229 ], [ 226, 230 ], [ 230, 231 ], [ 230, 232 ], [ 232, 233 ], [ 218, 234 ], [ 234, 235 ], [ 234, 236 ], [ 236, 237 ], [ 236, 238 ], [ 218, 239 ], [ 239, 240 ], [ 239, 241 ], [ 241, 242 ], [ 241, 243 ], [ 243, 244 ], [ 218, 245 ], [ 245, 246 ], [ 246, 247 ], [ 247, 248 ], [ 248, 249 ], [ 248, 250 ], [ 250, 251 ], [ 247, 252 ], [ 246, 253 ], [ 253, 254 ], [ 253, 255 ], [ 245, 256 ], [ 256, 257 ], [ 257, 258 ], [ 257, 259 ], [ 259, 260 ], [ 260, 261 ], [ 261, 262 ], [ 261, 263 ], [ 260, 264 ], [ 259, 265 ], [ 218, 266 ], [ 266, 267 ], [ 266, 268 ], [ 268, 269 ], [ 269, 270 ], [ 218, 271 ], [ 271, 272 ], [ 54, 273 ], [ 273, 274 ], [ 273, 275 ], [ 275, 276 ], [ 276, 277 ], [ 276, 278 ], [ 275, 279 ], [ 279, 280 ], [ 279, 281 ], [ 281, 282 ], [ 275, 283 ], [ 283, 284 ], [ 284, 285 ], [ 284, 286 ], [ 283, 287 ], [ 287, 288 ], [ 287, 289 ], [ 289, 290 ], [ 275, 291 ], [ 291, 292 ], [ 291, 293 ], [ 293, 294 ], [ 293, 295 ], [ 275, 296 ], [ 296, 297 ], [ 296, 298 ], [ 298, 299 ], [ 298, 300 ], [ 300, 301 ], [ 275, 302 ], [ 302, 303 ], [ 303, 304 ], [ 304, 305 ], [ 305, 306 ], [ 305, 307 ], [ 307, 308 ], [ 304, 309 ], [ 303, 310 ], [ 310, 311 ], [ 310, 312 ], [ 302, 313 ], [ 313, 314 ], [ 314, 315 ], [ 314, 316 ], [ 316, 317 ], [ 317, 318 ], [ 318, 319 ], [ 318, 320 ], [ 317, 321 ], [ 316, 322 ], [ 275, 323 ], [ 323, 324 ], [ 323, 325 ], [ 325, 326 ], [ 326, 327 ], [ 275, 328 ], [ 328, 329 ], [ 54, 330 ], [ 330, 331 ], [ 330, 332 ], [ 332, 333 ], [ 333, 334 ], [ 333, 335 ], [ 332, 336 ], [ 336, 337 ], [ 336, 338 ], [ 332, 339 ], [ 339, 340 ], [ 339, 341 ], [ 341, 342 ], [ 332, 343 ], [ 343, 344 ], [ 344, 345 ], [ 344, 346 ], [ 343, 347 ], [ 347, 348 ], [ 347, 349 ], [ 349, 350 ], [ 332, 351 ], [ 351, 352 ], [ 351, 353 ], [ 353, 354 ], [ 353, 355 ], [ 332, 356 ], [ 356, 357 ], [ 356, 358 ], [ 358, 359 ], [ 358, 360 ], [ 360, 361 ], [ 332, 362 ], [ 362, 363 ], [ 363, 364 ], [ 364, 365 ], [ 365, 366 ], [ 365, 367 ], [ 367, 368 ], [ 364, 369 ], [ 363, 370 ], [ 370, 371 ], [ 370, 372 ], [ 362, 373 ], [ 373, 374 ], [ 374, 375 ], [ 374, 376 ], [ 376, 377 ], [ 377, 378 ], [ 378, 379 ], [ 378, 380 ], [ 377, 381 ], [ 376, 382 ], [ 332, 383 ], [ 383, 384 ], [ 384, 385 ], [ 384, 386 ], [ 383, 387 ], [ 387, 388 ], [ 388, 389 ], [ 389, 390 ], [ 390, 391 ], [ 391, 392 ], [ 391, 393 ], [ 393, 394 ], [ 390, 395 ], [ 389, 396 ], [ 396, 397 ], [ 396, 398 ], [ 388, 399 ], [ 399, 400 ], [ 400, 401 ], [ 400, 402 ], [ 402, 403 ], [ 403, 404 ], [ 403, 405 ], [ 402, 406 ], [ 406, 407 ], [ 406, 408 ], [ 332, 409 ], [ 409, 410 ], [ 409, 411 ], [ 411, 412 ], [ 412, 413 ], [ 332, 414 ], [ 414, 415 ], [ 54, 416 ], [ 416, 417 ], [ 416, 418 ], [ 418, 419 ], [ 419, 420 ], [ 419, 421 ], [ 418, 423 ], [ 423, 424 ], [ 424, 425 ], [ 425, 426 ], [ 425, 427 ], [ 423, 428 ], [ 428, 429 ], [ 428, 430 ], [ 423, 431 ], [ 431, 432 ], [ 432, 433 ], [ 423, 434 ], [ 435, 435 ], [ 435, 436 ], [ 436, 437 ], [ 437, 438 ], [ 437, 439 ], [ 436, 440 ], [ 440, 441 ], [ 418, 442 ], [ 442, 443 ], [ 416, 444 ], [ 444, 445 ], [ 54, 446 ], [ 446, 447 ], [ 446, 448 ], [ 448, 449 ], [ 449, 450 ], [ 449, 451 ], [ 448, 453 ], [ 453, 454 ], [ 454, 455 ], [ 455, 456 ], [ 455, 457 ], [ 453, 458 ], [ 458, 459 ], [ 458, 460 ], [ 453, 461 ], [ 461, 462 ], [ 462, 463 ], [ 453, 464 ], [ 465, 465 ], [ 465, 466 ], [ 466, 467 ], [ 467, 468 ], [ 467, 469 ], [ 466, 470 ], [ 470, 471 ], [ 448, 472 ], [ 472, 473 ], [ 446, 474 ], [ 474, 475 ], [ 54, 476 ], [ 476, 477 ], [ 476, 478 ], [ 478, 479 ], [ 479, 480 ], [ 479, 481 ], [ 478, 483 ], [ 483, 484 ], [ 484, 485 ], [ 485, 486 ], [ 485, 487 ], [ 483, 488 ], [ 488, 489 ], [ 488, 490 ], [ 483, 491 ], [ 491, 492 ], [ 492, 493 ], [ 483, 494 ], [ 494, 495 ], [ 495, 496 ], [ 496, 497 ], [ 496, 498 ], [ 495, 499 ], [ 499, 500 ], [ 478, 501 ], [ 501, 502 ], [ 476, 503 ], [ 503, 504 ], [ 0, 505 ], [ 505, 506 ], [ 505, 507 ] ]
[ "import java.io.*;\n// import java.math.*;\nimport java.util.*;\n// import java.util.Map.*;\n// import java.util.stream.*;\n\npublic class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n int[] p = sc.intArray (N);\n Arrays.sort (p);\n System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum());\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n int[] p = sc.intArray (N);\n Arrays.sort (p);\n System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum());\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}", "Main", "public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n int[] p = sc.intArray (N);\n Arrays.sort (p);\n System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum());\n return;\n }", "main", "{\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n int[] p = sc.intArray (N);\n Arrays.sort (p);\n System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum());\n return;\n }", "FastScanner sc = new FastScanner();", "sc", "new FastScanner()", "final int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "final int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = sc.intArray (N);", "p", "sc.intArray (N)", "sc.intArray", "sc", "N", "Arrays.sort (p)", "Arrays.sort", "Arrays", "p", "System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum())", "System.out.println", "System.out", "System", "System.out", "Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum()", "Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum", "Arrays.stream (Arrays.copyOfRange (p, 0, K))", "Arrays.stream", "Arrays", "Arrays.copyOfRange (p, 0, K)", "Arrays.copyOfRange", "Arrays", "p", "0", "K", "return;", "String[] args", "args", "static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }", "FastScanner", "final private int BUFFER_SIZE = 1 << 16;", "BUFFER_SIZE", "1 << 16", "1", "16", "private DataInputStream din;", "din", "private byte[] buffer;", "buffer", "private int bufferPointer", "bufferPointer", "bytesRead;", "bytesRead", "public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "FastScanner", "{\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "din = new DataInputStream (System.in)", "din", "new DataInputStream (System.in)", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "FastScanner", "{\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }", "din = new DataInputStream (new FileInputStream (file_name))", "din", "new DataInputStream (new FileInputStream (file_name))", "buffer = new byte[BUFFER_SIZE]", "buffer", "new byte[BUFFER_SIZE]", "BUFFER_SIZE", "bufferPointer = bytesRead = 0", "bufferPointer", "bytesRead = 0", "bytesRead", "0", "String file_name", "file_name", "private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }", "read", "{\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }", "if (bufferPointer == bytesRead)\n fillBuffer();", "bufferPointer == bytesRead", "bufferPointer", "bytesRead", "fillBuffer()", "fillBuffer", "return buffer[bufferPointer++];", "buffer[bufferPointer++]", "buffer", "bufferPointer++", "bufferPointer", "public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }", "close", "{\n if (din == null)\n return;\n din.close();\n }", "if (din == null)\n return;", "din == null", "din", "null", "return;", "din.close()", "din.close", "din", "private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }", "fillBuffer", "{\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }", "bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE)", "bytesRead", "din.read (buffer, bufferPointer = 0, BUFFER_SIZE)", "din.read", "din", "buffer", "bufferPointer = 0", "bufferPointer", "0", "BUFFER_SIZE", "if (bytesRead == -1)\n buffer[0] = -1;", "bytesRead == -1", "bytesRead", "-1", "1", "buffer[0] = -1", "buffer[0]", "buffer", "0", "-1", "1", "public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }", "nextChar", "{\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }", "byte c = read();", "c", "read()", "read", "while (Character.isWhitespace (c)) {\n c = read();\n }", "Character.isWhitespace (c)", "Character.isWhitespace", "Character", "c", "{\n c = read();\n }", "c = read()", "c", "read()", "read", "return (char)c;", "(char)c", "public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }", "nextString", "{\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }", "byte c = read();", "c", "read()", "read", "while (Character.isWhitespace (c)) {\n c = read();\n }", "Character.isWhitespace (c)", "Character.isWhitespace", "Character", "c", "{\n c = read();\n }", "c = read()", "c", "read()", "read", "StringBuilder builder = new StringBuilder();", "builder", "new StringBuilder()", "builder.append ((char)c)", "builder.append", "builder", "(char)c", "c = read()", "c", "read()", "read", "while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }", "!Character.isWhitespace (c)", "Character.isWhitespace (c)", "Character.isWhitespace", "Character", "c", "{\n builder.append ((char)c);\n c = read();\n }", "builder.append ((char)c)", "builder.append", "builder", "(char)c", "c = read()", "c", "read()", "read", "return builder.toString();", "builder.toString()", "builder.toString", "builder", "public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }", "nextInt", "{\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }", "int ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n c = read();", "neg", "c = read()", "c", "read()", "read", "do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret = ret * 10 + c - '0';\n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg)\n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }", "nextLong", "{\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }", "long ret = 0;", "ret", "0", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n c = read();", "neg", "c = read()", "c", "read()", "read", "do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret = ret * 10 + c - '0';\n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (neg)\n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }", "nextDouble", "{\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }", "double ret = 0", "ret", "0", "div = 1;", "div", "1", "byte c = read();", "c", "read()", "read", "while (c <= ' ')\n c = read();", "c <= ' '", "c", "' '", "c = read()", "c", "read()", "read", "boolean neg = (c == '-');", "neg", "(c == '-')", "c", "'-'", "if (neg)\n c = read();", "neg", "c = read()", "c", "read()", "read", "do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret = ret * 10 + c - '0';\n }", "ret = ret * 10 + c - '0'", "ret", "ret * 10 + c - '0'", "ret * 10 + c", "ret * 10", "ret", "10", "c", "'0'", "if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }", "c == '.'", "c", "'.'", "{\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }", "while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }", "(c = read()) >= '0' && c <= '9'", "(c = read()) >= '0'", "(c = read())", "c", "read()", "read", "'0'", "c <= '9'", "c", "'9'", "{\n ret += (c - '0') / (div *= 10);\n }", "ret += (c - '0') / (div *= 10)", "ret", "(c - '0') / (div *= 10)", "(c - '0')", "c", "'0'", "(div *= 10)", "div", "10", "if (neg)\n return -ret;", "neg", "return -ret;", "-ret", "ret", "return ret;", "ret", "public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }", "intArray", "{\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }", "int arr[] = new int[n];", "arr", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n arr[i] = nextInt();\n }", "{\n arr[i] = nextInt();\n }", "arr[i] = nextInt()", "arr[i]", "arr", "i", "nextInt()", "nextInt", "return arr;", "arr", "int n", "n", "public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }", "longArray", "{\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }", "long arr[] = new long[n];", "arr", "new long[n]", "n", "for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n arr[i] = nextLong();\n }", "{\n arr[i] = nextLong();\n }", "arr[i] = nextLong()", "arr[i]", "arr", "i", "nextLong()", "nextLong", "return arr;", "arr", "int n", "n", "public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }", "doubleArray", "{\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }", "double arr[] = new double[n];", "arr", "new double[n]", "n", "for (int i = 0; i < n; i++)\n arr[i] = nextDouble();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "arr[i] = nextDouble();", "arr[i] = nextDouble()", "arr[i]", "arr", "i", "nextDouble()", "nextDouble", "return arr;", "arr", "int n", "n", "public class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n int[] p = sc.intArray (N);\n Arrays.sort (p);\n System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum());\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}", "public class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n int[] p = sc.intArray (N);\n Arrays.sort (p);\n System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum());\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}", "Main" ]
import java.io.*; // import java.math.*; import java.util.*; // import java.util.Map.*; // import java.util.stream.*; public class Main { public static void main (String[] args) throws IOException { FastScanner sc = new FastScanner(); final int N = sc.nextInt(); final int K = sc.nextInt(); int[] p = sc.intArray (N); Arrays.sort (p); System.out.println (Arrays.stream (Arrays.copyOfRange (p, 0, K)).sum()); return; } // FastScanner start static class FastScanner { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public FastScanner() { din = new DataInputStream (System.in); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public FastScanner (String file_name) throws IOException { din = new DataInputStream (new FileInputStream (file_name)); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } private byte read() throws IOException { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } public void close() throws IOException { if (din == null) return; din.close(); } private void fillBuffer() throws IOException { bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE); if (bytesRead == -1) buffer[0] = -1; } public char nextChar() throws IOException { byte c = read(); while (Character.isWhitespace (c)) { c = read(); } return (char)c; } public String nextString() throws IOException { byte c = read(); while (Character.isWhitespace (c)) { c = read(); } StringBuilder builder = new StringBuilder(); builder.append ((char)c); c = read(); while (!Character.isWhitespace (c)) { builder.append ((char)c); c = read(); } return builder.toString(); } public int nextInt() throws IOException { int ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public long nextLong() throws IOException { long ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public double nextDouble() throws IOException { double ret = 0, div = 1; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (c == '.') { while ((c = read()) >= '0' && c <= '9') { ret += (c - '0') / (div *= 10); } } if (neg) return -ret; return ret; } public int[] intArray (int n) throws IOException { int arr[] = new int[n]; for (int i = 0; i < n; i++) { arr[i] = nextInt(); } return arr; } public long[] longArray (int n) throws IOException { long arr[] = new long[n]; for (int i = 0; i < n; i++) { arr[i] = nextLong(); } return arr; } public double[] doubleArray (int n) throws IOException { double arr[] = new double[n]; for (int i = 0; i < n; i++) arr[i] = nextDouble(); return arr; } } // FastScanner end }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 17, 0, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 20, 42, 4, 18, 13, 30, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 77, 8 ], [ 77, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 11, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 11, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 11, 28 ], [ 28, 29 ], [ 28, 30 ], [ 11, 31 ], [ 31, 32 ], [ 31, 33 ], [ 11, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 34, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 39, 42 ], [ 42, 43 ], [ 43, 44 ], [ 11, 45 ], [ 45, 46 ], [ 46, 47 ], [ 45, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 49, 57 ], [ 57, 58 ], [ 58, 59 ], [ 49, 60 ], [ 61, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 64, 67 ], [ 11, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 68, 73 ], [ 9, 74 ], [ 74, 75 ], [ 0, 76 ], [ 76, 77 ], [ 76, 78 ] ]
[ "import java.util.*;\nimport java.util.Collections;\npublic class Main {\n\tpublic static void main(String[] args){\n \n Scanner sc = null;\n sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n long sumPrice = 0;\n ArrayList<Integer> pList = new ArrayList<Integer>();\n while(sc.hasNextInt()){\n pList.add(sc.nextInt());\n }\n Collections.sort(pList);\n for(int i=0; i < K; i++){\n sumPrice += pList.get(i);\n }\n System.out.println(sumPrice);\n }\n}", "import java.util.*;", "util.*", "java", "import java.util.Collections;", "Collections", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n \n Scanner sc = null;\n sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n long sumPrice = 0;\n ArrayList<Integer> pList = new ArrayList<Integer>();\n while(sc.hasNextInt()){\n pList.add(sc.nextInt());\n }\n Collections.sort(pList);\n for(int i=0; i < K; i++){\n sumPrice += pList.get(i);\n }\n System.out.println(sumPrice);\n }\n}", "Main", "public static void main(String[] args){\n \n Scanner sc = null;\n sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n long sumPrice = 0;\n ArrayList<Integer> pList = new ArrayList<Integer>();\n while(sc.hasNextInt()){\n pList.add(sc.nextInt());\n }\n Collections.sort(pList);\n for(int i=0; i < K; i++){\n sumPrice += pList.get(i);\n }\n System.out.println(sumPrice);\n }", "main", "{\n \n Scanner sc = null;\n sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n long sumPrice = 0;\n ArrayList<Integer> pList = new ArrayList<Integer>();\n while(sc.hasNextInt()){\n pList.add(sc.nextInt());\n }\n Collections.sort(pList);\n for(int i=0; i < K; i++){\n sumPrice += pList.get(i);\n }\n System.out.println(sumPrice);\n }", "Scanner sc = null;", "sc", "null", "sc = new Scanner(System.in)", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "long sumPrice = 0;", "sumPrice", "0", "ArrayList<Integer> pList = new ArrayList<Integer>();", "pList", "new ArrayList<Integer>()", "while(sc.hasNextInt()){\n pList.add(sc.nextInt());\n }", "sc.hasNextInt()", "sc.hasNextInt", "sc", "{\n pList.add(sc.nextInt());\n }", "pList.add(sc.nextInt())", "pList.add", "pList", "sc.nextInt()", "sc.nextInt", "sc", "Collections.sort(pList)", "Collections.sort", "Collections", "pList", "for(int i=0; i < K; i++){\n sumPrice += pList.get(i);\n }", "int i=0;", "int i=0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sumPrice += pList.get(i);\n }", "{\n sumPrice += pList.get(i);\n }", "sumPrice += pList.get(i)", "sumPrice", "pList.get(i)", "pList.get", "pList", "i", "System.out.println(sumPrice)", "System.out.println", "System.out", "System", "System.out", "sumPrice", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n \n Scanner sc = null;\n sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n long sumPrice = 0;\n ArrayList<Integer> pList = new ArrayList<Integer>();\n while(sc.hasNextInt()){\n pList.add(sc.nextInt());\n }\n Collections.sort(pList);\n for(int i=0; i < K; i++){\n sumPrice += pList.get(i);\n }\n System.out.println(sumPrice);\n }\n}", "public class Main {\n\tpublic static void main(String[] args){\n \n Scanner sc = null;\n sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n long sumPrice = 0;\n ArrayList<Integer> pList = new ArrayList<Integer>();\n while(sc.hasNextInt()){\n pList.add(sc.nextInt());\n }\n Collections.sort(pList);\n for(int i=0; i < K; i++){\n sumPrice += pList.get(i);\n }\n System.out.println(sumPrice);\n }\n}", "Main" ]
import java.util.*; import java.util.Collections; public class Main { public static void main(String[] args){ Scanner sc = null; sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); long sumPrice = 0; ArrayList<Integer> pList = new ArrayList<Integer>(); while(sc.hasNextInt()){ pList.add(sc.nextInt()); } Collections.sort(pList); for(int i=0; i < K; i++){ sumPrice += pList.get(i); } System.out.println(sumPrice); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 20, 28, 13, 13, 30, 30, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 23, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 32, 33 ], [ 29, 34 ], [ 23, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 38, 39 ], [ 37, 40 ], [ 40, 41 ], [ 40, 42 ], [ 23, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 46, 47 ], [ 45, 48 ], [ 48, 49 ], [ 48, 50 ], [ 23, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 53, 58 ], [ 23, 59 ], [ 59, 60 ], [ 59, 61 ], [ 23, 62 ], [ 62, 63 ], [ 62, 64 ], [ 62, 65 ], [ 66, 66 ], [ 66, 67 ], [ 67, 68 ], [ 68, 69 ], [ 67, 70 ], [ 70, 71 ], [ 71, 72 ], [ 70, 73 ], [ 23, 74 ], [ 74, 75 ], [ 75, 76 ], [ 74, 77 ], [ 77, 78 ], [ 78, 79 ], [ 23, 80 ], [ 80, 81 ], [ 80, 82 ], [ 23, 83 ], [ 83, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 83, 88 ], [ 88, 89 ], [ 88, 90 ], [ 83, 91 ], [ 91, 92 ], [ 92, 93 ], [ 83, 94 ], [ 95, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 101, 102 ], [ 100, 103 ], [ 23, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 104, 109 ], [ 21, 110 ], [ 110, 111 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Comparator;\nimport java.util.List;\nclass Main {\n public static void main(String[] args) throws IOException{\n BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n String[] NK = bf.readLine().split(\" \");\n int N = Integer.parseInt(NK[0]);\n int K = Integer.parseInt(NK[1]);\n String[] P = bf.readLine().split(\" \");\n List<Integer> l = new ArrayList<Integer>();\n for (String s : P ) {\n l.add(Integer.parseInt(s));\n }\n l.sort(Comparator.naturalOrder());\n\n int sum = 0;\n for (int i = 0 ; i < K; i++) {\n sum = sum + l.get(i);\n }\n System.out.println(sum);\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Comparator;", "Comparator", "java.util", "import java.util.List;", "List", "java.util", "class Main {\n public static void main(String[] args) throws IOException{\n BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n String[] NK = bf.readLine().split(\" \");\n int N = Integer.parseInt(NK[0]);\n int K = Integer.parseInt(NK[1]);\n String[] P = bf.readLine().split(\" \");\n List<Integer> l = new ArrayList<Integer>();\n for (String s : P ) {\n l.add(Integer.parseInt(s));\n }\n l.sort(Comparator.naturalOrder());\n\n int sum = 0;\n for (int i = 0 ; i < K; i++) {\n sum = sum + l.get(i);\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args) throws IOException{\n BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n String[] NK = bf.readLine().split(\" \");\n int N = Integer.parseInt(NK[0]);\n int K = Integer.parseInt(NK[1]);\n String[] P = bf.readLine().split(\" \");\n List<Integer> l = new ArrayList<Integer>();\n for (String s : P ) {\n l.add(Integer.parseInt(s));\n }\n l.sort(Comparator.naturalOrder());\n\n int sum = 0;\n for (int i = 0 ; i < K; i++) {\n sum = sum + l.get(i);\n }\n System.out.println(sum);\n }", "main", "{\n BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n String[] NK = bf.readLine().split(\" \");\n int N = Integer.parseInt(NK[0]);\n int K = Integer.parseInt(NK[1]);\n String[] P = bf.readLine().split(\" \");\n List<Integer> l = new ArrayList<Integer>();\n for (String s : P ) {\n l.add(Integer.parseInt(s));\n }\n l.sort(Comparator.naturalOrder());\n\n int sum = 0;\n for (int i = 0 ; i < K; i++) {\n sum = sum + l.get(i);\n }\n System.out.println(sum);\n }", "BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));", "bf", "new BufferedReader(new InputStreamReader(System.in))", "String[] NK = bf.readLine().split(\" \");", "NK", "bf.readLine().split(\" \")", "bf.readLine().split", "bf.readLine()", "bf.readLine", "bf", "\" \"", "int N = Integer.parseInt(NK[0]);", "N", "Integer.parseInt(NK[0])", "Integer.parseInt", "Integer", "NK[0]", "NK", "0", "int K = Integer.parseInt(NK[1]);", "K", "Integer.parseInt(NK[1])", "Integer.parseInt", "Integer", "NK[1]", "NK", "1", "String[] P = bf.readLine().split(\" \");", "P", "bf.readLine().split(\" \")", "bf.readLine().split", "bf.readLine()", "bf.readLine", "bf", "\" \"", "List<Integer> l = new ArrayList<Integer>();", "l", "new ArrayList<Integer>()", "for (String s : P ) {\n l.add(Integer.parseInt(s));\n }", "String s", "P", "{\n l.add(Integer.parseInt(s));\n }", "{\n l.add(Integer.parseInt(s));\n }", "l.add(Integer.parseInt(s))", "l.add", "l", "Integer.parseInt(s)", "Integer.parseInt", "Integer", "s", "l.sort(Comparator.naturalOrder())", "l.sort", "l", "Comparator.naturalOrder()", "Comparator.naturalOrder", "Comparator", "int sum = 0;", "sum", "0", "for (int i = 0 ; i < K; i++) {\n sum = sum + l.get(i);\n }", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sum = sum + l.get(i);\n }", "{\n sum = sum + l.get(i);\n }", "sum = sum + l.get(i)", "sum", "sum + l.get(i)", "sum", "l.get(i)", "l.get", "l", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Comparator; import java.util.List; class Main { public static void main(String[] args) throws IOException{ BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String[] NK = bf.readLine().split(" "); int N = Integer.parseInt(NK[0]); int K = Integer.parseInt(NK[1]); String[] P = bf.readLine().split(" "); List<Integer> l = new ArrayList<Integer>(); for (String s : P ) { l.add(Integer.parseInt(s)); } l.sort(Comparator.naturalOrder()); int sum = 0; for (int i = 0 ; i < K; i++) { sum = sum + l.get(i); } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 17, 23, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 29, 4, 18, 13, 29, 17, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 30, 0, 13, 4, 18, 13, 14, 2, 13, 17, 30, 29, 17, 0, 13, 20, 29, 17, 12, 13, 30, 29, 20, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 25, 26 ], [ 25, 27 ], [ 0, 28 ], [ 28, 29 ], [ 28, 30 ], [ 0, 31 ], [ 31, 32 ], [ 31, 33 ], [ 0, 34 ], [ 235, 35 ], [ 235, 36 ], [ 36, 37 ], [ 36, 38 ], [ 235, 39 ], [ 39, 40 ], [ 39, 41 ], [ 235, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 47, 48 ], [ 48, 49 ], [ 44, 50 ], [ 50, 51 ], [ 50, 52 ], [ 52, 53 ], [ 53, 54 ], [ 44, 55 ], [ 55, 56 ], [ 55, 57 ], [ 44, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 64, 65 ], [ 64, 66 ], [ 59, 67 ], [ 67, 68 ], [ 68, 69 ], [ 59, 70 ], [ 71, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 72, 76 ], [ 76, 77 ], [ 77, 78 ], [ 44, 79 ], [ 79, 80 ], [ 80, 81 ], [ 79, 82 ], [ 44, 83 ], [ 83, 84 ], [ 83, 85 ], [ 44, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 86, 91 ], [ 91, 92 ], [ 91, 93 ], [ 86, 94 ], [ 94, 95 ], [ 95, 96 ], [ 86, 97 ], [ 98, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 101, 102 ], [ 101, 103 ], [ 44, 104 ], [ 104, 105 ], [ 105, 106 ], [ 104, 107 ], [ 44, 108 ], [ 108, 109 ], [ 109, 110 ], [ 42, 111 ], [ 111, 112 ], [ 235, 113 ], [ 113, 114 ], [ 113, 115 ], [ 115, 116 ], [ 113, 117 ], [ 117, 118 ], [ 113, 119 ], [ 119, 120 ], [ 119, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 121, 125 ], [ 125, 126 ], [ 125, 127 ], [ 119, 128 ], [ 128, 129 ], [ 113, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 133, 134 ], [ 134, 135 ], [ 135, 136 ], [ 135, 137 ], [ 134, 138 ], [ 138, 139 ], [ 139, 140 ], [ 140, 141 ], [ 133, 142 ], [ 142, 143 ], [ 143, 144 ], [ 144, 145 ], [ 144, 146 ], [ 146, 147 ], [ 147, 148 ], [ 143, 149 ], [ 149, 150 ], [ 150, 151 ], [ 150, 152 ], [ 132, 153 ], [ 153, 154 ], [ 154, 155 ], [ 155, 156 ], [ 113, 157 ], [ 157, 158 ], [ 157, 159 ], [ 159, 160 ], [ 160, 161 ], [ 161, 162 ], [ 162, 163 ], [ 161, 164 ], [ 164, 165 ], [ 113, 166 ], [ 166, 167 ], [ 166, 168 ], [ 168, 169 ], [ 169, 170 ], [ 170, 171 ], [ 171, 172 ], [ 170, 173 ], [ 173, 174 ], [ 113, 175 ], [ 175, 176 ], [ 175, 177 ], [ 177, 178 ], [ 178, 179 ], [ 179, 180 ], [ 180, 181 ], [ 179, 182 ], [ 182, 183 ], [ 113, 184 ], [ 184, 185 ], [ 184, 186 ], [ 186, 187 ], [ 187, 188 ], [ 188, 189 ], [ 188, 190 ], [ 190, 191 ], [ 191, 192 ], [ 192, 193 ], [ 187, 194 ], [ 194, 195 ], [ 195, 196 ], [ 196, 197 ], [ 197, 198 ], [ 186, 199 ], [ 199, 200 ], [ 113, 201 ], [ 201, 202 ], [ 201, 203 ], [ 203, 204 ], [ 204, 205 ], [ 204, 206 ], [ 203, 207 ], [ 207, 208 ], [ 208, 209 ], [ 208, 210 ], [ 207, 211 ], [ 211, 212 ], [ 212, 213 ], [ 212, 214 ], [ 214, 215 ], [ 215, 216 ], [ 203, 217 ], [ 217, 218 ], [ 218, 219 ], [ 218, 220 ], [ 217, 221 ], [ 221, 222 ], [ 222, 223 ], [ 203, 224 ], [ 224, 225 ], [ 224, 226 ], [ 203, 227 ], [ 227, 228 ], [ 113, 229 ], [ 229, 230 ], [ 229, 231 ], [ 231, 232 ], [ 232, 233 ], [ 0, 234 ], [ 234, 235 ], [ 234, 236 ] ]
[ "import java.io.*;\nimport java.lang.*;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.BufferedReader;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\nimport java.math.BigInteger;\n\npublic class Main {\n static InputReader in = new InputReader(System.in);\n static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) {\n int n = in.nextInt();\n int want = in.nextInt();\n int[] a = new int[n];\n for(int i = 0; i<n; i++){\n a[i] = in.nextInt();\n }\n Arrays.sort(a);\n int sum = 0;\n for(int i = 0; i<want; i++){\n sum+=a[i];\n }\n out.println(sum);\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public String nextLine() {\n try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext() {\n String next = null;\n try {\n next = reader.readLine();\n } catch (Exception e) {\n }\n if (next == null) {\n return false;\n }\n tokenizer = new StringTokenizer(next);\n return true;\n }\n\n public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }\n }\n}\n", "import java.io.*;", "io.*", "java", "import java.lang.*;", "lang.*", "java", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "import java.math.BigInteger;", "BigInteger", "java.math", "public class Main {\n static InputReader in = new InputReader(System.in);\n static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) {\n int n = in.nextInt();\n int want = in.nextInt();\n int[] a = new int[n];\n for(int i = 0; i<n; i++){\n a[i] = in.nextInt();\n }\n Arrays.sort(a);\n int sum = 0;\n for(int i = 0; i<want; i++){\n sum+=a[i];\n }\n out.println(sum);\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public String nextLine() {\n try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext() {\n String next = null;\n try {\n next = reader.readLine();\n } catch (Exception e) {\n }\n if (next == null) {\n return false;\n }\n tokenizer = new StringTokenizer(next);\n return true;\n }\n\n public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }\n }\n}", "Main", "static InputReader in = new InputReader(System.in);", "in", "new InputReader(System.in)", "static PrintWriter out = new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "public static void main(String[] args) {\n int n = in.nextInt();\n int want = in.nextInt();\n int[] a = new int[n];\n for(int i = 0; i<n; i++){\n a[i] = in.nextInt();\n }\n Arrays.sort(a);\n int sum = 0;\n for(int i = 0; i<want; i++){\n sum+=a[i];\n }\n out.println(sum);\n out.close();\n }", "main", "{\n int n = in.nextInt();\n int want = in.nextInt();\n int[] a = new int[n];\n for(int i = 0; i<n; i++){\n a[i] = in.nextInt();\n }\n Arrays.sort(a);\n int sum = 0;\n for(int i = 0; i<want; i++){\n sum+=a[i];\n }\n out.println(sum);\n out.close();\n }", "int n = in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int want = in.nextInt();", "want", "in.nextInt()", "in.nextInt", "in", "int[] a = new int[n];", "a", "new int[n]", "n", "for(int i = 0; i<n; i++){\n a[i] = in.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i] = in.nextInt();\n }", "{\n a[i] = in.nextInt();\n }", "a[i] = in.nextInt()", "a[i]", "a", "i", "in.nextInt()", "in.nextInt", "in", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "int sum = 0;", "sum", "0", "for(int i = 0; i<want; i++){\n sum+=a[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i<want", "i", "want", "i++", "i++", "i", "{\n sum+=a[i];\n }", "{\n sum+=a[i];\n }", "sum+=a[i]", "sum", "a[i]", "a", "i", "out.println(sum)", "out.println", "out", "sum", "out.close()", "out.close", "out", "String[] args", "args", "static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public String nextLine() {\n try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext() {\n String next = null;\n try {\n next = reader.readLine();\n } catch (Exception e) {\n }\n if (next == null) {\n return false;\n }\n tokenizer = new StringTokenizer(next);\n return true;\n }\n\n public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }\n }", "InputReader", "public BufferedReader reader;", "reader", "public StringTokenizer tokenizer;", "tokenizer", "public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }", "InputReader", "{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }", "reader = new BufferedReader(new InputStreamReader(stream), 32768)", "reader", "new BufferedReader(new InputStreamReader(stream), 32768)", "tokenizer = null", "tokenizer", "null", "InputStream stream", "stream", "public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }", "next", "{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }", "while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "tokenizer == null || !tokenizer.hasMoreTokens()", "tokenizer == null", "tokenizer", "null", "!tokenizer.hasMoreTokens()", "tokenizer.hasMoreTokens()", "tokenizer.hasMoreTokens", "tokenizer", "{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }", "catch (IOException e) {\n throw new RuntimeException(e);\n }", "IOException e", "{\n throw new RuntimeException(e);\n }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{\n tokenizer = new StringTokenizer(reader.readLine());\n }", "tokenizer = new StringTokenizer(reader.readLine())", "tokenizer", "new StringTokenizer(reader.readLine())", "return tokenizer.nextToken();", "tokenizer.nextToken()", "tokenizer.nextToken", "tokenizer", "public int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "public long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "public double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "public String nextLine() {\n try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "nextLine", "{\n try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }", "catch (Exception e) {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n return reader.readLine();\n }", "return reader.readLine();", "reader.readLine()", "reader.readLine", "reader", "return null;", "null", "public boolean hasNext() {\n String next = null;\n try {\n next = reader.readLine();\n } catch (Exception e) {\n }\n if (next == null) {\n return false;\n }\n tokenizer = new StringTokenizer(next);\n return true;\n }", "hasNext", "{\n String next = null;\n try {\n next = reader.readLine();\n } catch (Exception e) {\n }\n if (next == null) {\n return false;\n }\n tokenizer = new StringTokenizer(next);\n return true;\n }", "String next = null;", "next", "null", "try {\n next = reader.readLine();\n } catch (Exception e) {\n }", "catch (Exception e) {\n }", "Exception e", "{\n }", "{\n next = reader.readLine();\n }", "next = reader.readLine()", "next", "reader.readLine()", "reader.readLine", "reader", "if (next == null) {\n return false;\n }", "next == null", "next", "null", "{\n return false;\n }", "return false;", "false", "tokenizer = new StringTokenizer(next)", "tokenizer", "new StringTokenizer(next)", "return true;", "true", "public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }", "nextBigInteger", "{\n return new BigInteger(next());\n }", "return new BigInteger(next());", "new BigInteger(next())", "public class Main {\n static InputReader in = new InputReader(System.in);\n static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) {\n int n = in.nextInt();\n int want = in.nextInt();\n int[] a = new int[n];\n for(int i = 0; i<n; i++){\n a[i] = in.nextInt();\n }\n Arrays.sort(a);\n int sum = 0;\n for(int i = 0; i<want; i++){\n sum+=a[i];\n }\n out.println(sum);\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public String nextLine() {\n try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext() {\n String next = null;\n try {\n next = reader.readLine();\n } catch (Exception e) {\n }\n if (next == null) {\n return false;\n }\n tokenizer = new StringTokenizer(next);\n return true;\n }\n\n public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }\n }\n}", "public class Main {\n static InputReader in = new InputReader(System.in);\n static PrintWriter out = new PrintWriter(System.out);\n\n public static void main(String[] args) {\n int n = in.nextInt();\n int want = in.nextInt();\n int[] a = new int[n];\n for(int i = 0; i<n; i++){\n a[i] = in.nextInt();\n }\n Arrays.sort(a);\n int sum = 0;\n for(int i = 0; i<want; i++){\n sum+=a[i];\n }\n out.println(sum);\n out.close();\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public String nextLine() {\n try {\n return reader.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext() {\n String next = null;\n try {\n next = reader.readLine();\n } catch (Exception e) {\n }\n if (next == null) {\n return false;\n }\n tokenizer = new StringTokenizer(next);\n return true;\n }\n\n public BigInteger nextBigInteger() {\n return new BigInteger(next());\n }\n }\n}", "Main" ]
import java.io.*; import java.lang.*; import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.Arrays; import java.util.StringTokenizer; import java.math.BigInteger; public class Main { static InputReader in = new InputReader(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) { int n = in.nextInt(); int want = in.nextInt(); int[] a = new int[n]; for(int i = 0; i<n; i++){ a[i] = in.nextInt(); } Arrays.sort(a); int sum = 0; for(int i = 0; i<want; i++){ sum+=a[i]; } out.println(sum); out.close(); } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String nextLine() { try { return reader.readLine(); } catch (Exception e) { e.printStackTrace(); } return null; } public boolean hasNext() { String next = null; try { next = reader.readLine(); } catch (Exception e) { } if (next == null) { return false; } tokenizer = new StringTokenizer(next); return true; } public BigInteger nextBigInteger() { return new BigInteger(next()); } } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 12, 13, 30, 6, 13, 41, 13, 20, 41, 13, 20, 12, 13, 30, 42, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 29, 4, 18, 13, 29, 17, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 30, 0, 13, 4, 18, 13, 14, 2, 13, 17, 30, 29, 17, 0, 13, 20, 29, 17, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 194, 8 ], [ 194, 9 ], [ 9, 10 ], [ 9, 11 ], [ 194, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 14, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 14, 56 ], [ 56, 57 ], [ 56, 58 ], [ 14, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 64, 65 ], [ 64, 66 ], [ 59, 67 ], [ 67, 68 ], [ 68, 69 ], [ 59, 70 ], [ 71, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 14, 77 ], [ 77, 78 ], [ 78, 79 ], [ 77, 80 ], [ 14, 81 ], [ 81, 82 ], [ 82, 83 ], [ 12, 84 ], [ 84, 85 ], [ 194, 86 ], [ 86, 87 ], [ 86, 88 ], [ 194, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 89, 94 ], [ 94, 95 ], [ 94, 96 ], [ 89, 97 ], [ 97, 98 ], [ 97, 99 ], [ 99, 100 ], [ 100, 101 ], [ 101, 102 ], [ 102, 103 ], [ 103, 104 ], [ 100, 105 ], [ 105, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 110, 111 ], [ 111, 112 ], [ 106, 113 ], [ 113, 114 ], [ 114, 115 ], [ 114, 116 ], [ 99, 117 ], [ 117, 118 ], [ 118, 119 ], [ 119, 120 ], [ 89, 121 ], [ 121, 122 ], [ 121, 123 ], [ 123, 124 ], [ 124, 125 ], [ 125, 126 ], [ 126, 127 ], [ 125, 128 ], [ 128, 129 ], [ 89, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 133, 134 ], [ 134, 135 ], [ 135, 136 ], [ 134, 137 ], [ 137, 138 ], [ 89, 139 ], [ 139, 140 ], [ 139, 141 ], [ 141, 142 ], [ 142, 143 ], [ 143, 144 ], [ 144, 145 ], [ 143, 146 ], [ 146, 147 ], [ 89, 148 ], [ 148, 149 ], [ 148, 150 ], [ 150, 151 ], [ 151, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 156, 157 ], [ 151, 158 ], [ 158, 159 ], [ 159, 160 ], [ 160, 161 ], [ 161, 162 ], [ 150, 163 ], [ 163, 164 ], [ 89, 165 ], [ 165, 166 ], [ 165, 167 ], [ 167, 168 ], [ 168, 169 ], [ 168, 170 ], [ 167, 171 ], [ 171, 172 ], [ 172, 173 ], [ 172, 174 ], [ 171, 175 ], [ 175, 176 ], [ 176, 177 ], [ 176, 178 ], [ 178, 179 ], [ 179, 180 ], [ 167, 181 ], [ 181, 182 ], [ 182, 183 ], [ 182, 184 ], [ 181, 185 ], [ 185, 186 ], [ 186, 187 ], [ 167, 188 ], [ 188, 189 ], [ 188, 190 ], [ 167, 191 ], [ 191, 192 ], [ 0, 193 ], [ 193, 194 ], [ 193, 195 ] ]
[ "/*\n Author: @__goku__\n [email protected]\n \n `\\-. `\n \\ `. `\n \\ \\ |\n __.._ | \\. S O N - G O K U\n ..---~~ ~ . | Y\n ~-. `| |\n `. `~~--.\n \\ ~.\n \\ \\__. . -- - .\n .-~~~~~ , , ~~~~~~---...._\n .-~___ ,'/ ,'/ ,'\\ __...---~~~\n ~-. /._\\_( ,(/_. 7,-. ~~---...__\n _...>- P\"\"6=`_/\"6\"~ 6) ___...--~~~\n ~~--._ \\`--') `---' 9' _..--~~~\n ~\\ ~~/_ ~~~ /`-.--~~\n `. --- .' \\_\n `. \" _.-' | ~-.,-------._\n ..._../~~ ./ .-' .-~~~-.\n ,--~~~ ,'...\\` _./.----~~.'/ /' `-\n _.-( |\\ `/~ _____..-' / / _.-~~`.\n / | /. ^---~~~~ ' / / ,' ~. \\\n ( / ( . _ ' /' / ,/ \\ )\n (`. | `\\ - - - - ~ /' ( / . |\n \\.\\| \\ /' \\ |`. /\n /.'\\\\ `\\ /' ~-\\ . /\\\n /, ( `\\ /' `.___..- \\\n | | \\ `\\_/' // \\. |\n | | | _Seal_ /' | | |\n */\n\nimport java.io.*;\nimport java.util.*;\n\npublic class Main\n{\n static PrintWriter out = new PrintWriter((System.out));\n\n public static void main(String args[]) throws IOException\n {\n Kioken sc = new Kioken();\n int n=sc.nextInt();\n int k=sc.nextInt();\n int ar[]=new int[n];\n for(int x=0;x<n;x++)\n {\n ar[x]=sc.nextInt();\n }\n Arrays.parallelSort(ar);\n int sum=0;\n for(int x=0;x<k;x++)\n {\n sum+=ar[x];\n }\n out.println(sum);\n out.close();\n }\n\n public static void kamehameha()\n {\n }\n\n static class Kioken\n {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n public String next()\n {\n while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n public int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n public long nextLong()\n {\n return Long.parseLong(next());\n }\n\n public double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n public String nextLine()\n {\n try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext()\n {\n String next = null;\n try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }\n if (next == null)\n {\n return false;\n }\n st = new StringTokenizer(next);\n return true;\n }\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main\n{\n static PrintWriter out = new PrintWriter((System.out));\n\n public static void main(String args[]) throws IOException\n {\n Kioken sc = new Kioken();\n int n=sc.nextInt();\n int k=sc.nextInt();\n int ar[]=new int[n];\n for(int x=0;x<n;x++)\n {\n ar[x]=sc.nextInt();\n }\n Arrays.parallelSort(ar);\n int sum=0;\n for(int x=0;x<k;x++)\n {\n sum+=ar[x];\n }\n out.println(sum);\n out.close();\n }\n\n public static void kamehameha()\n {\n }\n\n static class Kioken\n {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n public String next()\n {\n while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n public int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n public long nextLong()\n {\n return Long.parseLong(next());\n }\n\n public double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n public String nextLine()\n {\n try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext()\n {\n String next = null;\n try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }\n if (next == null)\n {\n return false;\n }\n st = new StringTokenizer(next);\n return true;\n }\n }\n}", "Main", "static PrintWriter out = new PrintWriter((System.out));", "out", "new PrintWriter((System.out))", "public static void main(String args[]) throws IOException\n {\n Kioken sc = new Kioken();\n int n=sc.nextInt();\n int k=sc.nextInt();\n int ar[]=new int[n];\n for(int x=0;x<n;x++)\n {\n ar[x]=sc.nextInt();\n }\n Arrays.parallelSort(ar);\n int sum=0;\n for(int x=0;x<k;x++)\n {\n sum+=ar[x];\n }\n out.println(sum);\n out.close();\n }", "main", "{\n Kioken sc = new Kioken();\n int n=sc.nextInt();\n int k=sc.nextInt();\n int ar[]=new int[n];\n for(int x=0;x<n;x++)\n {\n ar[x]=sc.nextInt();\n }\n Arrays.parallelSort(ar);\n int sum=0;\n for(int x=0;x<k;x++)\n {\n sum+=ar[x];\n }\n out.println(sum);\n out.close();\n }", "Kioken sc = new Kioken();", "sc", "new Kioken()", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k=sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int ar[]=new int[n];", "ar", "new int[n]", "n", "for(int x=0;x<n;x++)\n {\n ar[x]=sc.nextInt();\n }", "int x=0;", "int x=0;", "x", "0", "x<n", "x", "n", "x++", "x++", "x", "{\n ar[x]=sc.nextInt();\n }", "{\n ar[x]=sc.nextInt();\n }", "ar[x]=sc.nextInt()", "ar[x]", "ar", "x", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.parallelSort(ar)", "Arrays.parallelSort", "Arrays", "ar", "int sum=0;", "sum", "0", "for(int x=0;x<k;x++)\n {\n sum+=ar[x];\n }", "int x=0;", "int x=0;", "x", "0", "x<k", "x", "k", "x++", "x++", "x", "{\n sum+=ar[x];\n }", "{\n sum+=ar[x];\n }", "sum+=ar[x]", "sum", "ar[x]", "ar", "x", "out.println(sum)", "out.println", "out", "sum", "out.close()", "out.close", "out", "String args[]", "args", "public static void kamehameha()\n {\n }", "kamehameha", "{\n }", "static class Kioken\n {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n public String next()\n {\n while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n public int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n public long nextLong()\n {\n return Long.parseLong(next());\n }\n\n public double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n public String nextLine()\n {\n try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext()\n {\n String next = null;\n try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }\n if (next == null)\n {\n return false;\n }\n st = new StringTokenizer(next);\n return true;\n }\n }", "Kioken", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "StringTokenizer st = new StringTokenizer(\"\");", "st", "new StringTokenizer(\"\")", "public String next()\n {\n while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "{\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }", "catch (Exception e)\n {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "public int nextInt()\n {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "public long nextLong()\n {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "public double nextDouble()\n {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "public String nextLine()\n {\n try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n }", "nextLine", "{\n try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n }", "try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }", "catch (Exception e)\n {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n return br.readLine();\n }", "return br.readLine();", "br.readLine()", "br.readLine", "br", "return null;", "null", "public boolean hasNext()\n {\n String next = null;\n try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }\n if (next == null)\n {\n return false;\n }\n st = new StringTokenizer(next);\n return true;\n }", "hasNext", "{\n String next = null;\n try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }\n if (next == null)\n {\n return false;\n }\n st = new StringTokenizer(next);\n return true;\n }", "String next = null;", "next", "null", "try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }", "catch (Exception e)\n {\n }", "Exception e", "{\n }", "{\n next = br.readLine();\n }", "next = br.readLine()", "next", "br.readLine()", "br.readLine", "br", "if (next == null)\n {\n return false;\n }", "next == null", "next", "null", "{\n return false;\n }", "return false;", "false", "st = new StringTokenizer(next)", "st", "new StringTokenizer(next)", "return true;", "true", "public class Main\n{\n static PrintWriter out = new PrintWriter((System.out));\n\n public static void main(String args[]) throws IOException\n {\n Kioken sc = new Kioken();\n int n=sc.nextInt();\n int k=sc.nextInt();\n int ar[]=new int[n];\n for(int x=0;x<n;x++)\n {\n ar[x]=sc.nextInt();\n }\n Arrays.parallelSort(ar);\n int sum=0;\n for(int x=0;x<k;x++)\n {\n sum+=ar[x];\n }\n out.println(sum);\n out.close();\n }\n\n public static void kamehameha()\n {\n }\n\n static class Kioken\n {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n public String next()\n {\n while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n public int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n public long nextLong()\n {\n return Long.parseLong(next());\n }\n\n public double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n public String nextLine()\n {\n try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext()\n {\n String next = null;\n try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }\n if (next == null)\n {\n return false;\n }\n st = new StringTokenizer(next);\n return true;\n }\n }\n}", "public class Main\n{\n static PrintWriter out = new PrintWriter((System.out));\n\n public static void main(String args[]) throws IOException\n {\n Kioken sc = new Kioken();\n int n=sc.nextInt();\n int k=sc.nextInt();\n int ar[]=new int[n];\n for(int x=0;x<n;x++)\n {\n ar[x]=sc.nextInt();\n }\n Arrays.parallelSort(ar);\n int sum=0;\n for(int x=0;x<k;x++)\n {\n sum+=ar[x];\n }\n out.println(sum);\n out.close();\n }\n\n public static void kamehameha()\n {\n }\n\n static class Kioken\n {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n\n public String next()\n {\n while (!st.hasMoreTokens())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n public int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n public long nextLong()\n {\n return Long.parseLong(next());\n }\n\n public double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n public String nextLine()\n {\n try\n {\n return br.readLine();\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n }\n\n public boolean hasNext()\n {\n String next = null;\n try\n {\n next = br.readLine();\n } catch (Exception e)\n {\n }\n if (next == null)\n {\n return false;\n }\n st = new StringTokenizer(next);\n return true;\n }\n }\n}", "Main" ]
/* Author: @__goku__ [email protected] `\-. ` \ `. ` \ \ | __.._ | \. S O N - G O K U ..---~~ ~ . | Y ~-. `| | `. `~~--. \ ~. \ \__. . -- - . .-~~~~~ , , ~~~~~~---...._ .-~___ ,'/ ,'/ ,'\ __...---~~~ ~-. /._\_( ,(/_. 7,-. ~~---...__ _...>- P""6=`_/"6"~ 6) ___...--~~~ ~~--._ \`--') `---' 9' _..--~~~ ~\ ~~/_ ~~~ /`-.--~~ `. --- .' \_ `. " _.-' | ~-.,-------._ ..._../~~ ./ .-' .-~~~-. ,--~~~ ,'...\` _./.----~~.'/ /' `- _.-( |\ `/~ _____..-' / / _.-~~`. / | /. ^---~~~~ ' / / ,' ~. \ ( / ( . _ ' /' / ,/ \ ) (`. | `\ - - - - ~ /' ( / . | \.\| \ /' \ |`. / /.'\\ `\ /' ~-\ . /\ /, ( `\ /' `.___..- \ | | \ `\_/' // \. | | | | _Seal_ /' | | | */ import java.io.*; import java.util.*; public class Main { static PrintWriter out = new PrintWriter((System.out)); public static void main(String args[]) throws IOException { Kioken sc = new Kioken(); int n=sc.nextInt(); int k=sc.nextInt(); int ar[]=new int[n]; for(int x=0;x<n;x++) { ar[x]=sc.nextInt(); } Arrays.parallelSort(ar); int sum=0; for(int x=0;x<k;x++) { sum+=ar[x]; } out.println(sum); out.close(); } public static void kamehameha() { } static class Kioken { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public String next() { while (!st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (Exception e) { e.printStackTrace(); } } return st.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String nextLine() { try { return br.readLine(); } catch (Exception e) { e.printStackTrace(); } return null; } public boolean hasNext() { String next = null; try { next = br.readLine(); } catch (Exception e) { } if (next == null) { return false; } st = new StringTokenizer(next); return true; } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 14, 2, 13, 17, 30, 4, 18, 18, 13, 13, 18, 13, 17, 29, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 46, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 51, 56 ], [ 56, 57 ], [ 56, 58 ], [ 50, 59 ], [ 8, 60 ], [ 60, 61 ], [ 61, 62 ], [ 60, 63 ], [ 8, 64 ], [ 64, 65 ], [ 64, 66 ], [ 8, 67 ], [ 67, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 67, 72 ], [ 72, 73 ], [ 72, 74 ], [ 67, 75 ], [ 75, 76 ], [ 76, 77 ], [ 67, 78 ], [ 79, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 8, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 85, 90 ], [ 6, 91 ], [ 91, 92 ] ]
[ "import java.util.*;\n \nclass Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n //種類\n int n = sc.nextInt();\n //買う数\n int k = sc.nextInt();\n \n int[] p = new int[n];\n \n \n \n for(int i = 0; i < n;i++){\n \tp[i] = sc.nextInt();\n }\n \n if(n == 1){\n System.out.println(p[0]);\n return;\n }\n \n Arrays.sort(p);\n \n int total = 0;\n for(int i = 0; i < k;i++){\n total += p[i];\n }\n \n System.out.println(total);\n \n }\n}", "import java.util.*;", "util.*", "java", "class Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n //種類\n int n = sc.nextInt();\n //買う数\n int k = sc.nextInt();\n \n int[] p = new int[n];\n \n \n \n for(int i = 0; i < n;i++){\n \tp[i] = sc.nextInt();\n }\n \n if(n == 1){\n System.out.println(p[0]);\n return;\n }\n \n Arrays.sort(p);\n \n int total = 0;\n for(int i = 0; i < k;i++){\n total += p[i];\n }\n \n System.out.println(total);\n \n }\n}", "Main", "public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n //種類\n int n = sc.nextInt();\n //買う数\n int k = sc.nextInt();\n \n int[] p = new int[n];\n \n \n \n for(int i = 0; i < n;i++){\n \tp[i] = sc.nextInt();\n }\n \n if(n == 1){\n System.out.println(p[0]);\n return;\n }\n \n Arrays.sort(p);\n \n int total = 0;\n for(int i = 0; i < k;i++){\n total += p[i];\n }\n \n System.out.println(total);\n \n }", "main", "{\n Scanner sc = new Scanner(System.in);\n //種類\n int n = sc.nextInt();\n //買う数\n int k = sc.nextInt();\n \n int[] p = new int[n];\n \n \n \n for(int i = 0; i < n;i++){\n \tp[i] = sc.nextInt();\n }\n \n if(n == 1){\n System.out.println(p[0]);\n return;\n }\n \n Arrays.sort(p);\n \n int total = 0;\n for(int i = 0; i < k;i++){\n total += p[i];\n }\n \n System.out.println(total);\n \n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = new int[n];", "p", "new int[n]", "n", "for(int i = 0; i < n;i++){\n \tp[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n \tp[i] = sc.nextInt();\n }", "{\n \tp[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "if(n == 1){\n System.out.println(p[0]);\n return;\n }", "n == 1", "n", "1", "{\n System.out.println(p[0]);\n return;\n }", "System.out.println(p[0])", "System.out.println", "System.out", "System", "System.out", "p[0]", "p", "0", "return;", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int total = 0;", "total", "0", "for(int i = 0; i < k;i++){\n total += p[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n total += p[i];\n }", "{\n total += p[i];\n }", "total += p[i]", "total", "p[i]", "p", "i", "System.out.println(total)", "System.out.println", "System.out", "System", "System.out", "total", "String args[]", "args" ]
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); //種類 int n = sc.nextInt(); //買う数 int k = sc.nextInt(); int[] p = new int[n]; for(int i = 0; i < n;i++){ p[i] = sc.nextInt(); } if(n == 1){ System.out.println(p[0]); return; } Arrays.sort(p); int total = 0; for(int i = 0; i < k;i++){ total += p[i]; } System.out.println(total); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 41, 13, 41, 13, 20, 0, 13, 4, 18, 13, 0, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 8, 11 ], [ 11, 12 ], [ 8, 13 ], [ 13, 14 ], [ 13, 15 ], [ 8, 16 ], [ 16, 17 ], [ 16, 18 ], [ 18, 19 ], [ 19, 20 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 8, 26 ], [ 26, 27 ], [ 26, 28 ], [ 8, 30 ], [ 30, 31 ], [ 31, 32 ], [ 32, 33 ], [ 32, 34 ], [ 30, 35 ], [ 35, 36 ], [ 35, 37 ], [ 30, 38 ], [ 38, 39 ], [ 39, 40 ], [ 30, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 8, 53 ], [ 53, 54 ], [ 53, 55 ], [ 8, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 8, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 6, 79 ], [ 79, 80 ] ]
[ "import java.util.*;\n\nclass Main {\n public static void main(String[] args) {\n int n, k;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n k = sc.nextInt();\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i++)\n arr[i] = sc.nextInt();\n \n Arrays.sort(arr);\n int res = 0;\n for(int i = 0; i < k; i++)\n res += arr[i];\n \n System.out.println(res);\n }\n}", "import java.util.*;", "util.*", "java", "class Main {\n public static void main(String[] args) {\n int n, k;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n k = sc.nextInt();\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i++)\n arr[i] = sc.nextInt();\n \n Arrays.sort(arr);\n int res = 0;\n for(int i = 0; i < k; i++)\n res += arr[i];\n \n System.out.println(res);\n }\n}", "Main", "public static void main(String[] args) {\n int n, k;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n k = sc.nextInt();\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i++)\n arr[i] = sc.nextInt();\n \n Arrays.sort(arr);\n int res = 0;\n for(int i = 0; i < k; i++)\n res += arr[i];\n \n System.out.println(res);\n }", "main", "{\n int n, k;\n Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n k = sc.nextInt();\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i++)\n arr[i] = sc.nextInt();\n \n Arrays.sort(arr);\n int res = 0;\n for(int i = 0; i < k; i++)\n res += arr[i];\n \n System.out.println(res);\n }", "int n", "n", "k;", "k", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "n = sc.nextInt()", "n", "sc.nextInt()", "sc.nextInt", "sc", "k = sc.nextInt()", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] arr = new int[n];", "arr", "new int[n]", "n", "for(int i = 0; i < n; i++)\n arr[i] = sc.nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "arr[i] = sc.nextInt();", "arr[i] = sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int res = 0;", "res", "0", "for(int i = 0; i < k; i++)\n res += arr[i];", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "res += arr[i];", "res += arr[i]", "res", "arr[i]", "arr", "i", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String[] args", "args" ]
import java.util.*; class Main { public static void main(String[] args) { int n, k; Scanner sc = new Scanner(System.in); n = sc.nextInt(); k = sc.nextInt(); int[] arr = new int[n]; for(int i = 0; i < n; i++) arr[i] = sc.nextInt(); Arrays.sort(arr); int res = 0; for(int i = 0; i < k; i++) res += arr[i]; System.out.println(res); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 41, 13, 20, 4, 18, 13, 17, 13, 13, 4, 18, 13, 23, 13, 6, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 23, 13, 23, 13, 6, 13, 12, 13, 30, 41, 13, 18, 13, 13, 28, 13, 13, 30, 0, 13, 4, 18, 13, 13, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 17, 42, 2, 13, 17, 30, 14, 2, 2, 13, 17, 17, 0, 13, 2, 13, 13, 0, 13, 2, 13, 17, 0, 13, 2, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 17, 0, 13, 13, 42, 2, 13, 17, 30, 14, 2, 2, 13, 17, 17, 30, 0, 13, 13, 0, 13, 13, 0, 13, 17, 0, 13, 13, 0, 13, 13, 29, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 41, 13, 41, 13, 41, 13, 41, 13, 41, 13, 41, 13, 41, 13, 20, 13, 11, 1, 0, 13, 17, 2, 13, 13, 1, 0, 13, 17, 30, 30, 11, 1, 0, 13, 17, 2, 13, 2, 13, 17, 1, 0, 13, 2, 13, 17, 30, 30, 0, 13, 4, 18, 13, 2, 2, 13, 2, 13, 17, 17, 2, 13, 17, 0, 13, 4, 18, 13, 2, 2, 13, 13, 17, 2, 13, 17, 0, 13, 13, 0, 13, 2, 13, 17, 0, 13, 13, 42, 2, 2, 13, 13, 2, 13, 13, 0, 18, 13, 40, 13, 8, 2, 18, 13, 13, 18, 13, 13, 18, 13, 40, 13, 18, 13, 40, 13, 42, 2, 13, 13, 0, 18, 13, 40, 13, 18, 13, 40, 13, 42, 2, 13, 13, 0, 18, 13, 40, 13, 18, 13, 40, 13, 11, 1, 0, 13, 13, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 18, 13, 13, 23, 13, 12, 13, 30, 14, 2, 13, 17, 29, 13, 29, 4, 13, 2, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 4, 13, 18, 13, 13, 13, 29, 13, 23, 13, 23, 13, 6, 13, 41, 13, 41, 13, 20, 17, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 23, 13, 12, 13, 30, 14, 2, 13, 40, 17, 37, 20, 14, 2, 13, 13, 30, 0, 13, 17, 38, 5, 13, 30, 37, 20, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 29, 40, 17, 29, 18, 13, 40, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 20, 42, 40, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 14, 2, 13, 17, 29, 4, 18, 13, 13, 29, 2, 2, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 23, 13, 12, 13, 30, 29, 4, 13, 6, 13, 12, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 744, 20 ], [ 744, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 26, 28 ], [ 23, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 31, 33 ], [ 23, 34 ], [ 34, 35 ], [ 34, 36 ], [ 23, 37 ], [ 37, 38 ], [ 37, 39 ], [ 23, 40 ], [ 40, 41 ], [ 40, 42 ], [ 23, 43 ], [ 43, 44 ], [ 44, 45 ], [ 43, 46 ], [ 43, 47 ], [ 43, 48 ], [ 23, 49 ], [ 49, 50 ], [ 50, 51 ], [ 21, 52 ], [ 52, 53 ], [ 744, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 62, 63 ], [ 58, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 67, 68 ], [ 58, 69 ], [ 69, 70 ], [ 69, 71 ], [ 58, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 78, 79 ], [ 78, 80 ], [ 73, 81 ], [ 81, 82 ], [ 82, 83 ], [ 73, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 90, 91 ], [ 58, 92 ], [ 92, 93 ], [ 93, 94 ], [ 92, 95 ], [ 58, 96 ], [ 96, 97 ], [ 96, 98 ], [ 58, 99 ], [ 99, 100 ], [ 100, 101 ], [ 101, 102 ], [ 101, 103 ], [ 99, 104 ], [ 104, 105 ], [ 104, 106 ], [ 99, 107 ], [ 107, 108 ], [ 108, 109 ], [ 99, 110 ], [ 111, 111 ], [ 111, 112 ], [ 112, 113 ], [ 112, 114 ], [ 114, 115 ], [ 114, 116 ], [ 58, 117 ], [ 117, 118 ], [ 118, 119 ], [ 117, 120 ], [ 56, 121 ], [ 121, 122 ], [ 56, 123 ], [ 123, 124 ], [ 56, 125 ], [ 125, 126 ], [ 744, 127 ], [ 127, 128 ], [ 127, 129 ], [ 129, 130 ], [ 129, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 134, 135 ], [ 134, 136 ], [ 131, 137 ], [ 137, 138 ], [ 137, 139 ], [ 137, 140 ], [ 140, 141 ], [ 141, 142 ], [ 141, 143 ], [ 143, 144 ], [ 144, 145 ], [ 143, 146 ], [ 143, 147 ], [ 131, 148 ], [ 148, 149 ], [ 129, 150 ], [ 150, 151 ], [ 127, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 155, 157 ], [ 154, 158 ], [ 158, 159 ], [ 159, 160 ], [ 159, 161 ], [ 158, 162 ], [ 162, 163 ], [ 163, 164 ], [ 164, 165 ], [ 165, 166 ], [ 165, 167 ], [ 164, 168 ], [ 163, 169 ], [ 169, 170 ], [ 169, 171 ], [ 171, 172 ], [ 171, 173 ], [ 162, 174 ], [ 174, 175 ], [ 174, 176 ], [ 176, 177 ], [ 176, 178 ], [ 162, 179 ], [ 179, 180 ], [ 179, 181 ], [ 181, 182 ], [ 181, 183 ], [ 154, 184 ], [ 184, 185 ], [ 152, 186 ], [ 186, 187 ], [ 152, 188 ], [ 188, 189 ], [ 127, 190 ], [ 190, 191 ], [ 190, 192 ], [ 192, 193 ], [ 193, 194 ], [ 193, 195 ], [ 192, 196 ], [ 196, 197 ], [ 196, 198 ], [ 192, 199 ], [ 199, 200 ], [ 200, 201 ], [ 200, 202 ], [ 199, 203 ], [ 203, 204 ], [ 204, 205 ], [ 205, 206 ], [ 206, 207 ], [ 206, 208 ], [ 205, 209 ], [ 204, 210 ], [ 210, 211 ], [ 211, 212 ], [ 211, 213 ], [ 210, 214 ], [ 214, 215 ], [ 214, 216 ], [ 203, 217 ], [ 217, 218 ], [ 217, 219 ], [ 203, 220 ], [ 220, 221 ], [ 220, 222 ], [ 203, 223 ], [ 223, 224 ], [ 223, 225 ], [ 192, 226 ], [ 226, 227 ], [ 190, 228 ], [ 228, 229 ], [ 190, 230 ], [ 230, 231 ], [ 190, 232 ], [ 232, 233 ], [ 127, 234 ], [ 234, 235 ], [ 234, 236 ], [ 236, 237 ], [ 237, 238 ], [ 237, 239 ], [ 239, 240 ], [ 239, 241 ], [ 236, 242 ], [ 242, 243 ], [ 236, 244 ], [ 244, 245 ], [ 236, 246 ], [ 246, 247 ], [ 236, 248 ], [ 248, 249 ], [ 236, 250 ], [ 250, 251 ], [ 236, 252 ], [ 252, 253 ], [ 236, 254 ], [ 254, 255 ], [ 236, 256 ], [ 256, 257 ], [ 256, 258 ], [ 236, 260 ], [ 260, 261 ], [ 261, 262 ], [ 262, 263 ], [ 262, 264 ], [ 260, 265 ], [ 265, 266 ], [ 265, 267 ], [ 260, 268 ], [ 268, 269 ], [ 269, 270 ], [ 269, 271 ], [ 260, 272 ], [ 273, 273 ], [ 273, 274 ], [ 274, 275 ], [ 275, 276 ], [ 276, 277 ], [ 276, 278 ], [ 274, 279 ], [ 279, 280 ], [ 279, 281 ], [ 281, 282 ], [ 281, 283 ], [ 274, 284 ], [ 284, 285 ], [ 285, 286 ], [ 285, 287 ], [ 287, 288 ], [ 287, 289 ], [ 274, 290 ], [ 291, 291 ], [ 291, 292 ], [ 292, 293 ], [ 292, 294 ], [ 294, 295 ], [ 295, 296 ], [ 294, 297 ], [ 297, 298 ], [ 298, 299 ], [ 298, 300 ], [ 300, 301 ], [ 300, 302 ], [ 297, 303 ], [ 294, 304 ], [ 304, 305 ], [ 304, 306 ], [ 291, 307 ], [ 307, 308 ], [ 307, 309 ], [ 309, 310 ], [ 310, 311 ], [ 309, 312 ], [ 312, 313 ], [ 313, 314 ], [ 313, 315 ], [ 312, 316 ], [ 309, 317 ], [ 317, 318 ], [ 317, 319 ], [ 291, 320 ], [ 320, 321 ], [ 320, 322 ], [ 291, 323 ], [ 323, 324 ], [ 323, 325 ], [ 325, 326 ], [ 325, 327 ], [ 291, 328 ], [ 328, 329 ], [ 328, 330 ], [ 291, 331 ], [ 331, 332 ], [ 332, 333 ], [ 333, 334 ], [ 333, 335 ], [ 332, 336 ], [ 336, 337 ], [ 336, 338 ], [ 331, 339 ], [ 339, 340 ], [ 340, 341 ], [ 340, 342 ], [ 342, 343 ], [ 339, 344 ], [ 344, 345 ], [ 345, 346 ], [ 346, 347 ], [ 346, 348 ], [ 345, 349 ], [ 349, 350 ], [ 349, 351 ], [ 344, 352 ], [ 352, 353 ], [ 352, 354 ], [ 354, 355 ], [ 344, 356 ], [ 356, 357 ], [ 356, 358 ], [ 358, 359 ], [ 291, 360 ], [ 360, 361 ], [ 361, 362 ], [ 361, 363 ], [ 360, 364 ], [ 364, 365 ], [ 365, 366 ], [ 365, 367 ], [ 367, 368 ], [ 364, 369 ], [ 369, 370 ], [ 369, 371 ], [ 371, 372 ], [ 291, 373 ], [ 373, 374 ], [ 374, 375 ], [ 374, 376 ], [ 373, 377 ], [ 377, 378 ], [ 378, 379 ], [ 378, 380 ], [ 380, 381 ], [ 377, 382 ], [ 382, 383 ], [ 382, 384 ], [ 384, 385 ], [ 291, 386 ], [ 386, 387 ], [ 387, 388 ], [ 388, 389 ], [ 388, 390 ], [ 386, 391 ], [ 391, 392 ], [ 391, 393 ], [ 386, 394 ], [ 394, 395 ], [ 395, 396 ], [ 386, 397 ], [ 397, 398 ], [ 398, 399 ], [ 399, 400 ], [ 399, 401 ], [ 398, 402 ], [ 402, 403 ], [ 402, 404 ], [ 234, 405 ], [ 405, 406 ], [ 127, 407 ], [ 407, 408 ], [ 407, 409 ], [ 409, 410 ], [ 410, 411 ], [ 411, 412 ], [ 411, 413 ], [ 410, 414 ], [ 414, 415 ], [ 409, 416 ], [ 416, 417 ], [ 417, 418 ], [ 417, 419 ], [ 419, 420 ], [ 419, 421 ], [ 417, 422 ], [ 407, 423 ], [ 423, 424 ], [ 407, 425 ], [ 425, 426 ], [ 127, 427 ], [ 427, 428 ], [ 427, 429 ], [ 429, 430 ], [ 430, 431 ], [ 430, 432 ], [ 432, 433 ], [ 432, 434 ], [ 429, 435 ], [ 435, 436 ], [ 436, 437 ], [ 437, 438 ], [ 437, 439 ], [ 435, 440 ], [ 440, 441 ], [ 440, 442 ], [ 435, 443 ], [ 443, 444 ], [ 444, 445 ], [ 435, 446 ], [ 446, 447 ], [ 447, 448 ], [ 447, 449 ], [ 449, 450 ], [ 449, 451 ], [ 451, 452 ], [ 451, 453 ], [ 449, 454 ], [ 429, 455 ], [ 455, 456 ], [ 427, 457 ], [ 457, 458 ], [ 427, 459 ], [ 459, 460 ], [ 744, 461 ], [ 461, 462 ], [ 461, 463 ], [ 463, 464 ], [ 461, 465 ], [ 465, 466 ], [ 465, 467 ], [ 461, 469 ], [ 469, 470 ], [ 461, 471 ], [ 471, 472 ], [ 461, 473 ], [ 473, 474 ], [ 461, 475 ], [ 475, 476 ], [ 475, 477 ], [ 477, 478 ], [ 478, 479 ], [ 479, 480 ], [ 479, 481 ], [ 478, 482 ], [ 475, 483 ], [ 483, 484 ], [ 461, 485 ], [ 485, 486 ], [ 485, 487 ], [ 487, 488 ], [ 488, 489 ], [ 489, 490 ], [ 489, 491 ], [ 491, 492 ], [ 488, 493 ], [ 493, 494 ], [ 487, 495 ], [ 495, 496 ], [ 496, 497 ], [ 496, 498 ], [ 495, 499 ], [ 499, 500 ], [ 500, 501 ], [ 500, 502 ], [ 499, 503 ], [ 503, 504 ], [ 504, 505 ], [ 504, 506 ], [ 506, 507 ], [ 507, 508 ], [ 503, 509 ], [ 509, 510 ], [ 510, 511 ], [ 510, 512 ], [ 512, 513 ], [ 513, 514 ], [ 512, 515 ], [ 499, 516 ], [ 516, 517 ], [ 517, 518 ], [ 517, 519 ], [ 516, 520 ], [ 520, 521 ], [ 521, 522 ], [ 487, 523 ], [ 523, 524 ], [ 524, 525 ], [ 524, 526 ], [ 526, 527 ], [ 461, 528 ], [ 528, 529 ], [ 528, 530 ], [ 530, 531 ], [ 531, 532 ], [ 531, 533 ], [ 533, 534 ], [ 530, 535 ], [ 535, 536 ], [ 536, 537 ], [ 536, 538 ], [ 535, 539 ], [ 539, 540 ], [ 539, 541 ], [ 541, 542 ], [ 530, 543 ], [ 543, 544 ], [ 543, 545 ], [ 530, 546 ], [ 546, 547 ], [ 547, 548 ], [ 547, 549 ], [ 546, 550 ], [ 550, 551 ], [ 551, 552 ], [ 551, 553 ], [ 553, 554 ], [ 550, 555 ], [ 555, 556 ], [ 555, 557 ], [ 557, 558 ], [ 530, 559 ], [ 559, 560 ], [ 559, 561 ], [ 530, 562 ], [ 562, 563 ], [ 563, 564 ], [ 564, 565 ], [ 564, 566 ], [ 562, 567 ], [ 567, 568 ], [ 568, 569 ], [ 569, 570 ], [ 570, 571 ], [ 570, 572 ], [ 569, 573 ], [ 573, 574 ], [ 573, 575 ], [ 568, 576 ], [ 576, 577 ], [ 567, 578 ], [ 578, 579 ], [ 578, 580 ], [ 567, 581 ], [ 581, 582 ], [ 581, 583 ], [ 583, 584 ], [ 583, 585 ], [ 567, 586 ], [ 586, 587 ], [ 586, 588 ], [ 588, 589 ], [ 530, 590 ], [ 590, 591 ], [ 591, 592 ], [ 591, 593 ], [ 461, 594 ], [ 594, 595 ], [ 594, 596 ], [ 596, 597 ], [ 597, 598 ], [ 597, 599 ], [ 599, 600 ], [ 596, 601 ], [ 601, 602 ], [ 602, 603 ], [ 602, 604 ], [ 601, 605 ], [ 605, 606 ], [ 605, 607 ], [ 607, 608 ], [ 596, 609 ], [ 609, 610 ], [ 609, 611 ], [ 596, 612 ], [ 612, 613 ], [ 613, 614 ], [ 613, 615 ], [ 612, 616 ], [ 616, 617 ], [ 617, 618 ], [ 617, 619 ], [ 619, 620 ], [ 616, 621 ], [ 621, 622 ], [ 621, 623 ], [ 623, 624 ], [ 596, 625 ], [ 625, 626 ], [ 625, 627 ], [ 596, 628 ], [ 628, 629 ], [ 629, 630 ], [ 630, 631 ], [ 630, 632 ], [ 628, 633 ], [ 633, 634 ], [ 634, 635 ], [ 635, 636 ], [ 636, 637 ], [ 636, 638 ], [ 635, 639 ], [ 639, 640 ], [ 639, 641 ], [ 634, 642 ], [ 642, 643 ], [ 633, 644 ], [ 644, 645 ], [ 644, 646 ], [ 633, 647 ], [ 647, 648 ], [ 647, 649 ], [ 649, 650 ], [ 649, 651 ], [ 633, 652 ], [ 652, 653 ], [ 652, 654 ], [ 654, 655 ], [ 596, 656 ], [ 656, 657 ], [ 657, 658 ], [ 657, 659 ], [ 461, 660 ], [ 660, 661 ], [ 660, 662 ], [ 662, 663 ], [ 663, 664 ], [ 663, 665 ], [ 665, 666 ], [ 662, 667 ], [ 667, 668 ], [ 668, 669 ], [ 668, 670 ], [ 667, 671 ], [ 671, 672 ], [ 671, 673 ], [ 673, 674 ], [ 662, 675 ], [ 675, 676 ], [ 675, 677 ], [ 662, 678 ], [ 678, 679 ], [ 679, 680 ], [ 680, 681 ], [ 680, 682 ], [ 678, 683 ], [ 683, 684 ], [ 684, 685 ], [ 685, 686 ], [ 684, 687 ], [ 683, 688 ], [ 688, 689 ], [ 688, 690 ], [ 690, 691 ], [ 662, 692 ], [ 692, 693 ], [ 693, 694 ], [ 694, 695 ], [ 461, 696 ], [ 696, 697 ], [ 696, 698 ], [ 698, 699 ], [ 699, 700 ], [ 700, 701 ], [ 700, 702 ], [ 699, 703 ], [ 703, 704 ], [ 704, 705 ], [ 705, 706 ], [ 704, 707 ], [ 698, 708 ], [ 708, 709 ], [ 712, 710 ], [ 722, 711 ], [ 719, 712 ], [ 712, 713 ], [ 713, 714 ], [ 713, 715 ], [ 712, 716 ], [ 716, 717 ], [ 716, 718 ], [ 719, 719 ], [ 719, 720 ], [ 719, 721 ], [ 722, 722 ], [ 722, 723 ], [ 722, 724 ], [ 712, 725 ], [ 725, 726 ], [ 725, 727 ], [ 727, 728 ], [ 696, 729 ], [ 729, 730 ], [ 461, 731 ], [ 731, 732 ], [ 731, 733 ], [ 733, 734 ], [ 734, 735 ], [ 735, 736 ], [ 461, 737 ], [ 737, 738 ], [ 737, 739 ], [ 739, 740 ], [ 739, 741 ], [ 741, 742 ], [ 0, 743 ], [ 743, 744 ], [ 743, 745 ] ]
[ "import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.*;\nimport java.util.InputMismatchException;\n\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author Manan Patel\n */\npublic class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n Solution solver = new Solution();\n //int testCount = Integer.parseInt(in.next());\n //for (int i = 1; i <= testCount; i++)\n solver.solve(1 , in, w);\n w.close();\n }\n\n static class Solution {\n public void solve(int tc, InputReader sc, PrintWriter w) {\n int n = sc.nextInt() , k = sc.nextInt();\n int a[] = new int[n];\n for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();\n f.sort(a);\n int sum = 0;\n for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }\n w.println(sum);\n }\n }\n static class f{\n public static long max(long a[]){\n long ans = Long.MIN_VALUE;\n for (long i : a)\n ans = Math.max(ans , i);\n return ans;\n }\n public static long power(long x, int y){\n long res = 1;\n while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }\n return res;\n }\n public static long powerm(long x, long y, long p) {\n long res = 1;\n x %= p;\n while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }\n return res;\n }\n public static void sort(int[] arr) {\n int n = arr.length, mid, h, s, l, i, j, k;\n int[] res = new int[n];\n for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }\n }\n public static long gcd(long a, long b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n public static long findGCD(long arr[], int n)\n {\n long result = arr[0];\n for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);\n return result;\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n}", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.*;", "util.*", "java", "import java.util.InputMismatchException;", "InputMismatchException", "java.util", "public class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n Solution solver = new Solution();\n //int testCount = Integer.parseInt(in.next());\n //for (int i = 1; i <= testCount; i++)\n solver.solve(1 , in, w);\n w.close();\n }\n\n static class Solution {\n public void solve(int tc, InputReader sc, PrintWriter w) {\n int n = sc.nextInt() , k = sc.nextInt();\n int a[] = new int[n];\n for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();\n f.sort(a);\n int sum = 0;\n for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }\n w.println(sum);\n }\n }\n static class f{\n public static long max(long a[]){\n long ans = Long.MIN_VALUE;\n for (long i : a)\n ans = Math.max(ans , i);\n return ans;\n }\n public static long power(long x, int y){\n long res = 1;\n while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }\n return res;\n }\n public static long powerm(long x, long y, long p) {\n long res = 1;\n x %= p;\n while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }\n return res;\n }\n public static void sort(int[] arr) {\n int n = arr.length, mid, h, s, l, i, j, k;\n int[] res = new int[n];\n for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }\n }\n public static long gcd(long a, long b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n public static long findGCD(long arr[], int n)\n {\n long result = arr[0];\n for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);\n return result;\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n}", "Main", "public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n Solution solver = new Solution();\n //int testCount = Integer.parseInt(in.next());\n //for (int i = 1; i <= testCount; i++)\n solver.solve(1 , in, w);\n w.close();\n }", "main", "{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n Solution solver = new Solution();\n //int testCount = Integer.parseInt(in.next());\n //for (int i = 1; i <= testCount; i++)\n solver.solve(1 , in, w);\n w.close();\n }", "InputStream inputStream = System.in;", "inputStream", "System.in", "System", "System.in", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "InputReader in = new InputReader(inputStream);", "in", "new InputReader(inputStream)", "PrintWriter w = new PrintWriter(outputStream);", "w", "new PrintWriter(outputStream)", "Solution solver = new Solution();", "solver", "new Solution()", "solver.solve(1 , in, w)", "solver.solve", "solver", "1", "in", "w", "w.close()", "w.close", "w", "String[] args", "args", "static class Solution {\n public void solve(int tc, InputReader sc, PrintWriter w) {\n int n = sc.nextInt() , k = sc.nextInt();\n int a[] = new int[n];\n for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();\n f.sort(a);\n int sum = 0;\n for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }\n w.println(sum);\n }\n }", "Solution", "public void solve(int tc, InputReader sc, PrintWriter w) {\n int n = sc.nextInt() , k = sc.nextInt();\n int a[] = new int[n];\n for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();\n f.sort(a);\n int sum = 0;\n for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }\n w.println(sum);\n }", "solve", "{\n int n = sc.nextInt() , k = sc.nextInt();\n int a[] = new int[n];\n for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();\n f.sort(a);\n int sum = 0;\n for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }\n w.println(sum);\n }", "int n = sc.nextInt()", "n", "sc.nextInt()", "sc.nextInt", "sc", "k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int a[] = new int[n];", "a", "new int[n]", "n", "for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = sc.nextInt();", "a[i] = sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "f.sort(a)", "f.sort", "f", "a", "int sum = 0;", "sum", "0", "for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n sum += a[i];\n }", "{\n sum += a[i];\n }", "sum += a[i]", "sum", "a[i]", "a", "i", "w.println(sum)", "w.println", "w", "sum", "int tc", "tc", "InputReader sc", "sc", "PrintWriter w", "w", "static class f{\n public static long max(long a[]){\n long ans = Long.MIN_VALUE;\n for (long i : a)\n ans = Math.max(ans , i);\n return ans;\n }\n public static long power(long x, int y){\n long res = 1;\n while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }\n return res;\n }\n public static long powerm(long x, long y, long p) {\n long res = 1;\n x %= p;\n while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }\n return res;\n }\n public static void sort(int[] arr) {\n int n = arr.length, mid, h, s, l, i, j, k;\n int[] res = new int[n];\n for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }\n }\n public static long gcd(long a, long b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n public static long findGCD(long arr[], int n)\n {\n long result = arr[0];\n for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);\n return result;\n }\n\n }", "f", "public static long max(long a[]){\n long ans = Long.MIN_VALUE;\n for (long i : a)\n ans = Math.max(ans , i);\n return ans;\n }", "max", "{\n long ans = Long.MIN_VALUE;\n for (long i : a)\n ans = Math.max(ans , i);\n return ans;\n }", "long ans = Long.MIN_VALUE;", "ans", "Long.MIN_VALUE", "Long", "Long.MIN_VALUE", "for (long i : a)\n ans = Math.max(ans , i);", "long i", "a", "ans = Math.max(ans , i);", "ans = Math.max(ans , i)", "ans", "Math.max(ans , i)", "Math.max", "Math", "ans", "i", "return ans;", "ans", "long a[]", "a", "public static long power(long x, int y){\n long res = 1;\n while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }\n return res;\n }", "power", "{\n long res = 1;\n while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }\n return res;\n }", "long res = 1;", "res", "1", "while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }", "y > 0", "y", "0", "{\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }", "if ((y & 1) == 1)\n res = (res*x);", "(y & 1) == 1", "(y & 1)", "y", "1", "1", "res = (res*x)", "res", "(res*x)", "res", "x", "y = y >> 1", "y", "y >> 1", "y", "1", "x = x * x", "x", "x * x", "x", "x", "return res;", "res", "long x", "x", "int y", "y", "public static long powerm(long x, long y, long p) {\n long res = 1;\n x %= p;\n while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }\n return res;\n }", "powerm", "{\n long res = 1;\n x %= p;\n while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }\n return res;\n }", "long res = 1;", "res", "1", "x %= p", "x", "p", "while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }", "y > 0", "y", "0", "{\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }", "if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }", "(y & 1) == 1", "(y & 1)", "y", "1", "1", "{\n res *= x;\n res %= p;\n }", "res *= x", "res", "x", "res %= p", "res", "p", "y >>= 1", "y", "1", "x *= x", "x", "x", "x %= p", "x", "p", "return res;", "res", "long x", "x", "long y", "y", "long p", "p", "public static void sort(int[] arr) {\n int n = arr.length, mid, h, s, l, i, j, k;\n int[] res = new int[n];\n for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }\n }", "sort", "{\n int n = arr.length, mid, h, s, l, i, j, k;\n int[] res = new int[n];\n for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }\n }", "int n = arr.length", "n", "arr.length", "arr", "arr.length", "mid", "mid", "h", "h", "s", "s", "l", "l", "i", "i", "j", "j", "k;", "k", "int[] res = new int[n];", "res", "new int[n]", "n", "for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }", "s = 1;", "s = 1", "s", "1", "s < n", "s", "n", "s <<= 1", "s <<= 1", "s", "1", "{\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }", "{\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }", "for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }", "l = 0;", "l = 0", "l", "0", "l < n - 1", "l", "n - 1", "n", "1", "l += (s << 1)", "l += (s << 1)", "l", "(s << 1)", "s", "1", "{\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }", "{\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }", "h = Math.min(l + (s << 1) - 1, n - 1)", "h", "Math.min(l + (s << 1) - 1, n - 1)", "Math.min", "Math", "l + (s << 1) - 1", "l + (s << 1)", "l", "(s << 1)", "s", "1", "1", "n - 1", "n", "1", "mid = Math.min(l + s - 1, n - 1)", "mid", "Math.min(l + s - 1, n - 1)", "Math.min", "Math", "l + s - 1", "l + s", "l", "s", "1", "n - 1", "n", "1", "i = l", "i", "l", "j = mid + 1", "j", "mid + 1", "mid", "1", "k = l", "k", "l", "while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);", "i <= mid && j <= h", "i <= mid", "i", "mid", "j <= h", "j", "h", "res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++])", "res[k++]", "res", "k++", "k", "(arr[i] <= arr[j] ? arr[i++] : arr[j++])", "arr[i] <= arr[j]", "arr[i]", "arr", "i", "arr[j]", "arr", "j", "arr[i++]", "arr", "i++", "i", "arr[j++]", "arr", "j++", "j", "while (i <= mid)\n res[k++] = arr[i++];", "i <= mid", "i", "mid", "res[k++] = arr[i++]", "res[k++]", "res", "k++", "k", "arr[i++]", "arr", "i++", "i", "while (j <= h)\n res[k++] = arr[j++];", "j <= h", "j", "h", "res[k++] = arr[j++]", "res[k++]", "res", "k++", "k", "arr[j++]", "arr", "j++", "j", "for (k = l; k <= h; k++)\n arr[k] = res[k];", "k = l;", "k = l", "k", "l", "k <= h", "k", "h", "k++", "k++", "k", "arr[k] = res[k];", "arr[k] = res[k]", "arr[k]", "arr", "k", "res[k]", "res", "k", "int[] arr", "arr", "public static long gcd(long a, long b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }", "gcd", "{\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }", "if (a == 0)\n return b;", "a == 0", "a", "0", "return b;", "b", "return gcd(b % a, a);", "gcd(b % a, a)", "gcd", "b % a", "b", "a", "a", "long a", "a", "long b", "b", "public static long findGCD(long arr[], int n)\n {\n long result = arr[0];\n for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);\n return result;\n }", "findGCD", "{\n long result = arr[0];\n for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);\n return result;\n }", "long result = arr[0];", "result", "arr[0]", "arr", "0", "for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);", "int i = 1;", "int i = 1;", "i", "1", "i < n", "i", "n", "i++", "i++", "i", "result = gcd(arr[i], result);", "result = gcd(arr[i], result)", "result", "gcd(arr[i], result)", "gcd", "arr[i]", "arr", "i", "result", "return result;", "result", "long arr[]", "arr", "int n", "n", "static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }", "InputReader", "private InputStream stream;", "stream", "private byte[] buf = new byte[1024];", "buf", "new byte[1024]", "1024", "private int curChar;", "curChar", "private int numChars;", "numChars", "private InputReader.SpaceCharFilter filter;", "filter", "public InputReader(InputStream stream) {\n this.stream = stream;\n }", "InputReader", "{\n this.stream = stream;\n }", "this.stream = stream", "this.stream", "this", "this.stream", "stream", "InputStream stream", "stream", "public int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "read", "{\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "if (numChars == -1)\n throw new InputMismatchException();", "numChars == -1", "numChars", "-1", "1", "throw new InputMismatchException();", "new InputMismatchException()", "if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }", "curChar >= numChars", "curChar", "numChars", "{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }", "curChar = 0", "curChar", "0", "try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }", "catch (IOException e) {\n throw new InputMismatchException();\n }", "IOException e", "{\n throw new InputMismatchException();\n }", "throw new InputMismatchException();", "new InputMismatchException()", "{\n numChars = stream.read(buf);\n }", "numChars = stream.read(buf)", "numChars", "stream.read(buf)", "stream.read", "stream", "buf", "if (numChars <= 0)\n return -1;", "numChars <= 0", "numChars", "0", "return -1;", "-1", "1", "return buf[curChar++];", "buf[curChar++]", "buf", "curChar++", "curChar", "public int nextInt() {\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }", "nextInt", "{\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "int res = 0;", "res", "0", "do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "nextLong", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "long res = 0;", "res", "0", "do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res.toString();\n }", "readString", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res.toString();\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "StringBuilder res = new StringBuilder();", "res", "new StringBuilder()", "do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n res.appendCodePoint(c);\n c = read();\n }", "res.appendCodePoint(c)", "res.appendCodePoint", "res", "c", "c = read()", "c", "read()", "read", "return res.toString();", "res.toString()", "res.toString", "res", "public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "isSpaceChar", "{\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "if (filter != null)\n return filter.isSpaceChar(c);", "filter != null", "filter", "null", "return filter.isSpaceChar(c);", "filter.isSpaceChar(c)", "filter.isSpaceChar", "filter", "c", "return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == '\\t'", "c == '\\r'", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == ' '", "c", "' '", "c == '\\n'", "c", "'\\n'", "c == '\\r'", "c", "'\\r'", "c == '\\t'", "c", "'\\t'", "c == -1", "c", "-1", "1", "int c", "c", "public String next() {\n return readString();\n }", "next", "{\n return readString();\n }", "return readString();", "readString()", "readString", "public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }", "SpaceCharFilter", "public boolean isSpaceChar(int ch);", "isSpaceChar", "int ch", "ch", "public class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n Solution solver = new Solution();\n //int testCount = Integer.parseInt(in.next());\n //for (int i = 1; i <= testCount; i++)\n solver.solve(1 , in, w);\n w.close();\n }\n\n static class Solution {\n public void solve(int tc, InputReader sc, PrintWriter w) {\n int n = sc.nextInt() , k = sc.nextInt();\n int a[] = new int[n];\n for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();\n f.sort(a);\n int sum = 0;\n for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }\n w.println(sum);\n }\n }\n static class f{\n public static long max(long a[]){\n long ans = Long.MIN_VALUE;\n for (long i : a)\n ans = Math.max(ans , i);\n return ans;\n }\n public static long power(long x, int y){\n long res = 1;\n while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }\n return res;\n }\n public static long powerm(long x, long y, long p) {\n long res = 1;\n x %= p;\n while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }\n return res;\n }\n public static void sort(int[] arr) {\n int n = arr.length, mid, h, s, l, i, j, k;\n int[] res = new int[n];\n for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }\n }\n public static long gcd(long a, long b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n public static long findGCD(long arr[], int n)\n {\n long result = arr[0];\n for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);\n return result;\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n}", "public class Main{\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n Solution solver = new Solution();\n //int testCount = Integer.parseInt(in.next());\n //for (int i = 1; i <= testCount; i++)\n solver.solve(1 , in, w);\n w.close();\n }\n\n static class Solution {\n public void solve(int tc, InputReader sc, PrintWriter w) {\n int n = sc.nextInt() , k = sc.nextInt();\n int a[] = new int[n];\n for(int i = 0 ; i < n ; i++)\n a[i] = sc.nextInt();\n f.sort(a);\n int sum = 0;\n for (int i = 0 ; i < k ; i++){\n sum += a[i];\n }\n w.println(sum);\n }\n }\n static class f{\n public static long max(long a[]){\n long ans = Long.MIN_VALUE;\n for (long i : a)\n ans = Math.max(ans , i);\n return ans;\n }\n public static long power(long x, int y){\n long res = 1;\n while (y > 0)\n {\n if ((y & 1) == 1)\n res = (res*x);\n y = y >> 1;\n x = x * x;\n }\n return res;\n }\n public static long powerm(long x, long y, long p) {\n long res = 1;\n x %= p;\n while (y > 0) {\n if ((y & 1) == 1) {\n res *= x;\n res %= p;\n }\n y >>= 1;\n x *= x;\n x %= p;\n }\n return res;\n }\n public static void sort(int[] arr) {\n int n = arr.length, mid, h, s, l, i, j, k;\n int[] res = new int[n];\n for (s = 1; s < n; s <<= 1) {\n for (l = 0; l < n - 1; l += (s << 1)) {\n h = Math.min(l + (s << 1) - 1, n - 1);\n mid = Math.min(l + s - 1, n - 1);\n i = l;\n j = mid + 1;\n k = l;\n while (i <= mid && j <= h)\n res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]);\n while (i <= mid)\n res[k++] = arr[i++];\n while (j <= h)\n res[k++] = arr[j++];\n for (k = l; k <= h; k++)\n arr[k] = res[k];\n }\n }\n }\n public static long gcd(long a, long b)\n {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n public static long findGCD(long arr[], int n)\n {\n long result = arr[0];\n for (int i = 1; i < n; i++)\n result = gcd(arr[i], result);\n return result;\n }\n\n }\n\n static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1)\n throw new InputMismatchException();\n\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n\n if (numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n\n while (isSpaceChar(c))\n c = read();\n\n int sgn = 1;\n\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n\n}", "Main" ]
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import java.util.InputMismatchException; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Manan Patel */ public class Main{ public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter w = new PrintWriter(outputStream); Solution solver = new Solution(); //int testCount = Integer.parseInt(in.next()); //for (int i = 1; i <= testCount; i++) solver.solve(1 , in, w); w.close(); } static class Solution { public void solve(int tc, InputReader sc, PrintWriter w) { int n = sc.nextInt() , k = sc.nextInt(); int a[] = new int[n]; for(int i = 0 ; i < n ; i++) a[i] = sc.nextInt(); f.sort(a); int sum = 0; for (int i = 0 ; i < k ; i++){ sum += a[i]; } w.println(sum); } } static class f{ public static long max(long a[]){ long ans = Long.MIN_VALUE; for (long i : a) ans = Math.max(ans , i); return ans; } public static long power(long x, int y){ long res = 1; while (y > 0) { if ((y & 1) == 1) res = (res*x); y = y >> 1; x = x * x; } return res; } public static long powerm(long x, long y, long p) { long res = 1; x %= p; while (y > 0) { if ((y & 1) == 1) { res *= x; res %= p; } y >>= 1; x *= x; x %= p; } return res; } public static void sort(int[] arr) { int n = arr.length, mid, h, s, l, i, j, k; int[] res = new int[n]; for (s = 1; s < n; s <<= 1) { for (l = 0; l < n - 1; l += (s << 1)) { h = Math.min(l + (s << 1) - 1, n - 1); mid = Math.min(l + s - 1, n - 1); i = l; j = mid + 1; k = l; while (i <= mid && j <= h) res[k++] = (arr[i] <= arr[j] ? arr[i++] : arr[j++]); while (i <= mid) res[k++] = arr[i++]; while (j <= h) res[k++] = arr[j++]; for (k = l; k <= h; k++) arr[k] = res[k]; } } } public static long gcd(long a, long b) { if (a == 0) return b; return gcd(b % a, a); } public static long findGCD(long arr[], int n) { long result = arr[0]; for (int i = 1; i < n; i++) result = gcd(arr[i], result); return result; } } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private InputReader.SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public String readString() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public String next() { return readString(); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 1, 40, 13, 30, 30, 14, 2, 13, 4, 18, 13, 13, 30, 0, 13, 4, 18, 13, 13, 0, 13, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 117, 11 ], [ 117, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 44, 47 ], [ 47, 48 ], [ 48, 49 ], [ 14, 50 ], [ 50, 51 ], [ 50, 52 ], [ 14, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 69, 70 ], [ 68, 71 ], [ 65, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 80, 81 ], [ 72, 82 ], [ 82, 83 ], [ 83, 84 ], [ 72, 85 ], [ 86, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 91, 92 ], [ 90, 93 ], [ 87, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 97, 98 ], [ 98, 99 ], [ 97, 100 ], [ 65, 101 ], [ 101, 102 ], [ 101, 103 ], [ 65, 104 ], [ 104, 105 ], [ 105, 106 ], [ 104, 107 ], [ 14, 108 ], [ 108, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 108, 113 ], [ 12, 114 ], [ 114, 115 ], [ 0, 116 ], [ 116, 117 ], [ 116, 118 ] ]
[ "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> prices = new ArrayList<Integer>();\n for(int i=0; i < n; i++){\n prices.add(sc.nextInt());\n }\n\n Integer total = 0;\n for(int i = 0; i < k; i++){\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }\n System.out.println(total);\n }\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.List;", "List", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> prices = new ArrayList<Integer>();\n for(int i=0; i < n; i++){\n prices.add(sc.nextInt());\n }\n\n Integer total = 0;\n for(int i = 0; i < k; i++){\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }\n System.out.println(total);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> prices = new ArrayList<Integer>();\n for(int i=0; i < n; i++){\n prices.add(sc.nextInt());\n }\n\n Integer total = 0;\n for(int i = 0; i < k; i++){\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }\n System.out.println(total);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> prices = new ArrayList<Integer>();\n for(int i=0; i < n; i++){\n prices.add(sc.nextInt());\n }\n\n Integer total = 0;\n for(int i = 0; i < k; i++){\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }\n System.out.println(total);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "List<Integer> prices = new ArrayList<Integer>();", "prices", "new ArrayList<Integer>()", "for(int i=0; i < n; i++){\n prices.add(sc.nextInt());\n }", "int i=0;", "int i=0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n prices.add(sc.nextInt());\n }", "{\n prices.add(sc.nextInt());\n }", "prices.add(sc.nextInt())", "prices.add", "prices", "sc.nextInt()", "sc.nextInt", "sc", "Integer total = 0;", "total", "0", "for(int i = 0; i < k; i++){\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }", "{\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }", "Integer min = prices.get(0);", "min", "prices.get(0)", "prices.get", "prices", "0", "for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }", "int j = 1;", "int j = 1;", "j", "1", "j < prices.size()", "j", "prices.size()", "prices.size", "prices", "j++", "j++", "j", "{\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }", "{\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }", "if(min > prices.get(j)){\n min = prices.get(j);\n }", "min > prices.get(j)", "min", "prices.get(j)", "prices.get", "prices", "j", "{\n min = prices.get(j);\n }", "min = prices.get(j)", "min", "prices.get(j)", "prices.get", "prices", "j", "total += min", "total", "min", "prices.remove(min)", "prices.remove", "prices", "min", "System.out.println(total)", "System.out.println", "System.out", "System", "System.out", "total", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> prices = new ArrayList<Integer>();\n for(int i=0; i < n; i++){\n prices.add(sc.nextInt());\n }\n\n Integer total = 0;\n for(int i = 0; i < k; i++){\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }\n System.out.println(total);\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> prices = new ArrayList<Integer>();\n for(int i=0; i < n; i++){\n prices.add(sc.nextInt());\n }\n\n Integer total = 0;\n for(int i = 0; i < k; i++){\n Integer min = prices.get(0);\n for(int j = 1; j < prices.size(); j++){\n if(min > prices.get(j)){\n min = prices.get(j);\n }\n }\n total += min;\n prices.remove(min);\n }\n System.out.println(total);\n }\n}", "Main" ]
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); List<Integer> prices = new ArrayList<Integer>(); for(int i=0; i < n; i++){ prices.add(sc.nextInt()); } Integer total = 0; for(int i = 0; i < k; i++){ Integer min = prices.get(0); for(int j = 1; j < prices.size(); j++){ if(min > prices.get(j)){ min = prices.get(j); } } total += min; prices.remove(min); } System.out.println(total); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 85, 8 ], [ 85, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 11, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 9, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.Scanner;\nimport java.util.Arrays;\npublic class Main{\n public static void main(String[] args) {\n Scanner kbd =new Scanner(System.in);\n int n =kbd.nextInt();\n int k =kbd.nextInt();\n int[] A= new int[n];\n for(int i=0;i<n;i++){\n A[i]=kbd.nextInt();\n }\n\n Arrays.sort(A);\n int x=0;\n for(int i=0;i<k;i++){\n x=x+A[i];\n }\n System.out.println(x);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "public class Main{\n public static void main(String[] args) {\n Scanner kbd =new Scanner(System.in);\n int n =kbd.nextInt();\n int k =kbd.nextInt();\n int[] A= new int[n];\n for(int i=0;i<n;i++){\n A[i]=kbd.nextInt();\n }\n\n Arrays.sort(A);\n int x=0;\n for(int i=0;i<k;i++){\n x=x+A[i];\n }\n System.out.println(x);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner kbd =new Scanner(System.in);\n int n =kbd.nextInt();\n int k =kbd.nextInt();\n int[] A= new int[n];\n for(int i=0;i<n;i++){\n A[i]=kbd.nextInt();\n }\n\n Arrays.sort(A);\n int x=0;\n for(int i=0;i<k;i++){\n x=x+A[i];\n }\n System.out.println(x);\n }", "main", "{\n Scanner kbd =new Scanner(System.in);\n int n =kbd.nextInt();\n int k =kbd.nextInt();\n int[] A= new int[n];\n for(int i=0;i<n;i++){\n A[i]=kbd.nextInt();\n }\n\n Arrays.sort(A);\n int x=0;\n for(int i=0;i<k;i++){\n x=x+A[i];\n }\n System.out.println(x);\n }", "Scanner kbd =new Scanner(System.in);", "kbd", "new Scanner(System.in)", "int n =kbd.nextInt();", "n", "kbd.nextInt()", "kbd.nextInt", "kbd", "int k =kbd.nextInt();", "k", "kbd.nextInt()", "kbd.nextInt", "kbd", "int[] A= new int[n];", "A", "new int[n]", "n", "for(int i=0;i<n;i++){\n A[i]=kbd.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n A[i]=kbd.nextInt();\n }", "{\n A[i]=kbd.nextInt();\n }", "A[i]=kbd.nextInt()", "A[i]", "A", "i", "kbd.nextInt()", "kbd.nextInt", "kbd", "Arrays.sort(A)", "Arrays.sort", "Arrays", "A", "int x=0;", "x", "0", "for(int i=0;i<k;i++){\n x=x+A[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n x=x+A[i];\n }", "{\n x=x+A[i];\n }", "x=x+A[i]", "x", "x+A[i]", "x", "A[i]", "A", "i", "System.out.println(x)", "System.out.println", "System.out", "System", "System.out", "x", "String[] args", "args", "public class Main{\n public static void main(String[] args) {\n Scanner kbd =new Scanner(System.in);\n int n =kbd.nextInt();\n int k =kbd.nextInt();\n int[] A= new int[n];\n for(int i=0;i<n;i++){\n A[i]=kbd.nextInt();\n }\n\n Arrays.sort(A);\n int x=0;\n for(int i=0;i<k;i++){\n x=x+A[i];\n }\n System.out.println(x);\n }\n}", "public class Main{\n public static void main(String[] args) {\n Scanner kbd =new Scanner(System.in);\n int n =kbd.nextInt();\n int k =kbd.nextInt();\n int[] A= new int[n];\n for(int i=0;i<n;i++){\n A[i]=kbd.nextInt();\n }\n\n Arrays.sort(A);\n int x=0;\n for(int i=0;i<k;i++){\n x=x+A[i];\n }\n System.out.println(x);\n }\n}", "Main" ]
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String[] args) { Scanner kbd =new Scanner(System.in); int n =kbd.nextInt(); int k =kbd.nextInt(); int[] A= new int[n]; for(int i=0;i<n;i++){ A[i]=kbd.nextInt(); } Arrays.sort(A); int x=0; for(int i=0;i<k;i++){ x=x+A[i]; } System.out.println(x); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 42, 4, 18, 13, 30, 41, 13, 41, 13, 41, 13, 17, 0, 13, 4, 18, 13, 0, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 94, 8 ], [ 94, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 16, 17 ], [ 17, 18 ], [ 15, 19 ], [ 19, 20 ], [ 20, 21 ], [ 19, 22 ], [ 22, 23 ], [ 19, 24 ], [ 24, 25 ], [ 24, 26 ], [ 19, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 19, 32 ], [ 32, 33 ], [ 32, 34 ], [ 34, 35 ], [ 35, 36 ], [ 19, 37 ], [ 37, 38 ], [ 37, 39 ], [ 19, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 41, 46 ], [ 46, 47 ], [ 46, 48 ], [ 41, 49 ], [ 49, 50 ], [ 50, 51 ], [ 41, 52 ], [ 53, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 54, 58 ], [ 58, 59 ], [ 59, 60 ], [ 19, 61 ], [ 61, 62 ], [ 62, 63 ], [ 61, 64 ], [ 19, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 65, 70 ], [ 70, 71 ], [ 70, 72 ], [ 65, 73 ], [ 73, 74 ], [ 74, 75 ], [ 65, 76 ], [ 77, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 19, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 85, 90 ], [ 9, 91 ], [ 91, 92 ], [ 0, 93 ], [ 93, 94 ], [ 93, 95 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner tan = new Scanner(System.in);\n while(tan.hasNext()){\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n Scanner tan = new Scanner(System.in);\n while(tan.hasNext()){\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }\n }\n}", "Main", "public static void main(String[] args) {\n Scanner tan = new Scanner(System.in);\n while(tan.hasNext()){\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }\n }", "main", "{\n Scanner tan = new Scanner(System.in);\n while(tan.hasNext()){\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }\n }", "Scanner tan = new Scanner(System.in);", "tan", "new Scanner(System.in)", "while(tan.hasNext()){\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }", "tan.hasNext()", "tan.hasNext", "tan", "{\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }", "int n", "n", "k", "k", "sum=0;", "sum", "0", "n=tan.nextInt()", "n", "tan.nextInt()", "tan.nextInt", "tan", "k=tan.nextInt()", "k", "tan.nextInt()", "tan.nextInt", "tan", "int []a=new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n a[i]=tan.nextInt();\n }", "{\n a[i]=tan.nextInt();\n }", "a[i]=tan.nextInt()", "a[i]", "a", "i", "tan.nextInt()", "tan.nextInt", "tan", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n sum=sum+a[i];\n }", "{\n sum=sum+a[i];\n }", "sum=sum+a[i]", "sum", "sum+a[i]", "sum", "a[i]", "a", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner tan = new Scanner(System.in);\n while(tan.hasNext()){\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner tan = new Scanner(System.in);\n while(tan.hasNext()){\n int n,k,sum=0;\n n=tan.nextInt();\n k=tan.nextInt();\n int []a=new int[n];\n for (int i = 0; i < n; i++) {\n a[i]=tan.nextInt();\n }\n Arrays.sort(a);\n for (int i = 0; i < k; i++) {\n sum=sum+a[i];\n }\n System.out.println(sum);\n }\n }\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner tan = new Scanner(System.in); while(tan.hasNext()){ int n,k,sum=0; n=tan.nextInt(); k=tan.nextInt(); int []a=new int[n]; for (int i = 0; i < n; i++) { a[i]=tan.nextInt(); } Arrays.sort(a); for (int i = 0; i < k; i++) { sum=sum+a[i]; } System.out.println(sum); } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 4, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 41, 13, 41, 13, 17, 12, 13, 30, 0, 13, 20, 17, 0, 13, 17, 0, 13, 20, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 14, 2, 13, 18, 13, 13, 29, 18, 13, 40, 13, 41, 13, 4, 18, 13, 42, 4, 18, 13, 17, 30, 0, 13, 4, 18, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 17, 29, 18, 13, 40, 13, 29, 17, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 29, 4, 18, 13, 4, 13, 29, 40, 17, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 29, 4, 18, 13, 4, 13, 29, 40, 17, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 29, 4, 18, 13, 4, 13, 29, 40, 17, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 246, 11 ], [ 246, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 19, 20 ], [ 18, 21 ], [ 12, 22 ], [ 22, 23 ], [ 246, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 26, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 32, 35 ], [ 35, 36 ], [ 36, 37 ], [ 26, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 40, 43 ], [ 43, 44 ], [ 44, 45 ], [ 26, 46 ], [ 46, 47 ], [ 46, 48 ], [ 26, 50 ], [ 50, 51 ], [ 50, 52 ], [ 26, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 66, 70 ], [ 70, 71 ], [ 71, 72 ], [ 70, 73 ], [ 73, 74 ], [ 74, 75 ], [ 26, 76 ], [ 76, 77 ], [ 77, 78 ], [ 76, 79 ], [ 26, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 80, 85 ], [ 85, 86 ], [ 85, 87 ], [ 80, 88 ], [ 88, 89 ], [ 89, 90 ], [ 80, 91 ], [ 92, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 95, 96 ], [ 95, 97 ], [ 26, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 98, 103 ], [ 24, 104 ], [ 104, 105 ], [ 246, 106 ], [ 106, 107 ], [ 106, 108 ], [ 108, 109 ], [ 106, 110 ], [ 110, 111 ], [ 106, 112 ], [ 112, 113 ], [ 106, 114 ], [ 114, 115 ], [ 114, 116 ], [ 106, 117 ], [ 117, 118 ], [ 117, 119 ], [ 119, 120 ], [ 120, 121 ], [ 120, 122 ], [ 119, 124 ], [ 124, 125 ], [ 124, 126 ], [ 119, 127 ], [ 127, 128 ], [ 127, 129 ], [ 106, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 133, 134 ], [ 134, 135 ], [ 134, 136 ], [ 136, 137 ], [ 137, 138 ], [ 138, 139 ], [ 133, 140 ], [ 140, 141 ], [ 141, 142 ], [ 142, 143 ], [ 142, 144 ], [ 144, 145 ], [ 144, 146 ], [ 141, 147 ], [ 147, 148 ], [ 148, 149 ], [ 148, 150 ], [ 150, 151 ], [ 140, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 140, 157 ], [ 157, 158 ], [ 158, 159 ], [ 159, 160 ], [ 158, 161 ], [ 157, 162 ], [ 162, 163 ], [ 163, 164 ], [ 163, 165 ], [ 165, 166 ], [ 166, 167 ], [ 140, 168 ], [ 168, 169 ], [ 168, 170 ], [ 170, 171 ], [ 171, 172 ], [ 170, 173 ], [ 170, 174 ], [ 140, 175 ], [ 175, 176 ], [ 175, 177 ], [ 140, 178 ], [ 178, 179 ], [ 179, 180 ], [ 179, 181 ], [ 181, 182 ], [ 132, 183 ], [ 183, 184 ], [ 106, 185 ], [ 185, 186 ], [ 185, 187 ], [ 187, 188 ], [ 188, 189 ], [ 189, 190 ], [ 189, 191 ], [ 191, 192 ], [ 192, 193 ], [ 193, 194 ], [ 188, 195 ], [ 195, 196 ], [ 196, 197 ], [ 197, 198 ], [ 198, 199 ], [ 197, 200 ], [ 200, 201 ], [ 187, 202 ], [ 202, 203 ], [ 203, 204 ], [ 106, 205 ], [ 205, 206 ], [ 205, 207 ], [ 207, 208 ], [ 208, 209 ], [ 209, 210 ], [ 209, 211 ], [ 211, 212 ], [ 212, 213 ], [ 213, 214 ], [ 208, 215 ], [ 215, 216 ], [ 216, 217 ], [ 217, 218 ], [ 218, 219 ], [ 217, 220 ], [ 220, 221 ], [ 207, 222 ], [ 222, 223 ], [ 223, 224 ], [ 106, 225 ], [ 225, 226 ], [ 225, 227 ], [ 227, 228 ], [ 228, 229 ], [ 229, 230 ], [ 229, 231 ], [ 231, 232 ], [ 232, 233 ], [ 233, 234 ], [ 228, 235 ], [ 235, 236 ], [ 236, 237 ], [ 237, 238 ], [ 238, 239 ], [ 237, 240 ], [ 240, 241 ], [ 227, 242 ], [ 242, 243 ], [ 243, 244 ], [ 0, 245 ], [ 245, 246 ], [ 245, 247 ] ]
[ "import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\n\n\npublic class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.solve(args);\n }\n\n public void solve(String[] args) {\n MyScanner scanner = new MyScanner();\n\n // ビジネスロジックここから\n int n = Integer.parseInt(scanner.next());\n \tint k = Integer.parseInt(scanner.next());\n \tint[] array = new int[n];\n \tint ans = 0;\n \t\n for(int i = 0 ; i < n ; i++){\n \tarray[i] = Integer.parseInt(scanner.next());\n }\n \n Arrays.sort(array);\n \t\n for(int i = 0; i < k; i++) {\n \tans += array[i];\n }\n \n System.out.println(ans);\n \n // ビジネスロジックここまで\n\n }\n\n private class MyScanner {\n String[] s;\n int i;\n BufferedReader br;\n String reg = \" \";\n MyScanner () {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n public String next() {\n try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}\n return null;\n }\n public int nextInt() {\n try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public double nextDouble() {\n try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public long nextLong() {\n try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "public class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.solve(args);\n }\n\n public void solve(String[] args) {\n MyScanner scanner = new MyScanner();\n\n // ビジネスロジックここから\n int n = Integer.parseInt(scanner.next());\n \tint k = Integer.parseInt(scanner.next());\n \tint[] array = new int[n];\n \tint ans = 0;\n \t\n for(int i = 0 ; i < n ; i++){\n \tarray[i] = Integer.parseInt(scanner.next());\n }\n \n Arrays.sort(array);\n \t\n for(int i = 0; i < k; i++) {\n \tans += array[i];\n }\n \n System.out.println(ans);\n \n // ビジネスロジックここまで\n\n }\n\n private class MyScanner {\n String[] s;\n int i;\n BufferedReader br;\n String reg = \" \";\n MyScanner () {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n public String next() {\n try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}\n return null;\n }\n public int nextInt() {\n try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public double nextDouble() {\n try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public long nextLong() {\n try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n }\n}", "Main", "public static void main(String[] args) {\n Main main = new Main();\n main.solve(args);\n }", "main", "{\n Main main = new Main();\n main.solve(args);\n }", "Main main = new Main();", "main", "new Main()", "main.solve(args)", "main.solve", "main", "args", "String[] args", "args", "public void solve(String[] args) {\n MyScanner scanner = new MyScanner();\n\n // ビジネスロジックここから\n int n = Integer.parseInt(scanner.next());\n \tint k = Integer.parseInt(scanner.next());\n \tint[] array = new int[n];\n \tint ans = 0;\n \t\n for(int i = 0 ; i < n ; i++){\n \tarray[i] = Integer.parseInt(scanner.next());\n }\n \n Arrays.sort(array);\n \t\n for(int i = 0; i < k; i++) {\n \tans += array[i];\n }\n \n System.out.println(ans);\n \n // ビジネスロジックここまで\n\n }", "solve", "{\n MyScanner scanner = new MyScanner();\n\n // ビジネスロジックここから\n int n = Integer.parseInt(scanner.next());\n \tint k = Integer.parseInt(scanner.next());\n \tint[] array = new int[n];\n \tint ans = 0;\n \t\n for(int i = 0 ; i < n ; i++){\n \tarray[i] = Integer.parseInt(scanner.next());\n }\n \n Arrays.sort(array);\n \t\n for(int i = 0; i < k; i++) {\n \tans += array[i];\n }\n \n System.out.println(ans);\n \n // ビジネスロジックここまで\n\n }", "MyScanner scanner = new MyScanner();", "scanner", "new MyScanner()", "int n = Integer.parseInt(scanner.next());", "n", "Integer.parseInt(scanner.next())", "Integer.parseInt", "Integer", "scanner.next()", "scanner.next", "scanner", "int k = Integer.parseInt(scanner.next());", "k", "Integer.parseInt(scanner.next())", "Integer.parseInt", "Integer", "scanner.next()", "scanner.next", "scanner", "int[] array = new int[n];", "array", "new int[n]", "n", "int ans = 0;", "ans", "0", "for(int i = 0 ; i < n ; i++){\n \tarray[i] = Integer.parseInt(scanner.next());\n }", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n \tarray[i] = Integer.parseInt(scanner.next());\n }", "{\n \tarray[i] = Integer.parseInt(scanner.next());\n }", "array[i] = Integer.parseInt(scanner.next())", "array[i]", "array", "i", "Integer.parseInt(scanner.next())", "Integer.parseInt", "Integer", "scanner.next()", "scanner.next", "scanner", "Arrays.sort(array)", "Arrays.sort", "Arrays", "array", "for(int i = 0; i < k; i++) {\n \tans += array[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n \tans += array[i];\n }", "{\n \tans += array[i];\n }", "ans += array[i]", "ans", "array[i]", "array", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "private class MyScanner {\n String[] s;\n int i;\n BufferedReader br;\n String reg = \" \";\n MyScanner () {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n public String next() {\n try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}\n return null;\n }\n public int nextInt() {\n try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public double nextDouble() {\n try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public long nextLong() {\n try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n }", "MyScanner", "String[] s;", "s", "int i;", "i", "BufferedReader br;", "br", "String reg = \" \";", "reg", "\" \"", "MyScanner () {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "MyScanner", "{\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "s = new String[0]", "s", "new String[0]", "0", "i = 0", "i", "0", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "public String next() {\n try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}\n return null;\n }", "next", "{\n try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}\n return null;\n }", "try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}", "catch (Exception e) {e.printStackTrace();}", "Exception e", "{e.printStackTrace();}", "e.printStackTrace()", "e.printStackTrace", "e", "{\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n }", "if (i < s.length) return s[i++];", "i < s.length", "i", "s.length", "s", "s.length", "return s[i++];", "s[i++]", "s", "i++", "i", "String line = br.readLine();", "line", "br.readLine()", "br.readLine", "br", "while (line.equals(\"\")) {line = br.readLine();}", "line.equals(\"\")", "line.equals", "line", "\"\"", "{line = br.readLine();}", "line = br.readLine()", "line", "br.readLine()", "br.readLine", "br", "s = line.split(reg, 0)", "s", "line.split(reg, 0)", "line.split", "line", "reg", "0", "i = 0", "i", "0", "return s[i++];", "s[i++]", "s", "i++", "i", "return null;", "null", "public int nextInt() {\n try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }", "nextInt", "{\n try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }", "try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}", "catch (Exception e) {e.printStackTrace();}", "Exception e", "{e.printStackTrace();}", "e.printStackTrace()", "e.printStackTrace", "e", "{return Integer.parseInt(next());}", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "return -1;", "-1", "1", "public double nextDouble() {\n try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }", "nextDouble", "{\n try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }", "try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}", "catch (Exception e) {e.printStackTrace();}", "Exception e", "{e.printStackTrace();}", "e.printStackTrace()", "e.printStackTrace", "e", "{return Double.parseDouble(next());}", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "return -1;", "-1", "1", "public long nextLong() {\n try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }", "nextLong", "{\n try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }", "try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}", "catch (Exception e) {e.printStackTrace();}", "Exception e", "{e.printStackTrace();}", "e.printStackTrace()", "e.printStackTrace", "e", "{return Long.parseLong(next());}", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "return -1;", "-1", "1", "public class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.solve(args);\n }\n\n public void solve(String[] args) {\n MyScanner scanner = new MyScanner();\n\n // ビジネスロジックここから\n int n = Integer.parseInt(scanner.next());\n \tint k = Integer.parseInt(scanner.next());\n \tint[] array = new int[n];\n \tint ans = 0;\n \t\n for(int i = 0 ; i < n ; i++){\n \tarray[i] = Integer.parseInt(scanner.next());\n }\n \n Arrays.sort(array);\n \t\n for(int i = 0; i < k; i++) {\n \tans += array[i];\n }\n \n System.out.println(ans);\n \n // ビジネスロジックここまで\n\n }\n\n private class MyScanner {\n String[] s;\n int i;\n BufferedReader br;\n String reg = \" \";\n MyScanner () {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n public String next() {\n try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}\n return null;\n }\n public int nextInt() {\n try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public double nextDouble() {\n try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public long nextLong() {\n try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n }\n}", "public class Main {\n public static void main(String[] args) {\n Main main = new Main();\n main.solve(args);\n }\n\n public void solve(String[] args) {\n MyScanner scanner = new MyScanner();\n\n // ビジネスロジックここから\n int n = Integer.parseInt(scanner.next());\n \tint k = Integer.parseInt(scanner.next());\n \tint[] array = new int[n];\n \tint ans = 0;\n \t\n for(int i = 0 ; i < n ; i++){\n \tarray[i] = Integer.parseInt(scanner.next());\n }\n \n Arrays.sort(array);\n \t\n for(int i = 0; i < k; i++) {\n \tans += array[i];\n }\n \n System.out.println(ans);\n \n // ビジネスロジックここまで\n\n }\n\n private class MyScanner {\n String[] s;\n int i;\n BufferedReader br;\n String reg = \" \";\n MyScanner () {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n public String next() {\n try {\n if (i < s.length) return s[i++];\n String line = br.readLine();\n while (line.equals(\"\")) {line = br.readLine();}\n s = line.split(reg, 0);\n i = 0;return s[i++];\n } catch (Exception e) {e.printStackTrace();}\n return null;\n }\n public int nextInt() {\n try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public double nextDouble() {\n try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n public long nextLong() {\n try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}\n return -1;\n }\n }\n}", "Main" ]
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) { Main main = new Main(); main.solve(args); } public void solve(String[] args) { MyScanner scanner = new MyScanner(); // ビジネスロジックここから int n = Integer.parseInt(scanner.next()); int k = Integer.parseInt(scanner.next()); int[] array = new int[n]; int ans = 0; for(int i = 0 ; i < n ; i++){ array[i] = Integer.parseInt(scanner.next()); } Arrays.sort(array); for(int i = 0; i < k; i++) { ans += array[i]; } System.out.println(ans); // ビジネスロジックここまで } private class MyScanner { String[] s; int i; BufferedReader br; String reg = " "; MyScanner () { s = new String[0]; i = 0; br = new BufferedReader(new InputStreamReader(System.in)); } public String next() { try { if (i < s.length) return s[i++]; String line = br.readLine(); while (line.equals("")) {line = br.readLine();} s = line.split(reg, 0); i = 0;return s[i++]; } catch (Exception e) {e.printStackTrace();} return null; } public int nextInt() { try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();} return -1; } public double nextDouble() { try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();} return -1; } public long nextLong() { try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();} return -1; } } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 83, 8 ], [ 83, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 29, 31 ], [ 11, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 11, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 9, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n\t\tint zentai = scan.nextInt();\n \t\tint kounyu = scan.nextInt();\n int[] priceArray = new int[zentai];\n int ans = 0;\n\n\t\tfor(int i=0; i<zentai; i++){\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}\n Arrays.sort(priceArray);\n \tfor(int i=0; i<kounyu; i++){\n\t\t\tans += priceArray[i];\n\t\t\t}\n\n\t\tSystem.out.println(ans); \n \n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n\t\tint zentai = scan.nextInt();\n \t\tint kounyu = scan.nextInt();\n int[] priceArray = new int[zentai];\n int ans = 0;\n\n\t\tfor(int i=0; i<zentai; i++){\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}\n Arrays.sort(priceArray);\n \tfor(int i=0; i<kounyu; i++){\n\t\t\tans += priceArray[i];\n\t\t\t}\n\n\t\tSystem.out.println(ans); \n \n\t}\n}", "Main", "public static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n\t\tint zentai = scan.nextInt();\n \t\tint kounyu = scan.nextInt();\n int[] priceArray = new int[zentai];\n int ans = 0;\n\n\t\tfor(int i=0; i<zentai; i++){\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}\n Arrays.sort(priceArray);\n \tfor(int i=0; i<kounyu; i++){\n\t\t\tans += priceArray[i];\n\t\t\t}\n\n\t\tSystem.out.println(ans); \n \n\t}", "main", "{\n \tScanner scan = new Scanner(System.in);\n\t\tint zentai = scan.nextInt();\n \t\tint kounyu = scan.nextInt();\n int[] priceArray = new int[zentai];\n int ans = 0;\n\n\t\tfor(int i=0; i<zentai; i++){\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}\n Arrays.sort(priceArray);\n \tfor(int i=0; i<kounyu; i++){\n\t\t\tans += priceArray[i];\n\t\t\t}\n\n\t\tSystem.out.println(ans); \n \n\t}", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int zentai = scan.nextInt();", "zentai", "scan.nextInt()", "scan.nextInt", "scan", "int kounyu = scan.nextInt();", "kounyu", "scan.nextInt()", "scan.nextInt", "scan", "int[] priceArray = new int[zentai];", "priceArray", "new int[zentai]", "zentai", "int ans = 0;", "ans", "0", "for(int i=0; i<zentai; i++){\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}", "int i=0;", "int i=0;", "i", "0", "i<zentai", "i", "zentai", "i++", "i++", "i", "{\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}", "{\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}", "priceArray[i] = scan.nextInt()", "priceArray[i]", "priceArray", "i", "scan.nextInt()", "scan.nextInt", "scan", "Arrays.sort(priceArray)", "Arrays.sort", "Arrays", "priceArray", "for(int i=0; i<kounyu; i++){\n\t\t\tans += priceArray[i];\n\t\t\t}", "int i=0;", "int i=0;", "i", "0", "i<kounyu", "i", "kounyu", "i++", "i++", "i", "{\n\t\t\tans += priceArray[i];\n\t\t\t}", "{\n\t\t\tans += priceArray[i];\n\t\t\t}", "ans += priceArray[i]", "ans", "priceArray[i]", "priceArray", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n\t\tint zentai = scan.nextInt();\n \t\tint kounyu = scan.nextInt();\n int[] priceArray = new int[zentai];\n int ans = 0;\n\n\t\tfor(int i=0; i<zentai; i++){\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}\n Arrays.sort(priceArray);\n \tfor(int i=0; i<kounyu; i++){\n\t\t\tans += priceArray[i];\n\t\t\t}\n\n\t\tSystem.out.println(ans); \n \n\t}\n}", "public class Main {\n\tpublic static void main(String[] args){\n \tScanner scan = new Scanner(System.in);\n\t\tint zentai = scan.nextInt();\n \t\tint kounyu = scan.nextInt();\n int[] priceArray = new int[zentai];\n int ans = 0;\n\n\t\tfor(int i=0; i<zentai; i++){\n\t\t\tpriceArray[i] = scan.nextInt();\n\t\t\t}\n Arrays.sort(priceArray);\n \tfor(int i=0; i<kounyu; i++){\n\t\t\tans += priceArray[i];\n\t\t\t}\n\n\t\tSystem.out.println(ans); \n \n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner scan = new Scanner(System.in); int zentai = scan.nextInt(); int kounyu = scan.nextInt(); int[] priceArray = new int[zentai]; int ans = 0; for(int i=0; i<zentai; i++){ priceArray[i] = scan.nextInt(); } Arrays.sort(priceArray); for(int i=0; i<kounyu; i++){ ans += priceArray[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 85, 8 ], [ 85, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 40, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 46, 47 ], [ 11, 48 ], [ 48, 49 ], [ 49, 50 ], [ 48, 51 ], [ 11, 52 ], [ 52, 53 ], [ 52, 54 ], [ 11, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 55, 60 ], [ 60, 61 ], [ 60, 62 ], [ 55, 63 ], [ 63, 64 ], [ 64, 65 ], [ 55, 66 ], [ 67, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 11, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 11, 79 ], [ 79, 80 ], [ 80, 81 ], [ 9, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\t// input\n\t\tScanner inData = new Scanner(System.in);\n\n\t\t// 種類\n\t\tint N = inData.nextInt();\n\t\t// 購入種別数\n\t\tint K = inData.nextInt();\n\t\t// 各種類ごとの値段\n\t\tint[] P = new int[N];\n\t\tfor(int i=0; i<N; i++) P[i] = inData.nextInt();\n\t\tArrays.sort(P);\n\n\t\tint kin = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tkin += P[i];\n\t\t}\n\n\t\tSystem.out.println(kin);\n\n\t\tinData.close();\n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n\t\t// input\n\t\tScanner inData = new Scanner(System.in);\n\n\t\t// 種類\n\t\tint N = inData.nextInt();\n\t\t// 購入種別数\n\t\tint K = inData.nextInt();\n\t\t// 各種類ごとの値段\n\t\tint[] P = new int[N];\n\t\tfor(int i=0; i<N; i++) P[i] = inData.nextInt();\n\t\tArrays.sort(P);\n\n\t\tint kin = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tkin += P[i];\n\t\t}\n\n\t\tSystem.out.println(kin);\n\n\t\tinData.close();\n\t}\n}", "Main", "public static void main(String[] args){\n\t\t// input\n\t\tScanner inData = new Scanner(System.in);\n\n\t\t// 種類\n\t\tint N = inData.nextInt();\n\t\t// 購入種別数\n\t\tint K = inData.nextInt();\n\t\t// 各種類ごとの値段\n\t\tint[] P = new int[N];\n\t\tfor(int i=0; i<N; i++) P[i] = inData.nextInt();\n\t\tArrays.sort(P);\n\n\t\tint kin = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tkin += P[i];\n\t\t}\n\n\t\tSystem.out.println(kin);\n\n\t\tinData.close();\n\t}", "main", "{\n\t\t// input\n\t\tScanner inData = new Scanner(System.in);\n\n\t\t// 種類\n\t\tint N = inData.nextInt();\n\t\t// 購入種別数\n\t\tint K = inData.nextInt();\n\t\t// 各種類ごとの値段\n\t\tint[] P = new int[N];\n\t\tfor(int i=0; i<N; i++) P[i] = inData.nextInt();\n\t\tArrays.sort(P);\n\n\t\tint kin = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tkin += P[i];\n\t\t}\n\n\t\tSystem.out.println(kin);\n\n\t\tinData.close();\n\t}", "Scanner inData = new Scanner(System.in);", "inData", "new Scanner(System.in)", "int N = inData.nextInt();", "N", "inData.nextInt()", "inData.nextInt", "inData", "int K = inData.nextInt();", "K", "inData.nextInt()", "inData.nextInt", "inData", "int[] P = new int[N];", "P", "new int[N]", "N", "for(int i=0; i<N; i++) P[i] = inData.nextInt();", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "P[i] = inData.nextInt();", "P[i] = inData.nextInt()", "P[i]", "P", "i", "inData.nextInt()", "inData.nextInt", "inData", "Arrays.sort(P)", "Arrays.sort", "Arrays", "P", "int kin = 0;", "kin", "0", "for (int i = 0; i < K; i++) {\n\t\t\tkin += P[i];\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n\t\t\tkin += P[i];\n\t\t}", "{\n\t\t\tkin += P[i];\n\t\t}", "kin += P[i]", "kin", "P[i]", "P", "i", "System.out.println(kin)", "System.out.println", "System.out", "System", "System.out", "kin", "inData.close()", "inData.close", "inData", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\t// input\n\t\tScanner inData = new Scanner(System.in);\n\n\t\t// 種類\n\t\tint N = inData.nextInt();\n\t\t// 購入種別数\n\t\tint K = inData.nextInt();\n\t\t// 各種類ごとの値段\n\t\tint[] P = new int[N];\n\t\tfor(int i=0; i<N; i++) P[i] = inData.nextInt();\n\t\tArrays.sort(P);\n\n\t\tint kin = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tkin += P[i];\n\t\t}\n\n\t\tSystem.out.println(kin);\n\n\t\tinData.close();\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\t// input\n\t\tScanner inData = new Scanner(System.in);\n\n\t\t// 種類\n\t\tint N = inData.nextInt();\n\t\t// 購入種別数\n\t\tint K = inData.nextInt();\n\t\t// 各種類ごとの値段\n\t\tint[] P = new int[N];\n\t\tfor(int i=0; i<N; i++) P[i] = inData.nextInt();\n\t\tArrays.sort(P);\n\n\t\tint kin = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tkin += P[i];\n\t\t}\n\n\t\tSystem.out.println(kin);\n\n\t\tinData.close();\n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ // input Scanner inData = new Scanner(System.in); // 種類 int N = inData.nextInt(); // 購入種別数 int K = inData.nextInt(); // 各種類ごとの値段 int[] P = new int[N]; for(int i=0; i<N; i++) P[i] = inData.nextInt(); Arrays.sort(P); int kin = 0; for (int i = 0; i < K; i++) { kin += P[i]; } System.out.println(kin); inData.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 28, 13, 13, 30, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 29, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 102, 11 ], [ 102, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 14, 52 ], [ 52, 53 ], [ 53, 54 ], [ 14, 55 ], [ 55, 56 ], [ 55, 57 ], [ 14, 58 ], [ 58, 59 ], [ 58, 60 ], [ 58, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 62, 65 ], [ 14, 66 ], [ 66, 67 ], [ 67, 68 ], [ 66, 69 ], [ 14, 70 ], [ 70, 71 ], [ 70, 72 ], [ 14, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 78, 79 ], [ 78, 80 ], [ 73, 81 ], [ 81, 82 ], [ 82, 83 ], [ 73, 84 ], [ 85, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 89, 90 ], [ 88, 91 ], [ 14, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 92, 97 ], [ 14, 98 ], [ 12, 99 ], [ 99, 100 ], [ 0, 101 ], [ 101, 102 ], [ 101, 103 ] ]
[ "import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n\n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n sc.close();\n\n final ArrayList<Integer> list = new ArrayList<Integer>();\n for (final int t : p)\n list.add(t);\n\n Collections.sort(list);\n\n int sum = 0;\n\n for (int i = 0; i < K; i++) {\n sum += list.get(i);\n }\n\n System.out.println(sum);\n\n return;\n }\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n\n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n sc.close();\n\n final ArrayList<Integer> list = new ArrayList<Integer>();\n for (final int t : p)\n list.add(t);\n\n Collections.sort(list);\n\n int sum = 0;\n\n for (int i = 0; i < K; i++) {\n sum += list.get(i);\n }\n\n System.out.println(sum);\n\n return;\n }\n}", "Main", "public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n\n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n sc.close();\n\n final ArrayList<Integer> list = new ArrayList<Integer>();\n for (final int t : p)\n list.add(t);\n\n Collections.sort(list);\n\n int sum = 0;\n\n for (int i = 0; i < K; i++) {\n sum += list.get(i);\n }\n\n System.out.println(sum);\n\n return;\n }", "main", "{\n final Scanner sc = new Scanner(System.in);\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n\n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n sc.close();\n\n final ArrayList<Integer> list = new ArrayList<Integer>();\n for (final int t : p)\n list.add(t);\n\n Collections.sort(list);\n\n int sum = 0;\n\n for (int i = 0; i < K; i++) {\n sum += list.get(i);\n }\n\n System.out.println(sum);\n\n return;\n }", "final Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "final int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "final int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "final int[] p = new int[N];", "p", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n p[i] = sc.nextInt();\n }", "{\n p[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "sc.close()", "sc.close", "sc", "final ArrayList<Integer> list = new ArrayList<Integer>();", "list", "new ArrayList<Integer>()", "for (final int t : p)\n list.add(t);", "final int t", "p", "list.add(t);", "list.add(t)", "list.add", "list", "t", "Collections.sort(list)", "Collections.sort", "Collections", "list", "int sum = 0;", "sum", "0", "for (int i = 0; i < K; i++) {\n sum += list.get(i);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sum += list.get(i);\n }", "{\n sum += list.get(i);\n }", "sum += list.get(i)", "sum", "list.get(i)", "list.get", "list", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "return;", "final String[] args", "args", "public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n\n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n sc.close();\n\n final ArrayList<Integer> list = new ArrayList<Integer>();\n for (final int t : p)\n list.add(t);\n\n Collections.sort(list);\n\n int sum = 0;\n\n for (int i = 0; i < K; i++) {\n sum += list.get(i);\n }\n\n System.out.println(sum);\n\n return;\n }\n}", "public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n final int N = sc.nextInt();\n final int K = sc.nextInt();\n\n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n sc.close();\n\n final ArrayList<Integer> list = new ArrayList<Integer>();\n for (final int t : p)\n list.add(t);\n\n Collections.sort(list);\n\n int sum = 0;\n\n for (int i = 0; i < K; i++) {\n sum += list.get(i);\n }\n\n System.out.println(sum);\n\n return;\n }\n}", "Main" ]
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(final String[] args) { final Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int K = sc.nextInt(); final int[] p = new int[N]; for (int i = 0; i < N; i++) { p[i] = sc.nextInt(); } sc.close(); final ArrayList<Integer> list = new ArrayList<Integer>(); for (final int t : p) list.add(t); Collections.sort(list); int sum = 0; for (int i = 0; i < K; i++) { sum += list.get(i); } System.out.println(sum); return; } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 26, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 26, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 38, 39 ], [ 26, 40 ], [ 40, 41 ], [ 40, 42 ], [ 26, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 44, 49 ], [ 49, 50 ], [ 49, 51 ], [ 44, 52 ], [ 52, 53 ], [ 53, 54 ], [ 44, 55 ], [ 56, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 57, 61 ], [ 61, 62 ], [ 62, 63 ], [ 26, 64 ], [ 64, 65 ], [ 65, 66 ], [ 64, 67 ], [ 26, 68 ], [ 68, 69 ], [ 68, 70 ], [ 26, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 76, 77 ], [ 76, 78 ], [ 71, 79 ], [ 79, 80 ], [ 80, 81 ], [ 71, 82 ], [ 83, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 86, 88 ], [ 26, 89 ], [ 89, 90 ], [ 90, 91 ], [ 91, 92 ], [ 91, 93 ], [ 89, 94 ], [ 24, 95 ], [ 95, 96 ] ]
[ "import java.util.*;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.TreeMap;\nimport java.util.ArrayDeque;\nimport java.awt.Point;\n \nclass Main{\n public static void main(String[] args){\n \n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] P = new int[N];\n \n for(int i=0; i<N; i++){\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int min = 0;\n\n for(int i=0; i<K; i++){\n min += P[i];\n }\n\n System.out.println(min);\n } \n}", "import java.util.*;", "util.*", "java", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.HashMap;", "HashMap", "java.util", "import java.util.TreeMap;", "TreeMap", "java.util", "import java.util.ArrayDeque;", "ArrayDeque", "java.util", "import java.awt.Point;", "Point", "java.awt", "class Main{\n public static void main(String[] args){\n \n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] P = new int[N];\n \n for(int i=0; i<N; i++){\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int min = 0;\n\n for(int i=0; i<K; i++){\n min += P[i];\n }\n\n System.out.println(min);\n } \n}", "Main", "public static void main(String[] args){\n \n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] P = new int[N];\n \n for(int i=0; i<N; i++){\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int min = 0;\n\n for(int i=0; i<K; i++){\n min += P[i];\n }\n\n System.out.println(min);\n }", "main", "{\n \n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] P = new int[N];\n \n for(int i=0; i<N; i++){\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int min = 0;\n\n for(int i=0; i<K; i++){\n min += P[i];\n }\n\n System.out.println(min);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] P = new int[N];", "P", "new int[N]", "N", "for(int i=0; i<N; i++){\n P[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n P[i] = sc.nextInt();\n }", "{\n P[i] = sc.nextInt();\n }", "P[i] = sc.nextInt()", "P[i]", "P", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(P)", "Arrays.sort", "Arrays", "P", "int min = 0;", "min", "0", "for(int i=0; i<K; i++){\n min += P[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n min += P[i];\n }", "{\n min += P[i];\n }", "min += P[i]", "min", "P[i]", "P", "i", "System.out.println(min)", "System.out.println", "System.out", "System", "System.out", "min", "String[] args", "args" ]
import java.util.*; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.TreeMap; import java.util.ArrayDeque; import java.awt.Point; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] P = new int[N]; for(int i=0; i<N; i++){ P[i] = sc.nextInt(); } Arrays.sort(P); int min = 0; for(int i=0; i<K; i++){ min += P[i]; } System.out.println(min); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 29, 8, 2, 13, 17, 13, 4, 13, 13, 2, 13, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 4, 13, 13, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 12, 13, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 14, 2, 13, 17, 30, 29, 17, 14, 2, 2, 13, 17, 2, 13, 17, 30, 29, 17, 14, 2, 2, 2, 13, 17, 17, 2, 2, 13, 17, 17, 30, 29, 17, 41, 13, 2, 4, 18, 13, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 0, 13, 17, 30, 30, 14, 2, 2, 2, 13, 2, 13, 17, 17, 2, 2, 13, 2, 13, 17, 17, 30, 29, 17, 29, 17, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 13, 0, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 13, 18, 13, 13, 23, 13, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 312, 8 ], [ 312, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 13, 14 ], [ 14, 15 ], [ 14, 16 ], [ 13, 17 ], [ 13, 18 ], [ 18, 19 ], [ 18, 20 ], [ 18, 21 ], [ 21, 22 ], [ 21, 23 ], [ 9, 24 ], [ 24, 25 ], [ 9, 26 ], [ 26, 27 ], [ 312, 28 ], [ 28, 29 ], [ 28, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 30, 34 ], [ 34, 35 ], [ 34, 36 ], [ 30, 37 ], [ 37, 38 ], [ 37, 39 ], [ 30, 40 ], [ 40, 41 ], [ 40, 42 ], [ 42, 43 ], [ 43, 44 ], [ 30, 45 ], [ 45, 46 ], [ 45, 47 ], [ 47, 48 ], [ 48, 49 ], [ 30, 50 ], [ 50, 51 ], [ 50, 52 ], [ 30, 54 ], [ 54, 55 ], [ 54, 56 ], [ 54, 57 ], [ 54, 58 ], [ 30, 59 ], [ 59, 60 ], [ 60, 61 ], [ 59, 62 ], [ 30, 63 ], [ 63, 64 ], [ 63, 65 ], [ 30, 66 ], [ 66, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 66, 71 ], [ 71, 72 ], [ 71, 73 ], [ 66, 74 ], [ 74, 75 ], [ 75, 76 ], [ 66, 77 ], [ 78, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 30, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 84, 89 ], [ 30, 90 ], [ 90, 91 ], [ 91, 92 ], [ 28, 93 ], [ 93, 94 ], [ 312, 95 ], [ 95, 96 ], [ 95, 97 ], [ 97, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 98, 103 ], [ 103, 104 ], [ 103, 105 ], [ 98, 106 ], [ 106, 107 ], [ 107, 108 ], [ 98, 109 ], [ 110, 110 ], [ 110, 111 ], [ 111, 112 ], [ 112, 113 ], [ 112, 114 ], [ 111, 115 ], [ 115, 116 ], [ 116, 117 ], [ 95, 118 ], [ 118, 119 ], [ 95, 120 ], [ 120, 121 ], [ 95, 122 ], [ 122, 123 ], [ 312, 124 ], [ 124, 125 ], [ 124, 126 ], [ 126, 127 ], [ 127, 128 ], [ 128, 129 ], [ 129, 130 ], [ 129, 131 ], [ 127, 132 ], [ 132, 133 ], [ 132, 134 ], [ 127, 135 ], [ 135, 136 ], [ 136, 137 ], [ 127, 138 ], [ 139, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 141, 143 ], [ 140, 144 ], [ 144, 145 ], [ 145, 146 ], [ 124, 147 ], [ 147, 148 ], [ 124, 149 ], [ 149, 150 ], [ 124, 151 ], [ 151, 152 ], [ 312, 153 ], [ 153, 154 ], [ 153, 155 ], [ 155, 156 ], [ 156, 157 ], [ 157, 158 ], [ 158, 159 ], [ 158, 160 ], [ 156, 161 ], [ 161, 162 ], [ 161, 163 ], [ 156, 164 ], [ 164, 165 ], [ 165, 166 ], [ 156, 167 ], [ 168, 168 ], [ 168, 169 ], [ 169, 170 ], [ 170, 171 ], [ 171, 172 ], [ 171, 173 ], [ 169, 174 ], [ 174, 175 ], [ 174, 176 ], [ 169, 177 ], [ 177, 178 ], [ 178, 179 ], [ 169, 180 ], [ 181, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 184, 185 ], [ 184, 186 ], [ 183, 187 ], [ 182, 188 ], [ 188, 189 ], [ 189, 190 ], [ 153, 191 ], [ 191, 192 ], [ 153, 193 ], [ 193, 194 ], [ 153, 195 ], [ 195, 196 ], [ 153, 197 ], [ 197, 198 ], [ 312, 199 ], [ 199, 200 ], [ 199, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 203, 205 ], [ 202, 206 ], [ 206, 207 ], [ 207, 208 ], [ 202, 209 ], [ 209, 210 ], [ 210, 211 ], [ 211, 212 ], [ 211, 213 ], [ 210, 214 ], [ 214, 215 ], [ 214, 216 ], [ 209, 217 ], [ 217, 218 ], [ 218, 219 ], [ 209, 220 ], [ 220, 221 ], [ 221, 222 ], [ 222, 223 ], [ 223, 224 ], [ 223, 225 ], [ 222, 226 ], [ 221, 227 ], [ 227, 228 ], [ 228, 229 ], [ 228, 230 ], [ 227, 231 ], [ 220, 232 ], [ 232, 233 ], [ 233, 234 ], [ 201, 235 ], [ 235, 236 ], [ 235, 237 ], [ 237, 238 ], [ 238, 239 ], [ 239, 240 ], [ 238, 241 ], [ 237, 242 ], [ 201, 243 ], [ 243, 244 ], [ 244, 245 ], [ 245, 246 ], [ 245, 247 ], [ 243, 248 ], [ 248, 249 ], [ 248, 250 ], [ 243, 251 ], [ 251, 252 ], [ 252, 253 ], [ 252, 254 ], [ 243, 255 ], [ 256, 256 ], [ 256, 257 ], [ 257, 258 ], [ 258, 259 ], [ 259, 260 ], [ 260, 261 ], [ 260, 262 ], [ 262, 263 ], [ 262, 264 ], [ 259, 265 ], [ 258, 266 ], [ 266, 267 ], [ 267, 268 ], [ 267, 269 ], [ 269, 270 ], [ 269, 271 ], [ 266, 272 ], [ 257, 273 ], [ 273, 274 ], [ 274, 275 ], [ 201, 276 ], [ 276, 277 ], [ 199, 278 ], [ 278, 279 ], [ 312, 280 ], [ 280, 281 ], [ 280, 282 ], [ 282, 283 ], [ 280, 284 ], [ 284, 285 ], [ 280, 286 ], [ 286, 287 ], [ 286, 288 ], [ 288, 289 ], [ 289, 290 ], [ 289, 291 ], [ 288, 292 ], [ 292, 293 ], [ 292, 294 ], [ 286, 295 ], [ 295, 296 ], [ 286, 297 ], [ 297, 298 ], [ 280, 299 ], [ 299, 300 ], [ 299, 301 ], [ 301, 302 ], [ 302, 303 ], [ 303, 304 ], [ 303, 305 ], [ 305, 306 ], [ 305, 307 ], [ 299, 308 ], [ 308, 309 ], [ 280, 310 ], [ 0, 311 ], [ 311, 312 ], [ 311, 313 ] ]
[ "\nimport java.io.*;\nimport java.util.*;\n//import java.util.Map.Entry;\n//import java.util.stream.*;\n//import java.math.*;\n\npublic class Main {\n\n public static int gcd(int a, int b) {\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int array[] = new int[n];\n forl_0(n, array, sc);\n Arrays.sort(array);\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum += array[i];\n }\n System.out.println(sum);\n bw.flush();\n }\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n\n static class Pair implements Comparable<Pair> {\n\n int a, b;\n\n public Pair(int x, int y) {\n a = x;\n b = y;\n }\n\n @Override\n public int compareTo(Pair p) {\n return a - p.a;\n }\n }\n\n static void forl_0(int n, int[] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void forl_1(int n, int[] array, Scanner sc) {\n for (int i = 1; i <= n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void two_d(int n, int m, int[][] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }\n }\n\n static boolean isPrime(long n) {\n if (n < 2) {\n return false;\n } else if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }\n long sqrtN = (long) Math.sqrt(n) + 1;\n for (long i = 6L; i <= sqrtN; i += 6) {\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }\n return true;\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n\n public static int gcd(int a, int b) {\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int array[] = new int[n];\n forl_0(n, array, sc);\n Arrays.sort(array);\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum += array[i];\n }\n System.out.println(sum);\n bw.flush();\n }\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n\n static class Pair implements Comparable<Pair> {\n\n int a, b;\n\n public Pair(int x, int y) {\n a = x;\n b = y;\n }\n\n @Override\n public int compareTo(Pair p) {\n return a - p.a;\n }\n }\n\n static void forl_0(int n, int[] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void forl_1(int n, int[] array, Scanner sc) {\n for (int i = 1; i <= n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void two_d(int n, int m, int[][] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }\n }\n\n static boolean isPrime(long n) {\n if (n < 2) {\n return false;\n } else if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }\n long sqrtN = (long) Math.sqrt(n) + 1;\n for (long i = 6L; i <= sqrtN; i += 6) {\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }\n return true;\n }\n}", "Main", "public static int gcd(int a, int b) {\n return (b == 0) ? a : gcd(b, a % b);\n }", "gcd", "{\n return (b == 0) ? a : gcd(b, a % b);\n }", "return (b == 0) ? a : gcd(b, a % b);", "(b == 0) ? a : gcd(b, a % b)", "(b == 0)", "b", "0", "a", "gcd(b, a % b)", "gcd", "b", "a % b", "a", "b", "int a", "a", "int b", "b", "public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int array[] = new int[n];\n forl_0(n, array, sc);\n Arrays.sort(array);\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum += array[i];\n }\n System.out.println(sum);\n bw.flush();\n }", "main", "{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int array[] = new int[n];\n forl_0(n, array, sc);\n Arrays.sort(array);\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum += array[i];\n }\n System.out.println(sum);\n bw.flush();\n }", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));", "bw", "new BufferedWriter(new OutputStreamWriter(System.out))", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int array[] = new int[n];", "array", "new int[n]", "n", "forl_0(n, array, sc)", "forl_0", "n", "array", "sc", "Arrays.sort(array)", "Arrays.sort", "Arrays", "array", "long sum = 0;", "sum", "0", "for (int i = 0; i < k; i++) {\n sum += array[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n sum += array[i];\n }", "{\n sum += array[i];\n }", "sum += array[i]", "sum", "array[i]", "array", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "bw.flush()", "bw.flush", "bw", "String[] args", "args", "static void forl_0(int n, int[] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }\n }", "forl_0", "{\n for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }\n }", "for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n array[i] = sc.nextInt();\n }", "{\n array[i] = sc.nextInt();\n }", "array[i] = sc.nextInt()", "array[i]", "array", "i", "sc.nextInt()", "sc.nextInt", "sc", "int n", "n", "int[] array", "array", "Scanner sc", "sc", "static void forl_1(int n, int[] array, Scanner sc) {\n for (int i = 1; i <= n; i++) {\n array[i] = sc.nextInt();\n }\n }", "forl_1", "{\n for (int i = 1; i <= n; i++) {\n array[i] = sc.nextInt();\n }\n }", "for (int i = 1; i <= n; i++) {\n array[i] = sc.nextInt();\n }", "int i = 1;", "int i = 1;", "i", "1", "i <= n", "i", "n", "i++", "i++", "i", "{\n array[i] = sc.nextInt();\n }", "{\n array[i] = sc.nextInt();\n }", "array[i] = sc.nextInt()", "array[i]", "array", "i", "sc.nextInt()", "sc.nextInt", "sc", "int n", "n", "int[] array", "array", "Scanner sc", "sc", "static void two_d(int n, int m, int[][] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }\n }", "two_d", "{\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }\n }", "for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }", "{\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }", "for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }", "int j = 0;", "int j = 0;", "j", "0", "j < m", "j", "m", "j++", "j++", "j", "{\n array[i][j] = sc.nextInt();\n }", "{\n array[i][j] = sc.nextInt();\n }", "array[i][j] = sc.nextInt()", "array[i][j]", "array[i]", "array", "i", "j", "sc.nextInt()", "sc.nextInt", "sc", "int n", "n", "int m", "m", "int[][] array", "array", "Scanner sc", "sc", "static boolean isPrime(long n) {\n if (n < 2) {\n return false;\n } else if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }\n long sqrtN = (long) Math.sqrt(n) + 1;\n for (long i = 6L; i <= sqrtN; i += 6) {\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }\n return true;\n }", "isPrime", "{\n if (n < 2) {\n return false;\n } else if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }\n long sqrtN = (long) Math.sqrt(n) + 1;\n for (long i = 6L; i <= sqrtN; i += 6) {\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }\n return true;\n }", "if (n < 2) {\n return false;\n } else if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }", "n < 2", "n", "2", "{\n return false;\n }", "return false;", "false", "if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }", "n == 2 || n == 3", "n == 2", "n", "2", "n == 3", "n", "3", "{\n return true;\n }", "return true;", "true", "if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }", "n % 2 == 0 || n % 3 == 0", "n % 2 == 0", "n % 2", "n", "2", "0", "n % 3 == 0", "n % 3", "n", "3", "0", "{\n return false;\n }", "return false;", "false", "long sqrtN = (long) Math.sqrt(n) + 1;", "sqrtN", "(long) Math.sqrt(n) + 1", "(long) Math.sqrt(n)", "Math.sqrt", "Math", "n", "1", "for (long i = 6L; i <= sqrtN; i += 6) {\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }", "long i = 6L;", "long i = 6L;", "i", "6L", "i <= sqrtN", "i", "sqrtN", "i += 6", "i += 6", "i", "6", "{\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }", "{\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }", "if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }", "n % (i - 1) == 0 || n % (i + 1) == 0", "n % (i - 1) == 0", "n % (i - 1)", "n", "(i - 1)", "i", "1", "0", "n % (i + 1) == 0", "n % (i + 1)", "n", "(i + 1)", "i", "1", "0", "{\n return false;\n }", "return false;", "false", "return true;", "true", "long n", "n", "static class Pair implements Comparable<Pair> {\n\n int a, b;\n\n public Pair(int x, int y) {\n a = x;\n b = y;\n }\n\n @Override\n public int compareTo(Pair p) {\n return a - p.a;\n }\n }", "Pair", "int a", "a", "b;", "b", "public Pair(int x, int y) {\n a = x;\n b = y;\n }", "Pair", "{\n a = x;\n b = y;\n }", "a = x", "a", "x", "b = y", "b", "y", "int x", "x", "int y", "y", "@Override\n public int compareTo(Pair p) {\n return a - p.a;\n }", "compareTo", "{\n return a - p.a;\n }", "return a - p.a;", "a - p.a", "a", "p.a", "p", "p.a", "Pair p", "p", "Comparable", "public class Main {\n\n public static int gcd(int a, int b) {\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int array[] = new int[n];\n forl_0(n, array, sc);\n Arrays.sort(array);\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum += array[i];\n }\n System.out.println(sum);\n bw.flush();\n }\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n\n static class Pair implements Comparable<Pair> {\n\n int a, b;\n\n public Pair(int x, int y) {\n a = x;\n b = y;\n }\n\n @Override\n public int compareTo(Pair p) {\n return a - p.a;\n }\n }\n\n static void forl_0(int n, int[] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void forl_1(int n, int[] array, Scanner sc) {\n for (int i = 1; i <= n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void two_d(int n, int m, int[][] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }\n }\n\n static boolean isPrime(long n) {\n if (n < 2) {\n return false;\n } else if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }\n long sqrtN = (long) Math.sqrt(n) + 1;\n for (long i = 6L; i <= sqrtN; i += 6) {\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }\n return true;\n }\n}", "public class Main {\n\n public static int gcd(int a, int b) {\n return (b == 0) ? a : gcd(b, a % b);\n }\n\n public static void main(String[] args) throws IOException {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int array[] = new int[n];\n forl_0(n, array, sc);\n Arrays.sort(array);\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum += array[i];\n }\n System.out.println(sum);\n bw.flush();\n }\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n//==============================================//\n\n static class Pair implements Comparable<Pair> {\n\n int a, b;\n\n public Pair(int x, int y) {\n a = x;\n b = y;\n }\n\n @Override\n public int compareTo(Pair p) {\n return a - p.a;\n }\n }\n\n static void forl_0(int n, int[] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void forl_1(int n, int[] array, Scanner sc) {\n for (int i = 1; i <= n; i++) {\n array[i] = sc.nextInt();\n }\n }\n\n static void two_d(int n, int m, int[][] array, Scanner sc) {\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n array[i][j] = sc.nextInt();\n }\n }\n }\n\n static boolean isPrime(long n) {\n if (n < 2) {\n return false;\n } else if (n == 2 || n == 3) {\n return true;\n } else if (n % 2 == 0 || n % 3 == 0) {\n return false;\n }\n long sqrtN = (long) Math.sqrt(n) + 1;\n for (long i = 6L; i <= sqrtN; i += 6) {\n if (n % (i - 1) == 0 || n % (i + 1) == 0) {\n return false;\n }\n }\n return true;\n }\n}", "Main" ]
import java.io.*; import java.util.*; //import java.util.Map.Entry; //import java.util.stream.*; //import java.math.*; public class Main { public static int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); } public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int array[] = new int[n]; forl_0(n, array, sc); Arrays.sort(array); long sum = 0; for (int i = 0; i < k; i++) { sum += array[i]; } System.out.println(sum); bw.flush(); } //==============================================// //==============================================// //==============================================// //==============================================// //==============================================// //==============================================// //==============================================// //==============================================// static class Pair implements Comparable<Pair> { int a, b; public Pair(int x, int y) { a = x; b = y; } @Override public int compareTo(Pair p) { return a - p.a; } } static void forl_0(int n, int[] array, Scanner sc) { for (int i = 0; i < n; i++) { array[i] = sc.nextInt(); } } static void forl_1(int n, int[] array, Scanner sc) { for (int i = 1; i <= n; i++) { array[i] = sc.nextInt(); } } static void two_d(int n, int m, int[][] array, Scanner sc) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { array[i][j] = sc.nextInt(); } } } static boolean isPrime(long n) { if (n < 2) { return false; } else if (n == 2 || n == 3) { return true; } else if (n % 2 == 0 || n % 3 == 0) { return false; } long sqrtN = (long) Math.sqrt(n) + 1; for (long i = 6L; i <= sqrtN; i += 6) { if (n % (i - 1) == 0 || n % (i + 1) == 0) { return false; } } return true; } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 11, 1, 41, 13, 2, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 18, 13, 13, 0, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 26, 28 ], [ 8, 29 ], [ 29, 30 ], [ 29, 31 ], [ 8, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 8, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 54, 56 ], [ 52, 57 ], [ 57, 58 ], [ 57, 59 ], [ 52, 60 ], [ 60, 61 ], [ 61, 62 ], [ 52, 63 ], [ 64, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 69, 71 ], [ 65, 72 ], [ 72, 73 ], [ 72, 74 ], [ 65, 75 ], [ 75, 76 ], [ 76, 77 ], [ 65, 78 ], [ 79, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 81, 85 ], [ 85, 86 ], [ 85, 87 ], [ 80, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 88, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 94, 98 ], [ 98, 99 ], [ 98, 100 ], [ 88, 101 ], [ 101, 102 ], [ 102, 103 ], [ 102, 104 ], [ 101, 105 ], [ 8, 106 ], [ 106, 107 ], [ 107, 108 ], [ 108, 109 ], [ 108, 110 ], [ 106, 111 ], [ 111, 112 ], [ 111, 113 ], [ 106, 114 ], [ 114, 115 ], [ 115, 116 ], [ 106, 117 ], [ 118, 118 ], [ 118, 119 ], [ 119, 120 ], [ 119, 121 ], [ 121, 122 ], [ 121, 123 ], [ 8, 124 ], [ 124, 125 ], [ 125, 126 ], [ 126, 127 ], [ 126, 128 ], [ 124, 129 ], [ 6, 130 ], [ 130, 131 ] ]
[ "import java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int sacrifice = 0;\n int sum = 0;\n \n for(int i=0;i<N;i++){\n p[i] = sc.nextInt();\n }\n \n for(int i=0;i<N;i++){\n for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }\n }\n \n for(int i=0;i<K;i++){\n sum += p[i];\n }\n \n System.out.println(sum);\n\t}\n}", "import java.util.*;", "util.*", "java", "class Main{\n\tpublic static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int sacrifice = 0;\n int sum = 0;\n \n for(int i=0;i<N;i++){\n p[i] = sc.nextInt();\n }\n \n for(int i=0;i<N;i++){\n for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }\n }\n \n for(int i=0;i<K;i++){\n sum += p[i];\n }\n \n System.out.println(sum);\n\t}\n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int sacrifice = 0;\n int sum = 0;\n \n for(int i=0;i<N;i++){\n p[i] = sc.nextInt();\n }\n \n for(int i=0;i<N;i++){\n for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }\n }\n \n for(int i=0;i<K;i++){\n sum += p[i];\n }\n \n System.out.println(sum);\n\t}", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int sacrifice = 0;\n int sum = 0;\n \n for(int i=0;i<N;i++){\n p[i] = sc.nextInt();\n }\n \n for(int i=0;i<N;i++){\n for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }\n }\n \n for(int i=0;i<K;i++){\n sum += p[i];\n }\n \n System.out.println(sum);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = new int[N];", "p", "new int[N]", "N", "int sacrifice = 0;", "sacrifice", "0", "int sum = 0;", "sum", "0", "for(int i=0;i<N;i++){\n p[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n p[i] = sc.nextInt();\n }", "{\n p[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "for(int i=0;i<N;i++){\n for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }\n }", "{\n for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }\n }", "for(int j=i+1;j<N;j++){\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }", "int j=i+1;", "int j=i+1;", "j", "i+1", "i", "1", "j<N", "j", "N", "j++", "j++", "j", "{\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }", "{\n if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }\n }", "if(p[i] > p[j]){\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }", "p[i] > p[j]", "p[i]", "p", "i", "p[j]", "p", "j", "{\n sacrifice = p[i];\n p[i] = p[j];\n p[j] = sacrifice;\n }", "sacrifice = p[i]", "sacrifice", "p[i]", "p", "i", "p[i] = p[j]", "p[i]", "p", "i", "p[j]", "p", "j", "p[j] = sacrifice", "p[j]", "p", "j", "sacrifice", "for(int i=0;i<K;i++){\n sum += p[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n sum += p[i];\n }", "{\n sum += p[i];\n }", "sum += p[i]", "sum", "p[i]", "p", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args" ]
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] p = new int[N]; int sacrifice = 0; int sum = 0; for(int i=0;i<N;i++){ p[i] = sc.nextInt(); } for(int i=0;i<N;i++){ for(int j=i+1;j<N;j++){ if(p[i] > p[j]){ sacrifice = p[i]; p[i] = p[j]; p[j] = sacrifice; } } } for(int i=0;i<K;i++){ sum += p[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 83, 11 ], [ 83, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 44, 47 ], [ 47, 48 ], [ 48, 49 ], [ 14, 50 ], [ 50, 51 ], [ 50, 52 ], [ 14, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 69, 70 ], [ 14, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 14, 77 ], [ 77, 78 ], [ 78, 79 ], [ 12, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.PriorityQueue;\nimport java.util.Queue;\nimport java.util.Scanner;\n\n/**\n * B - Mix Juice\n * ある店で N 種類の果物、果物 1,…,N が売られており、それぞれの価格は一個あたり p1,…,pN 円です。\n * この店で K 種類の果物を一個ずつ買うとき、それらの合計価格として考えられる最小の金額を求めてください。\n */\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n int n = sc.nextInt(); // 果物の種類\n int k = sc.nextInt(); // 購入する果物の種類\n\n Queue<Integer> queue = new PriorityQueue<>();\n for( int i = 0; i < n; i++ ) {\n queue.add( sc.nextInt() );\n }\n\n int result = 0;\n for( int i = 0; i < k; i++ ) {\n result += queue.poll();\n }\n\n System.out.println( result );\n\n sc.close();\n }\n}", "import java.util.PriorityQueue;", "PriorityQueue", "java.util", "import java.util.Queue;", "Queue", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n int n = sc.nextInt(); // 果物の種類\n int k = sc.nextInt(); // 購入する果物の種類\n\n Queue<Integer> queue = new PriorityQueue<>();\n for( int i = 0; i < n; i++ ) {\n queue.add( sc.nextInt() );\n }\n\n int result = 0;\n for( int i = 0; i < k; i++ ) {\n result += queue.poll();\n }\n\n System.out.println( result );\n\n sc.close();\n }\n}", "Main", "public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n int n = sc.nextInt(); // 果物の種類\n int k = sc.nextInt(); // 購入する果物の種類\n\n Queue<Integer> queue = new PriorityQueue<>();\n for( int i = 0; i < n; i++ ) {\n queue.add( sc.nextInt() );\n }\n\n int result = 0;\n for( int i = 0; i < k; i++ ) {\n result += queue.poll();\n }\n\n System.out.println( result );\n\n sc.close();\n }", "main", "{\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n int n = sc.nextInt(); // 果物の種類\n int k = sc.nextInt(); // 購入する果物の種類\n\n Queue<Integer> queue = new PriorityQueue<>();\n for( int i = 0; i < n; i++ ) {\n queue.add( sc.nextInt() );\n }\n\n int result = 0;\n for( int i = 0; i < k; i++ ) {\n result += queue.poll();\n }\n\n System.out.println( result );\n\n sc.close();\n }", "Scanner sc = new Scanner( System.in );", "sc", "new Scanner( System.in )", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "Queue<Integer> queue = new PriorityQueue<>();", "queue", "new PriorityQueue<>()", "for( int i = 0; i < n; i++ ) {\n queue.add( sc.nextInt() );\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n queue.add( sc.nextInt() );\n }", "{\n queue.add( sc.nextInt() );\n }", "queue.add( sc.nextInt() )", "queue.add", "queue", "sc.nextInt()", "sc.nextInt", "sc", "int result = 0;", "result", "0", "for( int i = 0; i < k; i++ ) {\n result += queue.poll();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n result += queue.poll();\n }", "{\n result += queue.poll();\n }", "result += queue.poll()", "result", "queue.poll()", "queue.poll", "queue", "System.out.println( result )", "System.out.println", "System.out", "System", "System.out", "result", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n int n = sc.nextInt(); // 果物の種類\n int k = sc.nextInt(); // 購入する果物の種類\n\n Queue<Integer> queue = new PriorityQueue<>();\n for( int i = 0; i < n; i++ ) {\n queue.add( sc.nextInt() );\n }\n\n int result = 0;\n for( int i = 0; i < k; i++ ) {\n result += queue.poll();\n }\n\n System.out.println( result );\n\n sc.close();\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner( System.in );\n // 入力値\n int n = sc.nextInt(); // 果物の種類\n int k = sc.nextInt(); // 購入する果物の種類\n\n Queue<Integer> queue = new PriorityQueue<>();\n for( int i = 0; i < n; i++ ) {\n queue.add( sc.nextInt() );\n }\n\n int result = 0;\n for( int i = 0; i < k; i++ ) {\n result += queue.poll();\n }\n\n System.out.println( result );\n\n sc.close();\n }\n}", "Main" ]
import java.util.PriorityQueue; import java.util.Queue; import java.util.Scanner; /** * B - Mix Juice * ある店で N 種類の果物、果物 1,…,N が売られており、それぞれの価格は一個あたり p1,…,pN 円です。 * この店で K 種類の果物を一個ずつ買うとき、それらの合計価格として考えられる最小の金額を求めてください。 */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner( System.in ); // 入力値 int n = sc.nextInt(); // 果物の種類 int k = sc.nextInt(); // 購入する果物の種類 Queue<Integer> queue = new PriorityQueue<>(); for( int i = 0; i < n; i++ ) { queue.add( sc.nextInt() ); } int result = 0; for( int i = 0; i < k; i++ ) { result += queue.poll(); } System.out.println( result ); sc.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 86, 8 ], [ 86, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 29, 31 ], [ 11, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 11, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 11, 80 ], [ 80, 81 ], [ 81, 82 ], [ 9, 83 ], [ 83, 84 ], [ 0, 85 ], [ 85, 86 ], [ 85, 87 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint []p = new int[N];\n\t\tint max = 0;\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tfor(int c = 0; c < K; c++){\n\t\t\tmax += p[c];\n\t\t}\n\t\tSystem.out.println(max);\n\t\tstdIn.close();\n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint []p = new int[N];\n\t\tint max = 0;\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tfor(int c = 0; c < K; c++){\n\t\t\tmax += p[c];\n\t\t}\n\t\tSystem.out.println(max);\n\t\tstdIn.close();\n\t}\n}", "Main", "public static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint []p = new int[N];\n\t\tint max = 0;\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tfor(int c = 0; c < K; c++){\n\t\t\tmax += p[c];\n\t\t}\n\t\tSystem.out.println(max);\n\t\tstdIn.close();\n\t}", "main", "{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint []p = new int[N];\n\t\tint max = 0;\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tfor(int c = 0; c < K; c++){\n\t\t\tmax += p[c];\n\t\t}\n\t\tSystem.out.println(max);\n\t\tstdIn.close();\n\t}", "Scanner stdIn = new Scanner(System.in);", "stdIn", "new Scanner(System.in)", "int N = stdIn.nextInt();", "N", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "int K = stdIn.nextInt();", "K", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "int []p = new int[N];", "p", "new int[N]", "N", "int max = 0;", "max", "0", "for(int a = 0; a < N; a++){\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}", "int a = 0;", "int a = 0;", "a", "0", "a < N", "a", "N", "a++", "a++", "a", "{\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}", "{\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}", "p[a] = stdIn.nextInt()", "p[a]", "p", "a", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "for(int c = 0; c < K; c++){\n\t\t\tmax += p[c];\n\t\t}", "int c = 0;", "int c = 0;", "c", "0", "c < K", "c", "K", "c++", "c++", "c", "{\n\t\t\tmax += p[c];\n\t\t}", "{\n\t\t\tmax += p[c];\n\t\t}", "max += p[c]", "max", "p[c]", "p", "c", "System.out.println(max)", "System.out.println", "System.out", "System", "System.out", "max", "stdIn.close()", "stdIn.close", "stdIn", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint []p = new int[N];\n\t\tint max = 0;\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tfor(int c = 0; c < K; c++){\n\t\t\tmax += p[c];\n\t\t}\n\t\tSystem.out.println(max);\n\t\tstdIn.close();\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint []p = new int[N];\n\t\tint max = 0;\n\t\tfor(int a = 0; a < N; a++){\n\t\t\tp[a] = stdIn.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tfor(int c = 0; c < K; c++){\n\t\t\tmax += p[c];\n\t\t}\n\t\tSystem.out.println(max);\n\t\tstdIn.close();\n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); int K = stdIn.nextInt(); int []p = new int[N]; int max = 0; for(int a = 0; a < N; a++){ p[a] = stdIn.nextInt(); } Arrays.sort(p); for(int c = 0; c < K; c++){ max += p[c]; } System.out.println(max); stdIn.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 41, 13, 20, 13, 0, 13, 4, 18, 13, 0, 13, 4, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 116, 8 ], [ 116, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 22, 25 ], [ 11, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 29, 30 ], [ 28, 31 ], [ 31, 32 ], [ 31, 33 ], [ 11, 34 ], [ 34, 35 ], [ 34, 36 ], [ 36, 37 ], [ 37, 38 ], [ 36, 39 ], [ 39, 40 ], [ 39, 41 ], [ 11, 42 ], [ 42, 43 ], [ 42, 44 ], [ 11, 46 ], [ 46, 47 ], [ 46, 48 ], [ 48, 49 ], [ 49, 50 ], [ 11, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 54, 55 ], [ 53, 56 ], [ 11, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 62, 63 ], [ 62, 64 ], [ 57, 65 ], [ 65, 66 ], [ 66, 67 ], [ 57, 68 ], [ 69, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 70, 74 ], [ 74, 75 ], [ 75, 76 ], [ 74, 77 ], [ 77, 78 ], [ 77, 79 ], [ 11, 80 ], [ 80, 81 ], [ 81, 82 ], [ 80, 83 ], [ 11, 84 ], [ 84, 85 ], [ 84, 86 ], [ 11, 87 ], [ 87, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 87, 92 ], [ 92, 93 ], [ 92, 94 ], [ 87, 95 ], [ 95, 96 ], [ 96, 97 ], [ 87, 98 ], [ 99, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 102, 104 ], [ 104, 105 ], [ 104, 106 ], [ 11, 107 ], [ 107, 108 ], [ 108, 109 ], [ 109, 110 ], [ 109, 111 ], [ 107, 112 ], [ 9, 113 ], [ 113, 114 ], [ 0, 115 ], [ 115, 116 ], [ 115, 117 ] ]
[ "\nimport java.util.Scanner;\nimport java.util.Arrays;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] lines = line.split(\" \");\n\t\tint N = Integer.parseInt(lines[0]);\n\t\tint K = Integer.parseInt(lines[1]);\n\n\t\tint[] fruit = new int[N];\n\n\t\tline = sc.nextLine();\n\t\tlines = line.split(\" \");\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}\n\t\tArrays.sort(fruit);\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum = sum + fruit[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] lines = line.split(\" \");\n\t\tint N = Integer.parseInt(lines[0]);\n\t\tint K = Integer.parseInt(lines[1]);\n\n\t\tint[] fruit = new int[N];\n\n\t\tline = sc.nextLine();\n\t\tlines = line.split(\" \");\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}\n\t\tArrays.sort(fruit);\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum = sum + fruit[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] lines = line.split(\" \");\n\t\tint N = Integer.parseInt(lines[0]);\n\t\tint K = Integer.parseInt(lines[1]);\n\n\t\tint[] fruit = new int[N];\n\n\t\tline = sc.nextLine();\n\t\tlines = line.split(\" \");\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}\n\t\tArrays.sort(fruit);\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum = sum + fruit[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}", "main", "{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] lines = line.split(\" \");\n\t\tint N = Integer.parseInt(lines[0]);\n\t\tint K = Integer.parseInt(lines[1]);\n\n\t\tint[] fruit = new int[N];\n\n\t\tline = sc.nextLine();\n\t\tlines = line.split(\" \");\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}\n\t\tArrays.sort(fruit);\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum = sum + fruit[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "String line = sc.nextLine();", "line", "sc.nextLine()", "sc.nextLine", "sc", "String[] lines = line.split(\" \");", "lines", "line.split(\" \")", "line.split", "line", "\" \"", "int N = Integer.parseInt(lines[0]);", "N", "Integer.parseInt(lines[0])", "Integer.parseInt", "Integer", "lines[0]", "lines", "0", "int K = Integer.parseInt(lines[1]);", "K", "Integer.parseInt(lines[1])", "Integer.parseInt", "Integer", "lines[1]", "lines", "1", "int[] fruit = new int[N];", "fruit", "new int[N]", "N", "line = sc.nextLine()", "line", "sc.nextLine()", "sc.nextLine", "sc", "lines = line.split(\" \")", "lines", "line.split(\" \")", "line.split", "line", "\" \"", "for(int i = 0; i < N; i++) {\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}", "{\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}", "fruit[i] = Integer.parseInt(lines[i])", "fruit[i]", "fruit", "i", "Integer.parseInt(lines[i])", "Integer.parseInt", "Integer", "lines[i]", "lines", "i", "Arrays.sort(fruit)", "Arrays.sort", "Arrays", "fruit", "int sum = 0;", "sum", "0", "for(int i = 0; i < K; i++) {\n\t\t\tsum = sum + fruit[i];\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n\t\t\tsum = sum + fruit[i];\n\t\t}", "{\n\t\t\tsum = sum + fruit[i];\n\t\t}", "sum = sum + fruit[i]", "sum", "sum + fruit[i]", "sum", "fruit[i]", "fruit", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] lines = line.split(\" \");\n\t\tint N = Integer.parseInt(lines[0]);\n\t\tint K = Integer.parseInt(lines[1]);\n\n\t\tint[] fruit = new int[N];\n\n\t\tline = sc.nextLine();\n\t\tlines = line.split(\" \");\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}\n\t\tArrays.sort(fruit);\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum = sum + fruit[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tString line = sc.nextLine();\n\t\tString[] lines = line.split(\" \");\n\t\tint N = Integer.parseInt(lines[0]);\n\t\tint K = Integer.parseInt(lines[1]);\n\n\t\tint[] fruit = new int[N];\n\n\t\tline = sc.nextLine();\n\t\tlines = line.split(\" \");\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tfruit[i] = Integer.parseInt(lines[i]);\n\t\t}\n\t\tArrays.sort(fruit);\n\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum = sum + fruit[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t}\n\n}", "Main" ]
import java.util.Scanner; import java.util.Arrays; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); String line = sc.nextLine(); String[] lines = line.split(" "); int N = Integer.parseInt(lines[0]); int K = Integer.parseInt(lines[1]); int[] fruit = new int[N]; line = sc.nextLine(); lines = line.split(" "); for(int i = 0; i < N; i++) { fruit[i] = Integer.parseInt(lines[i]); } Arrays.sort(fruit); int sum = 0; for(int i = 0; i < K; i++) { sum = sum + fruit[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 41, 13, 2, 17, 17, 0, 13, 20, 0, 13, 20, 4, 13, 41, 13, 4, 13, 41, 13, 4, 13, 4, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 23, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 160, 11 ], [ 160, 12 ], [ 12, 13 ], [ 160, 14 ], [ 14, 15 ], [ 160, 16 ], [ 16, 17 ], [ 160, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 23, 25 ], [ 20, 26 ], [ 26, 27 ], [ 26, 28 ], [ 20, 29 ], [ 29, 30 ], [ 29, 31 ], [ 20, 32 ], [ 32, 33 ], [ 20, 34 ], [ 34, 35 ], [ 34, 36 ], [ 36, 37 ], [ 20, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 20, 42 ], [ 42, 43 ], [ 20, 44 ], [ 44, 45 ], [ 44, 46 ], [ 20, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 48, 53 ], [ 53, 54 ], [ 53, 55 ], [ 55, 56 ], [ 55, 57 ], [ 48, 58 ], [ 58, 59 ], [ 59, 60 ], [ 48, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 62, 66 ], [ 66, 67 ], [ 20, 68 ], [ 68, 69 ], [ 69, 70 ], [ 68, 71 ], [ 20, 72 ], [ 72, 73 ], [ 72, 74 ], [ 20, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 75, 80 ], [ 80, 81 ], [ 80, 82 ], [ 75, 83 ], [ 83, 84 ], [ 84, 85 ], [ 75, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 89, 90 ], [ 89, 91 ], [ 20, 92 ], [ 92, 93 ], [ 93, 94 ], [ 92, 95 ], [ 95, 96 ], [ 96, 97 ], [ 95, 98 ], [ 20, 99 ], [ 99, 100 ], [ 100, 101 ], [ 20, 102 ], [ 102, 103 ], [ 103, 104 ], [ 18, 105 ], [ 105, 106 ], [ 160, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 160, 113 ], [ 113, 114 ], [ 113, 115 ], [ 115, 116 ], [ 116, 117 ], [ 117, 118 ], [ 118, 119 ], [ 117, 120 ], [ 120, 121 ], [ 121, 122 ], [ 160, 123 ], [ 123, 124 ], [ 123, 125 ], [ 125, 126 ], [ 126, 127 ], [ 127, 128 ], [ 128, 129 ], [ 127, 130 ], [ 130, 131 ], [ 131, 132 ], [ 160, 133 ], [ 133, 134 ], [ 133, 135 ], [ 135, 136 ], [ 136, 137 ], [ 137, 138 ], [ 138, 139 ], [ 137, 140 ], [ 140, 141 ], [ 141, 142 ], [ 160, 143 ], [ 143, 144 ], [ 143, 145 ], [ 145, 146 ], [ 146, 147 ], [ 147, 148 ], [ 148, 149 ], [ 149, 150 ], [ 150, 151 ], [ 160, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 156, 157 ], [ 157, 158 ], [ 0, 159 ], [ 159, 160 ], [ 159, 161 ] ]
[ "//package atcoder.beginner_171;\n\nimport java.io.*;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n public static void main (String[] args) throws Exception {\n\n String s = \"5 3\\n\" +\n \"50 100 80 120 80\";\n\n// br = new BufferedReader(new StringReader(s));\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n rl(); int N=nin(), K=nin();\n rl(); int[] A=new int[N]; for(int i=0; i<A.length; ++i) A[i]=nin();\n Arrays.parallelSort(A);\n int sum=0;\n for(int i=0; i<K; ++i) sum+=A[i];\n\n\n bw.write(Integer.toString(sum));\n bw.newLine();\n bw.flush();\n\n }\n\n static BufferedReader br;\n static BufferedWriter bw;\n static StringTokenizer st;\n static void rl() throws Exception{\n st = new StringTokenizer(br.readLine());\n }\n static long nlo(){\n return Long.parseLong(st.nextToken());\n }\n static int nin(){\n return Integer.parseInt(st.nextToken());\n }\n /*private static void te(){\n }*/\n static double ndo(){\n return Double.parseDouble(st.nextToken());\n }\n static char[] nca(){\n return st.nextToken().toCharArray();\n }\n static String nstr(){\n return st.nextToken();\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\n public static void main (String[] args) throws Exception {\n\n String s = \"5 3\\n\" +\n \"50 100 80 120 80\";\n\n// br = new BufferedReader(new StringReader(s));\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n rl(); int N=nin(), K=nin();\n rl(); int[] A=new int[N]; for(int i=0; i<A.length; ++i) A[i]=nin();\n Arrays.parallelSort(A);\n int sum=0;\n for(int i=0; i<K; ++i) sum+=A[i];\n\n\n bw.write(Integer.toString(sum));\n bw.newLine();\n bw.flush();\n\n }\n\n static BufferedReader br;\n static BufferedWriter bw;\n static StringTokenizer st;\n static void rl() throws Exception{\n st = new StringTokenizer(br.readLine());\n }\n static long nlo(){\n return Long.parseLong(st.nextToken());\n }\n static int nin(){\n return Integer.parseInt(st.nextToken());\n }\n /*private static void te(){\n }*/\n static double ndo(){\n return Double.parseDouble(st.nextToken());\n }\n static char[] nca(){\n return st.nextToken().toCharArray();\n }\n static String nstr(){\n return st.nextToken();\n }\n}", "Main", "static BufferedReader br;", "br", "static BufferedWriter bw;", "bw", "static StringTokenizer st;", "st", "public static void main (String[] args) throws Exception {\n\n String s = \"5 3\\n\" +\n \"50 100 80 120 80\";\n\n// br = new BufferedReader(new StringReader(s));\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n rl(); int N=nin(), K=nin();\n rl(); int[] A=new int[N]; for(int i=0; i<A.length; ++i) A[i]=nin();\n Arrays.parallelSort(A);\n int sum=0;\n for(int i=0; i<K; ++i) sum+=A[i];\n\n\n bw.write(Integer.toString(sum));\n bw.newLine();\n bw.flush();\n\n }", "main", "{\n\n String s = \"5 3\\n\" +\n \"50 100 80 120 80\";\n\n// br = new BufferedReader(new StringReader(s));\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n rl(); int N=nin(), K=nin();\n rl(); int[] A=new int[N]; for(int i=0; i<A.length; ++i) A[i]=nin();\n Arrays.parallelSort(A);\n int sum=0;\n for(int i=0; i<K; ++i) sum+=A[i];\n\n\n bw.write(Integer.toString(sum));\n bw.newLine();\n bw.flush();\n\n }", "String s = \"5 3\\n\" +\n \"50 100 80 120 80\";", "s", "\"5 3\\n\" +\n \"50 100 80 120 80\"", "\"5 3\\n\"", "\"50 100 80 120 80\"", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "bw = new BufferedWriter(new OutputStreamWriter(System.out))", "bw", "new BufferedWriter(new OutputStreamWriter(System.out))", "rl()", "rl", "int N=nin()", "N", "nin()", "nin", "K=nin();", "K", "nin()", "nin", "rl()", "rl", "int[] A=new int[N];", "A", "new int[N]", "N", "for(int i=0; i<A.length; ++i) A[i]=nin();", "int i=0;", "int i=0;", "i", "0", "i<A.length", "i", "A.length", "A", "A.length", "++i", "++i", "i", "A[i]=nin();", "A[i]=nin()", "A[i]", "A", "i", "nin()", "nin", "Arrays.parallelSort(A)", "Arrays.parallelSort", "Arrays", "A", "int sum=0;", "sum", "0", "for(int i=0; i<K; ++i) sum+=A[i];", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "++i", "++i", "i", "sum+=A[i];", "sum+=A[i]", "sum", "A[i]", "A", "i", "bw.write(Integer.toString(sum))", "bw.write", "bw", "Integer.toString(sum)", "Integer.toString", "Integer", "sum", "bw.newLine()", "bw.newLine", "bw", "bw.flush()", "bw.flush", "bw", "String[] args", "args", "static void rl() throws Exception{\n st = new StringTokenizer(br.readLine());\n }", "rl", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "static long nlo(){\n return Long.parseLong(st.nextToken());\n }", "nlo", "{\n return Long.parseLong(st.nextToken());\n }", "return Long.parseLong(st.nextToken());", "Long.parseLong(st.nextToken())", "Long.parseLong", "Long", "st.nextToken()", "st.nextToken", "st", "static int nin(){\n return Integer.parseInt(st.nextToken());\n }", "nin", "{\n return Integer.parseInt(st.nextToken());\n }", "return Integer.parseInt(st.nextToken());", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "/*private static void te(){\n }*/\n static double ndo(){\n return Double.parseDouble(st.nextToken());\n }", "ndo", "{\n return Double.parseDouble(st.nextToken());\n }", "return Double.parseDouble(st.nextToken());", "Double.parseDouble(st.nextToken())", "Double.parseDouble", "Double", "st.nextToken()", "st.nextToken", "st", "static char[] nca(){\n return st.nextToken().toCharArray();\n }", "nca", "{\n return st.nextToken().toCharArray();\n }", "return st.nextToken().toCharArray();", "st.nextToken().toCharArray()", "st.nextToken().toCharArray", "st.nextToken()", "st.nextToken", "st", "static String nstr(){\n return st.nextToken();\n }", "nstr", "{\n return st.nextToken();\n }", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "public class Main {\n\n public static void main (String[] args) throws Exception {\n\n String s = \"5 3\\n\" +\n \"50 100 80 120 80\";\n\n// br = new BufferedReader(new StringReader(s));\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n rl(); int N=nin(), K=nin();\n rl(); int[] A=new int[N]; for(int i=0; i<A.length; ++i) A[i]=nin();\n Arrays.parallelSort(A);\n int sum=0;\n for(int i=0; i<K; ++i) sum+=A[i];\n\n\n bw.write(Integer.toString(sum));\n bw.newLine();\n bw.flush();\n\n }\n\n static BufferedReader br;\n static BufferedWriter bw;\n static StringTokenizer st;\n static void rl() throws Exception{\n st = new StringTokenizer(br.readLine());\n }\n static long nlo(){\n return Long.parseLong(st.nextToken());\n }\n static int nin(){\n return Integer.parseInt(st.nextToken());\n }\n /*private static void te(){\n }*/\n static double ndo(){\n return Double.parseDouble(st.nextToken());\n }\n static char[] nca(){\n return st.nextToken().toCharArray();\n }\n static String nstr(){\n return st.nextToken();\n }\n}", "public class Main {\n\n public static void main (String[] args) throws Exception {\n\n String s = \"5 3\\n\" +\n \"50 100 80 120 80\";\n\n// br = new BufferedReader(new StringReader(s));\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n rl(); int N=nin(), K=nin();\n rl(); int[] A=new int[N]; for(int i=0; i<A.length; ++i) A[i]=nin();\n Arrays.parallelSort(A);\n int sum=0;\n for(int i=0; i<K; ++i) sum+=A[i];\n\n\n bw.write(Integer.toString(sum));\n bw.newLine();\n bw.flush();\n\n }\n\n static BufferedReader br;\n static BufferedWriter bw;\n static StringTokenizer st;\n static void rl() throws Exception{\n st = new StringTokenizer(br.readLine());\n }\n static long nlo(){\n return Long.parseLong(st.nextToken());\n }\n static int nin(){\n return Integer.parseInt(st.nextToken());\n }\n /*private static void te(){\n }*/\n static double ndo(){\n return Double.parseDouble(st.nextToken());\n }\n static char[] nca(){\n return st.nextToken().toCharArray();\n }\n static String nstr(){\n return st.nextToken();\n }\n}", "Main" ]
//package atcoder.beginner_171; import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public static void main (String[] args) throws Exception { String s = "5 3\n" + "50 100 80 120 80"; // br = new BufferedReader(new StringReader(s)); br = new BufferedReader(new InputStreamReader(System.in)); bw = new BufferedWriter(new OutputStreamWriter(System.out)); rl(); int N=nin(), K=nin(); rl(); int[] A=new int[N]; for(int i=0; i<A.length; ++i) A[i]=nin(); Arrays.parallelSort(A); int sum=0; for(int i=0; i<K; ++i) sum+=A[i]; bw.write(Integer.toString(sum)); bw.newLine(); bw.flush(); } static BufferedReader br; static BufferedWriter bw; static StringTokenizer st; static void rl() throws Exception{ st = new StringTokenizer(br.readLine()); } static long nlo(){ return Long.parseLong(st.nextToken()); } static int nin(){ return Integer.parseInt(st.nextToken()); } /*private static void te(){ }*/ static double ndo(){ return Double.parseDouble(st.nextToken()); } static char[] nca(){ return st.nextToken().toCharArray(); } static String nstr(){ return st.nextToken(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 17, 41, 13, 17, 41, 13, 17, 41, 13, 17, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 42, 2, 13, 13, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 2, 13, 18, 13, 13, 2, 18, 13, 13, 17, 30, 0, 13, 18, 13, 13, 0, 13, 13, 14, 2, 2, 13, 17, 13, 30, 0, 18, 13, 13, 17, 0, 13, 13, 0, 13, 17, 40, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 129, 5 ], [ 129, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 8, 15 ], [ 15, 16 ], [ 15, 17 ], [ 8, 18 ], [ 18, 19 ], [ 18, 20 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 8, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 8, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 32, 33 ], [ 8, 34 ], [ 34, 35 ], [ 34, 36 ], [ 8, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 38, 43 ], [ 43, 44 ], [ 43, 45 ], [ 38, 46 ], [ 46, 47 ], [ 47, 48 ], [ 38, 49 ], [ 50, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 51, 55 ], [ 55, 56 ], [ 56, 57 ], [ 8, 58 ], [ 58, 59 ], [ 59, 60 ], [ 8, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 66, 71 ], [ 71, 72 ], [ 71, 73 ], [ 66, 74 ], [ 74, 75 ], [ 75, 76 ], [ 66, 77 ], [ 78, 78 ], [ 78, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 83, 84 ], [ 83, 85 ], [ 80, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 79, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 91, 97 ], [ 97, 98 ], [ 97, 99 ], [ 78, 100 ], [ 100, 101 ], [ 101, 102 ], [ 102, 103 ], [ 102, 104 ], [ 101, 105 ], [ 100, 106 ], [ 106, 107 ], [ 107, 108 ], [ 108, 109 ], [ 108, 110 ], [ 107, 111 ], [ 65, 112 ], [ 112, 113 ], [ 112, 114 ], [ 65, 115 ], [ 115, 116 ], [ 115, 117 ], [ 65, 118 ], [ 118, 119 ], [ 8, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 120, 125 ], [ 6, 126 ], [ 126, 127 ], [ 0, 128 ], [ 128, 129 ], [ 128, 130 ] ]
[ "import java.util.Scanner;\n\npublic class Main \n{\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\t\n\t\tint count = 0;\n\t\tint temp = 1000;\n\t\tint tempo = 0;\n\t\tint answer = 0;\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t\n\t\tint[] p = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\t\n\t\twhile(count < k)\n\t\t{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}\n\t\t\n\t\tSystem.out.println(answer);\n\t\t\n\t}\n\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main \n{\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\t\n\t\tint count = 0;\n\t\tint temp = 1000;\n\t\tint tempo = 0;\n\t\tint answer = 0;\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t\n\t\tint[] p = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\t\n\t\twhile(count < k)\n\t\t{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}\n\t\t\n\t\tSystem.out.println(answer);\n\t\t\n\t}\n\n}", "Main", "public static void main(String[] args)\n\t{\n\t\t\n\t\tint count = 0;\n\t\tint temp = 1000;\n\t\tint tempo = 0;\n\t\tint answer = 0;\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t\n\t\tint[] p = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\t\n\t\twhile(count < k)\n\t\t{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}\n\t\t\n\t\tSystem.out.println(answer);\n\t\t\n\t}", "main", "{\n\t\t\n\t\tint count = 0;\n\t\tint temp = 1000;\n\t\tint tempo = 0;\n\t\tint answer = 0;\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t\n\t\tint[] p = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\t\n\t\twhile(count < k)\n\t\t{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}\n\t\t\n\t\tSystem.out.println(answer);\n\t\t\n\t}", "int count = 0;", "count", "0", "int temp = 1000;", "temp", "1000", "int tempo = 0;", "tempo", "0", "int answer = 0;", "answer", "0", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = new int[n];", "p", "new int[n]", "n", "for(int i = 0; i < n; i++)\n\t\t{\n\t\t\tp[i] = sc.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tp[i] = sc.nextInt();\n\t\t}", "{\n\t\t\tp[i] = sc.nextInt();\n\t\t}", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "sc.close()", "sc.close", "sc", "while(count < k)\n\t\t{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}", "count < k", "count", "k", "{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}", "for(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}", "{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}", "if(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}", "temp > p[i] && p[i] != 0", "temp > p[i]", "temp", "p[i]", "p", "i", "p[i] != 0", "p[i]", "p", "i", "0", "{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}", "temp = p[i]", "temp", "p[i]", "p", "i", "tempo = i", "tempo", "i", "if(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}", "i + 1 == n", "i + 1", "i", "1", "n", "{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}", "p[tempo] = 1000", "p[tempo]", "p", "tempo", "1000", "answer += temp", "answer", "temp", "temp = 1000", "temp", "1000", "count++", "count", "System.out.println(answer)", "System.out.println", "System.out", "System", "System.out", "answer", "String[] args", "args", "public class Main \n{\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\t\n\t\tint count = 0;\n\t\tint temp = 1000;\n\t\tint tempo = 0;\n\t\tint answer = 0;\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t\n\t\tint[] p = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\t\n\t\twhile(count < k)\n\t\t{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}\n\t\t\n\t\tSystem.out.println(answer);\n\t\t\n\t}\n\n}", "public class Main \n{\n\t\n\tpublic static void main(String[] args)\n\t{\n\t\t\n\t\tint count = 0;\n\t\tint temp = 1000;\n\t\tint tempo = 0;\n\t\tint answer = 0;\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t\n\t\tint[] p = new int[n];\n\t\t\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\t\n\t\twhile(count < k)\n\t\t{\n\t\t\tfor(int i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(temp > p[i] && p[i] != 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = p[i];\n\t\t\t\t\ttempo = i;\n\t\t\t\t}\n\t\t\t\tif(i + 1 == n)\n\t\t\t\t{\n\t\t\t\t\tp[tempo] = 1000;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tanswer += temp;\n\t\t\ttemp = 1000;\n\t\t\tcount++;\n\n\t\t}\n\t\t\n\t\tSystem.out.println(answer);\n\t\t\n\t}\n\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { int count = 0; int temp = 1000; int tempo = 0; int answer = 0; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] p = new int[n]; for(int i = 0; i < n; i++) { p[i] = sc.nextInt(); } sc.close(); while(count < k) { for(int i = 0; i < n; i++) { if(temp > p[i] && p[i] != 0) { temp = p[i]; tempo = i; } if(i + 1 == n) { p[tempo] = 1000; } } answer += temp; temp = 1000; count++; } System.out.println(answer); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 26, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 26, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 38, 39 ], [ 26, 40 ], [ 40, 41 ], [ 40, 42 ], [ 26, 43 ], [ 43, 44 ], [ 43, 45 ], [ 26, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 59, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 60, 64 ], [ 64, 65 ], [ 65, 66 ], [ 26, 67 ], [ 67, 68 ], [ 68, 69 ], [ 67, 70 ], [ 26, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 76, 77 ], [ 76, 78 ], [ 71, 79 ], [ 79, 80 ], [ 80, 81 ], [ 71, 82 ], [ 83, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 86, 88 ], [ 26, 89 ], [ 89, 90 ], [ 90, 91 ], [ 91, 92 ], [ 91, 93 ], [ 89, 94 ], [ 24, 95 ], [ 95, 96 ] ]
[ "import java.util.Scanner;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Comparator;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.*;\nclass Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int sum = 0;\n Integer[] p = new Integer[N];\n for (int i = 0; i < N; i++) {\n p[i] = scan.nextInt();\n }\n Arrays.sort(p);\n for (int i = 0; i < K; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }\n}\n", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.List;", "List", "java.util", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Comparator;", "Comparator", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.*;", "util.*", "java", "class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int sum = 0;\n Integer[] p = new Integer[N];\n for (int i = 0; i < N; i++) {\n p[i] = scan.nextInt();\n }\n Arrays.sort(p);\n for (int i = 0; i < K; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int sum = 0;\n Integer[] p = new Integer[N];\n for (int i = 0; i < N; i++) {\n p[i] = scan.nextInt();\n }\n Arrays.sort(p);\n for (int i = 0; i < K; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }", "main", "{\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int sum = 0;\n Integer[] p = new Integer[N];\n for (int i = 0; i < N; i++) {\n p[i] = scan.nextInt();\n }\n Arrays.sort(p);\n for (int i = 0; i < K; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int N = scan.nextInt();", "N", "scan.nextInt()", "scan.nextInt", "scan", "int K = scan.nextInt();", "K", "scan.nextInt()", "scan.nextInt", "scan", "int sum = 0;", "sum", "0", "Integer[] p = new Integer[N];", "p", "new Integer[N]", "N", "for (int i = 0; i < N; i++) {\n p[i] = scan.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n p[i] = scan.nextInt();\n }", "{\n p[i] = scan.nextInt();\n }", "p[i] = scan.nextInt()", "p[i]", "p", "i", "scan.nextInt()", "scan.nextInt", "scan", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "for (int i = 0; i < K; i++) {\n sum += p[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sum += p[i];\n }", "{\n sum += p[i];\n }", "sum += p[i]", "sum", "p[i]", "p", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args" ]
import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.Comparator; import java.util.Arrays; import java.util.Collections; import java.util.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int K = scan.nextInt(); int sum = 0; Integer[] p = new Integer[N]; for (int i = 0; i < N; i++) { p[i] = scan.nextInt(); } Arrays.sort(p); for (int i = 0; i < K; i++) { sum += p[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 83, 8 ], [ 83, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 9, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n\n int P[] = new int[N];\n for (int i = 0; i < N; i++) {\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int sum = 0;\n for(int i = 0; i < K; i++){\n sum+=P[i];\n }\n System.out.println(sum);\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n\n int P[] = new int[N];\n for (int i = 0; i < N; i++) {\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int sum = 0;\n for(int i = 0; i < K; i++){\n sum+=P[i];\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n\n int P[] = new int[N];\n for (int i = 0; i < N; i++) {\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int sum = 0;\n for(int i = 0; i < K; i++){\n sum+=P[i];\n }\n System.out.println(sum);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n\n int P[] = new int[N];\n for (int i = 0; i < N; i++) {\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int sum = 0;\n for(int i = 0; i < K; i++){\n sum+=P[i];\n }\n System.out.println(sum);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int P[] = new int[N];", "P", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n P[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n P[i] = sc.nextInt();\n }", "{\n P[i] = sc.nextInt();\n }", "P[i] = sc.nextInt()", "P[i]", "P", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(P)", "Arrays.sort", "Arrays", "P", "int sum = 0;", "sum", "0", "for(int i = 0; i < K; i++){\n sum+=P[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sum+=P[i];\n }", "{\n sum+=P[i];\n }", "sum+=P[i]", "sum", "P[i]", "P", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n\n int P[] = new int[N];\n for (int i = 0; i < N; i++) {\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int sum = 0;\n for(int i = 0; i < K; i++){\n sum+=P[i];\n }\n System.out.println(sum);\n }\n}", "public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt();\n int K = sc.nextInt();\n\n int P[] = new int[N];\n for (int i = 0; i < N; i++) {\n P[i] = sc.nextInt();\n }\n\n Arrays.sort(P);\n\n int sum = 0;\n for(int i = 0; i < K; i++){\n sum+=P[i];\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int P[] = new int[N]; for (int i = 0; i < N; i++) { P[i] = sc.nextInt(); } Arrays.sort(P); int sum = 0; for(int i = 0; i < K; i++){ sum+=P[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 81, 5 ], [ 81, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 33, 34 ], [ 33, 35 ], [ 26, 36 ], [ 36, 37 ], [ 37, 38 ], [ 26, 39 ], [ 40, 40 ], [ 40, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 46, 47 ], [ 8, 48 ], [ 48, 49 ], [ 49, 50 ], [ 48, 51 ], [ 8, 52 ], [ 52, 53 ], [ 52, 54 ], [ 8, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 55, 60 ], [ 60, 61 ], [ 60, 62 ], [ 55, 63 ], [ 63, 64 ], [ 64, 65 ], [ 55, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 69, 71 ], [ 8, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 6, 78 ], [ 78, 79 ], [ 0, 80 ], [ 80, 81 ], [ 80, 82 ] ]
[ "import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n \tint k = scn.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\ta[i] = scn.nextInt();\n\t\t}\n \tArrays.sort(a);\n \tint ans = 0;\n \tfor(int i=0; i<k; i++) ans+=a[i];\n \tSystem.out.println(ans);\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n \tint k = scn.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\ta[i] = scn.nextInt();\n\t\t}\n \tArrays.sort(a);\n \tint ans = 0;\n \tfor(int i=0; i<k; i++) ans+=a[i];\n \tSystem.out.println(ans);\n\t}\n}", "Main", "public static void main(String[] args) throws Exception{\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n \tint k = scn.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\ta[i] = scn.nextInt();\n\t\t}\n \tArrays.sort(a);\n \tint ans = 0;\n \tfor(int i=0; i<k; i++) ans+=a[i];\n \tSystem.out.println(ans);\n\t}", "main", "{\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n \tint k = scn.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\ta[i] = scn.nextInt();\n\t\t}\n \tArrays.sort(a);\n \tint ans = 0;\n \tfor(int i=0; i<k; i++) ans+=a[i];\n \tSystem.out.println(ans);\n\t}", "Scanner scn = new Scanner(System.in);", "scn", "new Scanner(System.in)", "int n = scn.nextInt();", "n", "scn.nextInt()", "scn.nextInt", "scn", "int k = scn.nextInt();", "k", "scn.nextInt()", "scn.nextInt", "scn", "int[] a = new int[n];", "a", "new int[n]", "n", "for(int i=0; i<a.length; i++){\n\t\t\ta[i] = scn.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<a.length", "i", "a.length", "a", "a.length", "i++", "i++", "i", "{\n\t\t\ta[i] = scn.nextInt();\n\t\t}", "{\n\t\t\ta[i] = scn.nextInt();\n\t\t}", "a[i] = scn.nextInt()", "a[i]", "a", "i", "scn.nextInt()", "scn.nextInt", "scn", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "int ans = 0;", "ans", "0", "for(int i=0; i<k; i++) ans+=a[i];", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "ans+=a[i];", "ans+=a[i]", "ans", "a[i]", "a", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n \tint k = scn.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\ta[i] = scn.nextInt();\n\t\t}\n \tArrays.sort(a);\n \tint ans = 0;\n \tfor(int i=0; i<k; i++) ans+=a[i];\n \tSystem.out.println(ans);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) throws Exception{\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n \tint k = scn.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor(int i=0; i<a.length; i++){\n\t\t\ta[i] = scn.nextInt();\n\t\t}\n \tArrays.sort(a);\n \tint ans = 0;\n \tfor(int i=0; i<k; i++) ans+=a[i];\n \tSystem.out.println(ans);\n\t}\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int k = scn.nextInt(); int[] a = new int[n]; for(int i=0; i<a.length; i++){ a[i] = scn.nextInt(); } Arrays.sort(a); int ans = 0; for(int i=0; i<k; i++) ans+=a[i]; System.out.println(ans); } }
[ 7, 6, 12, 13, 30, 14, 2, 18, 13, 13, 18, 13, 13, 29, 17, 29, 40, 17, 23, 13, 23, 13, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 17, 41, 13, 17, 41, 13, 41, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 14, 2, 13, 17, 29, 13, 29, 4, 13, 2, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 2, 13, 13, 4, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 4, 18, 13, 13, 20, 23, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 11, 1, 41, 13, 2, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 18, 13, 13, 2, 13, 18, 13, 13, 0, 13, 4, 18, 13, 13, 13, 29, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 41, 13, 41, 13, 41, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 0, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 0, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 20, 17, 41, 13, 41, 13, 41, 13, 41, 13, 20, 12, 13, 30, 0, 18, 36, 13, 13, 23, 13, 12, 13, 30, 14, 2, 13, 40, 17, 37, 20, 14, 2, 13, 13, 30, 0, 13, 17, 38, 5, 13, 30, 37, 20, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 29, 40, 17, 29, 18, 13, 40, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 2, 40, 4, 13, 13, 2, 13, 17, 30, 14, 2, 2, 13, 17, 2, 13, 17, 29, 2, 13, 4, 18, 13, 17, 4, 13, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 14, 2, 13, 17, 30, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 29, 2, 13, 4, 18, 13, 17, 4, 13, 14, 2, 2, 13, 17, 2, 13, 17, 37, 20, 0, 13, 17, 0, 13, 2, 2, 13, 17, 13, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 20, 42, 40, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 14, 2, 13, 17, 29, 4, 18, 13, 13, 29, 2, 2, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 23, 13, 12, 13, 30, 29, 4, 13, 6, 13, 12, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 0, 18, 36, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 8, 2, 13, 17, 17, 2, 4, 18, 13, 17, 8, 2, 13, 17, 17, 4, 18, 13, 12, 13, 30, 14, 2, 36, 13, 29, 17, 14, 2, 2, 13, 17, 2, 4, 13, 4, 18, 13, 29, 17, 41, 13, 13, 29, 2, 8, 2, 13, 17, 2, 18, 13, 13, 17, 4, 18, 13, 18, 13, 13, 8, 2, 13, 17, 2, 18, 13, 13, 17, 4, 18, 13, 18, 13, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 13, 18, 13, 13, 29, 8, 2, 13, 17, 13, 4, 18, 13, 18, 13, 13, 23, 13, 12, 13, 30, 29, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 2, 3 ], [ 2, 4 ], [ 4, 5 ], [ 5, 6 ], [ 6, 7 ], [ 7, 8 ], [ 7, 9 ], [ 6, 10 ], [ 10, 11 ], [ 10, 12 ], [ 5, 13 ], [ 13, 14 ], [ 5, 15 ], [ 15, 16 ], [ 16, 17 ], [ 2, 18 ], [ 18, 19 ], [ 2, 20 ], [ 20, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 25, 26 ], [ 25, 27 ], [ 0, 28 ], [ 28, 29 ], [ 28, 30 ], [ 0, 31 ], [ 31, 32 ], [ 31, 33 ], [ 0, 34 ], [ 34, 35 ], [ 34, 36 ], [ 0, 37 ], [ 37, 38 ], [ 37, 39 ], [ 0, 40 ], [ 40, 41 ], [ 40, 42 ], [ 0, 43 ], [ 43, 44 ], [ 43, 45 ], [ 0, 46 ], [ 859, 47 ], [ 859, 48 ], [ 48, 49 ], [ 48, 50 ], [ 859, 51 ], [ 51, 52 ], [ 51, 53 ], [ 859, 54 ], [ 54, 55 ], [ 859, 56 ], [ 56, 57 ], [ 859, 58 ], [ 58, 59 ], [ 859, 60 ], [ 60, 61 ], [ 859, 62 ], [ 62, 63 ], [ 859, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 67, 71 ], [ 71, 72 ], [ 66, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 64, 80 ], [ 80, 81 ], [ 64, 82 ], [ 82, 83 ], [ 859, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 88, 92 ], [ 92, 93 ], [ 92, 94 ], [ 92, 95 ], [ 84, 96 ], [ 96, 97 ], [ 84, 98 ], [ 98, 99 ], [ 859, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 103, 104 ], [ 104, 105 ], [ 103, 106 ], [ 103, 107 ], [ 100, 108 ], [ 108, 109 ], [ 100, 110 ], [ 110, 111 ], [ 859, 112 ], [ 112, 113 ], [ 112, 114 ], [ 114, 115 ], [ 115, 116 ], [ 115, 117 ], [ 117, 118 ], [ 117, 119 ], [ 114, 120 ], [ 120, 121 ], [ 120, 122 ], [ 122, 123 ], [ 122, 124 ], [ 114, 125 ], [ 125, 126 ], [ 126, 127 ], [ 127, 128 ], [ 127, 129 ], [ 129, 130 ], [ 129, 131 ], [ 125, 132 ], [ 132, 133 ], [ 132, 134 ], [ 125, 135 ], [ 135, 136 ], [ 136, 137 ], [ 125, 138 ], [ 139, 139 ], [ 139, 140 ], [ 140, 141 ], [ 140, 142 ], [ 142, 143 ], [ 143, 144 ], [ 142, 145 ], [ 145, 146 ], [ 145, 147 ], [ 142, 148 ], [ 148, 149 ], [ 148, 150 ], [ 150, 151 ], [ 150, 152 ], [ 139, 153 ], [ 153, 154 ], [ 153, 155 ], [ 155, 156 ], [ 156, 157 ], [ 155, 158 ], [ 155, 159 ], [ 114, 160 ], [ 160, 161 ], [ 112, 162 ], [ 162, 163 ], [ 112, 164 ], [ 164, 165 ], [ 112, 166 ], [ 166, 167 ], [ 859, 168 ], [ 168, 169 ], [ 168, 170 ], [ 170, 171 ], [ 171, 172 ], [ 171, 173 ], [ 173, 174 ], [ 173, 175 ], [ 170, 176 ], [ 176, 177 ], [ 176, 178 ], [ 178, 179 ], [ 178, 180 ], [ 170, 181 ], [ 181, 182 ], [ 181, 183 ], [ 170, 184 ], [ 184, 185 ], [ 184, 186 ], [ 170, 187 ], [ 187, 188 ], [ 170, 189 ], [ 189, 190 ], [ 170, 191 ], [ 191, 192 ], [ 170, 193 ], [ 193, 194 ], [ 193, 195 ], [ 195, 196 ], [ 196, 197 ], [ 170, 198 ], [ 198, 199 ], [ 198, 200 ], [ 200, 201 ], [ 201, 202 ], [ 170, 203 ], [ 203, 204 ], [ 203, 205 ], [ 170, 207 ], [ 207, 208 ], [ 208, 209 ], [ 209, 210 ], [ 209, 211 ], [ 207, 212 ], [ 212, 213 ], [ 212, 214 ], [ 207, 215 ], [ 215, 216 ], [ 216, 217 ], [ 207, 218 ], [ 219, 219 ], [ 219, 220 ], [ 220, 221 ], [ 221, 222 ], [ 221, 223 ], [ 220, 224 ], [ 224, 225 ], [ 225, 226 ], [ 170, 227 ], [ 227, 228 ], [ 228, 229 ], [ 227, 230 ], [ 170, 231 ], [ 231, 232 ], [ 231, 233 ], [ 170, 234 ], [ 234, 235 ], [ 235, 236 ], [ 236, 237 ], [ 236, 238 ], [ 234, 239 ], [ 239, 240 ], [ 239, 241 ], [ 234, 242 ], [ 242, 243 ], [ 243, 244 ], [ 234, 245 ], [ 246, 246 ], [ 246, 247 ], [ 247, 248 ], [ 247, 249 ], [ 249, 250 ], [ 249, 251 ], [ 170, 252 ], [ 252, 253 ], [ 253, 254 ], [ 252, 255 ], [ 170, 256 ], [ 256, 257 ], [ 257, 258 ], [ 168, 259 ], [ 259, 260 ], [ 859, 261 ], [ 261, 262 ], [ 261, 263 ], [ 263, 264 ], [ 261, 265 ], [ 265, 266 ], [ 265, 267 ], [ 261, 269 ], [ 269, 270 ], [ 261, 271 ], [ 271, 272 ], [ 261, 273 ], [ 273, 274 ], [ 261, 275 ], [ 275, 276 ], [ 275, 277 ], [ 261, 278 ], [ 278, 279 ], [ 278, 280 ], [ 280, 281 ], [ 281, 282 ], [ 282, 283 ], [ 282, 284 ], [ 281, 285 ], [ 278, 286 ], [ 286, 287 ], [ 261, 288 ], [ 288, 289 ], [ 288, 290 ], [ 290, 291 ], [ 291, 292 ], [ 292, 293 ], [ 292, 294 ], [ 294, 295 ], [ 291, 296 ], [ 296, 297 ], [ 290, 298 ], [ 298, 299 ], [ 299, 300 ], [ 299, 301 ], [ 298, 302 ], [ 302, 303 ], [ 303, 304 ], [ 303, 305 ], [ 302, 306 ], [ 306, 307 ], [ 307, 308 ], [ 307, 309 ], [ 309, 310 ], [ 310, 311 ], [ 306, 312 ], [ 312, 313 ], [ 313, 314 ], [ 313, 315 ], [ 315, 316 ], [ 316, 317 ], [ 315, 318 ], [ 302, 319 ], [ 319, 320 ], [ 320, 321 ], [ 320, 322 ], [ 319, 323 ], [ 323, 324 ], [ 324, 325 ], [ 290, 326 ], [ 326, 327 ], [ 327, 328 ], [ 327, 329 ], [ 329, 330 ], [ 261, 331 ], [ 331, 332 ], [ 331, 333 ], [ 333, 334 ], [ 334, 335 ], [ 334, 336 ], [ 333, 337 ], [ 337, 338 ], [ 338, 339 ], [ 338, 340 ], [ 340, 341 ], [ 341, 342 ], [ 342, 343 ], [ 337, 344 ], [ 344, 345 ], [ 345, 346 ], [ 345, 347 ], [ 347, 348 ], [ 348, 349 ], [ 333, 350 ], [ 350, 351 ], [ 261, 352 ], [ 352, 353 ], [ 352, 354 ], [ 354, 355 ], [ 355, 356 ], [ 355, 357 ], [ 357, 358 ], [ 354, 359 ], [ 359, 360 ], [ 360, 361 ], [ 360, 362 ], [ 359, 363 ], [ 363, 364 ], [ 363, 365 ], [ 365, 366 ], [ 354, 367 ], [ 367, 368 ], [ 367, 369 ], [ 354, 370 ], [ 370, 371 ], [ 371, 372 ], [ 371, 373 ], [ 370, 374 ], [ 374, 375 ], [ 375, 376 ], [ 375, 377 ], [ 377, 378 ], [ 374, 379 ], [ 379, 380 ], [ 379, 381 ], [ 381, 382 ], [ 354, 383 ], [ 383, 384 ], [ 383, 385 ], [ 354, 386 ], [ 386, 387 ], [ 387, 388 ], [ 388, 389 ], [ 388, 390 ], [ 386, 391 ], [ 391, 392 ], [ 392, 393 ], [ 393, 394 ], [ 394, 395 ], [ 394, 396 ], [ 393, 397 ], [ 397, 398 ], [ 397, 399 ], [ 392, 400 ], [ 400, 401 ], [ 391, 402 ], [ 402, 403 ], [ 402, 404 ], [ 391, 405 ], [ 405, 406 ], [ 405, 407 ], [ 407, 408 ], [ 407, 409 ], [ 391, 410 ], [ 410, 411 ], [ 410, 412 ], [ 412, 413 ], [ 354, 414 ], [ 414, 415 ], [ 415, 416 ], [ 415, 417 ], [ 261, 418 ], [ 418, 419 ], [ 418, 420 ], [ 420, 421 ], [ 421, 422 ], [ 421, 423 ], [ 423, 424 ], [ 420, 425 ], [ 425, 426 ], [ 426, 427 ], [ 426, 428 ], [ 425, 429 ], [ 429, 430 ], [ 429, 431 ], [ 431, 432 ], [ 420, 433 ], [ 433, 434 ], [ 433, 435 ], [ 420, 436 ], [ 436, 437 ], [ 437, 438 ], [ 437, 439 ], [ 436, 440 ], [ 440, 441 ], [ 441, 442 ], [ 441, 443 ], [ 443, 444 ], [ 440, 445 ], [ 445, 446 ], [ 445, 447 ], [ 447, 448 ], [ 420, 449 ], [ 449, 450 ], [ 449, 451 ], [ 420, 452 ], [ 452, 453 ], [ 453, 454 ], [ 454, 455 ], [ 454, 456 ], [ 452, 457 ], [ 457, 458 ], [ 458, 459 ], [ 459, 460 ], [ 460, 461 ], [ 460, 462 ], [ 459, 463 ], [ 463, 464 ], [ 463, 465 ], [ 458, 466 ], [ 466, 467 ], [ 457, 468 ], [ 468, 469 ], [ 468, 470 ], [ 457, 471 ], [ 471, 472 ], [ 471, 473 ], [ 473, 474 ], [ 473, 475 ], [ 457, 476 ], [ 476, 477 ], [ 476, 478 ], [ 478, 479 ], [ 420, 480 ], [ 480, 481 ], [ 481, 482 ], [ 481, 483 ], [ 261, 484 ], [ 484, 485 ], [ 484, 486 ], [ 486, 487 ], [ 487, 488 ], [ 487, 489 ], [ 489, 490 ], [ 486, 491 ], [ 491, 492 ], [ 492, 493 ], [ 492, 494 ], [ 491, 495 ], [ 495, 496 ], [ 495, 497 ], [ 497, 498 ], [ 486, 499 ], [ 499, 500 ], [ 499, 501 ], [ 486, 502 ], [ 502, 503 ], [ 503, 504 ], [ 503, 505 ], [ 502, 506 ], [ 506, 507 ], [ 507, 508 ], [ 507, 509 ], [ 509, 510 ], [ 506, 511 ], [ 511, 512 ], [ 511, 513 ], [ 513, 514 ], [ 486, 515 ], [ 515, 516 ], [ 515, 517 ], [ 486, 518 ], [ 518, 519 ], [ 519, 520 ], [ 520, 521 ], [ 521, 522 ], [ 521, 523 ], [ 519, 524 ], [ 524, 525 ], [ 524, 526 ], [ 518, 527 ], [ 527, 528 ], [ 528, 529 ], [ 529, 530 ], [ 530, 531 ], [ 530, 532 ], [ 529, 533 ], [ 533, 534 ], [ 533, 535 ], [ 528, 536 ], [ 536, 537 ], [ 537, 538 ], [ 537, 539 ], [ 539, 540 ], [ 540, 541 ], [ 539, 542 ], [ 539, 543 ], [ 543, 544 ], [ 527, 545 ], [ 545, 546 ], [ 546, 547 ], [ 547, 548 ], [ 547, 549 ], [ 546, 550 ], [ 550, 551 ], [ 550, 552 ], [ 545, 553 ], [ 553, 554 ], [ 527, 555 ], [ 555, 556 ], [ 555, 557 ], [ 527, 558 ], [ 558, 559 ], [ 558, 560 ], [ 560, 561 ], [ 560, 562 ], [ 527, 563 ], [ 563, 564 ], [ 563, 565 ], [ 565, 566 ], [ 486, 567 ], [ 567, 568 ], [ 568, 569 ], [ 568, 570 ], [ 567, 571 ], [ 571, 572 ], [ 572, 573 ], [ 572, 574 ], [ 574, 575 ], [ 571, 576 ], [ 576, 577 ], [ 576, 578 ], [ 571, 579 ], [ 579, 580 ], [ 580, 581 ], [ 581, 582 ], [ 581, 583 ], [ 579, 584 ], [ 584, 585 ], [ 585, 586 ], [ 586, 587 ], [ 587, 588 ], [ 587, 589 ], [ 586, 590 ], [ 590, 591 ], [ 590, 592 ], [ 585, 593 ], [ 593, 594 ], [ 594, 595 ], [ 594, 596 ], [ 596, 597 ], [ 597, 598 ], [ 596, 599 ], [ 596, 600 ], [ 600, 601 ], [ 584, 602 ], [ 602, 603 ], [ 603, 604 ], [ 604, 605 ], [ 604, 606 ], [ 603, 607 ], [ 607, 608 ], [ 607, 609 ], [ 602, 610 ], [ 610, 611 ], [ 584, 612 ], [ 612, 613 ], [ 612, 614 ], [ 584, 615 ], [ 615, 616 ], [ 615, 617 ], [ 617, 618 ], [ 618, 619 ], [ 618, 620 ], [ 617, 621 ], [ 584, 622 ], [ 622, 623 ], [ 622, 624 ], [ 624, 625 ], [ 486, 626 ], [ 626, 627 ], [ 627, 628 ], [ 627, 629 ], [ 261, 630 ], [ 630, 631 ], [ 630, 632 ], [ 632, 633 ], [ 633, 634 ], [ 633, 635 ], [ 635, 636 ], [ 632, 637 ], [ 637, 638 ], [ 638, 639 ], [ 638, 640 ], [ 637, 641 ], [ 641, 642 ], [ 641, 643 ], [ 643, 644 ], [ 632, 645 ], [ 645, 646 ], [ 645, 647 ], [ 632, 648 ], [ 648, 649 ], [ 649, 650 ], [ 650, 651 ], [ 650, 652 ], [ 648, 653 ], [ 653, 654 ], [ 654, 655 ], [ 655, 656 ], [ 654, 657 ], [ 653, 658 ], [ 658, 659 ], [ 658, 660 ], [ 660, 661 ], [ 632, 662 ], [ 662, 663 ], [ 663, 664 ], [ 664, 665 ], [ 261, 666 ], [ 666, 667 ], [ 666, 668 ], [ 668, 669 ], [ 669, 670 ], [ 670, 671 ], [ 670, 672 ], [ 669, 673 ], [ 673, 674 ], [ 674, 675 ], [ 675, 676 ], [ 674, 677 ], [ 668, 678 ], [ 678, 679 ], [ 682, 680 ], [ 692, 681 ], [ 689, 682 ], [ 682, 683 ], [ 683, 684 ], [ 683, 685 ], [ 682, 686 ], [ 686, 687 ], [ 686, 688 ], [ 689, 689 ], [ 689, 690 ], [ 689, 691 ], [ 692, 692 ], [ 692, 693 ], [ 692, 694 ], [ 682, 695 ], [ 695, 696 ], [ 695, 697 ], [ 697, 698 ], [ 666, 699 ], [ 699, 700 ], [ 261, 701 ], [ 701, 702 ], [ 701, 703 ], [ 703, 704 ], [ 704, 705 ], [ 705, 706 ], [ 261, 707 ], [ 707, 708 ], [ 707, 709 ], [ 709, 710 ], [ 709, 711 ], [ 711, 712 ], [ 859, 713 ], [ 713, 714 ], [ 713, 715 ], [ 715, 716 ], [ 713, 717 ], [ 717, 718 ], [ 713, 719 ], [ 719, 720 ], [ 719, 721 ], [ 721, 722 ], [ 722, 723 ], [ 723, 724 ], [ 723, 725 ], [ 722, 726 ], [ 721, 727 ], [ 727, 728 ], [ 728, 729 ], [ 728, 730 ], [ 727, 731 ], [ 719, 732 ], [ 732, 733 ], [ 719, 734 ], [ 734, 735 ], [ 713, 736 ], [ 736, 737 ], [ 736, 738 ], [ 738, 739 ], [ 739, 740 ], [ 740, 741 ], [ 741, 742 ], [ 742, 743 ], [ 742, 744 ], [ 741, 745 ], [ 741, 746 ], [ 746, 747 ], [ 747, 748 ], [ 748, 749 ], [ 746, 750 ], [ 740, 751 ], [ 751, 752 ], [ 752, 753 ], [ 752, 754 ], [ 751, 755 ], [ 751, 756 ], [ 756, 757 ], [ 757, 758 ], [ 713, 759 ], [ 759, 760 ], [ 759, 761 ], [ 761, 762 ], [ 762, 763 ], [ 763, 764 ], [ 763, 765 ], [ 762, 766 ], [ 766, 767 ], [ 761, 768 ], [ 768, 769 ], [ 769, 770 ], [ 770, 771 ], [ 770, 772 ], [ 769, 773 ], [ 773, 774 ], [ 774, 775 ], [ 773, 776 ], [ 776, 777 ], [ 777, 778 ], [ 768, 779 ], [ 779, 780 ], [ 761, 781 ], [ 781, 782 ], [ 781, 783 ], [ 761, 784 ], [ 784, 785 ], [ 785, 786 ], [ 786, 787 ], [ 787, 788 ], [ 787, 789 ], [ 786, 790 ], [ 790, 791 ], [ 791, 792 ], [ 791, 793 ], [ 790, 794 ], [ 786, 795 ], [ 795, 796 ], [ 796, 797 ], [ 795, 798 ], [ 798, 799 ], [ 798, 800 ], [ 785, 801 ], [ 801, 802 ], [ 802, 803 ], [ 802, 804 ], [ 801, 805 ], [ 805, 806 ], [ 806, 807 ], [ 806, 808 ], [ 805, 809 ], [ 801, 810 ], [ 810, 811 ], [ 811, 812 ], [ 810, 813 ], [ 813, 814 ], [ 813, 815 ], [ 759, 816 ], [ 816, 817 ], [ 713, 818 ], [ 818, 819 ], [ 818, 820 ], [ 820, 821 ], [ 821, 822 ], [ 821, 823 ], [ 823, 824 ], [ 824, 825 ], [ 823, 826 ], [ 826, 827 ], [ 826, 828 ], [ 820, 829 ], [ 829, 830 ], [ 830, 831 ], [ 831, 832 ], [ 831, 833 ], [ 830, 834 ], [ 830, 835 ], [ 835, 836 ], [ 836, 837 ], [ 835, 838 ], [ 838, 839 ], [ 838, 840 ], [ 818, 841 ], [ 841, 842 ], [ 713, 843 ], [ 843, 844 ], [ 843, 845 ], [ 845, 846 ], [ 846, 847 ], [ 847, 848 ], [ 848, 849 ], [ 847, 850 ], [ 847, 851 ], [ 851, 852 ], [ 852, 853 ], [ 847, 854 ], [ 854, 855 ], [ 855, 856 ], [ 713, 857 ], [ 0, 858 ], [ 858, 859 ], [ 858, 860 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.InputMismatchException;\nimport java.util.*;\nimport java.io.*;\nimport java.lang.*;\npublic class Main{\n public static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n \n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n \n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n \n public String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n \n while(isSpaceChar(c))\n c = read();\n \n int sgn = 1;\n \n if (c == '-') {\n sgn = -1;\n c = read();\n }\n \n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res * sgn;\n }\n \n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n \n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n \n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n \n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res.toString();\n }\n \n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n \n public String next() {\n return readString();\n }\n \n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n \n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n public static void sortbyColumn(int arr[][], int col) \n { \n \n Arrays.sort(arr, new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }); \n } \n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n //static LinkedList<Integer> li;\n //static LinkedList<Integer> ans;\n static int ans1=0,ans2=0,k;\n static long dist[];\n static int visited[];\n //static int arr[];\n static ArrayList<Integer> adj[];\n static int color[];\n \n \n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n int t,i,j;\n \n \n \n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(i=0;i<n;i++){\n arr[i]=in.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(i=0;i<k;i++){\n sum+=arr[i];\n }\n w.println(sum);\n \n \n \n \n w.close();\n }\n}", "Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }", "@Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n }", "compare", "{ \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n }", "if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1;", "entry1[col] > entry2[col]", "entry1[col]", "entry1", "col", "entry2[col]", "entry2", "col", "return 1;", "1", "return -1;", "-1", "1", "final int[] entry1", "entry1", "final int[] entry2", "entry2", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.InputMismatchException;", "InputMismatchException", "java.util", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "import java.lang.*;", "lang.*", "java", "public class Main{\n public static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n \n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n \n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n \n public String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n \n while(isSpaceChar(c))\n c = read();\n \n int sgn = 1;\n \n if (c == '-') {\n sgn = -1;\n c = read();\n }\n \n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res * sgn;\n }\n \n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n \n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n \n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n \n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res.toString();\n }\n \n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n \n public String next() {\n return readString();\n }\n \n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n \n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n public static void sortbyColumn(int arr[][], int col) \n { \n \n Arrays.sort(arr, new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }); \n } \n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n //static LinkedList<Integer> li;\n //static LinkedList<Integer> ans;\n static int ans1=0,ans2=0,k;\n static long dist[];\n static int visited[];\n //static int arr[];\n static ArrayList<Integer> adj[];\n static int color[];\n \n \n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n int t,i,j;\n \n \n \n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(i=0;i<n;i++){\n arr[i]=in.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(i=0;i<k;i++){\n sum+=arr[i];\n }\n w.println(sum);\n \n \n \n \n w.close();\n }\n}", "Main", "//static LinkedList<Integer> li;\n //static LinkedList<Integer> ans;\n static int ans1=0", "ans1", "0", "ans2=0", "ans2", "0", "k;", "k", "static long dist[];", "dist", "static int visited[];", "visited", "//static int arr[];\n static ArrayList<Integer> adj[];", "adj", "static int color[];", "color", "static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }", "gcd", "{\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }", "if (a == 0)\n return b;", "a == 0", "a", "0", "return b;", "b", "return gcd(b % a, a);", "gcd(b % a, a)", "gcd", "b % a", "b", "a", "a", "long a", "a", "long b", "b", "static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }", "lcm", "{\n return (a*b)/gcd(a, b); \n }", "return (a*b)/gcd(a, b);", "(a*b)/gcd(a, b)", "(a*b)", "a", "b", "gcd(a, b)", "gcd", "a", "b", "long a", "a", "long b", "b", "public static void sortbyColumn(int arr[][], int col) \n { \n \n Arrays.sort(arr, new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }); \n }", "sortbyColumn", "{ \n \n Arrays.sort(arr, new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }); \n }", "Arrays.sort(arr, new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n })", "Arrays.sort", "Arrays", "arr", "new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }", "int arr[][]", "arr", "int col", "col", "static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }", "func", "{\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }", "long max1=a[s];", "max1", "a[s]", "a", "s", "long maxc=a[s];", "maxc", "a[s]", "a", "s", "for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }", "int i=s+1;", "int i=s+1;", "i", "s+1", "s", "1", "i<size", "i", "size", "i++", "i++", "i", "{\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }", "{\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }", "maxc=Math.max(a[i],maxc+a[i])", "maxc", "Math.max(a[i],maxc+a[i])", "Math.max", "Math", "a[i]", "a", "i", "maxc+a[i]", "maxc", "a[i]", "a", "i", "max1=Math.max(maxc,max1)", "max1", "Math.max(maxc,max1)", "Math.max", "Math", "maxc", "max1", "return max1;", "max1", "long a[]", "a", "long size", "size", "int s", "s", "public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n int t,i,j;\n \n \n \n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(i=0;i<n;i++){\n arr[i]=in.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(i=0;i<k;i++){\n sum+=arr[i];\n }\n w.println(sum);\n \n \n \n \n w.close();\n }", "main", "{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n int t,i,j;\n \n \n \n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(i=0;i<n;i++){\n arr[i]=in.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(i=0;i<k;i++){\n sum+=arr[i];\n }\n w.println(sum);\n \n \n \n \n w.close();\n }", "InputStream inputStream = System.in;", "inputStream", "System.in", "System", "System.in", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "InputReader in = new InputReader(inputStream);", "in", "new InputReader(inputStream)", "PrintWriter w = new PrintWriter(outputStream);", "w", "new PrintWriter(outputStream)", "int t", "t", "i", "i", "j;", "j", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int k=in.nextInt();", "k", "in.nextInt()", "in.nextInt", "in", "int arr[]=new int[n];", "arr", "new int[n]", "n", "for(i=0;i<n;i++){\n arr[i]=in.nextInt();\n }", "i=0;", "i=0", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n arr[i]=in.nextInt();\n }", "{\n arr[i]=in.nextInt();\n }", "arr[i]=in.nextInt()", "arr[i]", "arr", "i", "in.nextInt()", "in.nextInt", "in", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int sum=0;", "sum", "0", "for(i=0;i<k;i++){\n sum+=arr[i];\n }", "i=0;", "i=0", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n sum+=arr[i];\n }", "{\n sum+=arr[i];\n }", "sum+=arr[i]", "sum", "arr[i]", "arr", "i", "w.println(sum)", "w.println", "w", "sum", "w.close()", "w.close", "w", "String args[]", "args", "public static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n \n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n \n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n \n public String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n \n while(isSpaceChar(c))\n c = read();\n \n int sgn = 1;\n \n if (c == '-') {\n sgn = -1;\n c = read();\n }\n \n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res * sgn;\n }\n \n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n \n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n \n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n \n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res.toString();\n }\n \n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n \n public String next() {\n return readString();\n }\n \n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }", "InputReader", "private InputStream stream;", "stream", "private byte[] buf = new byte[1024];", "buf", "new byte[1024]", "1024", "private int curChar;", "curChar", "private int numChars;", "numChars", "private InputReader.SpaceCharFilter filter;", "filter", "private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "public InputReader(InputStream stream) {\n this.stream = stream;\n }", "InputReader", "{\n this.stream = stream;\n }", "this.stream = stream", "this.stream", "this", "this.stream", "stream", "InputStream stream", "stream", "public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n \n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "read", "{\n if (numChars==-1)\n throw new InputMismatchException();\n \n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "if (numChars==-1)\n throw new InputMismatchException();", "numChars==-1", "numChars", "-1", "1", "throw new InputMismatchException();", "new InputMismatchException()", "if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }", "curChar >= numChars", "curChar", "numChars", "{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }", "curChar = 0", "curChar", "0", "try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }", "catch (IOException e) {\n throw new InputMismatchException();\n }", "IOException e", "{\n throw new InputMismatchException();\n }", "throw new InputMismatchException();", "new InputMismatchException()", "{\n numChars = stream.read(buf);\n }", "numChars = stream.read(buf)", "numChars", "stream.read(buf)", "stream.read", "stream", "buf", "if(numChars <= 0)\n return -1;", "numChars <= 0", "numChars", "0", "return -1;", "-1", "1", "return buf[curChar++];", "buf[curChar++]", "buf", "curChar++", "curChar", "public String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public int nextInt() {\n int c = read();\n \n while(isSpaceChar(c))\n c = read();\n \n int sgn = 1;\n \n if (c == '-') {\n sgn = -1;\n c = read();\n }\n \n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res * sgn;\n }", "nextInt", "{\n int c = read();\n \n while(isSpaceChar(c))\n c = read();\n \n int sgn = 1;\n \n if (c == '-') {\n sgn = -1;\n c = read();\n }\n \n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while(isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "int res = 0;", "res", "0", "do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if(c<'0'||c>'9')\n throw new InputMismatchException();", "c<'0'||c>'9'", "c<'0'", "c", "'0'", "c>'9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n \n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "nextLong", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n \n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "long res = 0;", "res", "0", "do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }", "nextDouble", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "double res = 0;", "res", "0", "while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "!isSpaceChar(c) && c != '.'", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "c != '.'", "c", "'.'", "{\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }", "if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());", "c == 'e' || c == 'E'", "c == 'e'", "c", "'e'", "c == 'E'", "c", "'E'", "return res * Math.pow(10, nextInt());", "res * Math.pow(10, nextInt())", "res", "Math.pow(10, nextInt())", "Math.pow", "Math", "10", "nextInt()", "nextInt", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }", "c == '.'", "c", "'.'", "{\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }", "c = read()", "c", "read()", "read", "double m = 1;", "m", "1", "while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }", "if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());", "c == 'e' || c == 'E'", "c == 'e'", "c", "'e'", "c == 'E'", "c", "'E'", "return res * Math.pow(10, nextInt());", "res * Math.pow(10, nextInt())", "res", "Math.pow(10, nextInt())", "Math.pow", "Math", "10", "nextInt()", "nextInt", "if (c < '0' || c > '9')\n throw new InputMismatchException();", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "throw new InputMismatchException();", "new InputMismatchException()", "m /= 10", "m", "10", "res += (c - '0') * m", "res", "(c - '0') * m", "(c - '0')", "c", "'0'", "m", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res.toString();\n }", "readString", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res.toString();\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "StringBuilder res = new StringBuilder();", "res", "new StringBuilder()", "do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n res.appendCodePoint(c);\n c = read();\n }", "res.appendCodePoint(c)", "res.appendCodePoint", "res", "c", "c = read()", "c", "read()", "read", "return res.toString();", "res.toString()", "res.toString", "res", "public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "isSpaceChar", "{\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "if (filter != null)\n return filter.isSpaceChar(c);", "filter != null", "filter", "null", "return filter.isSpaceChar(c);", "filter.isSpaceChar(c)", "filter.isSpaceChar", "filter", "c", "return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == '\\t'", "c == '\\r'", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == ' '", "c", "' '", "c == '\\n'", "c", "'\\n'", "c == '\\r'", "c", "'\\r'", "c == '\\t'", "c", "'\\t'", "c == -1", "c", "-1", "1", "int c", "c", "public String next() {\n return readString();\n }", "next", "{\n return readString();\n }", "return readString();", "readString()", "readString", "public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }", "SpaceCharFilter", "public boolean isSpaceChar(int ch);", "isSpaceChar", "int ch", "ch", "public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }", "Pair", "public U x;", "x", "public V y;", "y", "public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }", "Pair", "{\n this.x = x;\n this.y = y;\n }", "this.x = x", "this.x", "this", "this.x", "x", "this.y = y", "this.y", "this", "this.y", "y", "U x", "x", "V y", "y", "public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }", "hashCode", "{\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }", "return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());", "(x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode())", "(x == null ? 0 : x.hashCode() * 31)", "x == null", "x", "null", "0", "x.hashCode() * 31", "x.hashCode()", "x.hashCode", "x", "31", "(y == null ? 0 : y.hashCode())", "y == null", "y", "null", "0", "y.hashCode()", "y.hashCode", "y", "public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }", "equals", "{\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }", "if (this == o)\n return true;", "this == o", "this", "o", "return true;", "true", "if (o == null || getClass() != o.getClass())\n return false;", "o == null || getClass() != o.getClass()", "o == null", "o", "null", "getClass() != o.getClass()", "getClass()", "getClass", "o.getClass()", "o.getClass", "o", "return false;", "false", "Pair<U, V> p = (Pair<U, V>) o;", "p", "(Pair<U, V>) o", "return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));", "(x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y))", "(x == null ? p.x == null : x.equals(p.x))", "x == null", "x", "null", "p.x == null", "p.x", "p", "p.x", "null", "x.equals(p.x)", "x.equals", "x", "p.x", "p", "p.x", "(y == null ? p.y == null : y.equals(p.y))", "y == null", "y", "null", "p.y == null", "p.y", "p", "p.y", "null", "y.equals(p.y)", "y.equals", "y", "p.y", "p", "p.y", "Object o", "o", "public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }", "compareTo", "{\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }", "int cmpU = x.compareTo(b.x);", "cmpU", "x.compareTo(b.x)", "x.compareTo", "x", "b.x", "b", "b.x", "return cmpU != 0 ? cmpU : y.compareTo(b.y);", "cmpU != 0 ? cmpU : y.compareTo(b.y)", "cmpU != 0", "cmpU", "0", "cmpU", "y.compareTo(b.y)", "y.compareTo", "y", "b.y", "b", "b.y", "Pair<U, V> b", "b", "public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }", "toString", "{\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }", "return String.format(\"(%s, %s)\", x.toString(), y.toString());", "String.format(\"(%s, %s)\", x.toString(), y.toString())", "String.format", "String", "\"(%s, %s)\"", "x.toString()", "x.toString", "x", "y.toString()", "y.toString", "y", "Comparable", "public class Main{\n public static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n \n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n \n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n \n public String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n \n while(isSpaceChar(c))\n c = read();\n \n int sgn = 1;\n \n if (c == '-') {\n sgn = -1;\n c = read();\n }\n \n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res * sgn;\n }\n \n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n \n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n \n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n \n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res.toString();\n }\n \n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n \n public String next() {\n return readString();\n }\n \n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n \n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n public static void sortbyColumn(int arr[][], int col) \n { \n \n Arrays.sort(arr, new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }); \n } \n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n //static LinkedList<Integer> li;\n //static LinkedList<Integer> ans;\n static int ans1=0,ans2=0,k;\n static long dist[];\n static int visited[];\n //static int arr[];\n static ArrayList<Integer> adj[];\n static int color[];\n \n \n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n int t,i,j;\n \n \n \n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(i=0;i<n;i++){\n arr[i]=in.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(i=0;i<k;i++){\n sum+=arr[i];\n }\n w.println(sum);\n \n \n \n \n w.close();\n }\n}", "public class Main{\n public static class InputReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private InputReader.SpaceCharFilter filter;\n private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n \n public int read() {\n if (numChars==-1)\n throw new InputMismatchException();\n \n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n }\n catch (IOException e) {\n throw new InputMismatchException();\n }\n \n if(numChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n \n public String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n public int nextInt() {\n int c = read();\n \n while(isSpaceChar(c))\n c = read();\n \n int sgn = 1;\n \n if (c == '-') {\n sgn = -1;\n c = read();\n }\n \n int res = 0;\n do {\n if(c<'0'||c>'9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res * sgn;\n }\n \n public long nextLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n \n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n while (!isSpaceChar(c));\n return res * sgn;\n }\n \n public double nextDouble() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n double res = 0;\n while (!isSpaceChar(c) && c != '.') {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }\n if (c == '.') {\n c = read();\n double m = 1;\n while (!isSpaceChar(c)) {\n if (c == 'e' || c == 'E')\n return res * Math.pow(10, nextInt());\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n m /= 10;\n res += (c - '0') * m;\n c = read();\n }\n }\n return res * sgn;\n }\n \n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n }\n while (!isSpaceChar(c));\n \n return res.toString();\n }\n \n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n \n public String next() {\n return readString();\n }\n \n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n \n static long gcd(long a, long b){\n if (a == 0)\n return b; \n return gcd(b % a, a); \n }\n static long lcm(long a, long b) {\n return (a*b)/gcd(a, b); \n }\n public static void sortbyColumn(int arr[][], int col) \n { \n \n Arrays.sort(arr, new Comparator<int[]>() { \n \n @Override \n \n public int compare(final int[] entry1, \n final int[] entry2) { \n \n \n if (entry1[col] > entry2[col]) \n return 1; \n else\n return -1; \n } \n }); \n } \n static long func(long a[],long size,int s){\n long max1=a[s];\n long maxc=a[s];\n for(int i=s+1;i<size;i++){\n maxc=Math.max(a[i],maxc+a[i]);\n max1=Math.max(maxc,max1);\n }\n return max1;\n }\n public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {\n public U x;\n public V y;\n \n public Pair(U x, V y) {\n this.x = x;\n this.y = y;\n }\n \n public int hashCode() {\n return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());\n }\n \n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Pair<U, V> p = (Pair<U, V>) o;\n return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));\n }\n \n public int compareTo(Pair<U, V> b) {\n int cmpU = x.compareTo(b.x);\n return cmpU != 0 ? cmpU : y.compareTo(b.y);\n }\n \n public String toString() {\n return String.format(\"(%s, %s)\", x.toString(), y.toString());\n }\n \n }\n //static LinkedList<Integer> li;\n //static LinkedList<Integer> ans;\n static int ans1=0,ans2=0,k;\n static long dist[];\n static int visited[];\n //static int arr[];\n static ArrayList<Integer> adj[];\n static int color[];\n \n \n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter w = new PrintWriter(outputStream);\n int t,i,j;\n \n \n \n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(i=0;i<n;i++){\n arr[i]=in.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(i=0;i<k;i++){\n sum+=arr[i];\n }\n w.println(sum);\n \n \n \n \n w.close();\n }\n}", "Main" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.InputMismatchException; import java.util.*; import java.io.*; import java.lang.*; public class Main{ public static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private InputReader.SpaceCharFilter filter; private BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars==-1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if(numChars <= 0) return -1; } return buf[curChar++]; } public String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } public int nextInt() { int c = read(); while(isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if(c<'0'||c>'9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public double nextDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public String readString() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public String next() { return readString(); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } static long gcd(long a, long b){ if (a == 0) return b; return gcd(b % a, a); } static long lcm(long a, long b) { return (a*b)/gcd(a, b); } public static void sortbyColumn(int arr[][], int col) { Arrays.sort(arr, new Comparator<int[]>() { @Override public int compare(final int[] entry1, final int[] entry2) { if (entry1[col] > entry2[col]) return 1; else return -1; } }); } static long func(long a[],long size,int s){ long max1=a[s]; long maxc=a[s]; for(int i=s+1;i<size;i++){ maxc=Math.max(a[i],maxc+a[i]); max1=Math.max(maxc,max1); } return max1; } public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> { public U x; public V y; public Pair(U x, V y) { this.x = x; this.y = y; } public int hashCode() { return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode()); } public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Pair<U, V> p = (Pair<U, V>) o; return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y)); } public int compareTo(Pair<U, V> b) { int cmpU = x.compareTo(b.x); return cmpU != 0 ? cmpU : y.compareTo(b.y); } public String toString() { return String.format("(%s, %s)", x.toString(), y.toString()); } } //static LinkedList<Integer> li; //static LinkedList<Integer> ans; static int ans1=0,ans2=0,k; static long dist[]; static int visited[]; //static int arr[]; static ArrayList<Integer> adj[]; static int color[]; public static void main(String args[]){ InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter w = new PrintWriter(outputStream); int t,i,j; int n=in.nextInt(); int k=in.nextInt(); int arr[]=new int[n]; for(i=0;i<n;i++){ arr[i]=in.nextInt(); } Arrays.sort(arr); int sum=0; for(i=0;i<k;i++){ sum+=arr[i]; } w.println(sum); w.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 91, 8 ], [ 91, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 27, 28 ], [ 28, 29 ], [ 11, 30 ], [ 30, 31 ], [ 30, 32 ], [ 11, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 34, 39 ], [ 39, 40 ], [ 39, 41 ], [ 34, 42 ], [ 42, 43 ], [ 43, 44 ], [ 34, 45 ], [ 46, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 47, 51 ], [ 51, 52 ], [ 52, 53 ], [ 11, 54 ], [ 54, 55 ], [ 55, 56 ], [ 54, 57 ], [ 11, 58 ], [ 58, 59 ], [ 58, 60 ], [ 11, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 61, 66 ], [ 66, 67 ], [ 66, 68 ], [ 61, 69 ], [ 69, 70 ], [ 70, 71 ], [ 61, 72 ], [ 73, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 11, 79 ], [ 79, 80 ], [ 80, 81 ], [ 11, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 82, 87 ], [ 9, 88 ], [ 88, 89 ], [ 0, 90 ], [ 90, 91 ], [ 90, 92 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tString tmp = sc.nextLine();\n\t\tInteger [] p = new Integer[a];\n\t\tfor (int i=0; i<a; i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor (int i=0; i<b; i++) {\n\t\t\tans +=p[i];\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tString tmp = sc.nextLine();\n\t\tInteger [] p = new Integer[a];\n\t\tfor (int i=0; i<a; i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor (int i=0; i<b; i++) {\n\t\t\tans +=p[i];\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\t}\n}", "Main", "public static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tString tmp = sc.nextLine();\n\t\tInteger [] p = new Integer[a];\n\t\tfor (int i=0; i<a; i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor (int i=0; i<b; i++) {\n\t\t\tans +=p[i];\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tString tmp = sc.nextLine();\n\t\tInteger [] p = new Integer[a];\n\t\tfor (int i=0; i<a; i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor (int i=0; i<b; i++) {\n\t\t\tans +=p[i];\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int a = sc.nextInt();", "a", "sc.nextInt()", "sc.nextInt", "sc", "int b = sc.nextInt();", "b", "sc.nextInt()", "sc.nextInt", "sc", "String tmp = sc.nextLine();", "tmp", "sc.nextLine()", "sc.nextLine", "sc", "Integer [] p = new Integer[a];", "p", "new Integer[a]", "a", "for (int i=0; i<a; i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<a", "i", "a", "i++", "i++", "i", "{\n\t\t\tp[i]= sc.nextInt();\n\t\t}", "{\n\t\t\tp[i]= sc.nextInt();\n\t\t}", "p[i]= sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int ans = 0;", "ans", "0", "for (int i=0; i<b; i++) {\n\t\t\tans +=p[i];\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<b", "i", "b", "i++", "i++", "i", "{\n\t\t\tans +=p[i];\n\t\t}", "{\n\t\t\tans +=p[i];\n\t\t}", "ans +=p[i]", "ans", "p[i]", "p", "i", "sc.close()", "sc.close", "sc", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tString tmp = sc.nextLine();\n\t\tInteger [] p = new Integer[a];\n\t\tfor (int i=0; i<a; i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor (int i=0; i<b; i++) {\n\t\t\tans +=p[i];\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\t}\n}", "public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tString tmp = sc.nextLine();\n\t\tInteger [] p = new Integer[a];\n\t\tfor (int i=0; i<a; i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor (int i=0; i<b; i++) {\n\t\t\tans +=p[i];\n\t\t}\n\n\t\tsc.close();\n\t\tSystem.out.println(ans);\n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); String tmp = sc.nextLine(); Integer [] p = new Integer[a]; for (int i=0; i<a; i++) { p[i]= sc.nextInt(); } Arrays.sort(p); int ans = 0; for (int i=0; i<b; i++) { ans +=p[i]; } sc.close(); System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 85, 8 ], [ 85, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 29, 31 ], [ 11, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 11, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 11, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 9, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint juice[] =new int[a];\n\t\tint ans =0;\n\t\t\n\t\tfor(int i =0;i<a;i++) {\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(juice);\n\t\t\n\t\t\n\t\tfor(int i =0;i<b;i++) {\n\t\t\tans =ans+juice[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint juice[] =new int[a];\n\t\tint ans =0;\n\t\t\n\t\tfor(int i =0;i<a;i++) {\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(juice);\n\t\t\n\t\t\n\t\tfor(int i =0;i<b;i++) {\n\t\t\tans =ans+juice[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint juice[] =new int[a];\n\t\tint ans =0;\n\t\t\n\t\tfor(int i =0;i<a;i++) {\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(juice);\n\t\t\n\t\t\n\t\tfor(int i =0;i<b;i++) {\n\t\t\tans =ans+juice[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint juice[] =new int[a];\n\t\tint ans =0;\n\t\t\n\t\tfor(int i =0;i<a;i++) {\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(juice);\n\t\t\n\t\t\n\t\tfor(int i =0;i<b;i++) {\n\t\t\tans =ans+juice[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int a = sc.nextInt();", "a", "sc.nextInt()", "sc.nextInt", "sc", "int b = sc.nextInt();", "b", "sc.nextInt()", "sc.nextInt", "sc", "int juice[] =new int[a];", "juice", "new int[a]", "a", "int ans =0;", "ans", "0", "for(int i =0;i<a;i++) {\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}", "int i =0;", "int i =0;", "i", "0", "i<a", "i", "a", "i++", "i++", "i", "{\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}", "{\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}", "juice[i] = sc.nextInt()", "juice[i]", "juice", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(juice)", "Arrays.sort", "Arrays", "juice", "for(int i =0;i<b;i++) {\n\t\t\tans =ans+juice[i];\n\t\t}", "int i =0;", "int i =0;", "i", "0", "i<b", "i", "b", "i++", "i++", "i", "{\n\t\t\tans =ans+juice[i];\n\t\t}", "{\n\t\t\tans =ans+juice[i];\n\t\t}", "ans =ans+juice[i]", "ans", "ans+juice[i]", "ans", "juice[i]", "juice", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint juice[] =new int[a];\n\t\tint ans =0;\n\t\t\n\t\tfor(int i =0;i<a;i++) {\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(juice);\n\t\t\n\t\t\n\t\tfor(int i =0;i<b;i++) {\n\t\t\tans =ans+juice[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tint juice[] =new int[a];\n\t\tint ans =0;\n\t\t\n\t\tfor(int i =0;i<a;i++) {\n\t\t\tjuice[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(juice);\n\t\t\n\t\t\n\t\tfor(int i =0;i<b;i++) {\n\t\t\tans =ans+juice[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int juice[] =new int[a]; int ans =0; for(int i =0;i<a;i++) { juice[i] = sc.nextInt(); } Arrays.sort(juice); for(int i =0;i<b;i++) { ans =ans+juice[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 88, 8 ], [ 88, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 11, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 36, 37 ], [ 36, 38 ], [ 29, 39 ], [ 39, 40 ], [ 40, 41 ], [ 29, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 44, 48 ], [ 48, 49 ], [ 49, 50 ], [ 11, 51 ], [ 51, 52 ], [ 52, 53 ], [ 51, 54 ], [ 11, 55 ], [ 55, 56 ], [ 55, 57 ], [ 11, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 58, 63 ], [ 63, 64 ], [ 63, 65 ], [ 58, 66 ], [ 66, 67 ], [ 67, 68 ], [ 58, 69 ], [ 70, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 11, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 11, 82 ], [ 82, 83 ], [ 83, 84 ], [ 9, 85 ], [ 85, 86 ], [ 0, 87 ], [ 87, 88 ], [ 87, 89 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint N[] = new int[a];\n\t\tint b = sc.nextInt();\n\t\tfor (int i = 0; i < N.length; i++) {\n\t\t\tN[i] = sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(N);\n\t\tint sum = 0;\n\n\n\t\tfor (int i = 0; i < b; i++) {\n\t\t\tsum += N[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint N[] = new int[a];\n\t\tint b = sc.nextInt();\n\t\tfor (int i = 0; i < N.length; i++) {\n\t\t\tN[i] = sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(N);\n\t\tint sum = 0;\n\n\n\t\tfor (int i = 0; i < b; i++) {\n\t\t\tsum += N[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint N[] = new int[a];\n\t\tint b = sc.nextInt();\n\t\tfor (int i = 0; i < N.length; i++) {\n\t\t\tN[i] = sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(N);\n\t\tint sum = 0;\n\n\n\t\tfor (int i = 0; i < b; i++) {\n\t\t\tsum += N[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint N[] = new int[a];\n\t\tint b = sc.nextInt();\n\t\tfor (int i = 0; i < N.length; i++) {\n\t\t\tN[i] = sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(N);\n\t\tint sum = 0;\n\n\n\t\tfor (int i = 0; i < b; i++) {\n\t\t\tsum += N[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int a = sc.nextInt();", "a", "sc.nextInt()", "sc.nextInt", "sc", "int N[] = new int[a];", "N", "new int[a]", "a", "int b = sc.nextInt();", "b", "sc.nextInt()", "sc.nextInt", "sc", "for (int i = 0; i < N.length; i++) {\n\t\t\tN[i] = sc.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N.length", "i", "N.length", "N", "N.length", "i++", "i++", "i", "{\n\t\t\tN[i] = sc.nextInt();\n\t\t}", "{\n\t\t\tN[i] = sc.nextInt();\n\t\t}", "N[i] = sc.nextInt()", "N[i]", "N", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(N)", "Arrays.sort", "Arrays", "N", "int sum = 0;", "sum", "0", "for (int i = 0; i < b; i++) {\n\t\t\tsum += N[i];\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < b", "i", "b", "i++", "i++", "i", "{\n\t\t\tsum += N[i];\n\t\t}", "{\n\t\t\tsum += N[i];\n\t\t}", "sum += N[i]", "sum", "N[i]", "N", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint N[] = new int[a];\n\t\tint b = sc.nextInt();\n\t\tfor (int i = 0; i < N.length; i++) {\n\t\t\tN[i] = sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(N);\n\t\tint sum = 0;\n\n\n\t\tfor (int i = 0; i < b; i++) {\n\t\t\tsum += N[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint N[] = new int[a];\n\t\tint b = sc.nextInt();\n\t\tfor (int i = 0; i < N.length; i++) {\n\t\t\tN[i] = sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(N);\n\t\tint sum = 0;\n\n\n\t\tfor (int i = 0; i < b; i++) {\n\t\t\tsum += N[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int N[] = new int[a]; int b = sc.nextInt(); for (int i = 0; i < N.length; i++) { N[i] = sc.nextInt(); } Arrays.sort(N); int sum = 0; for (int i = 0; i < b; i++) { sum += N[i]; } System.out.println(sum); sc.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 1, 40, 13, 30, 30, 14, 2, 4, 18, 13, 13, 13, 30, 0, 13, 4, 18, 13, 13, 0, 13, 13, 0, 13, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 120, 8 ], [ 120, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 28, 36 ], [ 36, 37 ], [ 37, 38 ], [ 28, 39 ], [ 40, 40 ], [ 40, 41 ], [ 41, 42 ], [ 42, 43 ], [ 41, 44 ], [ 44, 45 ], [ 45, 46 ], [ 11, 47 ], [ 47, 48 ], [ 47, 49 ], [ 11, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 50, 55 ], [ 55, 56 ], [ 55, 57 ], [ 50, 58 ], [ 58, 59 ], [ 59, 60 ], [ 50, 61 ], [ 62, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 66, 67 ], [ 65, 68 ], [ 62, 69 ], [ 69, 70 ], [ 69, 71 ], [ 62, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 80, 81 ], [ 72, 82 ], [ 82, 83 ], [ 83, 84 ], [ 72, 85 ], [ 86, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 89, 92 ], [ 88, 93 ], [ 87, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 97, 98 ], [ 98, 99 ], [ 97, 100 ], [ 94, 101 ], [ 101, 102 ], [ 101, 103 ], [ 62, 104 ], [ 104, 105 ], [ 104, 106 ], [ 62, 107 ], [ 107, 108 ], [ 108, 109 ], [ 107, 110 ], [ 11, 111 ], [ 111, 112 ], [ 112, 113 ], [ 113, 114 ], [ 113, 115 ], [ 111, 116 ], [ 9, 117 ], [ 117, 118 ], [ 0, 119 ], [ 119, 120 ], [ 119, 121 ] ]
[ "import java.util.Scanner;\nimport java.util.ArrayList;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n //input\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> intArray = new ArrayList<Integer>();\n for(int i = 0; i < n; i++){\n intArray.add(sc.nextInt());\n }\n\n //output\n //find smallest value\n int total = 0;\n for(int i = 0; i < k; i++){ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }\n System.out.println(total);\n\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.ArrayList;", "ArrayList", "java.util", "public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n //input\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> intArray = new ArrayList<Integer>();\n for(int i = 0; i < n; i++){\n intArray.add(sc.nextInt());\n }\n\n //output\n //find smallest value\n int total = 0;\n for(int i = 0; i < k; i++){ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }\n System.out.println(total);\n\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n //input\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> intArray = new ArrayList<Integer>();\n for(int i = 0; i < n; i++){\n intArray.add(sc.nextInt());\n }\n\n //output\n //find smallest value\n int total = 0;\n for(int i = 0; i < k; i++){ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }\n System.out.println(total);\n\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n\n //input\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> intArray = new ArrayList<Integer>();\n for(int i = 0; i < n; i++){\n intArray.add(sc.nextInt());\n }\n\n //output\n //find smallest value\n int total = 0;\n for(int i = 0; i < k; i++){ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }\n System.out.println(total);\n\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "ArrayList<Integer> intArray = new ArrayList<Integer>();", "intArray", "new ArrayList<Integer>()", "for(int i = 0; i < n; i++){\n intArray.add(sc.nextInt());\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n intArray.add(sc.nextInt());\n }", "{\n intArray.add(sc.nextInt());\n }", "intArray.add(sc.nextInt())", "intArray.add", "intArray", "sc.nextInt()", "sc.nextInt", "sc", "int total = 0;", "total", "0", "for(int i = 0; i < k; i++){ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }", "{ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }", "int smallestInt = intArray.get(0);", "smallestInt", "intArray.get(0)", "intArray.get", "intArray", "0", "int smallestIntLocation = 0;", "smallestIntLocation", "0", "for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }", "int j = 0;", "int j = 0;", "j", "0", "j < intArray.size()", "j", "intArray.size()", "intArray.size", "intArray", "j++", "j++", "j", "{\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }", "{\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }", "if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }", "intArray.get(j) < smallestInt", "intArray.get(j)", "intArray.get", "intArray", "j", "smallestInt", "{\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }", "smallestInt = intArray.get(j)", "smallestInt", "intArray.get(j)", "intArray.get", "intArray", "j", "smallestIntLocation = j", "smallestIntLocation", "j", "total += smallestInt", "total", "smallestInt", "intArray.remove(smallestIntLocation)", "intArray.remove", "intArray", "smallestIntLocation", "System.out.println(total)", "System.out.println", "System.out", "System", "System.out", "total", "String[] args", "args", "public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n //input\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> intArray = new ArrayList<Integer>();\n for(int i = 0; i < n; i++){\n intArray.add(sc.nextInt());\n }\n\n //output\n //find smallest value\n int total = 0;\n for(int i = 0; i < k; i++){ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }\n System.out.println(total);\n\n }\n}", "public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n //input\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> intArray = new ArrayList<Integer>();\n for(int i = 0; i < n; i++){\n intArray.add(sc.nextInt());\n }\n\n //output\n //find smallest value\n int total = 0;\n for(int i = 0; i < k; i++){ //repeat k times\n int smallestInt = intArray.get(0);\n int smallestIntLocation = 0;\n for(int j = 0; j < intArray.size(); j++){\n if( intArray.get(j) < smallestInt ){\n smallestInt = intArray.get(j);\n smallestIntLocation = j;\n }\n }\n total += smallestInt;\n intArray.remove(smallestIntLocation);\n }\n System.out.println(total);\n\n }\n}", "Main" ]
import java.util.Scanner; import java.util.ArrayList; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); //input int n = sc.nextInt(); int k = sc.nextInt(); ArrayList<Integer> intArray = new ArrayList<Integer>(); for(int i = 0; i < n; i++){ intArray.add(sc.nextInt()); } //output //find smallest value int total = 0; for(int i = 0; i < k; i++){ //repeat k times int smallestInt = intArray.get(0); int smallestIntLocation = 0; for(int j = 0; j < intArray.size(); j++){ if( intArray.get(j) < smallestInt ){ smallestInt = intArray.get(j); smallestIntLocation = j; } } total += smallestInt; intArray.remove(smallestIntLocation); } System.out.println(total); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 17, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 8, 4, 18, 13, 18, 13, 13, 20, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 4, 13, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 20, 0, 18, 36, 13, 17, 23, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 25, 26 ], [ 25, 27 ], [ 0, 28 ], [ 28, 29 ], [ 28, 30 ], [ 0, 31 ], [ 213, 32 ], [ 213, 33 ], [ 33, 34 ], [ 33, 35 ], [ 213, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 42, 43 ], [ 38, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 47, 48 ], [ 38, 49 ], [ 49, 50 ], [ 49, 51 ], [ 38, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 65, 69 ], [ 69, 70 ], [ 70, 71 ], [ 38, 72 ], [ 72, 73 ], [ 73, 74 ], [ 72, 75 ], [ 38, 76 ], [ 76, 77 ], [ 76, 78 ], [ 38, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 84, 85 ], [ 84, 86 ], [ 79, 87 ], [ 87, 88 ], [ 88, 89 ], [ 79, 90 ], [ 90, 91 ], [ 91, 92 ], [ 91, 93 ], [ 93, 94 ], [ 93, 95 ], [ 38, 96 ], [ 96, 97 ], [ 97, 98 ], [ 96, 99 ], [ 36, 100 ], [ 100, 101 ], [ 36, 102 ], [ 102, 103 ], [ 213, 104 ], [ 104, 105 ], [ 104, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 109, 110 ], [ 110, 111 ], [ 111, 112 ], [ 109, 113 ], [ 113, 114 ], [ 113, 115 ], [ 109, 116 ], [ 106, 117 ], [ 117, 118 ], [ 117, 119 ], [ 119, 120 ], [ 119, 121 ], [ 106, 122 ], [ 122, 123 ], [ 122, 124 ], [ 106, 125 ], [ 125, 126 ], [ 125, 127 ], [ 106, 128 ], [ 128, 129 ], [ 128, 130 ], [ 128, 131 ], [ 106, 132 ], [ 132, 133 ], [ 133, 134 ], [ 104, 135 ], [ 135, 136 ], [ 213, 137 ], [ 137, 138 ], [ 137, 139 ], [ 139, 140 ], [ 137, 141 ], [ 141, 142 ], [ 137, 143 ], [ 143, 144 ], [ 143, 145 ], [ 145, 146 ], [ 146, 147 ], [ 147, 148 ], [ 147, 149 ], [ 146, 150 ], [ 145, 151 ], [ 151, 152 ], [ 152, 153 ], [ 152, 154 ], [ 151, 155 ], [ 143, 156 ], [ 156, 157 ], [ 137, 158 ], [ 158, 159 ], [ 158, 160 ], [ 160, 161 ], [ 161, 162 ], [ 162, 163 ], [ 163, 164 ], [ 163, 165 ], [ 162, 166 ], [ 166, 167 ], [ 167, 168 ], [ 168, 169 ], [ 161, 170 ], [ 170, 171 ], [ 171, 172 ], [ 172, 173 ], [ 172, 174 ], [ 174, 175 ], [ 175, 176 ], [ 171, 177 ], [ 177, 178 ], [ 178, 179 ], [ 178, 180 ], [ 160, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 137, 185 ], [ 185, 186 ], [ 185, 187 ], [ 187, 188 ], [ 188, 189 ], [ 189, 190 ], [ 190, 191 ], [ 189, 192 ], [ 192, 193 ], [ 137, 194 ], [ 194, 195 ], [ 194, 196 ], [ 196, 197 ], [ 197, 198 ], [ 198, 199 ], [ 199, 200 ], [ 198, 201 ], [ 201, 202 ], [ 137, 203 ], [ 203, 204 ], [ 203, 205 ], [ 205, 206 ], [ 206, 207 ], [ 207, 208 ], [ 208, 209 ], [ 207, 210 ], [ 210, 211 ], [ 0, 212 ], [ 212, 213 ], [ 212, 214 ] ]
[ "\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n static void solve(InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n for (int i = 0; i < n; i++) p[i] = in.nextInt();\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) ans += p[i];\n out.println(ans);\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n solve(inputReader, printWriter);\n\n printWriter.close();\n }\n\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.File;", "File", "java.io", "import java.io.FileInputStream;", "FileInputStream", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n static void solve(InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n for (int i = 0; i < n; i++) p[i] = in.nextInt();\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) ans += p[i];\n out.println(ans);\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n solve(inputReader, printWriter);\n\n printWriter.close();\n }\n\n}", "Main", "private static final String INPUT_FILE_PATH = \"\";", "INPUT_FILE_PATH", "\"\"", "static void solve(InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n for (int i = 0; i < n; i++) p[i] = in.nextInt();\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) ans += p[i];\n out.println(ans);\n }", "solve", "{\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n for (int i = 0; i < n; i++) p[i] = in.nextInt();\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) ans += p[i];\n out.println(ans);\n }", "int n = in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int k = in.nextInt();", "k", "in.nextInt()", "in.nextInt", "in", "int[] p = new int[n];", "p", "new int[n]", "n", "for (int i = 0; i < n; i++) p[i] = in.nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "p[i] = in.nextInt();", "p[i] = in.nextInt()", "p[i]", "p", "i", "in.nextInt()", "in.nextInt", "in", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int ans = 0;", "ans", "0", "for (int i = 0; i < k; i++) ans += p[i];", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "ans += p[i];", "ans += p[i]", "ans", "p[i]", "p", "i", "out.println(ans)", "out.println", "out", "ans", "InputReader in", "in", "PrintWriter out", "out", "public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n solve(inputReader, printWriter);\n\n printWriter.close();\n }", "main", "{\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n solve(inputReader, printWriter);\n\n printWriter.close();\n }", "InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));", "inputStream", "INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH))", "INPUT_FILE_PATH.isEmpty()", "INPUT_FILE_PATH.isEmpty", "INPUT_FILE_PATH", "System.in", "System", "System.in", "new FileInputStream(new File(INPUT_FILE_PATH))", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "InputReader inputReader = new InputReader(inputStream);", "inputReader", "new InputReader(inputStream)", "PrintWriter printWriter = new PrintWriter(outputStream);", "printWriter", "new PrintWriter(outputStream)", "solve(inputReader, printWriter)", "solve", "inputReader", "printWriter", "printWriter.close()", "printWriter.close", "printWriter", "String[] args", "args", "private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }", "InputReader", "private BufferedReader br;", "br", "private StringTokenizer st;", "st", "public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }", "InputReader", "{\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }", "this.br = new BufferedReader(new InputStreamReader(inputStream), 32768)", "this.br", "this", "this.br", "new BufferedReader(new InputStreamReader(inputStream), 32768)", "this.st = null", "this.st", "this", "this.st", "null", "InputStream inputStream", "inputStream", "public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }", "nextToken", "{\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "st == null || !st.hasMoreTokens()", "st == null", "st", "null", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }", "catch (IOException e) {\n throw new RuntimeException(e);\n }", "IOException e", "{\n throw new RuntimeException(e);\n }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "public int nextInt() {\n return Integer.parseInt(nextToken());\n }", "nextInt", "{\n return Integer.parseInt(nextToken());\n }", "return Integer.parseInt(nextToken());", "Integer.parseInt(nextToken())", "Integer.parseInt", "Integer", "nextToken()", "nextToken", "public long nextLong() {\n return Long.parseLong(nextToken());\n }", "nextLong", "{\n return Long.parseLong(nextToken());\n }", "return Long.parseLong(nextToken());", "Long.parseLong(nextToken())", "Long.parseLong", "Long", "nextToken()", "nextToken", "public double nextDouble() {\n return Double.parseDouble(nextToken());\n }", "nextDouble", "{\n return Double.parseDouble(nextToken());\n }", "return Double.parseDouble(nextToken());", "Double.parseDouble(nextToken())", "Double.parseDouble", "Double", "nextToken()", "nextToken", "public class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n static void solve(InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n for (int i = 0; i < n; i++) p[i] = in.nextInt();\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) ans += p[i];\n out.println(ans);\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n solve(inputReader, printWriter);\n\n printWriter.close();\n }\n\n}", "public class Main {\n\n private static final String INPUT_FILE_PATH = \"\";\n\n static void solve(InputReader in, PrintWriter out) {\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n for (int i = 0; i < n; i++) p[i] = in.nextInt();\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) ans += p[i];\n out.println(ans);\n }\n\n private static class InputReader {\n private BufferedReader br;\n private StringTokenizer st;\n\n public InputReader(InputStream inputStream) {\n this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);\n this.st = null;\n }\n\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return st.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(nextToken());\n }\n\n public long nextLong() {\n return Long.parseLong(nextToken());\n }\n\n public double nextDouble() {\n return Double.parseDouble(nextToken());\n }\n }\n\n public static void main(String[] args) throws Exception {\n InputStream inputStream = INPUT_FILE_PATH.isEmpty()\n ? System.in\n : new FileInputStream(new File(INPUT_FILE_PATH));\n OutputStream outputStream = System.out;\n\n InputReader inputReader = new InputReader(inputStream);\n PrintWriter printWriter = new PrintWriter(outputStream);\n\n solve(inputReader, printWriter);\n\n printWriter.close();\n }\n\n}", "Main" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class Main { private static final String INPUT_FILE_PATH = ""; static void solve(InputReader in, PrintWriter out) { int n = in.nextInt(); int k = in.nextInt(); int[] p = new int[n]; for (int i = 0; i < n; i++) p[i] = in.nextInt(); Arrays.sort(p); int ans = 0; for (int i = 0; i < k; i++) ans += p[i]; out.println(ans); } private static class InputReader { private BufferedReader br; private StringTokenizer st; public InputReader(InputStream inputStream) { this.br = new BufferedReader(new InputStreamReader(inputStream), 32768); this.st = null; } public String nextToken() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return st.nextToken(); } public int nextInt() { return Integer.parseInt(nextToken()); } public long nextLong() { return Long.parseLong(nextToken()); } public double nextDouble() { return Double.parseDouble(nextToken()); } } public static void main(String[] args) throws Exception { InputStream inputStream = INPUT_FILE_PATH.isEmpty() ? System.in : new FileInputStream(new File(INPUT_FILE_PATH)); OutputStream outputStream = System.out; InputReader inputReader = new InputReader(inputStream); PrintWriter printWriter = new PrintWriter(outputStream); solve(inputReader, printWriter); printWriter.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 17, 41, 13, 20, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 18, 13, 17, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 18, 13, 17, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 109, 14 ], [ 109, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 21, 23 ], [ 17, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 17, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 32, 33 ], [ 31, 34 ], [ 17, 35 ], [ 35, 36 ], [ 35, 37 ], [ 17, 38 ], [ 38, 39 ], [ 38, 40 ], [ 17, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 41, 46 ], [ 46, 47 ], [ 46, 48 ], [ 48, 49 ], [ 49, 50 ], [ 48, 51 ], [ 51, 52 ], [ 51, 53 ], [ 41, 54 ], [ 54, 55 ], [ 55, 56 ], [ 41, 57 ], [ 58, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 59, 62 ], [ 62, 63 ], [ 63, 64 ], [ 62, 65 ], [ 65, 66 ], [ 66, 67 ], [ 17, 68 ], [ 68, 69 ], [ 69, 70 ], [ 68, 71 ], [ 17, 72 ], [ 72, 73 ], [ 72, 74 ], [ 17, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 75, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 83, 84 ], [ 82, 85 ], [ 85, 86 ], [ 85, 87 ], [ 75, 88 ], [ 88, 89 ], [ 89, 90 ], [ 75, 91 ], [ 92, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 95, 96 ], [ 96, 97 ], [ 95, 98 ], [ 17, 99 ], [ 99, 100 ], [ 100, 101 ], [ 99, 102 ], [ 17, 103 ], [ 103, 104 ], [ 104, 105 ], [ 15, 106 ], [ 106, 107 ], [ 0, 108 ], [ 108, 109 ], [ 108, 110 ] ]
[ "import java.io.*;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(System.out);\n //--------------------------START CODING HERE-----------------------------\n\n String line= f.readLine();\n\n String[] theLine = line.split(\" \");\n ArrayList<Integer> theInts = new ArrayList<>();\n\n StringTokenizer st = new StringTokenizer(f.readLine());\n for(int i = 0; i < Integer.parseInt(theLine[0]); i++)\n {\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }\n Collections.sort(theInts);\n\n int sum = 0;\n for(int g = 0; g < Integer.parseInt(theLine[1]); g++)\n {\n sum+=theInts.get(g);\n }\n\n out.print(sum);\n\n\n out.close();\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\n public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(System.out);\n //--------------------------START CODING HERE-----------------------------\n\n String line= f.readLine();\n\n String[] theLine = line.split(\" \");\n ArrayList<Integer> theInts = new ArrayList<>();\n\n StringTokenizer st = new StringTokenizer(f.readLine());\n for(int i = 0; i < Integer.parseInt(theLine[0]); i++)\n {\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }\n Collections.sort(theInts);\n\n int sum = 0;\n for(int g = 0; g < Integer.parseInt(theLine[1]); g++)\n {\n sum+=theInts.get(g);\n }\n\n out.print(sum);\n\n\n out.close();\n }\n}", "Main", "public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(System.out);\n //--------------------------START CODING HERE-----------------------------\n\n String line= f.readLine();\n\n String[] theLine = line.split(\" \");\n ArrayList<Integer> theInts = new ArrayList<>();\n\n StringTokenizer st = new StringTokenizer(f.readLine());\n for(int i = 0; i < Integer.parseInt(theLine[0]); i++)\n {\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }\n Collections.sort(theInts);\n\n int sum = 0;\n for(int g = 0; g < Integer.parseInt(theLine[1]); g++)\n {\n sum+=theInts.get(g);\n }\n\n out.print(sum);\n\n\n out.close();\n }", "main", "{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(System.out);\n //--------------------------START CODING HERE-----------------------------\n\n String line= f.readLine();\n\n String[] theLine = line.split(\" \");\n ArrayList<Integer> theInts = new ArrayList<>();\n\n StringTokenizer st = new StringTokenizer(f.readLine());\n for(int i = 0; i < Integer.parseInt(theLine[0]); i++)\n {\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }\n Collections.sort(theInts);\n\n int sum = 0;\n for(int g = 0; g < Integer.parseInt(theLine[1]); g++)\n {\n sum+=theInts.get(g);\n }\n\n out.print(sum);\n\n\n out.close();\n }", "BufferedReader f = new BufferedReader(new InputStreamReader(System.in));", "f", "new BufferedReader(new InputStreamReader(System.in))", "PrintWriter out = new PrintWriter(System.out);", "out", "new PrintWriter(System.out)", "String line= f.readLine();", "line", "f.readLine()", "f.readLine", "f", "String[] theLine = line.split(\" \");", "theLine", "line.split(\" \")", "line.split", "line", "\" \"", "ArrayList<Integer> theInts = new ArrayList<>();", "theInts", "new ArrayList<>()", "StringTokenizer st = new StringTokenizer(f.readLine());", "st", "new StringTokenizer(f.readLine())", "for(int i = 0; i < Integer.parseInt(theLine[0]); i++)\n {\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }", "int i = 0;", "int i = 0;", "i", "0", "i < Integer.parseInt(theLine[0])", "i", "Integer.parseInt(theLine[0])", "Integer.parseInt", "Integer", "theLine[0]", "theLine", "0", "i++", "i++", "i", "{\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }", "{\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }", "theInts.add(Integer.parseInt(st.nextToken()))", "theInts.add", "theInts", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "Collections.sort(theInts)", "Collections.sort", "Collections", "theInts", "int sum = 0;", "sum", "0", "for(int g = 0; g < Integer.parseInt(theLine[1]); g++)\n {\n sum+=theInts.get(g);\n }", "int g = 0;", "int g = 0;", "g", "0", "g < Integer.parseInt(theLine[1])", "g", "Integer.parseInt(theLine[1])", "Integer.parseInt", "Integer", "theLine[1]", "theLine", "1", "g++", "g++", "g", "{\n sum+=theInts.get(g);\n }", "{\n sum+=theInts.get(g);\n }", "sum+=theInts.get(g)", "sum", "theInts.get(g)", "theInts.get", "theInts", "g", "out.print(sum)", "out.print", "out", "sum", "out.close()", "out.close", "out", "String [] args", "args", "public class Main {\n\n public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(System.out);\n //--------------------------START CODING HERE-----------------------------\n\n String line= f.readLine();\n\n String[] theLine = line.split(\" \");\n ArrayList<Integer> theInts = new ArrayList<>();\n\n StringTokenizer st = new StringTokenizer(f.readLine());\n for(int i = 0; i < Integer.parseInt(theLine[0]); i++)\n {\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }\n Collections.sort(theInts);\n\n int sum = 0;\n for(int g = 0; g < Integer.parseInt(theLine[1]); g++)\n {\n sum+=theInts.get(g);\n }\n\n out.print(sum);\n\n\n out.close();\n }\n}", "public class Main {\n\n public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(System.out);\n //--------------------------START CODING HERE-----------------------------\n\n String line= f.readLine();\n\n String[] theLine = line.split(\" \");\n ArrayList<Integer> theInts = new ArrayList<>();\n\n StringTokenizer st = new StringTokenizer(f.readLine());\n for(int i = 0; i < Integer.parseInt(theLine[0]); i++)\n {\n\n theInts.add(Integer.parseInt(st.nextToken()));\n }\n Collections.sort(theInts);\n\n int sum = 0;\n for(int g = 0; g < Integer.parseInt(theLine[1]); g++)\n {\n sum+=theInts.get(g);\n }\n\n out.print(sum);\n\n\n out.close();\n }\n}", "Main" ]
import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.StringTokenizer; public class Main { public static void main (String [] args) throws IOException { BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); //--------------------------START CODING HERE----------------------------- String line= f.readLine(); String[] theLine = line.split(" "); ArrayList<Integer> theInts = new ArrayList<>(); StringTokenizer st = new StringTokenizer(f.readLine()); for(int i = 0; i < Integer.parseInt(theLine[0]); i++) { theInts.add(Integer.parseInt(st.nextToken())); } Collections.sort(theInts); int sum = 0; for(int g = 0; g < Integer.parseInt(theLine[1]); g++) { sum+=theInts.get(g); } out.print(sum); out.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 38, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 85, 8 ], [ 85, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 13, 14 ], [ 14, 15 ], [ 14, 16 ], [ 13, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 13, 22 ], [ 22, 23 ], [ 22, 24 ], [ 24, 25 ], [ 25, 26 ], [ 13, 27 ], [ 27, 28 ], [ 27, 29 ], [ 13, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 44, 48 ], [ 48, 49 ], [ 49, 50 ], [ 13, 51 ], [ 51, 52 ], [ 52, 53 ], [ 51, 54 ], [ 13, 55 ], [ 55, 56 ], [ 55, 57 ], [ 13, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 58, 63 ], [ 63, 64 ], [ 63, 65 ], [ 58, 66 ], [ 66, 67 ], [ 67, 68 ], [ 58, 69 ], [ 70, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 13, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 9, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }\n }\n}", "Main", "public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }\n }", "main", "{\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }\n }", "try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }", "{\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }", "Scanner sc = new Scanner(System.in)", "Scanner sc = new Scanner(System.in)", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = new int[N];", "p", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n p[i] = sc.nextInt();\n }", "{\n p[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int sum = 0;", "sum", "0", "for (int k = 0; k < K; k++) {\n sum += p[k];\n }", "int k = 0;", "int k = 0;", "k", "0", "k < K", "k", "K", "k++", "k++", "k", "{\n sum += p[k];\n }", "{\n sum += p[k];\n }", "sum += p[k]", "sum", "p[k]", "p", "k", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }\n }\n}", "public class Main {\n public static void main(String[] args) {\n try (Scanner sc = new Scanner(System.in)) {\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n Arrays.sort(p);\n int sum = 0;\n for (int k = 0; k < K; k++) {\n sum += p[k];\n }\n System.out.println(sum);\n }\n }\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int N = sc.nextInt(); int K = sc.nextInt(); int[] p = new int[N]; for (int i = 0; i < N; i++) { p[i] = sc.nextInt(); } Arrays.sort(p); int sum = 0; for (int k = 0; k < K; k++) { sum += p[k]; } System.out.println(sum); } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 41, 13, 41, 13, 20, 0, 13, 4, 18, 13, 0, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 101, 20 ], [ 101, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 23, 26 ], [ 26, 27 ], [ 23, 28 ], [ 28, 29 ], [ 28, 30 ], [ 23, 31 ], [ 31, 32 ], [ 31, 33 ], [ 33, 34 ], [ 34, 35 ], [ 23, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 23, 41 ], [ 41, 42 ], [ 41, 43 ], [ 23, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 45, 50 ], [ 50, 51 ], [ 50, 52 ], [ 45, 53 ], [ 53, 54 ], [ 54, 55 ], [ 45, 56 ], [ 57, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 58, 62 ], [ 62, 63 ], [ 63, 64 ], [ 23, 65 ], [ 65, 66 ], [ 66, 67 ], [ 65, 68 ], [ 23, 69 ], [ 69, 70 ], [ 69, 71 ], [ 23, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 72, 80 ], [ 80, 81 ], [ 81, 82 ], [ 72, 83 ], [ 84, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 87, 88 ], [ 87, 89 ], [ 89, 90 ], [ 89, 91 ], [ 23, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 92, 97 ], [ 21, 98 ], [ 98, 99 ], [ 0, 100 ], [ 100, 101 ], [ 100, 102 ] ]
[ "//package atcoder;\n \nimport java.io.BufferedWriter;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.util.*;\n//import java.math.BigDecimal;\n \npublic class Main {\n\tpublic static void main(String [] args) {\n\t int K,N;\n\t \n\t\tScanner sc = new Scanner(System.in);\n\t\tN = sc.nextInt();\n\t\tK = sc.nextInt();\n\t\tint p[] = new int [N];\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\t/*for(int k=0;k<N;k++) {\n\t\t\tSystem.out.println(p[k]);\n\t\t}*/\n\t\tint goukei = 0;\n\t\tfor(int j=0;j<K;j++) {\n\t\t\tgoukei = goukei+p[j];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t\t\n\t}\n}", "import java.io.BufferedWriter;", "BufferedWriter", "java.io", "import java.io.File;", "File", "java.io", "import java.io.FileWriter;", "FileWriter", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String [] args) {\n\t int K,N;\n\t \n\t\tScanner sc = new Scanner(System.in);\n\t\tN = sc.nextInt();\n\t\tK = sc.nextInt();\n\t\tint p[] = new int [N];\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\t/*for(int k=0;k<N;k++) {\n\t\t\tSystem.out.println(p[k]);\n\t\t}*/\n\t\tint goukei = 0;\n\t\tfor(int j=0;j<K;j++) {\n\t\t\tgoukei = goukei+p[j];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t\t\n\t}\n}", "Main", "public static void main(String [] args) {\n\t int K,N;\n\t \n\t\tScanner sc = new Scanner(System.in);\n\t\tN = sc.nextInt();\n\t\tK = sc.nextInt();\n\t\tint p[] = new int [N];\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\t/*for(int k=0;k<N;k++) {\n\t\t\tSystem.out.println(p[k]);\n\t\t}*/\n\t\tint goukei = 0;\n\t\tfor(int j=0;j<K;j++) {\n\t\t\tgoukei = goukei+p[j];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t\t\n\t}", "main", "{\n\t int K,N;\n\t \n\t\tScanner sc = new Scanner(System.in);\n\t\tN = sc.nextInt();\n\t\tK = sc.nextInt();\n\t\tint p[] = new int [N];\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\t/*for(int k=0;k<N;k++) {\n\t\t\tSystem.out.println(p[k]);\n\t\t}*/\n\t\tint goukei = 0;\n\t\tfor(int j=0;j<K;j++) {\n\t\t\tgoukei = goukei+p[j];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t\t\n\t}", "int K", "K", "N;", "N", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "N = sc.nextInt()", "N", "sc.nextInt()", "sc.nextInt", "sc", "K = sc.nextInt()", "K", "sc.nextInt()", "sc.nextInt", "sc", "int p[] = new int [N];", "p", "new int [N]", "N", "for(int i=0;i<N;i++) {\n\t\t\tp[i] = sc.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n\t\t\tp[i] = sc.nextInt();\n\t\t}", "{\n\t\t\tp[i] = sc.nextInt();\n\t\t}", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int goukei = 0;", "goukei", "0", "for(int j=0;j<K;j++) {\n\t\t\tgoukei = goukei+p[j];\n\t\t}", "int j=0;", "int j=0;", "j", "0", "j<K", "j", "K", "j++", "j++", "j", "{\n\t\t\tgoukei = goukei+p[j];\n\t\t}", "{\n\t\t\tgoukei = goukei+p[j];\n\t\t}", "goukei = goukei+p[j]", "goukei", "goukei+p[j]", "goukei", "p[j]", "p", "j", "System.out.println(goukei)", "System.out.println", "System.out", "System", "System.out", "goukei", "String [] args", "args", "public class Main {\n\tpublic static void main(String [] args) {\n\t int K,N;\n\t \n\t\tScanner sc = new Scanner(System.in);\n\t\tN = sc.nextInt();\n\t\tK = sc.nextInt();\n\t\tint p[] = new int [N];\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\t/*for(int k=0;k<N;k++) {\n\t\t\tSystem.out.println(p[k]);\n\t\t}*/\n\t\tint goukei = 0;\n\t\tfor(int j=0;j<K;j++) {\n\t\t\tgoukei = goukei+p[j];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t\t\n\t}\n}", "public class Main {\n\tpublic static void main(String [] args) {\n\t int K,N;\n\t \n\t\tScanner sc = new Scanner(System.in);\n\t\tN = sc.nextInt();\n\t\tK = sc.nextInt();\n\t\tint p[] = new int [N];\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tp[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\t/*for(int k=0;k<N;k++) {\n\t\t\tSystem.out.println(p[k]);\n\t\t}*/\n\t\tint goukei = 0;\n\t\tfor(int j=0;j<K;j++) {\n\t\t\tgoukei = goukei+p[j];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t\t\n\t}\n}", "Main" ]
//package atcoder; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.*; //import java.math.BigDecimal; public class Main { public static void main(String [] args) { int K,N; Scanner sc = new Scanner(System.in); N = sc.nextInt(); K = sc.nextInt(); int p[] = new int [N]; for(int i=0;i<N;i++) { p[i] = sc.nextInt(); } Arrays.sort(p); /*for(int k=0;k<N;k++) { System.out.println(p[k]); }*/ int goukei = 0; for(int j=0;j<K;j++) { goukei = goukei+p[j]; } System.out.println(goukei); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 42, 40, 4, 18, 13, 30, 0, 18, 13, 13, 4, 18, 13, 40, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 28, 36 ], [ 36, 37 ], [ 37, 38 ], [ 28, 39 ], [ 40, 40 ], [ 40, 41 ], [ 41, 42 ], [ 42, 43 ], [ 41, 44 ], [ 44, 45 ], [ 45, 46 ], [ 11, 47 ], [ 47, 48 ], [ 47, 49 ], [ 11, 51 ], [ 51, 52 ], [ 51, 53 ], [ 11, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 54, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 60, 64 ], [ 64, 65 ], [ 65, 66 ], [ 59, 67 ], [ 67, 68 ], [ 11, 69 ], [ 69, 70 ], [ 69, 71 ], [ 11, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 72, 80 ], [ 80, 81 ], [ 81, 82 ], [ 72, 83 ], [ 84, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 87, 88 ], [ 87, 89 ], [ 11, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 90, 95 ], [ 9, 96 ], [ 96, 97 ] ]
[ "\nimport java.util.PriorityQueue;\nimport java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\t\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tfor(int i=0; i < N; i++) {\n\t\t\tpq.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t\n\t\tint[] p = new int[N];\n\t\t\n\t\tint j = 0;\n\t\twhile(! pq.isEmpty()) {\n\t\t\tp[j] = pq.poll();\n\t\t\tj ++;\n\t\t}\n\t\t\n\t\tint total = 0;\n\n\t\t\n\t\tfor(int i=0; i<K; i++){\n\t\t\ttotal += p[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(total);\n\n\t}\n}\n", "import java.util.PriorityQueue;", "PriorityQueue", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\t\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tfor(int i=0; i < N; i++) {\n\t\t\tpq.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t\n\t\tint[] p = new int[N];\n\t\t\n\t\tint j = 0;\n\t\twhile(! pq.isEmpty()) {\n\t\t\tp[j] = pq.poll();\n\t\t\tj ++;\n\t\t}\n\t\t\n\t\tint total = 0;\n\n\t\t\n\t\tfor(int i=0; i<K; i++){\n\t\t\ttotal += p[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(total);\n\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\t\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tfor(int i=0; i < N; i++) {\n\t\t\tpq.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t\n\t\tint[] p = new int[N];\n\t\t\n\t\tint j = 0;\n\t\twhile(! pq.isEmpty()) {\n\t\t\tp[j] = pq.poll();\n\t\t\tj ++;\n\t\t}\n\t\t\n\t\tint total = 0;\n\n\t\t\n\t\tfor(int i=0; i<K; i++){\n\t\t\ttotal += p[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(total);\n\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\t\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tfor(int i=0; i < N; i++) {\n\t\t\tpq.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t\n\t\tint[] p = new int[N];\n\t\t\n\t\tint j = 0;\n\t\twhile(! pq.isEmpty()) {\n\t\t\tp[j] = pq.poll();\n\t\t\tj ++;\n\t\t}\n\t\t\n\t\tint total = 0;\n\n\t\t\n\t\tfor(int i=0; i<K; i++){\n\t\t\ttotal += p[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(total);\n\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "PriorityQueue<Integer> pq = new PriorityQueue<>();", "pq", "new PriorityQueue<>()", "for(int i=0; i < N; i++) {\n\t\t\tpq.add(sc.nextInt());\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tpq.add(sc.nextInt());\n\t\t}", "{\n\t\t\tpq.add(sc.nextInt());\n\t\t}", "pq.add(sc.nextInt())", "pq.add", "pq", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = new int[N];", "p", "new int[N]", "N", "int j = 0;", "j", "0", "while(! pq.isEmpty()) {\n\t\t\tp[j] = pq.poll();\n\t\t\tj ++;\n\t\t}", "! pq.isEmpty()", "pq.isEmpty()", "pq.isEmpty", "pq", "{\n\t\t\tp[j] = pq.poll();\n\t\t\tj ++;\n\t\t}", "p[j] = pq.poll()", "p[j]", "p", "j", "pq.poll()", "pq.poll", "pq", "j ++", "j", "int total = 0;", "total", "0", "for(int i=0; i<K; i++){\n\t\t\ttotal += p[i];\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n\t\t\ttotal += p[i];\n\t\t}", "{\n\t\t\ttotal += p[i];\n\t\t}", "total += p[i]", "total", "p[i]", "p", "i", "System.out.println(total)", "System.out.println", "System.out", "System", "System.out", "total", "String[] args", "args" ]
import java.util.PriorityQueue; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); PriorityQueue<Integer> pq = new PriorityQueue<>(); for(int i=0; i < N; i++) { pq.add(sc.nextInt()); } int[] p = new int[N]; int j = 0; while(! pq.isEmpty()) { p[j] = pq.poll(); j ++; } int total = 0; for(int i=0; i<K; i++){ total += p[i]; } System.out.println(total); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 83, 5 ], [ 83, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 8, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 8, 77 ], [ 77, 78 ], [ 78, 79 ], [ 6, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.*;\n\npublic class Main {\npublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tint K = keyboard.nextInt();\n\t\tint[] p = new int[N];\n\t\t\n\t\tfor(int i = 0; i < N ; i++) {\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\t\n\t\tfor(int j = 0; j < K; j++) {\n\t\t\tans += p[j];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\tkeyboard.close();\t\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main {\npublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tint K = keyboard.nextInt();\n\t\tint[] p = new int[N];\n\t\t\n\t\tfor(int i = 0; i < N ; i++) {\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\t\n\t\tfor(int j = 0; j < K; j++) {\n\t\t\tans += p[j];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\tkeyboard.close();\t\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tint K = keyboard.nextInt();\n\t\tint[] p = new int[N];\n\t\t\n\t\tfor(int i = 0; i < N ; i++) {\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\t\n\t\tfor(int j = 0; j < K; j++) {\n\t\t\tans += p[j];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\tkeyboard.close();\t\n\t}", "main", "{\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tint K = keyboard.nextInt();\n\t\tint[] p = new int[N];\n\t\t\n\t\tfor(int i = 0; i < N ; i++) {\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\t\n\t\tfor(int j = 0; j < K; j++) {\n\t\t\tans += p[j];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\tkeyboard.close();\t\n\t}", "Scanner keyboard = new Scanner(System.in);", "keyboard", "new Scanner(System.in)", "int N = keyboard.nextInt();", "N", "keyboard.nextInt()", "keyboard.nextInt", "keyboard", "int K = keyboard.nextInt();", "K", "keyboard.nextInt()", "keyboard.nextInt", "keyboard", "int[] p = new int[N];", "p", "new int[N]", "N", "for(int i = 0; i < N ; i++) {\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}", "{\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}", "p[i] = keyboard.nextInt()", "p[i]", "p", "i", "keyboard.nextInt()", "keyboard.nextInt", "keyboard", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int ans = 0;", "ans", "0", "for(int j = 0; j < K; j++) {\n\t\t\tans += p[j];\n\t\t}", "int j = 0;", "int j = 0;", "j", "0", "j < K", "j", "K", "j++", "j++", "j", "{\n\t\t\tans += p[j];\n\t\t}", "{\n\t\t\tans += p[j];\n\t\t}", "ans += p[j]", "ans", "p[j]", "p", "j", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "keyboard.close()", "keyboard.close", "keyboard", "String[] args", "args", "public class Main {\npublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tint K = keyboard.nextInt();\n\t\tint[] p = new int[N];\n\t\t\n\t\tfor(int i = 0; i < N ; i++) {\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\t\n\t\tfor(int j = 0; j < K; j++) {\n\t\t\tans += p[j];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\tkeyboard.close();\t\n\t}\n}", "public class Main {\npublic static void main(String[] args) {\n\t\t\n\t\tScanner keyboard = new Scanner(System.in); \n\t\t\n\t\tint N = keyboard.nextInt();\n\t\tint K = keyboard.nextInt();\n\t\tint[] p = new int[N];\n\t\t\n\t\tfor(int i = 0; i < N ; i++) {\n\t\t\tp[i] = keyboard.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\t\n\t\tfor(int j = 0; j < K; j++) {\n\t\t\tans += p[j];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t\tkeyboard.close();\t\n\t}\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); int N = keyboard.nextInt(); int K = keyboard.nextInt(); int[] p = new int[N]; for(int i = 0; i < N ; i++) { p[i] = keyboard.nextInt(); } Arrays.sort(p); int ans = 0; for(int j = 0; j < K; j++) { ans += p[j]; } System.out.println(ans); keyboard.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 191, 26 ], [ 191, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 29, 33 ], [ 33, 34 ], [ 33, 35 ], [ 35, 36 ], [ 36, 37 ], [ 29, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 29, 43 ], [ 43, 44 ], [ 43, 45 ], [ 29, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 59, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 60, 64 ], [ 64, 65 ], [ 65, 66 ], [ 29, 67 ], [ 67, 68 ], [ 68, 69 ], [ 67, 70 ], [ 29, 71 ], [ 71, 72 ], [ 71, 73 ], [ 29, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 81, 83 ], [ 74, 84 ], [ 84, 85 ], [ 85, 86 ], [ 74, 87 ], [ 88, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 29, 94 ], [ 94, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 94, 99 ], [ 27, 100 ], [ 100, 101 ], [ 191, 102 ], [ 102, 103 ], [ 102, 104 ], [ 104, 105 ], [ 102, 106 ], [ 106, 107 ], [ 102, 108 ], [ 108, 109 ], [ 108, 110 ], [ 110, 111 ], [ 111, 112 ], [ 111, 113 ], [ 102, 114 ], [ 114, 115 ], [ 114, 116 ], [ 116, 117 ], [ 117, 118 ], [ 118, 119 ], [ 119, 120 ], [ 119, 121 ], [ 118, 122 ], [ 122, 123 ], [ 123, 124 ], [ 124, 125 ], [ 117, 126 ], [ 126, 127 ], [ 127, 128 ], [ 128, 129 ], [ 128, 130 ], [ 130, 131 ], [ 131, 132 ], [ 132, 133 ], [ 127, 134 ], [ 134, 135 ], [ 135, 136 ], [ 135, 137 ], [ 116, 138 ], [ 138, 139 ], [ 139, 140 ], [ 140, 141 ], [ 102, 142 ], [ 142, 143 ], [ 142, 144 ], [ 144, 145 ], [ 145, 146 ], [ 146, 147 ], [ 147, 148 ], [ 146, 149 ], [ 149, 150 ], [ 102, 151 ], [ 151, 152 ], [ 151, 153 ], [ 153, 154 ], [ 154, 155 ], [ 155, 156 ], [ 156, 157 ], [ 155, 158 ], [ 158, 159 ], [ 102, 160 ], [ 160, 161 ], [ 160, 162 ], [ 162, 163 ], [ 163, 164 ], [ 164, 165 ], [ 165, 166 ], [ 164, 167 ], [ 167, 168 ], [ 102, 169 ], [ 169, 170 ], [ 169, 171 ], [ 171, 172 ], [ 172, 173 ], [ 172, 174 ], [ 171, 175 ], [ 175, 176 ], [ 176, 177 ], [ 176, 178 ], [ 178, 179 ], [ 179, 180 ], [ 180, 181 ], [ 175, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 185, 186 ], [ 186, 187 ], [ 171, 188 ], [ 188, 189 ], [ 0, 190 ], [ 190, 191 ], [ 190, 192 ] ]
[ "import java.util.*;\nimport java.util.Scanner;\nimport java.io.*;\nimport java.io.BufferedReader; \nimport java.io.IOException; \nimport java.io.InputStreamReader; \nimport java.util.Scanner; \nimport java.util.StringTokenizer; \n \npublic class Main\n{\n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main (String[] args) \n\t{\n //code by sushant kumar\n FastReader in=new FastReader();\n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(int i=0;i<n;i++)\n {\n arr[i]=in.nextInt();\n\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<=k-1;i++)\n {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}", "import java.util.*;", "util.*", "java", "import java.util.Scanner;", "Scanner", "java.util", "import java.io.*;", "io.*", "java", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main\n{\n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main (String[] args) \n\t{\n //code by sushant kumar\n FastReader in=new FastReader();\n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(int i=0;i<n;i++)\n {\n arr[i]=in.nextInt();\n\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<=k-1;i++)\n {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main (String[] args) \n\t{\n //code by sushant kumar\n FastReader in=new FastReader();\n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(int i=0;i<n;i++)\n {\n arr[i]=in.nextInt();\n\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<=k-1;i++)\n {\n sum+=arr[i];\n }\n System.out.println(sum);\n }", "main", "{\n //code by sushant kumar\n FastReader in=new FastReader();\n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(int i=0;i<n;i++)\n {\n arr[i]=in.nextInt();\n\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<=k-1;i++)\n {\n sum+=arr[i];\n }\n System.out.println(sum);\n }", "FastReader in=new FastReader();", "in", "new FastReader()", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int k=in.nextInt();", "k", "in.nextInt()", "in.nextInt", "in", "int arr[]=new int[n];", "arr", "new int[n]", "n", "for(int i=0;i<n;i++)\n {\n arr[i]=in.nextInt();\n\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n arr[i]=in.nextInt();\n\n }", "{\n arr[i]=in.nextInt();\n\n }", "arr[i]=in.nextInt()", "arr[i]", "arr", "i", "in.nextInt()", "in.nextInt", "in", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int sum=0;", "sum", "0", "for(int i=0;i<=k-1;i++)\n {\n sum+=arr[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<=k-1", "i", "k-1", "k", "1", "i++", "i++", "i", "{\n sum+=arr[i];\n }", "{\n sum+=arr[i];\n }", "sum+=arr[i]", "sum", "arr[i]", "arr", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }", "FastReader", "{ \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }", "br = new BufferedReader(new\n InputStreamReader(System.in))", "br", "new BufferedReader(new\n InputStreamReader(System.in))", "String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }", "next", "{ \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }", "while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{ \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n }", "try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n }", "catch (IOException e) \n { \n e.printStackTrace(); \n }", "IOException e", "{ \n e.printStackTrace(); \n }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n st = new StringTokenizer(br.readLine()); \n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() \n { \n return Integer.parseInt(next()); \n }", "nextInt", "{ \n return Integer.parseInt(next()); \n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() \n { \n return Long.parseLong(next()); \n }", "nextLong", "{ \n return Long.parseLong(next()); \n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() \n { \n return Double.parseDouble(next()); \n }", "nextDouble", "{ \n return Double.parseDouble(next()); \n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n }", "nextLine", "{ \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n }", "String str = \"\";", "str", "\"\"", "try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n }", "catch (IOException e) \n { \n e.printStackTrace(); \n }", "IOException e", "{ \n e.printStackTrace(); \n }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n str = br.readLine(); \n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main\n{\n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main (String[] args) \n\t{\n //code by sushant kumar\n FastReader in=new FastReader();\n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(int i=0;i<n;i++)\n {\n arr[i]=in.nextInt();\n\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<=k-1;i++)\n {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}", "public class Main\n{\n static class FastReader \n { \n BufferedReader br; \n StringTokenizer st; \n \n public FastReader() \n { \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next() \n { \n while (st == null || !st.hasMoreElements()) \n { \n try\n { \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt() \n { \n return Integer.parseInt(next()); \n } \n \n long nextLong() \n { \n return Long.parseLong(next()); \n } \n \n double nextDouble() \n { \n return Double.parseDouble(next()); \n } \n \n String nextLine() \n { \n String str = \"\"; \n try\n { \n str = br.readLine(); \n } \n catch (IOException e) \n { \n e.printStackTrace(); \n } \n return str; \n } \n } \n public static void main (String[] args) \n\t{\n //code by sushant kumar\n FastReader in=new FastReader();\n int n=in.nextInt();\n int k=in.nextInt();\n int arr[]=new int[n];\n for(int i=0;i<n;i++)\n {\n arr[i]=in.nextInt();\n\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<=k-1;i++)\n {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.*; import java.util.Scanner; import java.io.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } public static void main (String[] args) { //code by sushant kumar FastReader in=new FastReader(); int n=in.nextInt(); int k=in.nextInt(); int arr[]=new int[n]; for(int i=0;i<n;i++) { arr[i]=in.nextInt(); } Arrays.sort(arr); int sum=0; for(int i=0;i<=k-1;i++) { sum+=arr[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 99, 23 ], [ 99, 24 ], [ 24, 25 ], [ 24, 26 ], [ 99, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 29, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 40, 41 ], [ 40, 42 ], [ 29, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 45, 47 ], [ 43, 48 ], [ 48, 49 ], [ 48, 50 ], [ 43, 51 ], [ 51, 52 ], [ 52, 53 ], [ 43, 54 ], [ 55, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 59, 60 ], [ 55, 61 ], [ 61, 62 ], [ 62, 63 ], [ 61, 64 ], [ 29, 65 ], [ 65, 66 ], [ 66, 67 ], [ 65, 68 ], [ 29, 69 ], [ 69, 70 ], [ 69, 71 ], [ 29, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 72, 80 ], [ 80, 81 ], [ 81, 82 ], [ 72, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 86, 87 ], [ 87, 88 ], [ 86, 89 ], [ 29, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 90, 95 ], [ 27, 96 ], [ 96, 97 ], [ 0, 98 ], [ 98, 99 ], [ 98, 100 ] ]
[ "import java.lang.reflect.Array;\nimport java.math.BigInteger;\nimport java.nio.Buffer;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\nimport java.util.Vector;\n\npublic class Main {\n public static Scanner r=new Scanner(System.in);\n public static void main(String[] args) {\n int n=r.nextInt();\n int k=r.nextInt();\n ArrayList<Integer> p=new ArrayList<>();\n for(int i=0;i<n;++i){\n int x=r.nextInt();\n p.add(x);\n }\n Collections.sort(p);\n int ans=0;\n for(int i=0;i<k;++i) ans+=p.get(i);\n System.out.println(ans);\n }\n}", "import java.lang.reflect.Array;", "Array", "java.lang.reflect", "import java.math.BigInteger;", "BigInteger", "java.math", "import java.nio.Buffer;", "Buffer", "java.nio", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.Vector;", "Vector", "java.util", "public class Main {\n public static Scanner r=new Scanner(System.in);\n public static void main(String[] args) {\n int n=r.nextInt();\n int k=r.nextInt();\n ArrayList<Integer> p=new ArrayList<>();\n for(int i=0;i<n;++i){\n int x=r.nextInt();\n p.add(x);\n }\n Collections.sort(p);\n int ans=0;\n for(int i=0;i<k;++i) ans+=p.get(i);\n System.out.println(ans);\n }\n}", "Main", "public static Scanner r=new Scanner(System.in);", "r", "new Scanner(System.in)", "public static void main(String[] args) {\n int n=r.nextInt();\n int k=r.nextInt();\n ArrayList<Integer> p=new ArrayList<>();\n for(int i=0;i<n;++i){\n int x=r.nextInt();\n p.add(x);\n }\n Collections.sort(p);\n int ans=0;\n for(int i=0;i<k;++i) ans+=p.get(i);\n System.out.println(ans);\n }", "main", "{\n int n=r.nextInt();\n int k=r.nextInt();\n ArrayList<Integer> p=new ArrayList<>();\n for(int i=0;i<n;++i){\n int x=r.nextInt();\n p.add(x);\n }\n Collections.sort(p);\n int ans=0;\n for(int i=0;i<k;++i) ans+=p.get(i);\n System.out.println(ans);\n }", "int n=r.nextInt();", "n", "r.nextInt()", "r.nextInt", "r", "int k=r.nextInt();", "k", "r.nextInt()", "r.nextInt", "r", "ArrayList<Integer> p=new ArrayList<>();", "p", "new ArrayList<>()", "for(int i=0;i<n;++i){\n int x=r.nextInt();\n p.add(x);\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "++i", "++i", "i", "{\n int x=r.nextInt();\n p.add(x);\n }", "{\n int x=r.nextInt();\n p.add(x);\n }", "int x=r.nextInt();", "x", "r.nextInt()", "r.nextInt", "r", "p.add(x)", "p.add", "p", "x", "Collections.sort(p)", "Collections.sort", "Collections", "p", "int ans=0;", "ans", "0", "for(int i=0;i<k;++i) ans+=p.get(i);", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "++i", "++i", "i", "ans+=p.get(i);", "ans+=p.get(i)", "ans", "p.get(i)", "p.get", "p", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n public static Scanner r=new Scanner(System.in);\n public static void main(String[] args) {\n int n=r.nextInt();\n int k=r.nextInt();\n ArrayList<Integer> p=new ArrayList<>();\n for(int i=0;i<n;++i){\n int x=r.nextInt();\n p.add(x);\n }\n Collections.sort(p);\n int ans=0;\n for(int i=0;i<k;++i) ans+=p.get(i);\n System.out.println(ans);\n }\n}", "public class Main {\n public static Scanner r=new Scanner(System.in);\n public static void main(String[] args) {\n int n=r.nextInt();\n int k=r.nextInt();\n ArrayList<Integer> p=new ArrayList<>();\n for(int i=0;i<n;++i){\n int x=r.nextInt();\n p.add(x);\n }\n Collections.sort(p);\n int ans=0;\n for(int i=0;i<k;++i) ans+=p.get(i);\n System.out.println(ans);\n }\n}", "Main" ]
import java.lang.reflect.Array; import java.math.BigInteger; import java.nio.Buffer; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; import java.util.Vector; public class Main { public static Scanner r=new Scanner(System.in); public static void main(String[] args) { int n=r.nextInt(); int k=r.nextInt(); ArrayList<Integer> p=new ArrayList<>(); for(int i=0;i<n;++i){ int x=r.nextInt(); p.add(x); } Collections.sort(p); int ans=0; for(int i=0;i<k;++i) ans+=p.get(i); System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 91, 11 ], [ 91, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 47, 48 ], [ 43, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 14, 53 ], [ 53, 54 ], [ 54, 55 ], [ 53, 56 ], [ 14, 57 ], [ 57, 58 ], [ 57, 59 ], [ 14, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 60, 65 ], [ 65, 66 ], [ 65, 67 ], [ 60, 68 ], [ 68, 69 ], [ 69, 70 ], [ 60, 71 ], [ 72, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 76, 77 ], [ 75, 78 ], [ 14, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 14, 85 ], [ 85, 86 ], [ 86, 87 ], [ 12, 88 ], [ 88, 89 ], [ 0, 90 ], [ 90, 91 ], [ 90, 92 ] ]
[ "import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<>();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<>();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<>();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<>();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "ArrayList<Integer> list = new ArrayList<>();", "list", "new ArrayList<>()", "for (int i = 0; i < n; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}", "{\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}", "int p = sc.nextInt();", "p", "sc.nextInt()", "sc.nextInt", "sc", "list.add(p)", "list.add", "list", "p", "Collections.sort(list)", "Collections.sort", "Collections", "list", "int sum = 0;", "sum", "0", "for (int i = 0; i < k; i++) {\n\t\t\tsum += list.get(i);\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n\t\t\tsum += list.get(i);\n\t\t}", "{\n\t\t\tsum += list.get(i);\n\t\t}", "sum += list.get(i)", "sum", "list.get(i)", "list.get", "list", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<>();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<>();\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tlist.add(p);\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(sum);\n\n\t\tsc.close();\n\t}\n}", "Main" ]
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); ArrayList<Integer> list = new ArrayList<>(); for (int i = 0; i < n; i++) { int p = sc.nextInt(); list.add(p); } Collections.sort(list); int sum = 0; for (int i = 0; i < k; i++) { sum += list.get(i); } System.out.println(sum); sc.close(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 11, 1, 41, 13, 2, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 2, 13, 17, 18, 13, 13, 30, 41, 13, 18, 13, 2, 13, 17, 0, 18, 13, 2, 13, 17, 18, 13, 13, 0, 18, 13, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 138, 5 ], [ 138, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 8, 26 ], [ 26, 27 ], [ 26, 28 ], [ 8, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 56, 58 ], [ 49, 59 ], [ 59, 60 ], [ 60, 61 ], [ 49, 62 ], [ 63, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 64, 71 ], [ 71, 72 ], [ 71, 73 ], [ 64, 74 ], [ 74, 75 ], [ 75, 76 ], [ 64, 77 ], [ 78, 78 ], [ 78, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 83, 84 ], [ 83, 85 ], [ 80, 86 ], [ 86, 87 ], [ 86, 88 ], [ 79, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 92, 94 ], [ 94, 95 ], [ 94, 96 ], [ 89, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 100, 101 ], [ 100, 102 ], [ 97, 103 ], [ 103, 104 ], [ 103, 105 ], [ 89, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 106, 110 ], [ 8, 111 ], [ 111, 112 ], [ 112, 113 ], [ 113, 114 ], [ 113, 115 ], [ 111, 116 ], [ 116, 117 ], [ 116, 118 ], [ 111, 119 ], [ 119, 120 ], [ 120, 121 ], [ 111, 122 ], [ 123, 123 ], [ 123, 124 ], [ 124, 125 ], [ 124, 126 ], [ 126, 127 ], [ 126, 128 ], [ 8, 129 ], [ 129, 130 ], [ 130, 131 ], [ 131, 132 ], [ 131, 133 ], [ 129, 134 ], [ 6, 135 ], [ 135, 136 ], [ 0, 137 ], [ 137, 138 ], [ 137, 139 ] ]
[ "import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();\n int[] b = new int[a];\n int c = sc.nextInt();\n int d = 0;\n for(int i = 0; i < a; i++){\n \tb[i] = sc.nextInt();\n }\n for (int i = 0; i < a- 1; i++) {\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }\n for(int i = 0; i < c; i++){\n \td += b[i];\n }\n \n System.out.println(d);\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();\n int[] b = new int[a];\n int c = sc.nextInt();\n int d = 0;\n for(int i = 0; i < a; i++){\n \tb[i] = sc.nextInt();\n }\n for (int i = 0; i < a- 1; i++) {\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }\n for(int i = 0; i < c; i++){\n \td += b[i];\n }\n \n System.out.println(d);\n\t}\n}", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();\n int[] b = new int[a];\n int c = sc.nextInt();\n int d = 0;\n for(int i = 0; i < a; i++){\n \tb[i] = sc.nextInt();\n }\n for (int i = 0; i < a- 1; i++) {\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }\n for(int i = 0; i < c; i++){\n \td += b[i];\n }\n \n System.out.println(d);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();\n int[] b = new int[a];\n int c = sc.nextInt();\n int d = 0;\n for(int i = 0; i < a; i++){\n \tb[i] = sc.nextInt();\n }\n for (int i = 0; i < a- 1; i++) {\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }\n for(int i = 0; i < c; i++){\n \td += b[i];\n }\n \n System.out.println(d);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int a = sc.nextInt();", "a", "sc.nextInt()", "sc.nextInt", "sc", "int[] b = new int[a];", "b", "new int[a]", "a", "int c = sc.nextInt();", "c", "sc.nextInt()", "sc.nextInt", "sc", "int d = 0;", "d", "0", "for(int i = 0; i < a; i++){\n \tb[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < a", "i", "a", "i++", "i++", "i", "{\n \tb[i] = sc.nextInt();\n }", "{\n \tb[i] = sc.nextInt();\n }", "b[i] = sc.nextInt()", "b[i]", "b", "i", "sc.nextInt()", "sc.nextInt", "sc", "for (int i = 0; i < a- 1; i++) {\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }", "int i = 0;", "int i = 0;", "i", "0", "i < a- 1", "i", "a- 1", "a", "1", "i++", "i++", "i", "{\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }", "{\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }", "for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }", "int j = a - 1;", "int j = a - 1;", "j", "a - 1", "a", "1", "j > i", "j", "i", "j--", "j--", "j", "{\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }", "{\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }", "if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }", "b[j - 1] > b[j]", "b[j - 1]", "b", "j - 1", "j", "1", "b[j]", "b", "j", "{\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }", "int tmp = b[j - 1];", "tmp", "b[j - 1]", "b", "j - 1", "j", "1", "b[j - 1] = b[j]", "b[j - 1]", "b", "j - 1", "j", "1", "b[j]", "b", "j", "b[j] = tmp", "b[j]", "b", "j", "tmp", "for(int i = 0; i < c; i++){\n \td += b[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < c", "i", "c", "i++", "i++", "i", "{\n \td += b[i];\n }", "{\n \td += b[i];\n }", "d += b[i]", "d", "b[i]", "b", "i", "System.out.println(d)", "System.out.println", "System.out", "System", "System.out", "d", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();\n int[] b = new int[a];\n int c = sc.nextInt();\n int d = 0;\n for(int i = 0; i < a; i++){\n \tb[i] = sc.nextInt();\n }\n for (int i = 0; i < a- 1; i++) {\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }\n for(int i = 0; i < c; i++){\n \td += b[i];\n }\n \n System.out.println(d);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();\n int[] b = new int[a];\n int c = sc.nextInt();\n int d = 0;\n for(int i = 0; i < a; i++){\n \tb[i] = sc.nextInt();\n }\n for (int i = 0; i < a- 1; i++) {\n for (int j = a - 1; j > i; j--) {\n if (b[j - 1] > b[j]) {\n // 入れ替え\n int tmp = b[j - 1];\n b[j - 1] = b[j];\n b[j] = tmp;\n }\n }\n }\n for(int i = 0; i < c; i++){\n \td += b[i];\n }\n \n System.out.println(d);\n\t}\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int a = sc.nextInt(); int[] b = new int[a]; int c = sc.nextInt(); int d = 0; for(int i = 0; i < a; i++){ b[i] = sc.nextInt(); } for (int i = 0; i < a- 1; i++) { for (int j = a - 1; j > i; j--) { if (b[j - 1] > b[j]) { // 入れ替え int tmp = b[j - 1]; b[j - 1] = b[j]; b[j] = tmp; } } } for(int i = 0; i < c; i++){ d += b[i]; } System.out.println(d); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 83, 5 ], [ 83, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 8, 53 ], [ 53, 54 ], [ 53, 55 ], [ 8, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 8, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 6, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] values = new int[N];\n for (int i = 0; i < N; i++) {\n values[i] = sc.nextInt();\n }\n sc.close();\n\n Arrays.sort(values);\n int allValues = 0;\n for (int i = 0; i < K; i++) {\n allValues += values[i];\n }\n System.out.println(allValues);\n\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] values = new int[N];\n for (int i = 0; i < N; i++) {\n values[i] = sc.nextInt();\n }\n sc.close();\n\n Arrays.sort(values);\n int allValues = 0;\n for (int i = 0; i < K; i++) {\n allValues += values[i];\n }\n System.out.println(allValues);\n\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] values = new int[N];\n for (int i = 0; i < N; i++) {\n values[i] = sc.nextInt();\n }\n sc.close();\n\n Arrays.sort(values);\n int allValues = 0;\n for (int i = 0; i < K; i++) {\n allValues += values[i];\n }\n System.out.println(allValues);\n\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] values = new int[N];\n for (int i = 0; i < N; i++) {\n values[i] = sc.nextInt();\n }\n sc.close();\n\n Arrays.sort(values);\n int allValues = 0;\n for (int i = 0; i < K; i++) {\n allValues += values[i];\n }\n System.out.println(allValues);\n\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] values = new int[N];", "values", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n values[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n values[i] = sc.nextInt();\n }", "{\n values[i] = sc.nextInt();\n }", "values[i] = sc.nextInt()", "values[i]", "values", "i", "sc.nextInt()", "sc.nextInt", "sc", "sc.close()", "sc.close", "sc", "Arrays.sort(values)", "Arrays.sort", "Arrays", "values", "int allValues = 0;", "allValues", "0", "for (int i = 0; i < K; i++) {\n allValues += values[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n allValues += values[i];\n }", "{\n allValues += values[i];\n }", "allValues += values[i]", "allValues", "values[i]", "values", "i", "System.out.println(allValues)", "System.out.println", "System.out", "System", "System.out", "allValues", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] values = new int[N];\n for (int i = 0; i < N; i++) {\n values[i] = sc.nextInt();\n }\n sc.close();\n\n Arrays.sort(values);\n int allValues = 0;\n for (int i = 0; i < K; i++) {\n allValues += values[i];\n }\n System.out.println(allValues);\n\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] values = new int[N];\n for (int i = 0; i < N; i++) {\n values[i] = sc.nextInt();\n }\n sc.close();\n\n Arrays.sort(values);\n int allValues = 0;\n for (int i = 0; i < K; i++) {\n allValues += values[i];\n }\n System.out.println(allValues);\n\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] values = new int[N]; for (int i = 0; i < N; i++) { values[i] = sc.nextInt(); } sc.close(); Arrays.sort(values); int allValues = 0; for (int i = 0; i < K; i++) { allValues += values[i]; } System.out.println(allValues); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 83, 8 ], [ 83, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 9, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.Scanner;\nimport java.util.Arrays;\n \npublic class Main {\n \n\t\tpublic static void main(String[] args) {\n\t Scanner sc = new Scanner(System.in);\n\t int n = sc.nextInt();\n\t int k = sc.nextInt();\n\t\t\tint[] strs = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) { \n\t\t\t\tstrs[i] = sc.nextInt(); \n }\n\t Arrays.sort(strs);\n\t\t\tint min = 0;\n\t for(int j = 0; j < k;j++){\n \tmin += strs[j]; \n }\n\t\t\tSystem.out.println(min);\n\t}\n}", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "public class Main {\n \n\t\tpublic static void main(String[] args) {\n\t Scanner sc = new Scanner(System.in);\n\t int n = sc.nextInt();\n\t int k = sc.nextInt();\n\t\t\tint[] strs = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) { \n\t\t\t\tstrs[i] = sc.nextInt(); \n }\n\t Arrays.sort(strs);\n\t\t\tint min = 0;\n\t for(int j = 0; j < k;j++){\n \tmin += strs[j]; \n }\n\t\t\tSystem.out.println(min);\n\t}\n}", "Main", "public static void main(String[] args) {\n\t Scanner sc = new Scanner(System.in);\n\t int n = sc.nextInt();\n\t int k = sc.nextInt();\n\t\t\tint[] strs = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) { \n\t\t\t\tstrs[i] = sc.nextInt(); \n }\n\t Arrays.sort(strs);\n\t\t\tint min = 0;\n\t for(int j = 0; j < k;j++){\n \tmin += strs[j]; \n }\n\t\t\tSystem.out.println(min);\n\t}", "main", "{\n\t Scanner sc = new Scanner(System.in);\n\t int n = sc.nextInt();\n\t int k = sc.nextInt();\n\t\t\tint[] strs = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) { \n\t\t\t\tstrs[i] = sc.nextInt(); \n }\n\t Arrays.sort(strs);\n\t\t\tint min = 0;\n\t for(int j = 0; j < k;j++){\n \tmin += strs[j]; \n }\n\t\t\tSystem.out.println(min);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] strs = new int[n];", "strs", "new int[n]", "n", "for (int i = 0; i < n; i++) { \n\t\t\t\tstrs[i] = sc.nextInt(); \n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{ \n\t\t\t\tstrs[i] = sc.nextInt(); \n }", "{ \n\t\t\t\tstrs[i] = sc.nextInt(); \n }", "strs[i] = sc.nextInt()", "strs[i]", "strs", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(strs)", "Arrays.sort", "Arrays", "strs", "int min = 0;", "min", "0", "for(int j = 0; j < k;j++){\n \tmin += strs[j]; \n }", "int j = 0;", "int j = 0;", "j", "0", "j < k", "j", "k", "j++", "j++", "j", "{\n \tmin += strs[j]; \n }", "{\n \tmin += strs[j]; \n }", "min += strs[j]", "min", "strs[j]", "strs", "j", "System.out.println(min)", "System.out.println", "System.out", "System", "System.out", "min", "String[] args", "args", "public class Main {\n \n\t\tpublic static void main(String[] args) {\n\t Scanner sc = new Scanner(System.in);\n\t int n = sc.nextInt();\n\t int k = sc.nextInt();\n\t\t\tint[] strs = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) { \n\t\t\t\tstrs[i] = sc.nextInt(); \n }\n\t Arrays.sort(strs);\n\t\t\tint min = 0;\n\t for(int j = 0; j < k;j++){\n \tmin += strs[j]; \n }\n\t\t\tSystem.out.println(min);\n\t}\n}", "public class Main {\n \n\t\tpublic static void main(String[] args) {\n\t Scanner sc = new Scanner(System.in);\n\t int n = sc.nextInt();\n\t int k = sc.nextInt();\n\t\t\tint[] strs = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) { \n\t\t\t\tstrs[i] = sc.nextInt(); \n }\n\t Arrays.sort(strs);\n\t\t\tint min = 0;\n\t for(int j = 0; j < k;j++){\n \tmin += strs[j]; \n }\n\t\t\tSystem.out.println(min);\n\t}\n}", "Main" ]
import java.util.Scanner; import java.util.Arrays; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] strs = new int[n]; for (int i = 0; i < n; i++) { strs[i] = sc.nextInt(); } Arrays.sort(strs); int min = 0; for(int j = 0; j < k;j++){ min += strs[j]; } System.out.println(min); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 17, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 29, 30 ], [ 17, 31 ], [ 31, 32 ], [ 31, 33 ], [ 17, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 35, 40 ], [ 40, 41 ], [ 40, 42 ], [ 35, 43 ], [ 43, 44 ], [ 44, 45 ], [ 35, 46 ], [ 47, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 52, 53 ], [ 53, 54 ], [ 17, 55 ], [ 55, 56 ], [ 56, 57 ], [ 55, 58 ], [ 17, 59 ], [ 59, 60 ], [ 59, 61 ], [ 17, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 62, 67 ], [ 67, 68 ], [ 67, 69 ], [ 62, 70 ], [ 70, 71 ], [ 71, 72 ], [ 62, 73 ], [ 74, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 77, 78 ], [ 77, 79 ], [ 17, 80 ], [ 80, 81 ], [ 81, 82 ], [ 82, 83 ], [ 82, 84 ], [ 80, 85 ], [ 15, 86 ], [ 86, 87 ], [ 13, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 88, 92 ], [ 92, 93 ], [ 88, 94 ], [ 94, 95 ], [ 94, 96 ], [ 96, 97 ], [ 97, 98 ], [ 97, 99 ], [ 88, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 103, 104 ], [ 104, 105 ], [ 105, 106 ], [ 105, 107 ], [ 104, 108 ], [ 108, 109 ], [ 109, 110 ], [ 110, 111 ], [ 103, 112 ], [ 112, 113 ], [ 113, 114 ], [ 114, 115 ], [ 114, 116 ], [ 116, 117 ], [ 117, 118 ], [ 118, 119 ], [ 113, 120 ], [ 120, 121 ], [ 121, 122 ], [ 121, 123 ], [ 102, 124 ], [ 124, 125 ], [ 125, 126 ], [ 126, 127 ], [ 88, 128 ], [ 128, 129 ], [ 128, 130 ], [ 130, 131 ], [ 131, 132 ], [ 132, 133 ], [ 133, 134 ], [ 132, 135 ], [ 135, 136 ], [ 88, 137 ], [ 137, 138 ], [ 137, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 142, 143 ], [ 141, 144 ], [ 144, 145 ], [ 88, 146 ], [ 146, 147 ], [ 146, 148 ], [ 148, 149 ], [ 149, 150 ], [ 150, 151 ], [ 151, 152 ], [ 150, 153 ], [ 153, 154 ], [ 88, 155 ], [ 155, 156 ], [ 155, 157 ], [ 157, 158 ], [ 158, 159 ], [ 158, 160 ], [ 157, 161 ], [ 161, 162 ], [ 162, 163 ], [ 162, 164 ], [ 164, 165 ], [ 165, 166 ], [ 166, 167 ], [ 161, 168 ], [ 168, 169 ], [ 169, 170 ], [ 169, 171 ], [ 171, 172 ], [ 172, 173 ], [ 157, 174 ], [ 174, 175 ] ]
[ "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\nclass Main\n{\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static void main(String[] args)\n {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int k = sc.nextInt();\n int arr[] = new int[n];\n for(int i=0; i < n; i++){\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int ret = 0;\n for (int i = 0; i < k; i++) {\n ret += arr[i];\n }\n System.out.println(ret);\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.*;", "util.*", "java", "class Main\n{\n static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static void main(String[] args)\n {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int k = sc.nextInt();\n int arr[] = new int[n];\n for(int i=0; i < n; i++){\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int ret = 0;\n for (int i = 0; i < k; i++) {\n ret += arr[i];\n }\n System.out.println(ret);\n }\n}", "Main", "public static void main(String[] args)\n {\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int k = sc.nextInt();\n int arr[] = new int[n];\n for(int i=0; i < n; i++){\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int ret = 0;\n for (int i = 0; i < k; i++) {\n ret += arr[i];\n }\n System.out.println(ret);\n }", "main", "{\n FastReader sc = new FastReader();\n int n = sc.nextInt();\n int k = sc.nextInt();\n int arr[] = new int[n];\n for(int i=0; i < n; i++){\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int ret = 0;\n for (int i = 0; i < k; i++) {\n ret += arr[i];\n }\n System.out.println(ret);\n }", "FastReader sc = new FastReader();", "sc", "new FastReader()", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int arr[] = new int[n];", "arr", "new int[n]", "n", "for(int i=0; i < n; i++){\n arr[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n arr[i] = sc.nextInt();\n }", "{\n arr[i] = sc.nextInt();\n }", "arr[i] = sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int ret = 0;", "ret", "0", "for (int i = 0; i < k; i++) {\n ret += arr[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n ret += arr[i];\n }", "{\n ret += arr[i];\n }", "ret += arr[i]", "ret", "arr[i]", "arr", "i", "System.out.println(ret)", "System.out.println", "System.out", "System", "System.out", "ret", "String[] args", "args", "static class FastReader\n {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt()\n {\n return Integer.parseInt(next());\n }\n\n long nextLong()\n {\n return Long.parseLong(next());\n }\n\n double nextDouble()\n {\n return Double.parseDouble(next());\n }\n\n String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }\n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader()\n {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }", "FastReader", "{\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }", "br = new BufferedReader(new\n InputStreamReader(System.in))", "br", "new BufferedReader(new\n InputStreamReader(System.in))", "String next()\n {\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements())\n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }", "catch (IOException e)\n {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt()\n {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong()\n {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble()\n {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine()\n {\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }", "catch (IOException e)\n {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } public static void main(String[] args) { FastReader sc = new FastReader(); int n = sc.nextInt(); int k = sc.nextInt(); int arr[] = new int[n]; for(int i=0; i < n; i++){ arr[i] = sc.nextInt(); } Arrays.sort(arr); int ret = 0; for (int i = 0; i < k; i++) { ret += arr[i]; } System.out.println(ret); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 0, 18, 13, 13, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 83, 5 ], [ 83, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 26, 28 ], [ 8, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 44, 45 ], [ 45, 46 ], [ 41, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 47, 51 ], [ 8, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 8, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 8, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 6, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.*;\npublic class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int [] app = new int[N];\n int anc = 0;\n for(int i = 0;i < N;i++){\n int p = sc.nextInt();\n app[i] = p;\n }\n Arrays.sort(app);\n for(int i = 0;i < K;i++){\n anc += app[i];\n }\n System.out.println(anc);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int [] app = new int[N];\n int anc = 0;\n for(int i = 0;i < N;i++){\n int p = sc.nextInt();\n app[i] = p;\n }\n Arrays.sort(app);\n for(int i = 0;i < K;i++){\n anc += app[i];\n }\n System.out.println(anc);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int [] app = new int[N];\n int anc = 0;\n for(int i = 0;i < N;i++){\n int p = sc.nextInt();\n app[i] = p;\n }\n Arrays.sort(app);\n for(int i = 0;i < K;i++){\n anc += app[i];\n }\n System.out.println(anc);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int [] app = new int[N];\n int anc = 0;\n for(int i = 0;i < N;i++){\n int p = sc.nextInt();\n app[i] = p;\n }\n Arrays.sort(app);\n for(int i = 0;i < K;i++){\n anc += app[i];\n }\n System.out.println(anc);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int [] app = new int[N];", "app", "new int[N]", "N", "int anc = 0;", "anc", "0", "for(int i = 0;i < N;i++){\n int p = sc.nextInt();\n app[i] = p;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n int p = sc.nextInt();\n app[i] = p;\n }", "{\n int p = sc.nextInt();\n app[i] = p;\n }", "int p = sc.nextInt();", "p", "sc.nextInt()", "sc.nextInt", "sc", "app[i] = p", "app[i]", "app", "i", "p", "Arrays.sort(app)", "Arrays.sort", "Arrays", "app", "for(int i = 0;i < K;i++){\n anc += app[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n anc += app[i];\n }", "{\n anc += app[i];\n }", "anc += app[i]", "anc", "app[i]", "app", "i", "System.out.println(anc)", "System.out.println", "System.out", "System", "System.out", "anc", "String[] args", "args", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int [] app = new int[N];\n int anc = 0;\n for(int i = 0;i < N;i++){\n int p = sc.nextInt();\n app[i] = p;\n }\n Arrays.sort(app);\n for(int i = 0;i < K;i++){\n anc += app[i];\n }\n System.out.println(anc);\n }\n}", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int [] app = new int[N];\n int anc = 0;\n for(int i = 0;i < N;i++){\n int p = sc.nextInt();\n app[i] = p;\n }\n Arrays.sort(app);\n for(int i = 0;i < K;i++){\n anc += app[i];\n }\n System.out.println(anc);\n }\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int [] app = new int[N]; int anc = 0; for(int i = 0;i < N;i++){ int p = sc.nextInt(); app[i] = p; } Arrays.sort(app); for(int i = 0;i < K;i++){ anc += app[i]; } System.out.println(anc); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 25, 30 ], [ 30, 31 ], [ 30, 32 ], [ 25, 33 ], [ 33, 34 ], [ 34, 35 ], [ 25, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 37, 40 ], [ 40, 41 ], [ 41, 42 ], [ 8, 43 ], [ 43, 44 ], [ 44, 45 ], [ 43, 46 ], [ 8, 47 ], [ 47, 48 ], [ 47, 49 ], [ 8, 50 ], [ 50, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 50, 55 ], [ 55, 56 ], [ 55, 57 ], [ 50, 58 ], [ 58, 59 ], [ 59, 60 ], [ 50, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 64, 67 ], [ 8, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 68, 73 ], [ 6, 74 ], [ 74, 75 ] ]
[ "import java.util.*;\nclass Main{\n public static void main(String[] args){\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n int k=in.nextInt();\n ArrayList<Integer> arr=new ArrayList<Integer>(n);\n for(int i=0;i<n;i++)\n arr.add(in.nextInt());\n Collections.sort(arr);\n int ans=0;\n for(int i=0;i<k;i++)\n ans+=arr.get(i);\n System.out.println(ans);\n }\n}", "import java.util.*;", "util.*", "java", "class Main{\n public static void main(String[] args){\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n int k=in.nextInt();\n ArrayList<Integer> arr=new ArrayList<Integer>(n);\n for(int i=0;i<n;i++)\n arr.add(in.nextInt());\n Collections.sort(arr);\n int ans=0;\n for(int i=0;i<k;i++)\n ans+=arr.get(i);\n System.out.println(ans);\n }\n}", "Main", "public static void main(String[] args){\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n int k=in.nextInt();\n ArrayList<Integer> arr=new ArrayList<Integer>(n);\n for(int i=0;i<n;i++)\n arr.add(in.nextInt());\n Collections.sort(arr);\n int ans=0;\n for(int i=0;i<k;i++)\n ans+=arr.get(i);\n System.out.println(ans);\n }", "main", "{\n Scanner in=new Scanner(System.in);\n int n=in.nextInt();\n int k=in.nextInt();\n ArrayList<Integer> arr=new ArrayList<Integer>(n);\n for(int i=0;i<n;i++)\n arr.add(in.nextInt());\n Collections.sort(arr);\n int ans=0;\n for(int i=0;i<k;i++)\n ans+=arr.get(i);\n System.out.println(ans);\n }", "Scanner in=new Scanner(System.in);", "in", "new Scanner(System.in)", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int k=in.nextInt();", "k", "in.nextInt()", "in.nextInt", "in", "ArrayList<Integer> arr=new ArrayList<Integer>(n);", "arr", "new ArrayList<Integer>(n)", "for(int i=0;i<n;i++)\n arr.add(in.nextInt());", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "arr.add(in.nextInt());", "arr.add(in.nextInt())", "arr.add", "arr", "in.nextInt()", "in.nextInt", "in", "Collections.sort(arr)", "Collections.sort", "Collections", "arr", "int ans=0;", "ans", "0", "for(int i=0;i<k;i++)\n ans+=arr.get(i);", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "ans+=arr.get(i);", "ans+=arr.get(i)", "ans", "arr.get(i)", "arr.get", "arr", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args" ]
import java.util.*; class Main{ public static void main(String[] args){ Scanner in=new Scanner(System.in); int n=in.nextInt(); int k=in.nextInt(); ArrayList<Integer> arr=new ArrayList<Integer>(n); for(int i=0;i<n;i++) arr.add(in.nextInt()); Collections.sort(arr); int ans=0; for(int i=0;i<k;i++) ans+=arr.get(i); System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 8, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 6, 79 ], [ 79, 80 ] ]
[ "import java.util.*;\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n long ans =0;\n for(int i=0;i<k;i++){\n ans=ans+arr[i];\n }\n System.out.println(ans);\n }\n}", "import java.util.*;", "util.*", "java", "class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n long ans =0;\n for(int i=0;i<k;i++){\n ans=ans+arr[i];\n }\n System.out.println(ans);\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n long ans =0;\n for(int i=0;i<k;i++){\n ans=ans+arr[i];\n }\n System.out.println(ans);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n long ans =0;\n for(int i=0;i<k;i++){\n ans=ans+arr[i];\n }\n System.out.println(ans);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] arr = new int[n];", "arr", "new int[n]", "n", "for(int i=0;i<n;i++){\n arr[i]=sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n arr[i]=sc.nextInt();\n }", "{\n arr[i]=sc.nextInt();\n }", "arr[i]=sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "long ans =0;", "ans", "0", "for(int i=0;i<k;i++){\n ans=ans+arr[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n ans=ans+arr[i];\n }", "{\n ans=ans+arr[i];\n }", "ans=ans+arr[i]", "ans", "ans+arr[i]", "ans", "arr[i]", "arr", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args" ]
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] arr = new int[n]; for(int i=0;i<n;i++){ arr[i]=sc.nextInt(); } Arrays.sort(arr); long ans =0; for(int i=0;i<k;i++){ ans=ans+arr[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 20, 42, 4, 18, 13, 30, 4, 18, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 85, 14 ], [ 85, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 17, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 29, 30 ], [ 17, 31 ], [ 31, 32 ], [ 31, 33 ], [ 17, 34 ], [ 34, 35 ], [ 34, 36 ], [ 17, 37 ], [ 37, 38 ], [ 38, 39 ], [ 39, 40 ], [ 37, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 42, 45 ], [ 45, 46 ], [ 46, 47 ], [ 17, 48 ], [ 48, 49 ], [ 49, 50 ], [ 48, 51 ], [ 51, 52 ], [ 52, 53 ], [ 17, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 54, 59 ], [ 59, 60 ], [ 59, 61 ], [ 54, 62 ], [ 62, 63 ], [ 63, 64 ], [ 54, 65 ], [ 66, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 69, 70 ], [ 70, 71 ], [ 69, 72 ], [ 17, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 17, 79 ], [ 79, 80 ], [ 80, 81 ], [ 15, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.ArrayList;\nimport java.util.Comparator;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int sum = 0;\n List<Integer> prices = new ArrayList<Integer>();\n while (scanner.hasNext()){\n prices.add(scanner.nextInt());\n }\n prices.sort(Comparator.naturalOrder());\n for (int i = 0; i < K; i++) {\n sum += prices.get(i);\n }\n System.out.println(sum);\n\n\n\n scanner.close();\n }\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Comparator;", "Comparator", "java.util", "import java.util.List;", "List", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int sum = 0;\n List<Integer> prices = new ArrayList<Integer>();\n while (scanner.hasNext()){\n prices.add(scanner.nextInt());\n }\n prices.sort(Comparator.naturalOrder());\n for (int i = 0; i < K; i++) {\n sum += prices.get(i);\n }\n System.out.println(sum);\n\n\n\n scanner.close();\n }\n}", "Main", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int sum = 0;\n List<Integer> prices = new ArrayList<Integer>();\n while (scanner.hasNext()){\n prices.add(scanner.nextInt());\n }\n prices.sort(Comparator.naturalOrder());\n for (int i = 0; i < K; i++) {\n sum += prices.get(i);\n }\n System.out.println(sum);\n\n\n\n scanner.close();\n }", "main", "{\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int sum = 0;\n List<Integer> prices = new ArrayList<Integer>();\n while (scanner.hasNext()){\n prices.add(scanner.nextInt());\n }\n prices.sort(Comparator.naturalOrder());\n for (int i = 0; i < K; i++) {\n sum += prices.get(i);\n }\n System.out.println(sum);\n\n\n\n scanner.close();\n }", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "int N = scanner.nextInt();", "N", "scanner.nextInt()", "scanner.nextInt", "scanner", "int K = scanner.nextInt();", "K", "scanner.nextInt()", "scanner.nextInt", "scanner", "int sum = 0;", "sum", "0", "List<Integer> prices = new ArrayList<Integer>();", "prices", "new ArrayList<Integer>()", "while (scanner.hasNext()){\n prices.add(scanner.nextInt());\n }", "scanner.hasNext()", "scanner.hasNext", "scanner", "{\n prices.add(scanner.nextInt());\n }", "prices.add(scanner.nextInt())", "prices.add", "prices", "scanner.nextInt()", "scanner.nextInt", "scanner", "prices.sort(Comparator.naturalOrder())", "prices.sort", "prices", "Comparator.naturalOrder()", "Comparator.naturalOrder", "Comparator", "for (int i = 0; i < K; i++) {\n sum += prices.get(i);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sum += prices.get(i);\n }", "{\n sum += prices.get(i);\n }", "sum += prices.get(i)", "sum", "prices.get(i)", "prices.get", "prices", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "scanner.close()", "scanner.close", "scanner", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int sum = 0;\n List<Integer> prices = new ArrayList<Integer>();\n while (scanner.hasNext()){\n prices.add(scanner.nextInt());\n }\n prices.sort(Comparator.naturalOrder());\n for (int i = 0; i < K; i++) {\n sum += prices.get(i);\n }\n System.out.println(sum);\n\n\n\n scanner.close();\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int sum = 0;\n List<Integer> prices = new ArrayList<Integer>();\n while (scanner.hasNext()){\n prices.add(scanner.nextInt());\n }\n prices.sort(Comparator.naturalOrder());\n for (int i = 0; i < K; i++) {\n sum += prices.get(i);\n }\n System.out.println(sum);\n\n\n\n scanner.close();\n }\n}", "Main" ]
import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int K = scanner.nextInt(); int sum = 0; List<Integer> prices = new ArrayList<Integer>(); while (scanner.hasNext()){ prices.add(scanner.nextInt()); } prices.sort(Comparator.naturalOrder()); for (int i = 0; i < K; i++) { sum += prices.get(i); } System.out.println(sum); scanner.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 85, 8 ], [ 85, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 11, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 9, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.*; \nimport java.lang.*; \n\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n int K = scan.nextInt();\n \n int[] ans = new int[N];\n \n for(int i=0; i<N; i++){\n ans[i] = scan.nextInt();\n }\n Arrays.sort(ans);\n \n int answer = 0;\n for(int i=0; i<K; i++){\n answer = answer + ans[i];\n }\n \n System.out.println(answer);\n }\n \n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n int K = scan.nextInt();\n \n int[] ans = new int[N];\n \n for(int i=0; i<N; i++){\n ans[i] = scan.nextInt();\n }\n Arrays.sort(ans);\n \n int answer = 0;\n for(int i=0; i<K; i++){\n answer = answer + ans[i];\n }\n \n System.out.println(answer);\n }\n \n}", "Main", "public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n int K = scan.nextInt();\n \n int[] ans = new int[N];\n \n for(int i=0; i<N; i++){\n ans[i] = scan.nextInt();\n }\n Arrays.sort(ans);\n \n int answer = 0;\n for(int i=0; i<K; i++){\n answer = answer + ans[i];\n }\n \n System.out.println(answer);\n }", "main", "{\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n int K = scan.nextInt();\n \n int[] ans = new int[N];\n \n for(int i=0; i<N; i++){\n ans[i] = scan.nextInt();\n }\n Arrays.sort(ans);\n \n int answer = 0;\n for(int i=0; i<K; i++){\n answer = answer + ans[i];\n }\n \n System.out.println(answer);\n }", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int N = scan.nextInt();", "N", "scan.nextInt()", "scan.nextInt", "scan", "int K = scan.nextInt();", "K", "scan.nextInt()", "scan.nextInt", "scan", "int[] ans = new int[N];", "ans", "new int[N]", "N", "for(int i=0; i<N; i++){\n ans[i] = scan.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n ans[i] = scan.nextInt();\n }", "{\n ans[i] = scan.nextInt();\n }", "ans[i] = scan.nextInt()", "ans[i]", "ans", "i", "scan.nextInt()", "scan.nextInt", "scan", "Arrays.sort(ans)", "Arrays.sort", "Arrays", "ans", "int answer = 0;", "answer", "0", "for(int i=0; i<K; i++){\n answer = answer + ans[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n answer = answer + ans[i];\n }", "{\n answer = answer + ans[i];\n }", "answer = answer + ans[i]", "answer", "answer + ans[i]", "answer", "ans[i]", "ans", "i", "System.out.println(answer)", "System.out.println", "System.out", "System", "System.out", "answer", "String[] args", "args", "public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n int K = scan.nextInt();\n \n int[] ans = new int[N];\n \n for(int i=0; i<N; i++){\n ans[i] = scan.nextInt();\n }\n Arrays.sort(ans);\n \n int answer = 0;\n for(int i=0; i<K; i++){\n answer = answer + ans[i];\n }\n \n System.out.println(answer);\n }\n \n}", "public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n \n int N = scan.nextInt();\n int K = scan.nextInt();\n \n int[] ans = new int[N];\n \n for(int i=0; i<N; i++){\n ans[i] = scan.nextInt();\n }\n Arrays.sort(ans);\n \n int answer = 0;\n for(int i=0; i<K; i++){\n answer = answer + ans[i];\n }\n \n System.out.println(answer);\n }\n \n}", "Main" ]
import java.util.*; import java.lang.*; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int K = scan.nextInt(); int[] ans = new int[N]; for(int i=0; i<N; i++){ ans[i] = scan.nextInt(); } Arrays.sort(ans); int answer = 0; for(int i=0; i<K; i++){ answer = answer + ans[i]; } System.out.println(answer); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 38, 5, 13, 30, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 88, 8 ], [ 88, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 13, 14 ], [ 13, 15 ], [ 12, 16 ], [ 16, 17 ], [ 17, 18 ], [ 17, 19 ], [ 16, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 16, 25 ], [ 25, 26 ], [ 25, 27 ], [ 27, 28 ], [ 28, 29 ], [ 16, 30 ], [ 30, 31 ], [ 30, 32 ], [ 16, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 34, 39 ], [ 39, 40 ], [ 39, 41 ], [ 34, 42 ], [ 42, 43 ], [ 43, 44 ], [ 34, 45 ], [ 46, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 47, 51 ], [ 51, 52 ], [ 52, 53 ], [ 16, 54 ], [ 54, 55 ], [ 55, 56 ], [ 54, 57 ], [ 16, 58 ], [ 58, 59 ], [ 58, 60 ], [ 16, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 61, 66 ], [ 66, 67 ], [ 66, 68 ], [ 61, 69 ], [ 69, 70 ], [ 70, 71 ], [ 61, 72 ], [ 73, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 16, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 9, 85 ], [ 85, 86 ], [ 0, 87 ], [ 87, 88 ], [ 87, 89 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "main", "{\n\t\t// TODO Auto-generated method stub\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "try (Scanner sc = new Scanner(System.in)) {\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}", "catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}", "Exception e", "{\n\t\t\t// TODO: handle exception\n\t\t}", "{\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t}", "Scanner sc = new Scanner(System.in)", "Scanner sc = new Scanner(System.in)", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] f = new int[n];", "f", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}", "{\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}", "f[i] = sc.nextInt()", "f[i]", "f", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(f)", "Arrays.sort", "Arrays", "f", "int ans = 0;", "ans", "0", "for (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n\t\t\t\tans += f[i];\n\t\t\t}", "{\n\t\t\t\tans += f[i];\n\t\t\t}", "ans += f[i]", "ans", "f[i]", "f", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\ttry (Scanner sc = new Scanner(System.in)) {\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\n\t\t\tint[] f = new int[n];\n\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tf[i] = sc.nextInt();\n\t\t\t}\n\n\t\t\tArrays.sort(f);\n\t\t\t\n\t\t\tint ans = 0;\n\n\t\t\tfor (int i = 0; i < k; i++) {\n\t\t\t\tans += f[i];\n\t\t\t}\n\n\t\t\tSystem.out.println(ans);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub try (Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); int k = sc.nextInt(); int[] f = new int[n]; for (int i = 0; i < n; i++) { f[i] = sc.nextInt(); } Arrays.sort(f); int ans = 0; for (int i = 0; i < k; i++) { ans += f[i]; } System.out.println(ans); } catch (Exception e) { // TODO: handle exception } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 91, 11 ], [ 91, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 47, 48 ], [ 43, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 14, 53 ], [ 53, 54 ], [ 54, 55 ], [ 14, 56 ], [ 56, 57 ], [ 57, 58 ], [ 56, 59 ], [ 14, 60 ], [ 60, 61 ], [ 60, 62 ], [ 14, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 63, 68 ], [ 68, 69 ], [ 68, 70 ], [ 63, 71 ], [ 71, 72 ], [ 72, 73 ], [ 63, 74 ], [ 75, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 78, 81 ], [ 14, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 82, 87 ], [ 12, 88 ], [ 88, 89 ], [ 0, 90 ], [ 90, 91 ], [ 90, 92 ] ]
[ "import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t//数取得\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<>();\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}\n\n\t\tsc.close();\n\n\t\tCollections.sort(priceList);\n\n\t\tint answer = 0;\n\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tanswer += priceList.get(i);\n\t\t}\n\n\t\tSystem.out.println(answer);\n\n\t}\n\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t//数取得\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<>();\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}\n\n\t\tsc.close();\n\n\t\tCollections.sort(priceList);\n\n\t\tint answer = 0;\n\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tanswer += priceList.get(i);\n\t\t}\n\n\t\tSystem.out.println(answer);\n\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t//数取得\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<>();\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}\n\n\t\tsc.close();\n\n\t\tCollections.sort(priceList);\n\n\t\tint answer = 0;\n\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tanswer += priceList.get(i);\n\t\t}\n\n\t\tSystem.out.println(answer);\n\n\t}", "main", "{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t//数取得\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<>();\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}\n\n\t\tsc.close();\n\n\t\tCollections.sort(priceList);\n\n\t\tint answer = 0;\n\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tanswer += priceList.get(i);\n\t\t}\n\n\t\tSystem.out.println(answer);\n\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "ArrayList<Integer> priceList = new ArrayList<>();", "priceList", "new ArrayList<>()", "for(int i = 0; i < N; i++) {\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}", "{\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}", "int num = sc.nextInt();", "num", "sc.nextInt()", "sc.nextInt", "sc", "priceList.add(num)", "priceList.add", "priceList", "num", "sc.close()", "sc.close", "sc", "Collections.sort(priceList)", "Collections.sort", "Collections", "priceList", "int answer = 0;", "answer", "0", "for(int i = 0; i < K; i++) {\n\t\t\tanswer += priceList.get(i);\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n\t\t\tanswer += priceList.get(i);\n\t\t}", "{\n\t\t\tanswer += priceList.get(i);\n\t\t}", "answer += priceList.get(i)", "answer", "priceList.get(i)", "priceList.get", "priceList", "i", "System.out.println(answer)", "System.out.println", "System.out", "System", "System.out", "answer", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t//数取得\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<>();\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}\n\n\t\tsc.close();\n\n\t\tCollections.sort(priceList);\n\n\t\tint answer = 0;\n\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tanswer += priceList.get(i);\n\t\t}\n\n\t\tSystem.out.println(answer);\n\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\t//数取得\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<>();\n\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tint num = sc.nextInt();\n\t\t\tpriceList.add(num);\n\t\t}\n\n\t\tsc.close();\n\n\t\tCollections.sort(priceList);\n\n\t\tint answer = 0;\n\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tanswer += priceList.get(i);\n\t\t}\n\n\t\tSystem.out.println(answer);\n\n\t}\n\n}", "Main" ]
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); //数取得 int N = sc.nextInt(); int K = sc.nextInt(); ArrayList<Integer> priceList = new ArrayList<>(); for(int i = 0; i < N; i++) { int num = sc.nextInt(); priceList.add(num); } sc.close(); Collections.sort(priceList); int answer = 0; for(int i = 0; i < K; i++) { answer += priceList.get(i); } System.out.println(answer); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 85, 8 ], [ 85, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 73, 74 ], [ 73, 75 ], [ 11, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 9, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner scn = new Scanner(System.in);\n\t\tint N = scn.nextInt();\n\t\tint k = scn.nextInt();\n\t\tint[] arr = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tArrays.parallelSort(arr);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tans = ans + arr[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner scn = new Scanner(System.in);\n\t\tint N = scn.nextInt();\n\t\tint k = scn.nextInt();\n\t\tint[] arr = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tArrays.parallelSort(arr);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tans = ans + arr[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner scn = new Scanner(System.in);\n\t\tint N = scn.nextInt();\n\t\tint k = scn.nextInt();\n\t\tint[] arr = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tArrays.parallelSort(arr);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tans = ans + arr[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}", "main", "{\n\t\t// TODO Auto-generated method stub\n\t\tScanner scn = new Scanner(System.in);\n\t\tint N = scn.nextInt();\n\t\tint k = scn.nextInt();\n\t\tint[] arr = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tArrays.parallelSort(arr);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tans = ans + arr[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}", "Scanner scn = new Scanner(System.in);", "scn", "new Scanner(System.in)", "int N = scn.nextInt();", "N", "scn.nextInt()", "scn.nextInt", "scn", "int k = scn.nextInt();", "k", "scn.nextInt()", "scn.nextInt", "scn", "int[] arr = new int[N];", "arr", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tarr[i] = scn.nextInt();\n\t\t}", "{\n\t\t\tarr[i] = scn.nextInt();\n\t\t}", "arr[i] = scn.nextInt()", "arr[i]", "arr", "i", "scn.nextInt()", "scn.nextInt", "scn", "Arrays.parallelSort(arr)", "Arrays.parallelSort", "Arrays", "arr", "int ans = 0;", "ans", "0", "for (int i = 0; i < k; i++) {\n\t\t\tans = ans + arr[i];\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n\t\t\tans = ans + arr[i];\n\t\t}", "{\n\t\t\tans = ans + arr[i];\n\t\t}", "ans = ans + arr[i]", "ans", "ans + arr[i]", "ans", "arr[i]", "arr", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner scn = new Scanner(System.in);\n\t\tint N = scn.nextInt();\n\t\tint k = scn.nextInt();\n\t\tint[] arr = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tArrays.parallelSort(arr);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tans = ans + arr[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner scn = new Scanner(System.in);\n\t\tint N = scn.nextInt();\n\t\tint k = scn.nextInt();\n\t\tint[] arr = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tArrays.parallelSort(arr);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tans = ans + arr[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\n\t}\n\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scn = new Scanner(System.in); int N = scn.nextInt(); int k = scn.nextInt(); int[] arr = new int[N]; for (int i = 0; i < N; i++) { arr[i] = scn.nextInt(); } Arrays.parallelSort(arr); int ans = 0; for (int i = 0; i < k; i++) { ans = ans + arr[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 38, 30, 41, 13, 20, 4, 18, 20, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 0, 18, 36, 13, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 6, 13, 41, 13, 18, 13, 13, 41, 13, 20, 17, 41, 13, 17, 41, 13, 17, 12, 13, 30, 12, 13, 30, 14, 2, 13, 13, 30, 29, 17, 30, 0, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 30, 29, 17, 29, 17, 12, 13, 30, 14, 4, 13, 29, 18, 13, 40, 13, 29, 40, 17, 12, 13, 30, 29, 2, 2, 17, 13, 2, 13, 17, 23, 13, 12, 13, 30, 42, 2, 4, 13, 40, 4, 13, 18, 13, 13, 40, 13, 29, 4, 13, 12, 13, 30, 14, 40, 4, 13, 37, 20, 41, 13, 20, 41, 13, 4, 13, 42, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 14, 40, 4, 13, 37, 20, 41, 13, 17, 41, 13, 17, 41, 13, 4, 13, 14, 2, 13, 17, 30, 0, 13, 17, 0, 13, 4, 13, 14, 2, 2, 13, 17, 2, 17, 13, 30, 37, 20, 42, 17, 30, 14, 2, 2, 17, 13, 2, 13, 17, 30, 0, 13, 17, 0, 13, 2, 13, 17, 14, 2, 2, 13, 40, 17, 40, 4, 13, 13, 30, 29, 8, 13, 40, 13, 13, 30, 37, 20, 0, 13, 4, 13, 12, 13, 30, 41, 13, 4, 13, 14, 2, 2, 13, 18, 13, 13, 2, 13, 18, 13, 13, 37, 20, 29, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 21, 23 ], [ 20, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 26, 28 ], [ 25, 29 ], [ 29, 30 ], [ 30, 31 ], [ 25, 32 ], [ 32, 33 ], [ 33, 34 ], [ 18, 35 ], [ 35, 36 ], [ 16, 37 ], [ 37, 38 ], [ 37, 39 ], [ 39, 40 ], [ 37, 41 ], [ 41, 42 ], [ 37, 43 ], [ 43, 44 ], [ 43, 45 ], [ 45, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 46, 50 ], [ 45, 51 ], [ 51, 52 ], [ 52, 53 ], [ 52, 54 ], [ 51, 55 ], [ 43, 56 ], [ 56, 57 ], [ 43, 58 ], [ 58, 59 ], [ 37, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 65, 66 ], [ 66, 67 ], [ 62, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 71, 72 ], [ 62, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 76, 77 ], [ 75, 78 ], [ 62, 79 ], [ 79, 80 ], [ 80, 81 ], [ 79, 82 ], [ 62, 83 ], [ 83, 84 ], [ 83, 85 ], [ 62, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 86, 91 ], [ 91, 92 ], [ 91, 93 ], [ 86, 94 ], [ 94, 95 ], [ 95, 96 ], [ 86, 97 ], [ 98, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 101, 102 ], [ 101, 103 ], [ 62, 104 ], [ 104, 105 ], [ 105, 106 ], [ 104, 107 ], [ 16, 108 ], [ 108, 109 ], [ 108, 110 ], [ 110, 111 ], [ 110, 112 ], [ 112, 113 ], [ 112, 114 ], [ 108, 115 ], [ 115, 116 ], [ 115, 117 ], [ 108, 119 ], [ 119, 120 ], [ 119, 121 ], [ 108, 122 ], [ 122, 123 ], [ 122, 124 ], [ 108, 125 ], [ 125, 126 ], [ 125, 127 ], [ 108, 128 ], [ 128, 129 ], [ 128, 130 ], [ 130, 131 ], [ 131, 132 ], [ 132, 133 ], [ 132, 134 ], [ 131, 135 ], [ 135, 136 ], [ 136, 137 ], [ 131, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 138, 142 ], [ 142, 143 ], [ 143, 144 ], [ 143, 145 ], [ 145, 146 ], [ 146, 147 ], [ 147, 148 ], [ 142, 149 ], [ 149, 150 ], [ 150, 151 ], [ 150, 152 ], [ 152, 153 ], [ 153, 154 ], [ 152, 155 ], [ 138, 156 ], [ 156, 157 ], [ 157, 158 ], [ 157, 159 ], [ 156, 160 ], [ 160, 161 ], [ 161, 162 ], [ 130, 163 ], [ 163, 164 ], [ 108, 165 ], [ 165, 166 ], [ 165, 167 ], [ 167, 168 ], [ 168, 169 ], [ 169, 170 ], [ 168, 171 ], [ 171, 172 ], [ 172, 173 ], [ 172, 174 ], [ 174, 175 ], [ 168, 176 ], [ 176, 177 ], [ 177, 178 ], [ 108, 179 ], [ 179, 180 ], [ 179, 181 ], [ 181, 182 ], [ 182, 183 ], [ 183, 184 ], [ 184, 185 ], [ 184, 186 ], [ 183, 187 ], [ 187, 188 ], [ 187, 189 ], [ 179, 190 ], [ 190, 191 ], [ 108, 192 ], [ 192, 193 ], [ 192, 194 ], [ 194, 195 ], [ 195, 196 ], [ 196, 197 ], [ 197, 198 ], [ 196, 199 ], [ 199, 200 ], [ 200, 201 ], [ 200, 202 ], [ 202, 203 ], [ 202, 204 ], [ 195, 205 ], [ 205, 206 ], [ 194, 207 ], [ 207, 208 ], [ 208, 209 ], [ 108, 210 ], [ 210, 211 ], [ 210, 212 ], [ 212, 213 ], [ 213, 214 ], [ 214, 215 ], [ 215, 216 ], [ 213, 217 ], [ 217, 218 ], [ 212, 219 ], [ 219, 220 ], [ 219, 221 ], [ 212, 222 ], [ 222, 223 ], [ 222, 224 ], [ 224, 225 ], [ 212, 226 ], [ 226, 227 ], [ 227, 228 ], [ 227, 229 ], [ 226, 230 ], [ 230, 231 ], [ 231, 232 ], [ 232, 233 ], [ 231, 234 ], [ 230, 235 ], [ 235, 236 ], [ 235, 237 ], [ 237, 238 ], [ 212, 239 ], [ 239, 240 ], [ 240, 241 ], [ 241, 242 ], [ 108, 243 ], [ 243, 244 ], [ 243, 245 ], [ 245, 246 ], [ 246, 247 ], [ 247, 248 ], [ 248, 249 ], [ 246, 250 ], [ 250, 251 ], [ 245, 252 ], [ 252, 253 ], [ 252, 254 ], [ 245, 255 ], [ 255, 256 ], [ 255, 257 ], [ 245, 258 ], [ 258, 259 ], [ 258, 260 ], [ 260, 261 ], [ 245, 262 ], [ 262, 263 ], [ 263, 264 ], [ 263, 265 ], [ 262, 266 ], [ 266, 267 ], [ 267, 268 ], [ 267, 269 ], [ 266, 270 ], [ 270, 271 ], [ 270, 272 ], [ 272, 273 ], [ 245, 274 ], [ 274, 275 ], [ 275, 276 ], [ 276, 277 ], [ 276, 278 ], [ 275, 279 ], [ 279, 280 ], [ 279, 281 ], [ 274, 282 ], [ 282, 283 ], [ 283, 284 ], [ 245, 285 ], [ 285, 286 ], [ 285, 287 ], [ 287, 288 ], [ 288, 289 ], [ 289, 290 ], [ 290, 291 ], [ 290, 292 ], [ 289, 293 ], [ 293, 294 ], [ 293, 295 ], [ 288, 296 ], [ 296, 297 ], [ 297, 298 ], [ 297, 299 ], [ 296, 300 ], [ 300, 301 ], [ 300, 302 ], [ 302, 303 ], [ 302, 304 ], [ 288, 305 ], [ 305, 306 ], [ 306, 307 ], [ 307, 308 ], [ 307, 309 ], [ 309, 310 ], [ 306, 311 ], [ 311, 312 ], [ 312, 313 ], [ 312, 314 ], [ 305, 315 ], [ 315, 316 ], [ 316, 317 ], [ 317, 318 ], [ 317, 319 ], [ 319, 320 ], [ 317, 321 ], [ 305, 322 ], [ 322, 323 ], [ 323, 324 ], [ 287, 325 ], [ 325, 326 ], [ 325, 327 ], [ 327, 328 ], [ 108, 329 ], [ 329, 330 ], [ 329, 331 ], [ 331, 332 ], [ 332, 333 ], [ 332, 334 ], [ 334, 335 ], [ 331, 336 ], [ 336, 337 ], [ 337, 338 ], [ 338, 339 ], [ 338, 340 ], [ 340, 341 ], [ 340, 342 ], [ 337, 343 ], [ 343, 344 ], [ 343, 345 ], [ 345, 346 ], [ 345, 347 ], [ 336, 348 ], [ 348, 349 ], [ 331, 350 ], [ 350, 351 ], [ 108, 352 ], [ 352, 353 ], [ 352, 354 ], [ 354, 355 ], [ 355, 356 ], [ 356, 357 ], [ 357, 358 ], [ 356, 359 ], [ 359, 360 ], [ 108, 361 ], [ 361, 362 ], [ 361, 363 ], [ 363, 364 ], [ 364, 365 ], [ 364, 366 ], [ 363, 368 ], [ 368, 369 ], [ 369, 370 ], [ 370, 371 ], [ 370, 372 ], [ 368, 373 ], [ 373, 374 ], [ 373, 375 ], [ 368, 376 ], [ 376, 377 ], [ 377, 378 ], [ 368, 379 ], [ 379, 380 ], [ 380, 381 ], [ 381, 382 ], [ 381, 383 ], [ 380, 384 ], [ 384, 385 ], [ 363, 386 ], [ 386, 387 ], [ 361, 388 ], [ 388, 389 ], [ 108, 390 ], [ 390, 391 ], [ 390, 392 ], [ 392, 393 ], [ 393, 394 ], [ 393, 395 ], [ 392, 397 ], [ 397, 398 ], [ 398, 399 ], [ 399, 400 ], [ 399, 401 ], [ 397, 402 ], [ 402, 403 ], [ 402, 404 ], [ 397, 405 ], [ 405, 406 ], [ 406, 407 ], [ 397, 408 ], [ 408, 409 ], [ 409, 410 ], [ 410, 411 ], [ 410, 412 ], [ 409, 413 ], [ 413, 414 ], [ 392, 415 ], [ 415, 416 ], [ 390, 417 ], [ 417, 418 ] ]
[ "import java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.NoSuchElementException;\n\nclass Main {\n\n static class Solver {\n final FastScanner sc;\n final PrintWriter writer;\n\n Solver(final FastScanner sc, final PrintWriter writer) {\n this.sc = sc;\n this.writer = writer;\n }\n\n void run() {\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] items = sc.nextIntArray(n);\n Arrays.sort(items);\n int result = 0;\n for (int i = 0; i < k; i++) {\n result += items[i];\n }\n writer.println(result);\n }\n }\n\n public static void main(final String[] args) {\n final FastScanner sc = new FastScanner();\n try (final PrintWriter w = new PrintWriter(System.out)) {\n new Solver(sc, w).run();\n w.flush();\n }\n }\n\n // FastScanner\n static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n public FastScanner() {\n }\n\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n\n private int readByte() {\n if (hasNextByte())\n return buffer[ptr++];\n else\n return -1;\n }\n\n private boolean isPrintableChar(final int c) {\n return 33 <= c && c <= 126;\n }\n\n public boolean hasNext() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr]))\n ptr++;\n return hasNextByte();\n }\n\n public String next() {\n if (!hasNext())\n throw new NoSuchElementException();\n final StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n public long nextLong() {\n if (!hasNext())\n throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n\n public int nextInt() {\n final long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)\n throw new NumberFormatException();\n return (int) nl;\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(final int n) {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(final int n) {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.NoSuchElementException;", "NoSuchElementException", "java.util", "class Main {\n\n static class Solver {\n final FastScanner sc;\n final PrintWriter writer;\n\n Solver(final FastScanner sc, final PrintWriter writer) {\n this.sc = sc;\n this.writer = writer;\n }\n\n void run() {\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] items = sc.nextIntArray(n);\n Arrays.sort(items);\n int result = 0;\n for (int i = 0; i < k; i++) {\n result += items[i];\n }\n writer.println(result);\n }\n }\n\n public static void main(final String[] args) {\n final FastScanner sc = new FastScanner();\n try (final PrintWriter w = new PrintWriter(System.out)) {\n new Solver(sc, w).run();\n w.flush();\n }\n }\n\n // FastScanner\n static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n public FastScanner() {\n }\n\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n\n private int readByte() {\n if (hasNextByte())\n return buffer[ptr++];\n else\n return -1;\n }\n\n private boolean isPrintableChar(final int c) {\n return 33 <= c && c <= 126;\n }\n\n public boolean hasNext() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr]))\n ptr++;\n return hasNextByte();\n }\n\n public String next() {\n if (!hasNext())\n throw new NoSuchElementException();\n final StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n public long nextLong() {\n if (!hasNext())\n throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n\n public int nextInt() {\n final long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)\n throw new NumberFormatException();\n return (int) nl;\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(final int n) {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(final int n) {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}", "Main", "public static void main(final String[] args) {\n final FastScanner sc = new FastScanner();\n try (final PrintWriter w = new PrintWriter(System.out)) {\n new Solver(sc, w).run();\n w.flush();\n }\n }", "main", "{\n final FastScanner sc = new FastScanner();\n try (final PrintWriter w = new PrintWriter(System.out)) {\n new Solver(sc, w).run();\n w.flush();\n }\n }", "final FastScanner sc = new FastScanner();", "sc", "new FastScanner()", "try (final PrintWriter w = new PrintWriter(System.out)) {\n new Solver(sc, w).run();\n w.flush();\n }", "{\n new Solver(sc, w).run();\n w.flush();\n }", "final PrintWriter w = new PrintWriter(System.out)", "final PrintWriter w = new PrintWriter(System.out)", "new PrintWriter(System.out)", "new Solver(sc, w).run()", "new Solver(sc, w).run", "new Solver(sc, w)", "w.flush()", "w.flush", "w", "final String[] args", "args", "static class Solver {\n final FastScanner sc;\n final PrintWriter writer;\n\n Solver(final FastScanner sc, final PrintWriter writer) {\n this.sc = sc;\n this.writer = writer;\n }\n\n void run() {\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] items = sc.nextIntArray(n);\n Arrays.sort(items);\n int result = 0;\n for (int i = 0; i < k; i++) {\n result += items[i];\n }\n writer.println(result);\n }\n }", "Solver", "final FastScanner sc;", "sc", "final PrintWriter writer;", "writer", "Solver(final FastScanner sc, final PrintWriter writer) {\n this.sc = sc;\n this.writer = writer;\n }", "Solver", "{\n this.sc = sc;\n this.writer = writer;\n }", "this.sc = sc", "this.sc", "this", "this.sc", "sc", "this.writer = writer", "this.writer", "this", "this.writer", "writer", "final FastScanner sc", "sc", "final PrintWriter writer", "writer", "void run() {\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] items = sc.nextIntArray(n);\n Arrays.sort(items);\n int result = 0;\n for (int i = 0; i < k; i++) {\n result += items[i];\n }\n writer.println(result);\n }", "run", "{\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] items = sc.nextIntArray(n);\n Arrays.sort(items);\n int result = 0;\n for (int i = 0; i < k; i++) {\n result += items[i];\n }\n writer.println(result);\n }", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] items = sc.nextIntArray(n);", "items", "sc.nextIntArray(n)", "sc.nextIntArray", "sc", "n", "Arrays.sort(items)", "Arrays.sort", "Arrays", "items", "int result = 0;", "result", "0", "for (int i = 0; i < k; i++) {\n result += items[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n result += items[i];\n }", "{\n result += items[i];\n }", "result += items[i]", "result", "items[i]", "items", "i", "writer.println(result)", "writer.println", "writer", "result", "static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n public FastScanner() {\n }\n\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n\n private int readByte() {\n if (hasNextByte())\n return buffer[ptr++];\n else\n return -1;\n }\n\n private boolean isPrintableChar(final int c) {\n return 33 <= c && c <= 126;\n }\n\n public boolean hasNext() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr]))\n ptr++;\n return hasNextByte();\n }\n\n public String next() {\n if (!hasNext())\n throw new NoSuchElementException();\n final StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n public long nextLong() {\n if (!hasNext())\n throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n\n public int nextInt() {\n final long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)\n throw new NumberFormatException();\n return (int) nl;\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(final int n) {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(final int n) {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }", "FastScanner", "private final InputStream in = System.in;", "in", "System.in", "System", "System.in", "private final byte[] buffer = new byte[1024];", "buffer", "new byte[1024]", "1024", "private int ptr = 0;", "ptr", "0", "private int buflen = 0;", "buflen", "0", "public FastScanner() {\n }", "FastScanner", "{\n }", "private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }", "hasNextByte", "{\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }", "if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }", "ptr < buflen", "ptr", "buflen", "{\n return true;\n }", "return true;", "true", "{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }", "ptr = 0", "ptr", "0", "try {\n buflen = in.read(buffer);\n } catch (final IOException e) {\n e.printStackTrace();\n }", "catch (final IOException e) {\n e.printStackTrace();\n }", "final IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n buflen = in.read(buffer);\n }", "buflen = in.read(buffer)", "buflen", "in.read(buffer)", "in.read", "in", "buffer", "if (buflen <= 0) {\n return false;\n }", "buflen <= 0", "buflen", "0", "{\n return false;\n }", "return false;", "false", "return true;", "true", "private int readByte() {\n if (hasNextByte())\n return buffer[ptr++];\n else\n return -1;\n }", "readByte", "{\n if (hasNextByte())\n return buffer[ptr++];\n else\n return -1;\n }", "if (hasNextByte())\n return buffer[ptr++];\n else\n return -1;", "hasNextByte()", "hasNextByte", "return buffer[ptr++];", "buffer[ptr++]", "buffer", "ptr++", "ptr", "return -1;", "-1", "1", "private boolean isPrintableChar(final int c) {\n return 33 <= c && c <= 126;\n }", "isPrintableChar", "{\n return 33 <= c && c <= 126;\n }", "return 33 <= c && c <= 126;", "33 <= c && c <= 126", "33 <= c", "33", "c", "c <= 126", "c", "126", "final int c", "c", "public boolean hasNext() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr]))\n ptr++;\n return hasNextByte();\n }", "hasNext", "{\n while (hasNextByte() && !isPrintableChar(buffer[ptr]))\n ptr++;\n return hasNextByte();\n }", "while (hasNextByte() && !isPrintableChar(buffer[ptr]))\n ptr++;", "hasNextByte() && !isPrintableChar(buffer[ptr])", "hasNextByte()", "hasNextByte", "!isPrintableChar(buffer[ptr])", "isPrintableChar(buffer[ptr])", "isPrintableChar", "buffer[ptr]", "buffer", "ptr", "ptr++", "ptr", "return hasNextByte();", "hasNextByte()", "hasNextByte", "public String next() {\n if (!hasNext())\n throw new NoSuchElementException();\n final StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }", "next", "{\n if (!hasNext())\n throw new NoSuchElementException();\n final StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }", "if (!hasNext())\n throw new NoSuchElementException();", "!hasNext()", "hasNext()", "hasNext", "throw new NoSuchElementException();", "new NoSuchElementException()", "final StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "int b = readByte();", "b", "readByte()", "readByte", "while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }", "isPrintableChar(b)", "isPrintableChar", "b", "{\n sb.appendCodePoint(b);\n b = readByte();\n }", "sb.appendCodePoint(b)", "sb.appendCodePoint", "sb", "b", "b = readByte()", "b", "readByte()", "readByte", "return sb.toString();", "sb.toString()", "sb.toString", "sb", "public long nextLong() {\n if (!hasNext())\n throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }", "nextLong", "{\n if (!hasNext())\n throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }", "if (!hasNext())\n throw new NoSuchElementException();", "!hasNext()", "hasNext()", "hasNext", "throw new NoSuchElementException();", "new NoSuchElementException()", "long n = 0;", "n", "0", "boolean minus = false;", "minus", "false", "int b = readByte();", "b", "readByte()", "readByte", "if (b == '-') {\n minus = true;\n b = readByte();\n }", "b == '-'", "b", "'-'", "{\n minus = true;\n b = readByte();\n }", "minus = true", "minus", "true", "b = readByte()", "b", "readByte()", "readByte", "if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }", "b < '0' || '9' < b", "b < '0'", "b", "'0'", "'9' < b", "'9'", "b", "{\n throw new NumberFormatException();\n }", "throw new NumberFormatException();", "new NumberFormatException()", "while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }", "true", "{\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }", "if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }", "'0' <= b && b <= '9'", "'0' <= b", "'0'", "b", "b <= '9'", "b", "'9'", "{\n n *= 10;\n n += b - '0';\n }", "n *= 10", "n", "10", "n += b - '0'", "n", "b - '0'", "b", "'0'", "if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }", "b == -1 || !isPrintableChar(b)", "b == -1", "b", "-1", "1", "!isPrintableChar(b)", "isPrintableChar(b)", "isPrintableChar", "b", "{\n return minus ? -n : n;\n }", "return minus ? -n : n;", "minus ? -n : n", "minus", "-n", "n", "n", "{\n throw new NumberFormatException();\n }", "throw new NumberFormatException();", "new NumberFormatException()", "b = readByte()", "b", "readByte()", "readByte", "public int nextInt() {\n final long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)\n throw new NumberFormatException();\n return (int) nl;\n }", "nextInt", "{\n final long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)\n throw new NumberFormatException();\n return (int) nl;\n }", "final long nl = nextLong();", "nl", "nextLong()", "nextLong", "if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)\n throw new NumberFormatException();", "nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE", "nl < Integer.MIN_VALUE", "nl", "Integer.MIN_VALUE", "Integer", "Integer.MIN_VALUE", "nl > Integer.MAX_VALUE", "nl", "Integer.MAX_VALUE", "Integer", "Integer.MAX_VALUE", "throw new NumberFormatException();", "new NumberFormatException()", "return (int) nl;", "(int) nl", "public double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "public int[] nextIntArray(final int n) {\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }", "nextIntArray", "{\n final int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }", "final int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++)\n a[i] = nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = nextInt();", "a[i] = nextInt()", "a[i]", "a", "i", "nextInt()", "nextInt", "return a;", "a", "final int n", "n", "public long[] nextLongArray(final int n) {\n final long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }", "nextLongArray", "{\n final long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }", "final long[] a = new long[n];", "a", "new long[n]", "n", "for (int i = 0; i < n; i++)\n a[i] = nextLong();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "a[i] = nextLong();", "a[i] = nextLong()", "a[i]", "a", "i", "nextLong()", "nextLong", "return a;", "a", "final int n", "n" ]
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.NoSuchElementException; class Main { static class Solver { final FastScanner sc; final PrintWriter writer; Solver(final FastScanner sc, final PrintWriter writer) { this.sc = sc; this.writer = writer; } void run() { int n = sc.nextInt(); int k = sc.nextInt(); int[] items = sc.nextIntArray(n); Arrays.sort(items); int result = 0; for (int i = 0; i < k; i++) { result += items[i]; } writer.println(result); } } public static void main(final String[] args) { final FastScanner sc = new FastScanner(); try (final PrintWriter w = new PrintWriter(System.out)) { new Solver(sc, w).run(); w.flush(); } } // FastScanner static class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; public FastScanner() { } private boolean hasNextByte() { if (ptr < buflen) { return true; } else { ptr = 0; try { buflen = in.read(buffer); } catch (final IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1; } private boolean isPrintableChar(final int c) { return 33 <= c && c <= 126; } public boolean hasNext() { while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte(); } public String next() { if (!hasNext()) throw new NoSuchElementException(); final StringBuilder sb = new StringBuilder(); int b = readByte(); while (isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while (true) { if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; } else if (b == -1 || !isPrintableChar(b)) { return minus ? -n : n; } else { throw new NumberFormatException(); } b = readByte(); } } public int nextInt() { final long nl = nextLong(); if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next()); } public int[] nextIntArray(final int n) { final int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } public long[] nextLongArray(final int n) { final long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 80, 5 ], [ 80, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 46, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 8, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 6, 77 ], [ 77, 78 ], [ 0, 79 ], [ 79, 80 ], [ 79, 81 ] ]
[ "import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n int K = s.nextInt();\n int[] foo = new int[N];\n for(int i = 0; i < N; i++) {\n foo[i] = s.nextInt();\n }\n \n int sum = 0; \n Arrays.sort(foo);\n \n for(int i = 0; i < K;i++) {\n sum+= foo[i];\n }\n System.out.println(sum);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args) throws Exception {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n int K = s.nextInt();\n int[] foo = new int[N];\n for(int i = 0; i < N; i++) {\n foo[i] = s.nextInt();\n }\n \n int sum = 0; \n Arrays.sort(foo);\n \n for(int i = 0; i < K;i++) {\n sum+= foo[i];\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args) throws Exception {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n int K = s.nextInt();\n int[] foo = new int[N];\n for(int i = 0; i < N; i++) {\n foo[i] = s.nextInt();\n }\n \n int sum = 0; \n Arrays.sort(foo);\n \n for(int i = 0; i < K;i++) {\n sum+= foo[i];\n }\n System.out.println(sum);\n }", "main", "{\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n int K = s.nextInt();\n int[] foo = new int[N];\n for(int i = 0; i < N; i++) {\n foo[i] = s.nextInt();\n }\n \n int sum = 0; \n Arrays.sort(foo);\n \n for(int i = 0; i < K;i++) {\n sum+= foo[i];\n }\n System.out.println(sum);\n }", "Scanner s = new Scanner(System.in);", "s", "new Scanner(System.in)", "int N = s.nextInt();", "N", "s.nextInt()", "s.nextInt", "s", "int K = s.nextInt();", "K", "s.nextInt()", "s.nextInt", "s", "int[] foo = new int[N];", "foo", "new int[N]", "N", "for(int i = 0; i < N; i++) {\n foo[i] = s.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n foo[i] = s.nextInt();\n }", "{\n foo[i] = s.nextInt();\n }", "foo[i] = s.nextInt()", "foo[i]", "foo", "i", "s.nextInt()", "s.nextInt", "s", "int sum = 0;", "sum", "0", "Arrays.sort(foo)", "Arrays.sort", "Arrays", "foo", "for(int i = 0; i < K;i++) {\n sum+= foo[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sum+= foo[i];\n }", "{\n sum+= foo[i];\n }", "sum+= foo[i]", "sum", "foo[i]", "foo", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args) throws Exception {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n int K = s.nextInt();\n int[] foo = new int[N];\n for(int i = 0; i < N; i++) {\n foo[i] = s.nextInt();\n }\n \n int sum = 0; \n Arrays.sort(foo);\n \n for(int i = 0; i < K;i++) {\n sum+= foo[i];\n }\n System.out.println(sum);\n }\n}", "public class Main {\n public static void main(String[] args) throws Exception {\n Scanner s = new Scanner(System.in);\n int N = s.nextInt();\n int K = s.nextInt();\n int[] foo = new int[N];\n for(int i = 0; i < N; i++) {\n foo[i] = s.nextInt();\n }\n \n int sum = 0; \n Arrays.sort(foo);\n \n for(int i = 0; i < K;i++) {\n sum+= foo[i];\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner s = new Scanner(System.in); int N = s.nextInt(); int K = s.nextInt(); int[] foo = new int[N]; for(int i = 0; i < N; i++) { foo[i] = s.nextInt(); } int sum = 0; Arrays.sort(foo); for(int i = 0; i < K;i++) { sum+= foo[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 44, 47 ], [ 47, 48 ], [ 48, 49 ], [ 14, 50 ], [ 50, 51 ], [ 51, 52 ], [ 50, 53 ], [ 14, 54 ], [ 54, 55 ], [ 54, 56 ], [ 14, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 62, 63 ], [ 62, 64 ], [ 57, 65 ], [ 65, 66 ], [ 66, 67 ], [ 57, 68 ], [ 69, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 72, 75 ], [ 14, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 12, 82 ], [ 82, 83 ] ]
[ "import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Integer n = sc.nextInt();\n Integer k = sc.nextInt();\n ArrayList<Integer> ps = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n ps.add(sc.nextInt());\n }\n Collections.sort(ps);\n Integer res = 0;\n for (int i=0;i<k;i++){\n res += ps.get(i);\n }\n\n System.out.println(res);\n }\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Integer n = sc.nextInt();\n Integer k = sc.nextInt();\n ArrayList<Integer> ps = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n ps.add(sc.nextInt());\n }\n Collections.sort(ps);\n Integer res = 0;\n for (int i=0;i<k;i++){\n res += ps.get(i);\n }\n\n System.out.println(res);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n Integer n = sc.nextInt();\n Integer k = sc.nextInt();\n ArrayList<Integer> ps = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n ps.add(sc.nextInt());\n }\n Collections.sort(ps);\n Integer res = 0;\n for (int i=0;i<k;i++){\n res += ps.get(i);\n }\n\n System.out.println(res);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n Integer n = sc.nextInt();\n Integer k = sc.nextInt();\n ArrayList<Integer> ps = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n ps.add(sc.nextInt());\n }\n Collections.sort(ps);\n Integer res = 0;\n for (int i=0;i<k;i++){\n res += ps.get(i);\n }\n\n System.out.println(res);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "Integer n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "Integer k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "ArrayList<Integer> ps = new ArrayList<>();", "ps", "new ArrayList<>()", "for (int i = 0; i < n; i++) {\n ps.add(sc.nextInt());\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n ps.add(sc.nextInt());\n }", "{\n ps.add(sc.nextInt());\n }", "ps.add(sc.nextInt())", "ps.add", "ps", "sc.nextInt()", "sc.nextInt", "sc", "Collections.sort(ps)", "Collections.sort", "Collections", "ps", "Integer res = 0;", "res", "0", "for (int i=0;i<k;i++){\n res += ps.get(i);\n }", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n res += ps.get(i);\n }", "{\n res += ps.get(i);\n }", "res += ps.get(i)", "res", "ps.get(i)", "ps.get", "ps", "i", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String[] args", "args" ]
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Integer n = sc.nextInt(); Integer k = sc.nextInt(); ArrayList<Integer> ps = new ArrayList<>(); for (int i = 0; i < n; i++) { ps.add(sc.nextInt()); } Collections.sort(ps); Integer res = 0; for (int i=0;i<k;i++){ res += ps.get(i); } System.out.println(res); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 41, 13, 20, 4, 18, 13, 17, 13, 13, 4, 18, 13, 23, 13, 6, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 23, 13, 23, 13, 6, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 29, 13, 23, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 147, 20 ], [ 147, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 26, 28 ], [ 23, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 31, 33 ], [ 23, 34 ], [ 34, 35 ], [ 34, 36 ], [ 23, 37 ], [ 37, 38 ], [ 37, 39 ], [ 23, 40 ], [ 40, 41 ], [ 40, 42 ], [ 23, 43 ], [ 43, 44 ], [ 44, 45 ], [ 43, 46 ], [ 43, 47 ], [ 43, 48 ], [ 23, 49 ], [ 49, 50 ], [ 50, 51 ], [ 21, 52 ], [ 52, 53 ], [ 147, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 61, 62 ], [ 62, 63 ], [ 58, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 67, 68 ], [ 58, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 72, 73 ], [ 71, 74 ], [ 71, 75 ], [ 58, 76 ], [ 76, 77 ], [ 77, 78 ], [ 76, 79 ], [ 58, 80 ], [ 80, 81 ], [ 80, 82 ], [ 58, 83 ], [ 83, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 83, 88 ], [ 88, 89 ], [ 88, 90 ], [ 83, 91 ], [ 91, 92 ], [ 92, 93 ], [ 83, 94 ], [ 95, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 98, 100 ], [ 58, 101 ], [ 101, 102 ], [ 102, 103 ], [ 101, 104 ], [ 56, 105 ], [ 105, 106 ], [ 56, 107 ], [ 107, 108 ], [ 56, 109 ], [ 109, 110 ], [ 147, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 113, 115 ], [ 115, 116 ], [ 116, 117 ], [ 116, 118 ], [ 115, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 120, 125 ], [ 125, 126 ], [ 125, 127 ], [ 120, 128 ], [ 128, 129 ], [ 129, 130 ], [ 120, 131 ], [ 132, 132 ], [ 132, 133 ], [ 133, 134 ], [ 134, 135 ], [ 134, 136 ], [ 133, 137 ], [ 137, 138 ], [ 138, 139 ], [ 115, 140 ], [ 140, 141 ], [ 113, 142 ], [ 142, 143 ], [ 113, 144 ], [ 144, 145 ], [ 0, 146 ], [ 146, 147 ], [ 146, 148 ] ]
[ "import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.Scanner;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main\n{\n public static void main(String[] args)\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task\n {\n public void solve(int testNumber, Scanner in, PrintWriter out)\n {\n int N = in.nextInt();\n int K = in.nextInt();\n int F[] = CPUtils.readIntArray(N, in);\n Arrays.sort(F);\n int sum = 0;\n for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }\n out.println(sum);\n }\n\n }\n\n static class CPUtils\n {\n public static int[] readIntArray(int size, Scanner in)\n {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }\n return array;\n }\n\n }\n}\n", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main\n{\n public static void main(String[] args)\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task\n {\n public void solve(int testNumber, Scanner in, PrintWriter out)\n {\n int N = in.nextInt();\n int K = in.nextInt();\n int F[] = CPUtils.readIntArray(N, in);\n Arrays.sort(F);\n int sum = 0;\n for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }\n out.println(sum);\n }\n\n }\n\n static class CPUtils\n {\n public static int[] readIntArray(int size, Scanner in)\n {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }\n return array;\n }\n\n }\n}", "Main", "public static void main(String[] args)\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }", "main", "{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }", "InputStream inputStream = System.in;", "inputStream", "System.in", "System", "System.in", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "Scanner in = new Scanner(inputStream);", "in", "new Scanner(inputStream)", "PrintWriter out = new PrintWriter(outputStream);", "out", "new PrintWriter(outputStream)", "Task solver = new Task();", "solver", "new Task()", "solver.solve(1, in, out)", "solver.solve", "solver", "1", "in", "out", "out.close()", "out.close", "out", "String[] args", "args", "static class Task\n {\n public void solve(int testNumber, Scanner in, PrintWriter out)\n {\n int N = in.nextInt();\n int K = in.nextInt();\n int F[] = CPUtils.readIntArray(N, in);\n Arrays.sort(F);\n int sum = 0;\n for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }\n out.println(sum);\n }\n\n }", "Task", "public void solve(int testNumber, Scanner in, PrintWriter out)\n {\n int N = in.nextInt();\n int K = in.nextInt();\n int F[] = CPUtils.readIntArray(N, in);\n Arrays.sort(F);\n int sum = 0;\n for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }\n out.println(sum);\n }", "solve", "{\n int N = in.nextInt();\n int K = in.nextInt();\n int F[] = CPUtils.readIntArray(N, in);\n Arrays.sort(F);\n int sum = 0;\n for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }\n out.println(sum);\n }", "int N = in.nextInt();", "N", "in.nextInt()", "in.nextInt", "in", "int K = in.nextInt();", "K", "in.nextInt()", "in.nextInt", "in", "int F[] = CPUtils.readIntArray(N, in);", "F", "CPUtils.readIntArray(N, in)", "CPUtils.readIntArray", "CPUtils", "N", "in", "Arrays.sort(F)", "Arrays.sort", "Arrays", "F", "int sum = 0;", "sum", "0", "for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n sum += F[i];\n }", "{\n sum += F[i];\n }", "sum += F[i]", "sum", "F[i]", "F", "i", "out.println(sum)", "out.println", "out", "sum", "int testNumber", "testNumber", "Scanner in", "in", "PrintWriter out", "out", "static class CPUtils\n {\n public static int[] readIntArray(int size, Scanner in)\n {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }\n return array;\n }\n\n }", "CPUtils", "public static int[] readIntArray(int size, Scanner in)\n {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }\n return array;\n }", "readIntArray", "{\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }\n return array;\n }", "int[] array = new int[size];", "array", "new int[size]", "size", "for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < size", "i", "size", "i++", "i++", "i", "{\n array[i] = in.nextInt();\n }", "{\n array[i] = in.nextInt();\n }", "array[i] = in.nextInt()", "array[i]", "array", "i", "in.nextInt()", "in.nextInt", "in", "return array;", "array", "int size", "size", "Scanner in", "in", "public class Main\n{\n public static void main(String[] args)\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task\n {\n public void solve(int testNumber, Scanner in, PrintWriter out)\n {\n int N = in.nextInt();\n int K = in.nextInt();\n int F[] = CPUtils.readIntArray(N, in);\n Arrays.sort(F);\n int sum = 0;\n for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }\n out.println(sum);\n }\n\n }\n\n static class CPUtils\n {\n public static int[] readIntArray(int size, Scanner in)\n {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }\n return array;\n }\n\n }\n}", "public class Main\n{\n public static void main(String[] args)\n {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Task solver = new Task();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class Task\n {\n public void solve(int testNumber, Scanner in, PrintWriter out)\n {\n int N = in.nextInt();\n int K = in.nextInt();\n int F[] = CPUtils.readIntArray(N, in);\n Arrays.sort(F);\n int sum = 0;\n for (int i = 0; i < K; i++)\n {\n sum += F[i];\n }\n out.println(sum);\n }\n\n }\n\n static class CPUtils\n {\n public static int[] readIntArray(int size, Scanner in)\n {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n {\n array[i] = in.nextInt();\n }\n return array;\n }\n\n }\n}", "Main" ]
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); Task solver = new Task(); solver.solve(1, in, out); out.close(); } static class Task { public void solve(int testNumber, Scanner in, PrintWriter out) { int N = in.nextInt(); int K = in.nextInt(); int F[] = CPUtils.readIntArray(N, in); Arrays.sort(F); int sum = 0; for (int i = 0; i < K; i++) { sum += F[i]; } out.println(sum); } } static class CPUtils { public static int[] readIntArray(int size, Scanner in) { int[] array = new int[size]; for (int i = 0; i < size; i++) { array[i] = in.nextInt(); } return array; } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 13, 30, 0, 13, 13, 0, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 17, 41, 13, 17, 28, 13, 13, 30, 30, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 18, 13, 13, 41, 13, 20, 17, 41, 13, 17, 41, 13, 17, 12, 13, 30, 14, 2, 13, 13, 30, 29, 17, 30, 0, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 30, 29, 17, 29, 17, 12, 13, 30, 14, 4, 13, 29, 18, 13, 40, 13, 29, 40, 17, 12, 13, 30, 29, 2, 2, 17, 13, 2, 13, 17, 23, 13, 12, 13, 30, 42, 2, 4, 13, 40, 4, 13, 18, 13, 13, 40, 13, 12, 13, 30, 4, 13, 29, 4, 13, 12, 13, 30, 14, 40, 4, 13, 37, 20, 41, 13, 20, 41, 13, 4, 13, 42, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 14, 40, 4, 13, 37, 20, 41, 13, 17, 41, 13, 17, 41, 13, 4, 13, 14, 2, 13, 17, 30, 0, 13, 17, 0, 13, 4, 13, 14, 2, 2, 13, 17, 2, 17, 13, 30, 37, 20, 42, 17, 30, 14, 2, 2, 17, 13, 2, 13, 17, 30, 0, 13, 17, 0, 13, 2, 13, 17, 14, 2, 2, 13, 40, 17, 40, 4, 13, 13, 30, 29, 8, 13, 40, 13, 13, 30, 37, 20, 0, 13, 4, 13, 12, 13, 30, 41, 13, 4, 13, 29, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 14, 52 ], [ 52, 53 ], [ 52, 54 ], [ 14, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 68, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 72, 80 ], [ 80, 81 ], [ 81, 82 ], [ 72, 83 ], [ 84, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 90, 91 ], [ 90, 92 ], [ 85, 93 ], [ 93, 94 ], [ 94, 95 ], [ 94, 96 ], [ 68, 97 ], [ 97, 98 ], [ 98, 99 ], [ 98, 100 ], [ 97, 101 ], [ 101, 102 ], [ 101, 103 ], [ 68, 104 ], [ 104, 105 ], [ 105, 106 ], [ 105, 107 ], [ 104, 108 ], [ 14, 109 ], [ 109, 110 ], [ 109, 111 ], [ 14, 112 ], [ 112, 113 ], [ 112, 114 ], [ 112, 115 ], [ 116, 116 ], [ 116, 117 ], [ 117, 118 ], [ 117, 119 ], [ 14, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 120, 125 ], [ 12, 126 ], [ 126, 127 ], [ 0, 128 ], [ 128, 129 ], [ 128, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 132, 134 ], [ 128, 135 ], [ 135, 136 ], [ 135, 137 ], [ 128, 139 ], [ 139, 140 ], [ 139, 141 ], [ 128, 142 ], [ 142, 143 ], [ 142, 144 ], [ 128, 145 ], [ 145, 146 ], [ 145, 147 ], [ 147, 148 ], [ 148, 149 ], [ 149, 150 ], [ 149, 151 ], [ 148, 152 ], [ 152, 153 ], [ 153, 154 ], [ 148, 155 ], [ 155, 156 ], [ 156, 157 ], [ 156, 158 ], [ 155, 159 ], [ 159, 160 ], [ 160, 161 ], [ 160, 162 ], [ 162, 163 ], [ 163, 164 ], [ 164, 165 ], [ 159, 166 ], [ 166, 167 ], [ 167, 168 ], [ 167, 169 ], [ 169, 170 ], [ 170, 171 ], [ 169, 172 ], [ 155, 173 ], [ 173, 174 ], [ 174, 175 ], [ 174, 176 ], [ 173, 177 ], [ 177, 178 ], [ 178, 179 ], [ 147, 180 ], [ 180, 181 ], [ 128, 182 ], [ 182, 183 ], [ 182, 184 ], [ 184, 185 ], [ 185, 186 ], [ 186, 187 ], [ 185, 188 ], [ 188, 189 ], [ 189, 190 ], [ 189, 191 ], [ 191, 192 ], [ 185, 193 ], [ 193, 194 ], [ 194, 195 ], [ 128, 196 ], [ 196, 197 ], [ 196, 198 ], [ 198, 199 ], [ 199, 200 ], [ 200, 201 ], [ 201, 202 ], [ 201, 203 ], [ 200, 204 ], [ 204, 205 ], [ 204, 206 ], [ 196, 207 ], [ 207, 208 ], [ 128, 209 ], [ 209, 210 ], [ 209, 211 ], [ 211, 212 ], [ 212, 213 ], [ 213, 214 ], [ 214, 215 ], [ 213, 216 ], [ 216, 217 ], [ 217, 218 ], [ 217, 219 ], [ 219, 220 ], [ 219, 221 ], [ 212, 222 ], [ 222, 223 ], [ 128, 224 ], [ 224, 225 ], [ 224, 226 ], [ 226, 227 ], [ 227, 228 ], [ 226, 229 ], [ 229, 230 ], [ 230, 231 ], [ 128, 232 ], [ 232, 233 ], [ 232, 234 ], [ 234, 235 ], [ 235, 236 ], [ 236, 237 ], [ 237, 238 ], [ 235, 239 ], [ 239, 240 ], [ 234, 241 ], [ 241, 242 ], [ 241, 243 ], [ 234, 244 ], [ 244, 245 ], [ 244, 246 ], [ 246, 247 ], [ 234, 248 ], [ 248, 249 ], [ 249, 250 ], [ 249, 251 ], [ 248, 252 ], [ 252, 253 ], [ 253, 254 ], [ 254, 255 ], [ 253, 256 ], [ 252, 257 ], [ 257, 258 ], [ 257, 259 ], [ 259, 260 ], [ 234, 261 ], [ 261, 262 ], [ 262, 263 ], [ 263, 264 ], [ 128, 265 ], [ 265, 266 ], [ 265, 267 ], [ 267, 268 ], [ 268, 269 ], [ 269, 270 ], [ 270, 271 ], [ 268, 272 ], [ 272, 273 ], [ 267, 274 ], [ 274, 275 ], [ 274, 276 ], [ 267, 277 ], [ 277, 278 ], [ 277, 279 ], [ 267, 280 ], [ 280, 281 ], [ 280, 282 ], [ 282, 283 ], [ 267, 284 ], [ 284, 285 ], [ 285, 286 ], [ 285, 287 ], [ 284, 288 ], [ 288, 289 ], [ 289, 290 ], [ 289, 291 ], [ 288, 292 ], [ 292, 293 ], [ 292, 294 ], [ 294, 295 ], [ 267, 296 ], [ 296, 297 ], [ 297, 298 ], [ 298, 299 ], [ 298, 300 ], [ 297, 301 ], [ 301, 302 ], [ 301, 303 ], [ 296, 304 ], [ 304, 305 ], [ 305, 306 ], [ 267, 307 ], [ 307, 308 ], [ 307, 309 ], [ 309, 310 ], [ 310, 311 ], [ 311, 312 ], [ 312, 313 ], [ 312, 314 ], [ 311, 315 ], [ 315, 316 ], [ 315, 317 ], [ 310, 318 ], [ 318, 319 ], [ 319, 320 ], [ 319, 321 ], [ 318, 322 ], [ 322, 323 ], [ 322, 324 ], [ 324, 325 ], [ 324, 326 ], [ 310, 327 ], [ 327, 328 ], [ 328, 329 ], [ 329, 330 ], [ 329, 331 ], [ 331, 332 ], [ 328, 333 ], [ 333, 334 ], [ 334, 335 ], [ 334, 336 ], [ 327, 337 ], [ 337, 338 ], [ 338, 339 ], [ 339, 340 ], [ 339, 341 ], [ 341, 342 ], [ 339, 343 ], [ 327, 344 ], [ 344, 345 ], [ 345, 346 ], [ 309, 347 ], [ 347, 348 ], [ 347, 349 ], [ 349, 350 ], [ 128, 351 ], [ 351, 352 ], [ 351, 353 ], [ 353, 354 ], [ 354, 355 ], [ 354, 356 ], [ 356, 357 ], [ 353, 358 ], [ 358, 359 ] ]
[ "import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.NoSuchElementException;\n\nclass Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n\n int[] buy = new int[K];\n for (int i = 0; i < K; i++) {\n int minId = 0;\n for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }\n buy[i] = p[minId];\n p[minId] = 1001;\n }\n\n int sum = 0;\n for (int i : buy) {\n sum += i;\n }\n System.out.println(sum);\n\n }\n}\n\nclass FastScanner {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] buffer = new byte[1024];\n\tprivate int ptr = 0;\n\tprivate int buflen = 0;\n\n\tprivate boolean hasNextByte() {\n\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate int readByte() {\n\t\tif (hasNextByte())\n\t\t\treturn buffer[ptr++];\n\t\telse\n\t\t\treturn -1;\n\t}\n\n\tprivate static boolean isPrintableChar(int c) {\n\t\treturn 33 <= c && c <= 126;\n\t}\n\n\tprivate void skipUnprintable() {\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr]))\n\t\t\tptr++;\n\t}\n\n\tpublic boolean hasNext() {\n\t\tskipUnprintable();\n\t\treturn hasNextByte();\n\t}\n\n\tpublic String next() {\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tpublic long nextLong() {\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tpublic int nextInt() {\n\t\tint n = (int) nextLong();\n\t\treturn n;\n\t}\n}", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.util.NoSuchElementException;", "NoSuchElementException", "java.util", "class Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n\n int[] buy = new int[K];\n for (int i = 0; i < K; i++) {\n int minId = 0;\n for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }\n buy[i] = p[minId];\n p[minId] = 1001;\n }\n\n int sum = 0;\n for (int i : buy) {\n sum += i;\n }\n System.out.println(sum);\n\n }\n}", "Main", "public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n\n int[] buy = new int[K];\n for (int i = 0; i < K; i++) {\n int minId = 0;\n for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }\n buy[i] = p[minId];\n p[minId] = 1001;\n }\n\n int sum = 0;\n for (int i : buy) {\n sum += i;\n }\n System.out.println(sum);\n\n }", "main", "{\n FastScanner sc = new FastScanner();\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n\n int[] buy = new int[K];\n for (int i = 0; i < K; i++) {\n int minId = 0;\n for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }\n buy[i] = p[minId];\n p[minId] = 1001;\n }\n\n int sum = 0;\n for (int i : buy) {\n sum += i;\n }\n System.out.println(sum);\n\n }", "FastScanner sc = new FastScanner();", "sc", "new FastScanner()", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = new int[N];", "p", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n p[i] = sc.nextInt();\n }", "{\n p[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "int[] buy = new int[K];", "buy", "new int[K]", "K", "for (int i = 0; i < K; i++) {\n int minId = 0;\n for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }\n buy[i] = p[minId];\n p[minId] = 1001;\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n int minId = 0;\n for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }\n buy[i] = p[minId];\n p[minId] = 1001;\n }", "{\n int minId = 0;\n for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }\n buy[i] = p[minId];\n p[minId] = 1001;\n }", "int minId = 0;", "minId", "0", "for (int j = 0; j < N; j++){\n if (p[minId] > p[j]) {\n minId = j;\n }\n }", "int j = 0;", "int j = 0;", "j", "0", "j < N", "j", "N", "j++", "j++", "j", "{\n if (p[minId] > p[j]) {\n minId = j;\n }\n }", "{\n if (p[minId] > p[j]) {\n minId = j;\n }\n }", "if (p[minId] > p[j]) {\n minId = j;\n }", "p[minId] > p[j]", "p[minId]", "p", "minId", "p[j]", "p", "j", "{\n minId = j;\n }", "minId = j", "minId", "j", "buy[i] = p[minId]", "buy[i]", "buy", "i", "p[minId]", "p", "minId", "p[minId] = 1001", "p[minId]", "p", "minId", "1001", "int sum = 0;", "sum", "0", "for (int i : buy) {\n sum += i;\n }", "int i", "buy", "{\n sum += i;\n }", "{\n sum += i;\n }", "sum += i", "sum", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "class FastScanner {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] buffer = new byte[1024];\n\tprivate int ptr = 0;\n\tprivate int buflen = 0;\n\n\tprivate boolean hasNextByte() {\n\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate int readByte() {\n\t\tif (hasNextByte())\n\t\t\treturn buffer[ptr++];\n\t\telse\n\t\t\treturn -1;\n\t}\n\n\tprivate static boolean isPrintableChar(int c) {\n\t\treturn 33 <= c && c <= 126;\n\t}\n\n\tprivate void skipUnprintable() {\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr]))\n\t\t\tptr++;\n\t}\n\n\tpublic boolean hasNext() {\n\t\tskipUnprintable();\n\t\treturn hasNextByte();\n\t}\n\n\tpublic String next() {\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\tpublic long nextLong() {\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\n\tpublic int nextInt() {\n\t\tint n = (int) nextLong();\n\t\treturn n;\n\t}\n}", "FastScanner", "private final InputStream in = System.in;", "in", "System.in", "System", "System.in", "private final byte[] buffer = new byte[1024];", "buffer", "new byte[1024]", "1024", "private int ptr = 0;", "ptr", "0", "private int buflen = 0;", "buflen", "0", "private boolean hasNextByte() {\n\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "hasNextByte", "{\n\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "if (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "ptr < buflen", "ptr", "buflen", "{\n\t\t\treturn true;\n\t\t}", "return true;", "true", "{\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "ptr = 0", "ptr", "0", "try {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}", "catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}", "IOException e", "{\n\t\t\t\te.printStackTrace();\n\t\t\t}", "e.printStackTrace()", "e.printStackTrace", "e", "{\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t}", "buflen = in.read(buffer)", "buflen", "in.read(buffer)", "in.read", "in", "buffer", "if (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}", "buflen <= 0", "buflen", "0", "{\n\t\t\t\treturn false;\n\t\t\t}", "return false;", "false", "return true;", "true", "private int readByte() {\n\t\tif (hasNextByte())\n\t\t\treturn buffer[ptr++];\n\t\telse\n\t\t\treturn -1;\n\t}", "readByte", "{\n\t\tif (hasNextByte())\n\t\t\treturn buffer[ptr++];\n\t\telse\n\t\t\treturn -1;\n\t}", "if (hasNextByte())\n\t\t\treturn buffer[ptr++];\n\t\telse\n\t\t\treturn -1;", "hasNextByte()", "hasNextByte", "return buffer[ptr++];", "buffer[ptr++]", "buffer", "ptr++", "ptr", "return -1;", "-1", "1", "private static boolean isPrintableChar(int c) {\n\t\treturn 33 <= c && c <= 126;\n\t}", "isPrintableChar", "{\n\t\treturn 33 <= c && c <= 126;\n\t}", "return 33 <= c && c <= 126;", "33 <= c && c <= 126", "33 <= c", "33", "c", "c <= 126", "c", "126", "int c", "c", "private void skipUnprintable() {\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr]))\n\t\t\tptr++;\n\t}", "skipUnprintable", "{\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr]))\n\t\t\tptr++;\n\t}", "while (hasNextByte() && !isPrintableChar(buffer[ptr]))\n\t\t\tptr++;", "hasNextByte() && !isPrintableChar(buffer[ptr])", "hasNextByte()", "hasNextByte", "!isPrintableChar(buffer[ptr])", "isPrintableChar(buffer[ptr])", "isPrintableChar", "buffer[ptr]", "buffer", "ptr", "ptr++", "ptr", "public boolean hasNext() {\n\t\tskipUnprintable();\n\t\treturn hasNextByte();\n\t}", "hasNext", "{\n\t\tskipUnprintable();\n\t\treturn hasNextByte();\n\t}", "skipUnprintable()", "skipUnprintable", "return hasNextByte();", "hasNextByte()", "hasNextByte", "public String next() {\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}", "next", "{\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}", "if (!hasNext())\n\t\t\tthrow new NoSuchElementException();", "!hasNext()", "hasNext()", "hasNext", "throw new NoSuchElementException();", "new NoSuchElementException()", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "int b = readByte();", "b", "readByte()", "readByte", "while (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}", "isPrintableChar(b)", "isPrintableChar", "b", "{\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}", "sb.appendCodePoint(b)", "sb.appendCodePoint", "sb", "b", "b = readByte()", "b", "readByte()", "readByte", "return sb.toString();", "sb.toString()", "sb.toString", "sb", "public long nextLong() {\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}", "nextLong", "{\n\t\tif (!hasNext())\n\t\t\tthrow new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}", "if (!hasNext())\n\t\t\tthrow new NoSuchElementException();", "!hasNext()", "hasNext()", "hasNext", "throw new NoSuchElementException();", "new NoSuchElementException()", "long n = 0;", "n", "0", "boolean minus = false;", "minus", "false", "int b = readByte();", "b", "readByte()", "readByte", "if (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}", "b == '-'", "b", "'-'", "{\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}", "minus = true", "minus", "true", "b = readByte()", "b", "readByte()", "readByte", "if (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}", "b < '0' || '9' < b", "b < '0'", "b", "'0'", "'9' < b", "'9'", "b", "{\n\t\t\tthrow new NumberFormatException();\n\t\t}", "throw new NumberFormatException();", "new NumberFormatException()", "while (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}", "true", "{\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}", "if ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}", "'0' <= b && b <= '9'", "'0' <= b", "'0'", "b", "b <= '9'", "b", "'9'", "{\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t}", "n *= 10", "n", "10", "n += b - '0'", "n", "b - '0'", "b", "'0'", "if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}", "b == -1 || !isPrintableChar(b)", "b == -1", "b", "-1", "1", "!isPrintableChar(b)", "isPrintableChar(b)", "isPrintableChar", "b", "{\n\t\t\t\treturn minus ? -n : n;\n\t\t\t}", "return minus ? -n : n;", "minus ? -n : n", "minus", "-n", "n", "n", "{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}", "throw new NumberFormatException();", "new NumberFormatException()", "b = readByte()", "b", "readByte()", "readByte", "public int nextInt() {\n\t\tint n = (int) nextLong();\n\t\treturn n;\n\t}", "nextInt", "{\n\t\tint n = (int) nextLong();\n\t\treturn n;\n\t}", "int n = (int) nextLong();", "n", "(int) nextLong()", "nextLong", "return n;", "n" ]
import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; class Main { public static void main(String[] args) { FastScanner sc = new FastScanner(); int N = sc.nextInt(); int K = sc.nextInt(); int[] p = new int[N]; for (int i = 0; i < N; i++) { p[i] = sc.nextInt(); } int[] buy = new int[K]; for (int i = 0; i < K; i++) { int minId = 0; for (int j = 0; j < N; j++){ if (p[minId] > p[j]) { minId = j; } } buy[i] = p[minId]; p[minId] = 1001; } int sum = 0; for (int i : buy) { sum += i; } System.out.println(sum); } } class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if (ptr < buflen) { return true; } else { ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1; } private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126; } private void skipUnprintable() { while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; } public boolean hasNext() { skipUnprintable(); return hasNextByte(); } public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while (isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while (true) { if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; } else if (b == -1 || !isPrintableChar(b)) { return minus ? -n : n; } else { throw new NumberFormatException(); } b = readByte(); } } public int nextInt() { int n = (int) nextLong(); return n; } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 20, 41, 13, 17, 42, 2, 40, 13, 17, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 41, 13, 17, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 6, 13, 41, 13, 41, 13, 20, 17, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 23, 13, 12, 13, 30, 14, 2, 13, 40, 17, 37, 20, 14, 2, 13, 13, 30, 0, 13, 17, 38, 5, 13, 30, 37, 20, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 29, 40, 17, 29, 18, 13, 40, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 30, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 30, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 11, 1, 41, 13, 17, 41, 13, 18, 13, 13, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 2, 4, 18, 13, 2, 13, 13, 13, 41, 13, 18, 13, 13, 0, 18, 13, 13, 18, 13, 13, 0, 18, 13, 13, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 30, 0, 13, 4, 13, 41, 13, 20, 42, 40, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 0, 13, 4, 13, 41, 13, 20, 42, 40, 4, 13, 13, 30, 4, 18, 13, 13, 0, 13, 4, 13, 29, 4, 18, 13, 12, 13, 30, 29, 2, 2, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 23, 13, 12, 13, 30, 29, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 460, 8 ], [ 460, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 11, 18 ], [ 18, 19 ], [ 18, 20 ], [ 11, 21 ], [ 21, 22 ], [ 21, 23 ], [ 11, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 25, 28 ], [ 24, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 29, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 40, 41 ], [ 40, 42 ], [ 42, 43 ], [ 43, 44 ], [ 42, 45 ], [ 29, 46 ], [ 46, 47 ], [ 46, 48 ], [ 29, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 29, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 67, 69 ], [ 29, 70 ], [ 70, 71 ], [ 71, 72 ], [ 70, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 9, 77 ], [ 77, 78 ], [ 460, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 79, 83 ], [ 83, 84 ], [ 83, 85 ], [ 79, 87 ], [ 87, 88 ], [ 79, 89 ], [ 89, 90 ], [ 79, 91 ], [ 91, 92 ], [ 91, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 94, 98 ], [ 91, 99 ], [ 99, 100 ], [ 79, 101 ], [ 101, 102 ], [ 101, 103 ], [ 103, 104 ], [ 104, 105 ], [ 105, 106 ], [ 105, 107 ], [ 107, 108 ], [ 104, 109 ], [ 109, 110 ], [ 103, 111 ], [ 111, 112 ], [ 112, 113 ], [ 112, 114 ], [ 111, 115 ], [ 115, 116 ], [ 116, 117 ], [ 116, 118 ], [ 115, 119 ], [ 119, 120 ], [ 120, 121 ], [ 120, 122 ], [ 122, 123 ], [ 123, 124 ], [ 119, 125 ], [ 125, 126 ], [ 126, 127 ], [ 126, 128 ], [ 128, 129 ], [ 129, 130 ], [ 128, 131 ], [ 115, 132 ], [ 132, 133 ], [ 133, 134 ], [ 133, 135 ], [ 132, 136 ], [ 136, 137 ], [ 137, 138 ], [ 103, 139 ], [ 139, 140 ], [ 140, 141 ], [ 140, 142 ], [ 142, 143 ], [ 79, 144 ], [ 144, 145 ], [ 144, 146 ], [ 146, 147 ], [ 147, 148 ], [ 147, 149 ], [ 149, 150 ], [ 146, 151 ], [ 151, 152 ], [ 152, 153 ], [ 152, 154 ], [ 151, 155 ], [ 155, 156 ], [ 156, 157 ], [ 156, 158 ], [ 158, 159 ], [ 146, 160 ], [ 160, 161 ], [ 160, 162 ], [ 146, 163 ], [ 163, 164 ], [ 164, 165 ], [ 164, 166 ], [ 163, 167 ], [ 167, 168 ], [ 168, 169 ], [ 168, 170 ], [ 170, 171 ], [ 167, 172 ], [ 172, 173 ], [ 172, 174 ], [ 174, 175 ], [ 146, 176 ], [ 176, 177 ], [ 176, 178 ], [ 146, 179 ], [ 179, 180 ], [ 180, 181 ], [ 181, 182 ], [ 181, 183 ], [ 179, 184 ], [ 184, 185 ], [ 185, 186 ], [ 185, 187 ], [ 184, 188 ], [ 188, 189 ], [ 188, 190 ], [ 190, 191 ], [ 190, 192 ], [ 184, 193 ], [ 193, 194 ], [ 193, 195 ], [ 195, 196 ], [ 146, 197 ], [ 197, 198 ], [ 198, 199 ], [ 198, 200 ], [ 79, 201 ], [ 201, 202 ], [ 201, 203 ], [ 203, 204 ], [ 204, 205 ], [ 204, 206 ], [ 206, 207 ], [ 203, 208 ], [ 208, 209 ], [ 209, 210 ], [ 209, 211 ], [ 208, 212 ], [ 212, 213 ], [ 213, 214 ], [ 213, 215 ], [ 215, 216 ], [ 203, 217 ], [ 217, 218 ], [ 217, 219 ], [ 203, 220 ], [ 220, 221 ], [ 221, 222 ], [ 221, 223 ], [ 220, 224 ], [ 224, 225 ], [ 225, 226 ], [ 225, 227 ], [ 227, 228 ], [ 224, 229 ], [ 229, 230 ], [ 229, 231 ], [ 231, 232 ], [ 203, 233 ], [ 233, 234 ], [ 233, 235 ], [ 203, 236 ], [ 236, 237 ], [ 237, 238 ], [ 238, 239 ], [ 238, 240 ], [ 236, 241 ], [ 241, 242 ], [ 242, 243 ], [ 242, 244 ], [ 241, 245 ], [ 245, 246 ], [ 245, 247 ], [ 247, 248 ], [ 247, 249 ], [ 241, 250 ], [ 250, 251 ], [ 250, 252 ], [ 252, 253 ], [ 203, 254 ], [ 254, 255 ], [ 255, 256 ], [ 255, 257 ], [ 79, 258 ], [ 258, 259 ], [ 258, 260 ], [ 260, 261 ], [ 261, 262 ], [ 261, 263 ], [ 260, 265 ], [ 265, 266 ], [ 266, 267 ], [ 267, 268 ], [ 267, 269 ], [ 265, 270 ], [ 270, 271 ], [ 270, 272 ], [ 265, 273 ], [ 273, 274 ], [ 274, 275 ], [ 265, 276 ], [ 277, 277 ], [ 277, 278 ], [ 278, 279 ], [ 279, 280 ], [ 279, 281 ], [ 278, 282 ], [ 282, 283 ], [ 260, 284 ], [ 284, 285 ], [ 258, 286 ], [ 286, 287 ], [ 79, 288 ], [ 288, 289 ], [ 288, 290 ], [ 290, 291 ], [ 291, 292 ], [ 292, 293 ], [ 293, 294 ], [ 293, 295 ], [ 292, 296 ], [ 296, 297 ], [ 296, 298 ], [ 298, 299 ], [ 298, 300 ], [ 291, 301 ], [ 301, 302 ], [ 301, 303 ], [ 291, 304 ], [ 304, 305 ], [ 305, 306 ], [ 291, 307 ], [ 308, 308 ], [ 308, 309 ], [ 309, 310 ], [ 309, 311 ], [ 311, 312 ], [ 312, 313 ], [ 313, 314 ], [ 312, 315 ], [ 315, 316 ], [ 315, 317 ], [ 311, 318 ], [ 308, 319 ], [ 319, 320 ], [ 319, 321 ], [ 321, 322 ], [ 321, 323 ], [ 308, 324 ], [ 324, 325 ], [ 325, 326 ], [ 325, 327 ], [ 324, 328 ], [ 328, 329 ], [ 328, 330 ], [ 308, 331 ], [ 331, 332 ], [ 332, 333 ], [ 332, 334 ], [ 331, 335 ], [ 290, 336 ], [ 336, 337 ], [ 288, 338 ], [ 338, 339 ], [ 288, 340 ], [ 340, 341 ], [ 79, 342 ], [ 342, 343 ], [ 342, 344 ], [ 344, 345 ], [ 345, 346 ], [ 345, 347 ], [ 347, 348 ], [ 344, 349 ], [ 349, 350 ], [ 350, 351 ], [ 350, 352 ], [ 349, 353 ], [ 353, 354 ], [ 354, 355 ], [ 354, 356 ], [ 356, 357 ], [ 344, 358 ], [ 358, 359 ], [ 358, 360 ], [ 344, 361 ], [ 361, 362 ], [ 362, 363 ], [ 363, 364 ], [ 363, 365 ], [ 361, 366 ], [ 366, 367 ], [ 367, 368 ], [ 368, 369 ], [ 367, 370 ], [ 366, 371 ], [ 371, 372 ], [ 371, 373 ], [ 373, 374 ], [ 344, 375 ], [ 375, 376 ], [ 376, 377 ], [ 377, 378 ], [ 79, 379 ], [ 379, 380 ], [ 379, 381 ], [ 381, 382 ], [ 382, 383 ], [ 382, 384 ], [ 384, 385 ], [ 381, 386 ], [ 386, 387 ], [ 387, 388 ], [ 387, 389 ], [ 386, 390 ], [ 390, 391 ], [ 390, 392 ], [ 392, 393 ], [ 381, 394 ], [ 394, 395 ], [ 394, 396 ], [ 381, 397 ], [ 397, 398 ], [ 398, 399 ], [ 399, 400 ], [ 399, 401 ], [ 397, 402 ], [ 402, 403 ], [ 403, 404 ], [ 404, 405 ], [ 403, 406 ], [ 402, 407 ], [ 407, 408 ], [ 407, 409 ], [ 409, 410 ], [ 381, 411 ], [ 411, 412 ], [ 412, 413 ], [ 413, 414 ], [ 79, 415 ], [ 415, 416 ], [ 415, 417 ], [ 417, 418 ], [ 418, 419 ], [ 422, 420 ], [ 432, 421 ], [ 429, 422 ], [ 422, 423 ], [ 423, 424 ], [ 423, 425 ], [ 422, 426 ], [ 426, 427 ], [ 426, 428 ], [ 429, 429 ], [ 429, 430 ], [ 429, 431 ], [ 432, 432 ], [ 432, 433 ], [ 432, 434 ], [ 422, 435 ], [ 435, 436 ], [ 435, 437 ], [ 437, 438 ], [ 415, 439 ], [ 439, 440 ], [ 79, 441 ], [ 441, 442 ], [ 441, 443 ], [ 443, 444 ], [ 444, 445 ], [ 446, 446 ], [ 446, 447 ], [ 447, 448 ], [ 447, 449 ], [ 446, 450 ], [ 450, 451 ], [ 450, 452 ], [ 446, 453 ], [ 453, 454 ], [ 453, 455 ], [ 455, 456 ], [ 441, 457 ], [ 457, 458 ], [ 0, 459 ], [ 459, 460 ], [ 459, 461 ] ]
[ "import java.io.*;\nimport java.util.*;\npublic class Main {\n\npublic static void main(String[] args) {\n InputReader sc = new InputReader(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n Random gen = new Random();\n int test = 1;//sc.nextInt();\n while(test-->0) {\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }\n pw.close();\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstatic class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n\n public InputReader(InputStream st) {\n this.stream = st;\n }\n\n public int read() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int [] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public static int[] shuffle(int[] a, Random gen)\n { for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }\n return a;\n }\n\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n}\n\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n\npublic static void main(String[] args) {\n InputReader sc = new InputReader(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n Random gen = new Random();\n int test = 1;//sc.nextInt();\n while(test-->0) {\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }\n pw.close();\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstatic class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n\n public InputReader(InputStream st) {\n this.stream = st;\n }\n\n public int read() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int [] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public static int[] shuffle(int[] a, Random gen)\n { for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }\n return a;\n }\n\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n}\n\n}", "Main", "public static void main(String[] args) {\n InputReader sc = new InputReader(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n Random gen = new Random();\n int test = 1;//sc.nextInt();\n while(test-->0) {\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }\n pw.close();\n\n}", "main", "{\n InputReader sc = new InputReader(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n Random gen = new Random();\n int test = 1;//sc.nextInt();\n while(test-->0) {\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }\n pw.close();\n\n}", "InputReader sc = new InputReader(System.in);", "sc", "new InputReader(System.in)", "PrintWriter pw = new PrintWriter(System.out);", "pw", "new PrintWriter(System.out)", "Random gen = new Random();", "gen", "new Random()", "int test = 1;", "test", "1", "while(test-->0) {\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }", "test-->0", "test--", "test", "0", "{\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int [] ar = sc.nextIntArray(n);", "ar", "sc.nextIntArray(n)", "sc.nextIntArray", "sc", "n", "long sum = 0;", "sum", "0", "Arrays.sort(ar)", "Arrays.sort", "Arrays", "ar", "for(int i=0;i<k;i++)\n sum+=ar[i];", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "sum+=ar[i];", "sum+=ar[i]", "sum", "ar[i]", "ar", "i", "pw.println(sum)", "pw.println", "pw", "sum", "pw.close()", "pw.close", "pw", "String[] args", "args", "static class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n\n public InputReader(InputStream st) {\n this.stream = st;\n }\n\n public int read() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int [] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public static int[] shuffle(int[] a, Random gen)\n { for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }\n return a;\n }\n\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n}", "InputReader", "private final InputStream stream;", "stream", "private final byte[] buf = new byte[8192];", "buf", "new byte[8192]", "8192", "private int curChar", "curChar", "snumChars;", "snumChars", "public InputReader(InputStream st) {\n this.stream = st;\n }", "InputReader", "{\n this.stream = st;\n }", "this.stream = st", "this.stream", "this", "this.stream", "st", "InputStream st", "st", "public int read() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "read", "{\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }", "if (snumChars == -1)\n throw new InputMismatchException();", "snumChars == -1", "snumChars", "-1", "1", "throw new InputMismatchException();", "new InputMismatchException()", "if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }", "curChar >= snumChars", "curChar", "snumChars", "{\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }", "curChar = 0", "curChar", "0", "try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }", "catch (IOException e) {\n throw new InputMismatchException();\n }", "IOException e", "{\n throw new InputMismatchException();\n }", "throw new InputMismatchException();", "new InputMismatchException()", "{\n snumChars = stream.read(buf);\n }", "snumChars = stream.read(buf)", "snumChars", "stream.read(buf)", "stream.read", "stream", "buf", "if (snumChars <= 0)\n return -1;", "snumChars <= 0", "snumChars", "0", "return -1;", "-1", "1", "return buf[curChar++];", "buf[curChar++]", "buf", "curChar++", "curChar", "public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "nextInt", "{\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c)) {\n c = read();\n }", "isSpaceChar(c)", "isSpaceChar", "c", "{\n c = read();\n }", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "int res = 0;", "res", "0", "do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n res *= 10;\n res += c - '0';\n c = read();\n }", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public long nextLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "nextLong", "{\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c)) {\n c = read();\n }", "isSpaceChar(c)", "isSpaceChar", "c", "{\n c = read();\n }", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "long res = 0;", "res", "0", "do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n res *= 10;\n res += c - '0';\n c = read();\n }", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public int[] nextIntArray(int n) {\n int [] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }", "nextIntArray", "{\n int [] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }", "int [] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n a[i] = nextInt();\n }", "{\n a[i] = nextInt();\n }", "a[i] = nextInt()", "a[i]", "a", "i", "nextInt()", "nextInt", "return a;", "a", "int n", "n", "public static int[] shuffle(int[] a, Random gen)\n { for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }\n return a;\n }", "shuffle", "{ for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }\n return a;\n }", "for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }", "int i = 0, n = a.length;", "int i = 0", "i", "0", "n = a.length;", "n", "a.length", "a", "a.length", "i < n", "i", "n", "i++", "i++", "i", "{ int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }", "{ int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }", "int ind = gen.nextInt(n-i)+i;", "ind", "gen.nextInt(n-i)+i", "gen.nextInt(n-i)", "gen.nextInt", "gen", "n-i", "n", "i", "i", "int d = a[i];", "d", "a[i]", "a", "i", "a[i] = a[ind]", "a[i]", "a", "i", "a[ind]", "a", "ind", "a[ind] = d", "a[ind]", "a", "ind", "d", "return a;", "a", "int[] a", "a", "Random gen", "gen", "public String readString() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }", "readString", "{\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c)) {\n c = read();\n }", "isSpaceChar(c)", "isSpaceChar", "c", "{\n c = read();\n }", "c = read()", "c", "read()", "read", "StringBuilder res = new StringBuilder();", "res", "new StringBuilder()", "do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n res.appendCodePoint(c);\n c = read();\n }", "res.appendCodePoint(c)", "res.appendCodePoint", "res", "c", "c = read()", "c", "read()", "read", "return res.toString();", "res.toString()", "res.toString", "res", "public String nextLine() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));\n return res.toString();\n }", "nextLine", "{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));\n return res.toString();\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c))\n c = read();", "isSpaceChar(c)", "isSpaceChar", "c", "c = read()", "c", "read()", "read", "StringBuilder res = new StringBuilder();", "res", "new StringBuilder()", "do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));", "!isEndOfLine(c)", "isEndOfLine(c)", "isEndOfLine", "c", "{\n res.appendCodePoint(c);\n c = read();\n }", "res.appendCodePoint(c)", "res.appendCodePoint", "res", "c", "c = read()", "c", "read()", "read", "return res.toString();", "res.toString()", "res.toString", "res", "public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "isSpaceChar", "{\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == '\\t'", "c == '\\r'", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == ' '", "c", "' '", "c == '\\n'", "c", "'\\n'", "c == '\\r'", "c", "'\\r'", "c == '\\t'", "c", "'\\t'", "c == -1", "c", "-1", "1", "int c", "c", "private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }", "isEndOfLine", "{\n return c == '\\n' || c == '\\r' || c == -1;\n }", "return c == '\\n' || c == '\\r' || c == -1;", "c == '\\n' || c == '\\r' || c == -1", "c == '\\n' || c == '\\r' || c == -1", "c == '\\n'", "c", "'\\n'", "c == '\\r'", "c", "'\\r'", "c == -1", "c", "-1", "1", "int c", "c", "public class Main {\n\npublic static void main(String[] args) {\n InputReader sc = new InputReader(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n Random gen = new Random();\n int test = 1;//sc.nextInt();\n while(test-->0) {\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }\n pw.close();\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstatic class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n\n public InputReader(InputStream st) {\n this.stream = st;\n }\n\n public int read() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int [] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public static int[] shuffle(int[] a, Random gen)\n { for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }\n return a;\n }\n\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n}\n\n}", "public class Main {\n\npublic static void main(String[] args) {\n InputReader sc = new InputReader(System.in);\n PrintWriter pw = new PrintWriter(System.out);\n Random gen = new Random();\n int test = 1;//sc.nextInt();\n while(test-->0) {\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n int [] ar = sc.nextIntArray(n);\n long sum = 0;\n Arrays.sort(ar);\n for(int i=0;i<k;i++)\n sum+=ar[i];\n\n pw.println(sum);\n }\n pw.close();\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstatic class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n\n public InputReader(InputStream st) {\n this.stream = st;\n }\n\n public int read() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int [] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public static int[] shuffle(int[] a, Random gen)\n { for(int i = 0, n = a.length;i < n;i++)\n { int ind = gen.nextInt(n-i)+i;\n int d = a[i];\n a[i] = a[ind];\n a[ind] = d;\n\n }\n return a;\n }\n\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n}\n\n}", "Main" ]
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { InputReader sc = new InputReader(System.in); PrintWriter pw = new PrintWriter(System.out); Random gen = new Random(); int test = 1;//sc.nextInt(); while(test-->0) { int n = sc.nextInt(); int k = sc.nextInt(); int [] ar = sc.nextIntArray(n); long sum = 0; Arrays.sort(ar); for(int i=0;i<k;i++) sum+=ar[i]; pw.println(sum); } pw.close(); } static class InputReader { private final InputStream stream; private final byte[] buf = new byte[8192]; private int curChar, snumChars; public InputReader(InputStream st) { this.stream = st; } public int read() { if (snumChars == -1) throw new InputMismatchException(); if (curChar >= snumChars) { curChar = 0; try { snumChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (snumChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = read(); while (isSpaceChar(c)) { c = read(); } int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = read(); while (isSpaceChar(c)) { c = read(); } int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public int[] nextIntArray(int n) { int [] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = nextInt(); } return a; } public static int[] shuffle(int[] a, Random gen) { for(int i = 0, n = a.length;i < n;i++) { int ind = gen.nextInt(n-i)+i; int d = a[i]; a[i] = a[ind]; a[ind] = d; } return a; } public String readString() { int c = read(); while (isSpaceChar(c)) { c = read(); } StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public String nextLine() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isEndOfLine(c)); return res.toString(); } public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } private boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 41, 13, 20, 4, 18, 13, 17, 13, 13, 4, 18, 13, 23, 13, 6, 13, 12, 13, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 23, 13, 23, 13, 6, 13, 41, 13, 41, 13, 20, 17, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 23, 13, 12, 13, 30, 14, 2, 13, 40, 17, 30, 37, 20, 14, 2, 13, 13, 30, 0, 13, 17, 38, 5, 13, 30, 37, 20, 30, 0, 13, 4, 18, 13, 13, 14, 2, 13, 17, 30, 29, 40, 17, 29, 18, 13, 40, 13, 12, 13, 30, 41, 13, 4, 13, 42, 4, 13, 13, 30, 0, 13, 4, 13, 41, 13, 17, 14, 2, 13, 17, 30, 0, 13, 40, 17, 0, 13, 4, 13, 41, 13, 17, 42, 40, 4, 13, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 30, 37, 20, 0, 13, 17, 0, 13, 2, 13, 17, 0, 13, 4, 13, 29, 2, 13, 13, 12, 13, 30, 14, 2, 13, 17, 30, 29, 4, 18, 13, 13, 29, 4, 13, 13, 23, 13, 12, 13, 30, 29, 2, 2, 2, 2, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 17, 2, 13, 40, 17, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 6, 13, 12, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 334, 26 ], [ 334, 27 ], [ 27, 28 ], [ 27, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 32, 34 ], [ 29, 35 ], [ 35, 36 ], [ 35, 37 ], [ 37, 38 ], [ 37, 39 ], [ 29, 40 ], [ 40, 41 ], [ 40, 42 ], [ 29, 43 ], [ 43, 44 ], [ 43, 45 ], [ 29, 46 ], [ 46, 47 ], [ 46, 48 ], [ 29, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 49, 53 ], [ 49, 54 ], [ 29, 55 ], [ 55, 56 ], [ 56, 57 ], [ 27, 58 ], [ 58, 59 ], [ 334, 60 ], [ 60, 61 ], [ 60, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 67, 68 ], [ 68, 69 ], [ 64, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 64, 75 ], [ 75, 76 ], [ 75, 77 ], [ 77, 78 ], [ 78, 79 ], [ 77, 80 ], [ 64, 81 ], [ 81, 82 ], [ 82, 83 ], [ 81, 84 ], [ 64, 85 ], [ 85, 86 ], [ 85, 87 ], [ 64, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 88, 93 ], [ 93, 94 ], [ 93, 95 ], [ 88, 96 ], [ 96, 97 ], [ 97, 98 ], [ 88, 99 ], [ 100, 100 ], [ 100, 101 ], [ 101, 102 ], [ 101, 103 ], [ 103, 104 ], [ 103, 105 ], [ 64, 106 ], [ 106, 107 ], [ 107, 108 ], [ 106, 109 ], [ 62, 110 ], [ 110, 111 ], [ 62, 112 ], [ 112, 113 ], [ 62, 114 ], [ 114, 115 ], [ 334, 116 ], [ 116, 117 ], [ 116, 118 ], [ 118, 119 ], [ 116, 120 ], [ 120, 121 ], [ 120, 122 ], [ 116, 124 ], [ 124, 125 ], [ 116, 126 ], [ 126, 127 ], [ 116, 128 ], [ 128, 129 ], [ 116, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 133, 134 ], [ 134, 135 ], [ 134, 136 ], [ 133, 137 ], [ 130, 138 ], [ 138, 139 ], [ 116, 140 ], [ 140, 141 ], [ 140, 142 ], [ 142, 143 ], [ 143, 144 ], [ 144, 145 ], [ 144, 146 ], [ 146, 147 ], [ 143, 148 ], [ 148, 149 ], [ 149, 150 ], [ 142, 151 ], [ 151, 152 ], [ 152, 153 ], [ 152, 154 ], [ 151, 155 ], [ 155, 156 ], [ 156, 157 ], [ 156, 158 ], [ 155, 159 ], [ 159, 160 ], [ 160, 161 ], [ 160, 162 ], [ 162, 163 ], [ 163, 164 ], [ 159, 165 ], [ 165, 166 ], [ 166, 167 ], [ 166, 168 ], [ 168, 169 ], [ 169, 170 ], [ 168, 171 ], [ 155, 172 ], [ 172, 173 ], [ 173, 174 ], [ 173, 175 ], [ 172, 176 ], [ 176, 177 ], [ 177, 178 ], [ 178, 179 ], [ 142, 180 ], [ 180, 181 ], [ 181, 182 ], [ 181, 183 ], [ 183, 184 ], [ 116, 185 ], [ 185, 186 ], [ 185, 187 ], [ 187, 188 ], [ 188, 189 ], [ 188, 190 ], [ 190, 191 ], [ 187, 192 ], [ 192, 193 ], [ 193, 194 ], [ 193, 195 ], [ 192, 196 ], [ 196, 197 ], [ 197, 198 ], [ 197, 199 ], [ 199, 200 ], [ 187, 201 ], [ 201, 202 ], [ 201, 203 ], [ 187, 204 ], [ 204, 205 ], [ 205, 206 ], [ 205, 207 ], [ 204, 208 ], [ 208, 209 ], [ 209, 210 ], [ 209, 211 ], [ 211, 212 ], [ 208, 213 ], [ 213, 214 ], [ 213, 215 ], [ 215, 216 ], [ 187, 217 ], [ 217, 218 ], [ 217, 219 ], [ 187, 220 ], [ 220, 221 ], [ 221, 222 ], [ 222, 223 ], [ 222, 224 ], [ 220, 225 ], [ 225, 226 ], [ 226, 227 ], [ 227, 228 ], [ 228, 229 ], [ 228, 230 ], [ 227, 231 ], [ 231, 232 ], [ 231, 233 ], [ 226, 234 ], [ 234, 235 ], [ 235, 236 ], [ 225, 237 ], [ 237, 238 ], [ 237, 239 ], [ 225, 240 ], [ 240, 241 ], [ 240, 242 ], [ 242, 243 ], [ 242, 244 ], [ 225, 245 ], [ 245, 246 ], [ 245, 247 ], [ 247, 248 ], [ 187, 249 ], [ 249, 250 ], [ 250, 251 ], [ 250, 252 ], [ 116, 253 ], [ 253, 254 ], [ 253, 255 ], [ 255, 256 ], [ 256, 257 ], [ 257, 258 ], [ 257, 259 ], [ 256, 260 ], [ 260, 261 ], [ 261, 262 ], [ 262, 263 ], [ 263, 264 ], [ 262, 265 ], [ 255, 266 ], [ 266, 267 ], [ 267, 268 ], [ 267, 269 ], [ 253, 270 ], [ 270, 271 ], [ 116, 272 ], [ 272, 273 ], [ 272, 274 ], [ 274, 275 ], [ 275, 276 ], [ 279, 277 ], [ 289, 278 ], [ 286, 279 ], [ 279, 280 ], [ 280, 281 ], [ 280, 282 ], [ 279, 283 ], [ 283, 284 ], [ 283, 285 ], [ 286, 286 ], [ 286, 287 ], [ 286, 288 ], [ 289, 289 ], [ 289, 290 ], [ 289, 291 ], [ 279, 292 ], [ 292, 293 ], [ 292, 294 ], [ 294, 295 ], [ 272, 296 ], [ 296, 297 ], [ 116, 298 ], [ 298, 299 ], [ 298, 300 ], [ 300, 301 ], [ 301, 302 ], [ 301, 303 ], [ 300, 305 ], [ 305, 306 ], [ 306, 307 ], [ 307, 308 ], [ 307, 309 ], [ 305, 310 ], [ 310, 311 ], [ 310, 312 ], [ 305, 313 ], [ 313, 314 ], [ 314, 315 ], [ 305, 316 ], [ 316, 317 ], [ 317, 318 ], [ 318, 319 ], [ 318, 320 ], [ 317, 321 ], [ 321, 322 ], [ 300, 323 ], [ 323, 324 ], [ 298, 325 ], [ 325, 326 ], [ 116, 327 ], [ 327, 328 ], [ 327, 329 ], [ 329, 330 ], [ 329, 331 ], [ 331, 332 ], [ 0, 333 ], [ 333, 334 ], [ 333, 335 ] ]
[ "import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.InputMismatchException;\nimport java.io.IOException;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMixJuice solver = new BMixJuice();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMixJuice {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int n = s.nextInt();\n int k = s.nextInt();\n int[] arr = s.nextIntArray(n);\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n out.println(sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; ++i) array[i] = nextInt();\n return array;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}\n", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.InputMismatchException;", "InputMismatchException", "java.util", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMixJuice solver = new BMixJuice();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMixJuice {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int n = s.nextInt();\n int k = s.nextInt();\n int[] arr = s.nextIntArray(n);\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n out.println(sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; ++i) array[i] = nextInt();\n return array;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}", "Main", "public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMixJuice solver = new BMixJuice();\n solver.solve(1, in, out);\n out.close();\n }", "main", "{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMixJuice solver = new BMixJuice();\n solver.solve(1, in, out);\n out.close();\n }", "InputStream inputStream = System.in;", "inputStream", "System.in", "System", "System.in", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "FastReader in = new FastReader(inputStream);", "in", "new FastReader(inputStream)", "PrintWriter out = new PrintWriter(outputStream);", "out", "new PrintWriter(outputStream)", "BMixJuice solver = new BMixJuice();", "solver", "new BMixJuice()", "solver.solve(1, in, out)", "solver.solve", "solver", "1", "in", "out", "out.close()", "out.close", "out", "String[] args", "args", "static class BMixJuice {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int n = s.nextInt();\n int k = s.nextInt();\n int[] arr = s.nextIntArray(n);\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n out.println(sum);\n }\n\n }", "BMixJuice", "public void solve(int testNumber, FastReader s, PrintWriter out) {\n int n = s.nextInt();\n int k = s.nextInt();\n int[] arr = s.nextIntArray(n);\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n out.println(sum);\n }", "solve", "{\n int n = s.nextInt();\n int k = s.nextInt();\n int[] arr = s.nextIntArray(n);\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n out.println(sum);\n }", "int n = s.nextInt();", "n", "s.nextInt()", "s.nextInt", "s", "int k = s.nextInt();", "k", "s.nextInt()", "s.nextInt", "s", "int[] arr = s.nextIntArray(n);", "arr", "s.nextIntArray(n)", "s.nextIntArray", "s", "n", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int sum = 0;", "sum", "0", "for (int i = 0; i < k; i++) {\n sum += arr[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n sum += arr[i];\n }", "{\n sum += arr[i];\n }", "sum += arr[i]", "sum", "arr[i]", "arr", "i", "out.println(sum)", "out.println", "out", "sum", "int testNumber", "testNumber", "FastReader s", "s", "PrintWriter out", "out", "static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; ++i) array[i] = nextInt();\n return array;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }", "FastReader", "private InputStream stream;", "stream", "private byte[] buf = new byte[1024];", "buf", "new byte[1024]", "1024", "private int curChar;", "curChar", "private int numChars;", "numChars", "private FastReader.SpaceCharFilter filter;", "filter", "public FastReader(InputStream stream) {\n this.stream = stream;\n }", "FastReader", "{\n this.stream = stream;\n }", "this.stream = stream", "this.stream", "this", "this.stream", "stream", "InputStream stream", "stream", "public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }", "read", "{\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }", "if (numChars == -1) {\n throw new InputMismatchException();\n }", "numChars == -1", "numChars", "-1", "1", "{\n throw new InputMismatchException();\n }", "throw new InputMismatchException();", "new InputMismatchException()", "if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }", "curChar >= numChars", "curChar", "numChars", "{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }", "curChar = 0", "curChar", "0", "try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }", "catch (IOException e) {\n throw new InputMismatchException();\n }", "IOException e", "{\n throw new InputMismatchException();\n }", "throw new InputMismatchException();", "new InputMismatchException()", "{\n numChars = stream.read(buf);\n }", "numChars = stream.read(buf)", "numChars", "stream.read(buf)", "stream.read", "stream", "buf", "if (numChars <= 0) {\n return -1;\n }", "numChars <= 0", "numChars", "0", "{\n return -1;\n }", "return -1;", "-1", "1", "return buf[curChar++];", "buf[curChar++]", "buf", "curChar++", "curChar", "public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "nextInt", "{\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }", "int c = read();", "c", "read()", "read", "while (isSpaceChar(c)) {\n c = read();\n }", "isSpaceChar(c)", "isSpaceChar", "c", "{\n c = read();\n }", "c = read()", "c", "read()", "read", "int sgn = 1;", "sgn", "1", "if (c == '-') {\n sgn = -1;\n c = read();\n }", "c == '-'", "c", "'-'", "{\n sgn = -1;\n c = read();\n }", "sgn = -1", "sgn", "-1", "1", "c = read()", "c", "read()", "read", "int res = 0;", "res", "0", "do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));", "!isSpaceChar(c)", "isSpaceChar(c)", "isSpaceChar", "c", "{\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n }", "if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }", "c < '0' || c > '9'", "c < '0'", "c", "'0'", "c > '9'", "c", "'9'", "{\n throw new InputMismatchException();\n }", "throw new InputMismatchException();", "new InputMismatchException()", "res *= 10", "res", "10", "res += c - '0'", "res", "c - '0'", "c", "'0'", "c = read()", "c", "read()", "read", "return res * sgn;", "res * sgn", "res", "sgn", "public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }", "isSpaceChar", "{\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }", "if (filter != null) {\n return filter.isSpaceChar(c);\n }", "filter != null", "filter", "null", "{\n return filter.isSpaceChar(c);\n }", "return filter.isSpaceChar(c);", "filter.isSpaceChar(c)", "filter.isSpaceChar", "filter", "c", "return isWhitespace(c);", "isWhitespace(c)", "isWhitespace", "c", "int c", "c", "public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "isWhitespace", "{\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }", "return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == '\\t'", "c == '\\r'", "c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1", "c == ' '", "c", "' '", "c == '\\n'", "c", "'\\n'", "c == '\\r'", "c", "'\\r'", "c == '\\t'", "c", "'\\t'", "c == -1", "c", "-1", "1", "int c", "c", "public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; ++i) array[i] = nextInt();\n return array;\n }", "nextIntArray", "{\n int[] array = new int[n];\n for (int i = 0; i < n; ++i) array[i] = nextInt();\n return array;\n }", "int[] array = new int[n];", "array", "new int[n]", "n", "for (int i = 0; i < n; ++i) array[i] = nextInt();", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "++i", "++i", "i", "array[i] = nextInt();", "array[i] = nextInt()", "array[i]", "array", "i", "nextInt()", "nextInt", "return array;", "array", "int n", "n", "public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }", "SpaceCharFilter", "public boolean isSpaceChar(int ch);", "isSpaceChar", "int ch", "ch", "public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMixJuice solver = new BMixJuice();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMixJuice {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int n = s.nextInt();\n int k = s.nextInt();\n int[] arr = s.nextIntArray(n);\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n out.println(sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; ++i) array[i] = nextInt();\n return array;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}", "public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BMixJuice solver = new BMixJuice();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BMixJuice {\n public void solve(int testNumber, FastReader s, PrintWriter out) {\n int n = s.nextInt();\n int k = s.nextInt();\n int[] arr = s.nextIntArray(n);\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n out.println(sum);\n }\n\n }\n\n static class FastReader {\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private FastReader.SpaceCharFilter filter;\n\n public FastReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if (numChars == -1) {\n throw new InputMismatchException();\n }\n if (curChar >= numChars) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (numChars <= 0) {\n return -1;\n }\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = read();\n while (isSpaceChar(c)) {\n c = read();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9') {\n throw new InputMismatchException();\n }\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null) {\n return filter.isSpaceChar(c);\n }\n return isWhitespace(c);\n }\n\n public static boolean isWhitespace(int c) {\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public int[] nextIntArray(int n) {\n int[] array = new int[n];\n for (int i = 0; i < n; ++i) array[i] = nextInt();\n return array;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n\n }\n\n }\n}", "Main" ]
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; FastReader in = new FastReader(inputStream); PrintWriter out = new PrintWriter(outputStream); BMixJuice solver = new BMixJuice(); solver.solve(1, in, out); out.close(); } static class BMixJuice { public void solve(int testNumber, FastReader s, PrintWriter out) { int n = s.nextInt(); int k = s.nextInt(); int[] arr = s.nextIntArray(n); Arrays.sort(arr); int sum = 0; for (int i = 0; i < k; i++) { sum += arr[i]; } out.println(sum); } } static class FastReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private FastReader.SpaceCharFilter filter; public FastReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) { throw new InputMismatchException(); } if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) { return -1; } } return buf[curChar++]; } public int nextInt() { int c = read(); while (isSpaceChar(c)) { c = read(); } int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') { throw new InputMismatchException(); } res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { if (filter != null) { return filter.isSpaceChar(c); } return isWhitespace(c); } public static boolean isWhitespace(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public int[] nextIntArray(int n) { int[] array = new int[n]; for (int i = 0; i < n; ++i) array[i] = nextInt(); return array; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 18, 18, 13, 13, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 84, 5 ], [ 84, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 46, 53 ], [ 8, 54 ], [ 54, 55 ], [ 54, 56 ], [ 8, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 62, 63 ], [ 62, 64 ], [ 57, 65 ], [ 65, 66 ], [ 66, 67 ], [ 57, 68 ], [ 69, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 72, 74 ], [ 8, 75 ], [ 75, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 75, 80 ], [ 6, 81 ], [ 81, 82 ], [ 0, 83 ], [ 83, 84 ], [ 83, 85 ] ]
[ "import java.util.Scanner;\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int k = scanner.nextInt();\n int[] a = new int[N];\n for (int i = 0; i < N; i++) {\n a[i] = scanner.nextInt();\n }\n java.util.Arrays.sort(a);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += a[i];\n }\n System.out.println(sum);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int k = scanner.nextInt();\n int[] a = new int[N];\n for (int i = 0; i < N; i++) {\n a[i] = scanner.nextInt();\n }\n java.util.Arrays.sort(a);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += a[i];\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int k = scanner.nextInt();\n int[] a = new int[N];\n for (int i = 0; i < N; i++) {\n a[i] = scanner.nextInt();\n }\n java.util.Arrays.sort(a);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += a[i];\n }\n System.out.println(sum);\n }", "main", "{\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int k = scanner.nextInt();\n int[] a = new int[N];\n for (int i = 0; i < N; i++) {\n a[i] = scanner.nextInt();\n }\n java.util.Arrays.sort(a);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += a[i];\n }\n System.out.println(sum);\n }", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "int N = scanner.nextInt();", "N", "scanner.nextInt()", "scanner.nextInt", "scanner", "int k = scanner.nextInt();", "k", "scanner.nextInt()", "scanner.nextInt", "scanner", "int[] a = new int[N];", "a", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n a[i] = scanner.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n a[i] = scanner.nextInt();\n }", "{\n a[i] = scanner.nextInt();\n }", "a[i] = scanner.nextInt()", "a[i]", "a", "i", "scanner.nextInt()", "scanner.nextInt", "scanner", "java.util.Arrays.sort(a)", "java.util.Arrays.sort", "java.util.Arrays", "java.util", "java", "java.util", "java.util.Arrays", "a", "int sum = 0;", "sum", "0", "for (int i = 0; i < k; i++) {\n sum += a[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n sum += a[i];\n }", "{\n sum += a[i];\n }", "sum += a[i]", "sum", "a[i]", "a", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int k = scanner.nextInt();\n int[] a = new int[N];\n for (int i = 0; i < N; i++) {\n a[i] = scanner.nextInt();\n }\n java.util.Arrays.sort(a);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += a[i];\n }\n System.out.println(sum);\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int k = scanner.nextInt();\n int[] a = new int[N];\n for (int i = 0; i < N; i++) {\n a[i] = scanner.nextInt();\n }\n java.util.Arrays.sort(a);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += a[i];\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int k = scanner.nextInt(); int[] a = new int[N]; for (int i = 0; i < N; i++) { a[i] = scanner.nextInt(); } java.util.Arrays.sort(a); int sum = 0; for (int i = 0; i < k; i++) { sum += a[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 2, 13, 17, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 110, 8 ], [ 110, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 19, 20 ], [ 20, 21 ], [ 17, 22 ], [ 11, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 25, 28 ], [ 28, 29 ], [ 28, 30 ], [ 11, 31 ], [ 31, 32 ], [ 31, 33 ], [ 33, 34 ], [ 34, 35 ], [ 33, 36 ], [ 36, 37 ], [ 36, 38 ], [ 11, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 44, 45 ], [ 41, 46 ], [ 11, 47 ], [ 47, 48 ], [ 47, 49 ], [ 11, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 51, 56 ], [ 56, 57 ], [ 56, 58 ], [ 51, 59 ], [ 59, 60 ], [ 60, 61 ], [ 51, 62 ], [ 63, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 64, 68 ], [ 68, 69 ], [ 69, 70 ], [ 68, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 74, 77 ], [ 11, 78 ], [ 78, 79 ], [ 78, 80 ], [ 11, 81 ], [ 81, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 81, 86 ], [ 86, 87 ], [ 86, 88 ], [ 88, 89 ], [ 88, 90 ], [ 81, 91 ], [ 91, 92 ], [ 92, 93 ], [ 81, 94 ], [ 95, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 98, 100 ], [ 11, 101 ], [ 101, 102 ], [ 102, 103 ], [ 103, 104 ], [ 103, 105 ], [ 101, 106 ], [ 9, 107 ], [ 107, 108 ], [ 0, 109 ], [ 109, 110 ], [ 109, 111 ] ]
[ "\nimport java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] str1 = sc.nextLine().split(\" \");\n int n = Integer.parseInt(str1[0]);\n int k = Integer.parseInt(str1[1]);\n\n String[] str2 = sc.nextLine().split(\" \");\n\n int[] int1 = new int[n];\n for(int i = 0; i < n;i++) {\n int1[i] = Integer.parseInt(str2[i]);\n }\n\n Arrays.sort(int1);\n int count = 0;\n\n for(int i = 0; i <= k-1;i++) {\n count += int1[i];\n }\n\n System.out.println(count);\n\n }\n\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] str1 = sc.nextLine().split(\" \");\n int n = Integer.parseInt(str1[0]);\n int k = Integer.parseInt(str1[1]);\n\n String[] str2 = sc.nextLine().split(\" \");\n\n int[] int1 = new int[n];\n for(int i = 0; i < n;i++) {\n int1[i] = Integer.parseInt(str2[i]);\n }\n\n Arrays.sort(int1);\n int count = 0;\n\n for(int i = 0; i <= k-1;i++) {\n count += int1[i];\n }\n\n System.out.println(count);\n\n }\n\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] str1 = sc.nextLine().split(\" \");\n int n = Integer.parseInt(str1[0]);\n int k = Integer.parseInt(str1[1]);\n\n String[] str2 = sc.nextLine().split(\" \");\n\n int[] int1 = new int[n];\n for(int i = 0; i < n;i++) {\n int1[i] = Integer.parseInt(str2[i]);\n }\n\n Arrays.sort(int1);\n int count = 0;\n\n for(int i = 0; i <= k-1;i++) {\n count += int1[i];\n }\n\n System.out.println(count);\n\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n String[] str1 = sc.nextLine().split(\" \");\n int n = Integer.parseInt(str1[0]);\n int k = Integer.parseInt(str1[1]);\n\n String[] str2 = sc.nextLine().split(\" \");\n\n int[] int1 = new int[n];\n for(int i = 0; i < n;i++) {\n int1[i] = Integer.parseInt(str2[i]);\n }\n\n Arrays.sort(int1);\n int count = 0;\n\n for(int i = 0; i <= k-1;i++) {\n count += int1[i];\n }\n\n System.out.println(count);\n\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "String[] str1 = sc.nextLine().split(\" \");", "str1", "sc.nextLine().split(\" \")", "sc.nextLine().split", "sc.nextLine()", "sc.nextLine", "sc", "\" \"", "int n = Integer.parseInt(str1[0]);", "n", "Integer.parseInt(str1[0])", "Integer.parseInt", "Integer", "str1[0]", "str1", "0", "int k = Integer.parseInt(str1[1]);", "k", "Integer.parseInt(str1[1])", "Integer.parseInt", "Integer", "str1[1]", "str1", "1", "String[] str2 = sc.nextLine().split(\" \");", "str2", "sc.nextLine().split(\" \")", "sc.nextLine().split", "sc.nextLine()", "sc.nextLine", "sc", "\" \"", "int[] int1 = new int[n];", "int1", "new int[n]", "n", "for(int i = 0; i < n;i++) {\n int1[i] = Integer.parseInt(str2[i]);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n int1[i] = Integer.parseInt(str2[i]);\n }", "{\n int1[i] = Integer.parseInt(str2[i]);\n }", "int1[i] = Integer.parseInt(str2[i])", "int1[i]", "int1", "i", "Integer.parseInt(str2[i])", "Integer.parseInt", "Integer", "str2[i]", "str2", "i", "Arrays.sort(int1)", "Arrays.sort", "Arrays", "int1", "int count = 0;", "count", "0", "for(int i = 0; i <= k-1;i++) {\n count += int1[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i <= k-1", "i", "k-1", "k", "1", "i++", "i++", "i", "{\n count += int1[i];\n }", "{\n count += int1[i];\n }", "count += int1[i]", "count", "int1[i]", "int1", "i", "System.out.println(count)", "System.out.println", "System.out", "System", "System.out", "count", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] str1 = sc.nextLine().split(\" \");\n int n = Integer.parseInt(str1[0]);\n int k = Integer.parseInt(str1[1]);\n\n String[] str2 = sc.nextLine().split(\" \");\n\n int[] int1 = new int[n];\n for(int i = 0; i < n;i++) {\n int1[i] = Integer.parseInt(str2[i]);\n }\n\n Arrays.sort(int1);\n int count = 0;\n\n for(int i = 0; i <= k-1;i++) {\n count += int1[i];\n }\n\n System.out.println(count);\n\n }\n\n}", "public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] str1 = sc.nextLine().split(\" \");\n int n = Integer.parseInt(str1[0]);\n int k = Integer.parseInt(str1[1]);\n\n String[] str2 = sc.nextLine().split(\" \");\n\n int[] int1 = new int[n];\n for(int i = 0; i < n;i++) {\n int1[i] = Integer.parseInt(str2[i]);\n }\n\n Arrays.sort(int1);\n int count = 0;\n\n for(int i = 0; i <= k-1;i++) {\n count += int1[i];\n }\n\n System.out.println(count);\n\n }\n\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] str1 = sc.nextLine().split(" "); int n = Integer.parseInt(str1[0]); int k = Integer.parseInt(str1[1]); String[] str2 = sc.nextLine().split(" "); int[] int1 = new int[n]; for(int i = 0; i < n;i++) { int1[i] = Integer.parseInt(str2[i]); } Arrays.sort(int1); int count = 0; for(int i = 0; i <= k-1;i++) { count += int1[i]; } System.out.println(count); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 13, 41, 13, 17, 14, 2, 13, 17, 29, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 2, 2, 13, 13, 17, 30, 0, 13, 2, 13, 13, 14, 2, 13, 13, 30, 40, 13, 40, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 12, 13, 30, 29, 17, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 243, 20 ], [ 243, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 23, 27 ], [ 27, 28 ], [ 27, 29 ], [ 23, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 30, 34 ], [ 34, 35 ], [ 23, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 38, 40 ], [ 36, 41 ], [ 41, 42 ], [ 41, 43 ], [ 36, 44 ], [ 44, 45 ], [ 45, 46 ], [ 36, 47 ], [ 48, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 50, 54 ], [ 49, 55 ], [ 55, 56 ], [ 56, 57 ], [ 56, 58 ], [ 58, 59 ], [ 58, 60 ], [ 55, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 66, 67 ], [ 55, 68 ], [ 68, 69 ], [ 23, 70 ], [ 70, 71 ], [ 21, 72 ], [ 72, 73 ], [ 243, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 77, 78 ], [ 77, 79 ], [ 76, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 83, 84 ], [ 76, 85 ], [ 85, 86 ], [ 85, 87 ], [ 87, 88 ], [ 88, 89 ], [ 76, 90 ], [ 90, 91 ], [ 90, 92 ], [ 76, 94 ], [ 94, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 94, 99 ], [ 99, 100 ], [ 99, 101 ], [ 94, 102 ], [ 102, 103 ], [ 103, 104 ], [ 94, 105 ], [ 106, 106 ], [ 106, 107 ], [ 107, 108 ], [ 108, 109 ], [ 108, 110 ], [ 107, 111 ], [ 111, 112 ], [ 112, 113 ], [ 76, 114 ], [ 114, 115 ], [ 115, 116 ], [ 114, 117 ], [ 76, 118 ], [ 118, 119 ], [ 118, 120 ], [ 76, 121 ], [ 121, 122 ], [ 122, 123 ], [ 123, 124 ], [ 123, 125 ], [ 121, 126 ], [ 126, 127 ], [ 126, 128 ], [ 121, 129 ], [ 129, 130 ], [ 130, 131 ], [ 121, 132 ], [ 133, 133 ], [ 133, 134 ], [ 134, 135 ], [ 134, 136 ], [ 136, 137 ], [ 136, 138 ], [ 76, 139 ], [ 139, 140 ], [ 140, 141 ], [ 141, 142 ], [ 141, 143 ], [ 139, 144 ], [ 74, 145 ], [ 145, 146 ], [ 243, 147 ], [ 147, 148 ], [ 147, 149 ], [ 149, 150 ], [ 147, 151 ], [ 151, 152 ], [ 147, 153 ], [ 153, 154 ], [ 153, 155 ], [ 155, 156 ], [ 156, 157 ], [ 156, 158 ], [ 147, 159 ], [ 159, 160 ], [ 159, 161 ], [ 161, 162 ], [ 162, 163 ], [ 163, 164 ], [ 164, 165 ], [ 164, 166 ], [ 163, 167 ], [ 167, 168 ], [ 168, 169 ], [ 169, 170 ], [ 162, 171 ], [ 171, 172 ], [ 172, 173 ], [ 173, 174 ], [ 173, 175 ], [ 175, 176 ], [ 176, 177 ], [ 177, 178 ], [ 172, 179 ], [ 179, 180 ], [ 180, 181 ], [ 180, 182 ], [ 161, 183 ], [ 183, 184 ], [ 184, 185 ], [ 185, 186 ], [ 147, 187 ], [ 187, 188 ], [ 187, 189 ], [ 189, 190 ], [ 190, 191 ], [ 191, 192 ], [ 192, 193 ], [ 191, 194 ], [ 194, 195 ], [ 147, 196 ], [ 196, 197 ], [ 196, 198 ], [ 198, 199 ], [ 199, 200 ], [ 200, 201 ], [ 201, 202 ], [ 200, 203 ], [ 203, 204 ], [ 147, 205 ], [ 205, 206 ], [ 205, 207 ], [ 207, 208 ], [ 208, 209 ], [ 209, 210 ], [ 210, 211 ], [ 209, 212 ], [ 212, 213 ], [ 147, 214 ], [ 214, 215 ], [ 214, 216 ], [ 216, 217 ], [ 217, 218 ], [ 217, 219 ], [ 216, 220 ], [ 220, 221 ], [ 221, 222 ], [ 221, 223 ], [ 223, 224 ], [ 224, 225 ], [ 225, 226 ], [ 220, 227 ], [ 227, 228 ], [ 228, 229 ], [ 228, 230 ], [ 230, 231 ], [ 231, 232 ], [ 216, 233 ], [ 233, 234 ], [ 147, 235 ], [ 235, 236 ], [ 235, 237 ], [ 237, 238 ], [ 238, 239 ], [ 235, 240 ], [ 240, 241 ], [ 0, 242 ], [ 242, 243 ], [ 242, 244 ] ]
[ "import java.io.BufferedReader;\nimport java.util.Arrays;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Scanner;\nimport java.util.StringTokenizer;\n\n\npublic class Main {\n\t static class FastReader \n\t { \n\t BufferedReader br; \n\t StringTokenizer st; \n\t \n\t \n\t public FastReader() \n\t { \n\t br = new BufferedReader(new\n\t InputStreamReader(System.in)); \n\t } \n\t \n\t String next() \n\t { \n\t while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t } \n\t return st.nextToken();\n\t \n\t } \n\t \n\t int nextInt() \n\t { \n\t return Integer.parseInt(next()); \n\t } \n\t \n\t long nextLong() \n\t { \n\t return Long.parseLong(next()); \n\t } \n\t \n\t double nextDouble() \n\t { \n\t return Double.parseDouble(next()); \n\t } \n\t \n\t String nextLine() \n\t { \n\t String str = \"\"; \n\t try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t return str; \n\t }\n\n\t\t\tpublic Character charAt(int i) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn null;\n\t\t\t} \n\t } \n\t static int divisors(long x) {\n\t\t long limit = x;\n\t\t int numberOfDivisors = 0;\n\n\t\t if (x == 1) return 1;\n\n\t\t for (int i = 1; i < limit; ++i) {\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }\n\n\t\t return numberOfDivisors;\n\t\t} \n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader s=new FastReader();\t\t\n\t\tint n = s.nextInt();\n\t\tint k = s.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tar[i]=s.nextInt();\n\t\t}\n\t\tArrays.sort(ar);\n\t\tint sum=0;\n\t\tfor(int i=0;i<k;i++) {\n\t\t\tsum+=ar[i];\n\t\t}\n\t\tSystem.out.println(sum);\n}\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\t static class FastReader \n\t { \n\t BufferedReader br; \n\t StringTokenizer st; \n\t \n\t \n\t public FastReader() \n\t { \n\t br = new BufferedReader(new\n\t InputStreamReader(System.in)); \n\t } \n\t \n\t String next() \n\t { \n\t while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t } \n\t return st.nextToken();\n\t \n\t } \n\t \n\t int nextInt() \n\t { \n\t return Integer.parseInt(next()); \n\t } \n\t \n\t long nextLong() \n\t { \n\t return Long.parseLong(next()); \n\t } \n\t \n\t double nextDouble() \n\t { \n\t return Double.parseDouble(next()); \n\t } \n\t \n\t String nextLine() \n\t { \n\t String str = \"\"; \n\t try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t return str; \n\t }\n\n\t\t\tpublic Character charAt(int i) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn null;\n\t\t\t} \n\t } \n\t static int divisors(long x) {\n\t\t long limit = x;\n\t\t int numberOfDivisors = 0;\n\n\t\t if (x == 1) return 1;\n\n\t\t for (int i = 1; i < limit; ++i) {\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }\n\n\t\t return numberOfDivisors;\n\t\t} \n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader s=new FastReader();\t\t\n\t\tint n = s.nextInt();\n\t\tint k = s.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tar[i]=s.nextInt();\n\t\t}\n\t\tArrays.sort(ar);\n\t\tint sum=0;\n\t\tfor(int i=0;i<k;i++) {\n\t\t\tsum+=ar[i];\n\t\t}\n\t\tSystem.out.println(sum);\n}\n}", "Main", "static int divisors(long x) {\n\t\t long limit = x;\n\t\t int numberOfDivisors = 0;\n\n\t\t if (x == 1) return 1;\n\n\t\t for (int i = 1; i < limit; ++i) {\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }\n\n\t\t return numberOfDivisors;\n\t\t}", "divisors", "{\n\t\t long limit = x;\n\t\t int numberOfDivisors = 0;\n\n\t\t if (x == 1) return 1;\n\n\t\t for (int i = 1; i < limit; ++i) {\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }\n\n\t\t return numberOfDivisors;\n\t\t}", "long limit = x;", "limit", "x", "int numberOfDivisors = 0;", "numberOfDivisors", "0", "if (x == 1) return 1;", "x == 1", "x", "1", "return 1;", "1", "for (int i = 1; i < limit; ++i) {\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }", "int i = 1;", "int i = 1;", "i", "1", "i < limit", "i", "limit", "++i", "++i", "i", "{\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }", "{\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }", "if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }", "x % i == 0", "x % i", "x", "i", "0", "{\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }", "limit = x / i", "limit", "x / i", "x", "i", "if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }", "limit != i", "limit", "i", "{\n\t\t numberOfDivisors++;\n\t\t }", "numberOfDivisors++", "numberOfDivisors", "numberOfDivisors++", "numberOfDivisors", "return numberOfDivisors;", "numberOfDivisors", "long x", "x", "public static void main(String[] args)throws IOException {\n\t\tFastReader s=new FastReader();\t\t\n\t\tint n = s.nextInt();\n\t\tint k = s.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tar[i]=s.nextInt();\n\t\t}\n\t\tArrays.sort(ar);\n\t\tint sum=0;\n\t\tfor(int i=0;i<k;i++) {\n\t\t\tsum+=ar[i];\n\t\t}\n\t\tSystem.out.println(sum);\n}", "main", "{\n\t\tFastReader s=new FastReader();\t\t\n\t\tint n = s.nextInt();\n\t\tint k = s.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tar[i]=s.nextInt();\n\t\t}\n\t\tArrays.sort(ar);\n\t\tint sum=0;\n\t\tfor(int i=0;i<k;i++) {\n\t\t\tsum+=ar[i];\n\t\t}\n\t\tSystem.out.println(sum);\n}", "FastReader s=new FastReader();", "s", "new FastReader()", "int n = s.nextInt();", "n", "s.nextInt()", "s.nextInt", "s", "int k = s.nextInt();", "k", "s.nextInt()", "s.nextInt", "s", "int[] ar = new int[n];", "ar", "new int[n]", "n", "for(int i=0;i<n;i++) {\n\t\t\tar[i]=s.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tar[i]=s.nextInt();\n\t\t}", "{\n\t\t\tar[i]=s.nextInt();\n\t\t}", "ar[i]=s.nextInt()", "ar[i]", "ar", "i", "s.nextInt()", "s.nextInt", "s", "Arrays.sort(ar)", "Arrays.sort", "Arrays", "ar", "int sum=0;", "sum", "0", "for(int i=0;i<k;i++) {\n\t\t\tsum+=ar[i];\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n\t\t\tsum+=ar[i];\n\t\t}", "{\n\t\t\tsum+=ar[i];\n\t\t}", "sum+=ar[i]", "sum", "ar[i]", "ar", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "static class FastReader \n\t { \n\t BufferedReader br; \n\t StringTokenizer st; \n\t \n\t \n\t public FastReader() \n\t { \n\t br = new BufferedReader(new\n\t InputStreamReader(System.in)); \n\t } \n\t \n\t String next() \n\t { \n\t while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t } \n\t return st.nextToken();\n\t \n\t } \n\t \n\t int nextInt() \n\t { \n\t return Integer.parseInt(next()); \n\t } \n\t \n\t long nextLong() \n\t { \n\t return Long.parseLong(next()); \n\t } \n\t \n\t double nextDouble() \n\t { \n\t return Double.parseDouble(next()); \n\t } \n\t \n\t String nextLine() \n\t { \n\t String str = \"\"; \n\t try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t return str; \n\t }\n\n\t\t\tpublic Character charAt(int i) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn null;\n\t\t\t} \n\t }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader() \n\t { \n\t br = new BufferedReader(new\n\t InputStreamReader(System.in)); \n\t }", "FastReader", "{ \n\t br = new BufferedReader(new\n\t InputStreamReader(System.in)); \n\t }", "br = new BufferedReader(new\n\t InputStreamReader(System.in))", "br", "new BufferedReader(new\n\t InputStreamReader(System.in))", "String next() \n\t { \n\t while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t } \n\t return st.nextToken();\n\t \n\t }", "next", "{ \n\t while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t } \n\t return st.nextToken();\n\t \n\t }", "while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t }", "st == null || !st.hasMoreTokens()", "st == null", "st", "null", "!st.hasMoreTokens()", "st.hasMoreTokens()", "st.hasMoreTokens", "st", "{ \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t }", "try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t }", "catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t }", "IOException e", "{ \n\t e.printStackTrace(); \n\t }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n\t st = new StringTokenizer(br.readLine()); \n\t }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() \n\t { \n\t return Integer.parseInt(next()); \n\t }", "nextInt", "{ \n\t return Integer.parseInt(next()); \n\t }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() \n\t { \n\t return Long.parseLong(next()); \n\t }", "nextLong", "{ \n\t return Long.parseLong(next()); \n\t }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() \n\t { \n\t return Double.parseDouble(next()); \n\t }", "nextDouble", "{ \n\t return Double.parseDouble(next()); \n\t }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() \n\t { \n\t String str = \"\"; \n\t try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t return str; \n\t }", "nextLine", "{ \n\t String str = \"\"; \n\t try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t return str; \n\t }", "String str = \"\";", "str", "\"\"", "try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t }", "catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t }", "IOException e", "{ \n\t e.printStackTrace(); \n\t }", "e.printStackTrace()", "e.printStackTrace", "e", "{ \n\t str = br.readLine(); \n\t }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public Character charAt(int i) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn null;\n\t\t\t}", "charAt", "{\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn null;\n\t\t\t}", "return null;", "null", "int i", "i", "public class Main {\n\t static class FastReader \n\t { \n\t BufferedReader br; \n\t StringTokenizer st; \n\t \n\t \n\t public FastReader() \n\t { \n\t br = new BufferedReader(new\n\t InputStreamReader(System.in)); \n\t } \n\t \n\t String next() \n\t { \n\t while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t } \n\t return st.nextToken();\n\t \n\t } \n\t \n\t int nextInt() \n\t { \n\t return Integer.parseInt(next()); \n\t } \n\t \n\t long nextLong() \n\t { \n\t return Long.parseLong(next()); \n\t } \n\t \n\t double nextDouble() \n\t { \n\t return Double.parseDouble(next()); \n\t } \n\t \n\t String nextLine() \n\t { \n\t String str = \"\"; \n\t try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t return str; \n\t }\n\n\t\t\tpublic Character charAt(int i) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn null;\n\t\t\t} \n\t } \n\t static int divisors(long x) {\n\t\t long limit = x;\n\t\t int numberOfDivisors = 0;\n\n\t\t if (x == 1) return 1;\n\n\t\t for (int i = 1; i < limit; ++i) {\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }\n\n\t\t return numberOfDivisors;\n\t\t} \n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader s=new FastReader();\t\t\n\t\tint n = s.nextInt();\n\t\tint k = s.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tar[i]=s.nextInt();\n\t\t}\n\t\tArrays.sort(ar);\n\t\tint sum=0;\n\t\tfor(int i=0;i<k;i++) {\n\t\t\tsum+=ar[i];\n\t\t}\n\t\tSystem.out.println(sum);\n}\n}", "public class Main {\n\t static class FastReader \n\t { \n\t BufferedReader br; \n\t StringTokenizer st; \n\t \n\t \n\t public FastReader() \n\t { \n\t br = new BufferedReader(new\n\t InputStreamReader(System.in)); \n\t } \n\t \n\t String next() \n\t { \n\t while (st == null || !st.hasMoreTokens()) \n\t { \n\t try\n\t { \n\t st = new StringTokenizer(br.readLine()); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t } \n\t return st.nextToken();\n\t \n\t } \n\t \n\t int nextInt() \n\t { \n\t return Integer.parseInt(next()); \n\t } \n\t \n\t long nextLong() \n\t { \n\t return Long.parseLong(next()); \n\t } \n\t \n\t double nextDouble() \n\t { \n\t return Double.parseDouble(next()); \n\t } \n\t \n\t String nextLine() \n\t { \n\t String str = \"\"; \n\t try\n\t { \n\t str = br.readLine(); \n\t } \n\t catch (IOException e) \n\t { \n\t e.printStackTrace(); \n\t } \n\t return str; \n\t }\n\n\t\t\tpublic Character charAt(int i) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn null;\n\t\t\t} \n\t } \n\t static int divisors(long x) {\n\t\t long limit = x;\n\t\t int numberOfDivisors = 0;\n\n\t\t if (x == 1) return 1;\n\n\t\t for (int i = 1; i < limit; ++i) {\n\t\t if (x % i == 0) {\n\t\t limit = x / i;\n\t\t if (limit != i) {\n\t\t numberOfDivisors++;\n\t\t }\n\t\t numberOfDivisors++;\n\t\t }\n\t\t }\n\n\t\t return numberOfDivisors;\n\t\t} \n\tpublic static void main(String[] args)throws IOException {\n\t\tFastReader s=new FastReader();\t\t\n\t\tint n = s.nextInt();\n\t\tint k = s.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tar[i]=s.nextInt();\n\t\t}\n\t\tArrays.sort(ar);\n\t\tint sum=0;\n\t\tfor(int i=0;i<k;i++) {\n\t\t\tsum+=ar[i];\n\t\t}\n\t\tSystem.out.println(sum);\n}\n}", "Main" ]
import java.io.BufferedReader; import java.util.Arrays; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } public Character charAt(int i) { // TODO Auto-generated method stub return null; } } static int divisors(long x) { long limit = x; int numberOfDivisors = 0; if (x == 1) return 1; for (int i = 1; i < limit; ++i) { if (x % i == 0) { limit = x / i; if (limit != i) { numberOfDivisors++; } numberOfDivisors++; } } return numberOfDivisors; } public static void main(String[] args)throws IOException { FastReader s=new FastReader(); int n = s.nextInt(); int k = s.nextInt(); int[] ar = new int[n]; for(int i=0;i<n;i++) { ar[i]=s.nextInt(); } Arrays.sort(ar); int sum=0; for(int i=0;i<k;i++) { sum+=ar[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 179, 14 ], [ 179, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 18, 20 ], [ 17, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 17, 26 ], [ 26, 27 ], [ 26, 28 ], [ 28, 29 ], [ 29, 30 ], [ 17, 31 ], [ 31, 32 ], [ 31, 33 ], [ 17, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 34, 39 ], [ 39, 40 ], [ 39, 41 ], [ 34, 42 ], [ 42, 43 ], [ 43, 44 ], [ 34, 45 ], [ 46, 46 ], [ 46, 47 ], [ 47, 48 ], [ 47, 49 ], [ 49, 50 ], [ 50, 51 ], [ 46, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 17, 56 ], [ 56, 57 ], [ 57, 58 ], [ 56, 59 ], [ 17, 60 ], [ 60, 61 ], [ 60, 62 ], [ 17, 63 ], [ 63, 64 ], [ 64, 65 ], [ 65, 66 ], [ 65, 67 ], [ 63, 68 ], [ 68, 69 ], [ 68, 70 ], [ 63, 71 ], [ 71, 72 ], [ 72, 73 ], [ 63, 74 ], [ 75, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 78, 79 ], [ 79, 80 ], [ 78, 81 ], [ 17, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 82, 87 ], [ 15, 88 ], [ 88, 89 ], [ 179, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 90, 94 ], [ 94, 95 ], [ 90, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 90, 102 ], [ 102, 103 ], [ 102, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 107, 108 ], [ 107, 109 ], [ 106, 110 ], [ 110, 111 ], [ 111, 112 ], [ 112, 113 ], [ 105, 114 ], [ 114, 115 ], [ 115, 116 ], [ 116, 117 ], [ 116, 118 ], [ 118, 119 ], [ 119, 120 ], [ 120, 121 ], [ 115, 122 ], [ 122, 123 ], [ 123, 124 ], [ 123, 125 ], [ 104, 126 ], [ 126, 127 ], [ 127, 128 ], [ 128, 129 ], [ 90, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 133, 134 ], [ 134, 135 ], [ 135, 136 ], [ 134, 137 ], [ 137, 138 ], [ 90, 139 ], [ 139, 140 ], [ 139, 141 ], [ 141, 142 ], [ 142, 143 ], [ 143, 144 ], [ 144, 145 ], [ 143, 146 ], [ 146, 147 ], [ 90, 148 ], [ 148, 149 ], [ 148, 150 ], [ 150, 151 ], [ 151, 152 ], [ 152, 153 ], [ 153, 154 ], [ 152, 155 ], [ 155, 156 ], [ 90, 157 ], [ 157, 158 ], [ 157, 159 ], [ 159, 160 ], [ 160, 161 ], [ 160, 162 ], [ 159, 163 ], [ 163, 164 ], [ 164, 165 ], [ 164, 166 ], [ 166, 167 ], [ 167, 168 ], [ 168, 169 ], [ 163, 170 ], [ 170, 171 ], [ 171, 172 ], [ 171, 173 ], [ 173, 174 ], [ 174, 175 ], [ 159, 176 ], [ 176, 177 ], [ 0, 178 ], [ 178, 179 ], [ 178, 180 ] ]
[ "\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\npublic class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static void main(String[] args) {\n FastReader fr = new FastReader();\n int n = fr.nextInt();\n int k = fr.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<>();\n for(int i=0;i<n;i++){\n int val = fr.nextInt();\n arrayList.add(val);\n }\n Collections.sort(arrayList);\n int ans = 0;\n for(int i=0;i<k;i++){\n ans+=(arrayList.get(i));\n }\n System.out.println(ans);\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.util.*;", "util.*", "java", "public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static void main(String[] args) {\n FastReader fr = new FastReader();\n int n = fr.nextInt();\n int k = fr.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<>();\n for(int i=0;i<n;i++){\n int val = fr.nextInt();\n arrayList.add(val);\n }\n Collections.sort(arrayList);\n int ans = 0;\n for(int i=0;i<k;i++){\n ans+=(arrayList.get(i));\n }\n System.out.println(ans);\n }\n}", "Main", "public static void main(String[] args) {\n FastReader fr = new FastReader();\n int n = fr.nextInt();\n int k = fr.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<>();\n for(int i=0;i<n;i++){\n int val = fr.nextInt();\n arrayList.add(val);\n }\n Collections.sort(arrayList);\n int ans = 0;\n for(int i=0;i<k;i++){\n ans+=(arrayList.get(i));\n }\n System.out.println(ans);\n }", "main", "{\n FastReader fr = new FastReader();\n int n = fr.nextInt();\n int k = fr.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<>();\n for(int i=0;i<n;i++){\n int val = fr.nextInt();\n arrayList.add(val);\n }\n Collections.sort(arrayList);\n int ans = 0;\n for(int i=0;i<k;i++){\n ans+=(arrayList.get(i));\n }\n System.out.println(ans);\n }", "FastReader fr = new FastReader();", "fr", "new FastReader()", "int n = fr.nextInt();", "n", "fr.nextInt()", "fr.nextInt", "fr", "int k = fr.nextInt();", "k", "fr.nextInt()", "fr.nextInt", "fr", "ArrayList<Integer> arrayList = new ArrayList<>();", "arrayList", "new ArrayList<>()", "for(int i=0;i<n;i++){\n int val = fr.nextInt();\n arrayList.add(val);\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n int val = fr.nextInt();\n arrayList.add(val);\n }", "{\n int val = fr.nextInt();\n arrayList.add(val);\n }", "int val = fr.nextInt();", "val", "fr.nextInt()", "fr.nextInt", "fr", "arrayList.add(val)", "arrayList.add", "arrayList", "val", "Collections.sort(arrayList)", "Collections.sort", "Collections", "arrayList", "int ans = 0;", "ans", "0", "for(int i=0;i<k;i++){\n ans+=(arrayList.get(i));\n }", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n ans+=(arrayList.get(i));\n }", "{\n ans+=(arrayList.get(i));\n }", "ans+=(arrayList.get(i))", "ans", "(arrayList.get(i))", "arrayList.get", "arrayList", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }", "FastReader", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }", "FastReader", "{\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }", "br = new BufferedReader(new\n InputStreamReader(System.in))", "br", "new BufferedReader(new\n InputStreamReader(System.in))", "String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static void main(String[] args) {\n FastReader fr = new FastReader();\n int n = fr.nextInt();\n int k = fr.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<>();\n for(int i=0;i<n;i++){\n int val = fr.nextInt();\n arrayList.add(val);\n }\n Collections.sort(arrayList);\n int ans = 0;\n for(int i=0;i<k;i++){\n ans+=(arrayList.get(i));\n }\n System.out.println(ans);\n }\n}", "public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new\n InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n public static void main(String[] args) {\n FastReader fr = new FastReader();\n int n = fr.nextInt();\n int k = fr.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<>();\n for(int i=0;i<n;i++){\n int val = fr.nextInt();\n arrayList.add(val);\n }\n Collections.sort(arrayList);\n int ans = 0;\n for(int i=0;i<k;i++){\n ans+=(arrayList.get(i));\n }\n System.out.println(ans);\n }\n}", "Main" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } public static void main(String[] args) { FastReader fr = new FastReader(); int n = fr.nextInt(); int k = fr.nextInt(); ArrayList<Integer> arrayList = new ArrayList<>(); for(int i=0;i<n;i++){ int val = fr.nextInt(); arrayList.add(val); } Collections.sort(arrayList); int ans = 0; for(int i=0;i<k;i++){ ans+=(arrayList.get(i)); } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 83, 8 ], [ 83, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 9, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] var0) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n\n int[] p = new int[N];\n\n for (int i = 0; i < N; i++) {\n p[i] = scanner.nextInt();\n }\n\n Arrays.sort(p);\n\n int ans = 0;\n\n for (int i = 0; i < K; i++) {\n ans += p[i];\n }\n\n System.out.println(ans);\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] var0) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n\n int[] p = new int[N];\n\n for (int i = 0; i < N; i++) {\n p[i] = scanner.nextInt();\n }\n\n Arrays.sort(p);\n\n int ans = 0;\n\n for (int i = 0; i < K; i++) {\n ans += p[i];\n }\n\n System.out.println(ans);\n }\n}", "Main", "public static void main(String[] var0) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n\n int[] p = new int[N];\n\n for (int i = 0; i < N; i++) {\n p[i] = scanner.nextInt();\n }\n\n Arrays.sort(p);\n\n int ans = 0;\n\n for (int i = 0; i < K; i++) {\n ans += p[i];\n }\n\n System.out.println(ans);\n }", "main", "{\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n\n int[] p = new int[N];\n\n for (int i = 0; i < N; i++) {\n p[i] = scanner.nextInt();\n }\n\n Arrays.sort(p);\n\n int ans = 0;\n\n for (int i = 0; i < K; i++) {\n ans += p[i];\n }\n\n System.out.println(ans);\n }", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "int N = scanner.nextInt();", "N", "scanner.nextInt()", "scanner.nextInt", "scanner", "int K = scanner.nextInt();", "K", "scanner.nextInt()", "scanner.nextInt", "scanner", "int[] p = new int[N];", "p", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n p[i] = scanner.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n p[i] = scanner.nextInt();\n }", "{\n p[i] = scanner.nextInt();\n }", "p[i] = scanner.nextInt()", "p[i]", "p", "i", "scanner.nextInt()", "scanner.nextInt", "scanner", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int ans = 0;", "ans", "0", "for (int i = 0; i < K; i++) {\n ans += p[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n ans += p[i];\n }", "{\n ans += p[i];\n }", "ans += p[i]", "ans", "p[i]", "p", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] var0", "var0", "public class Main {\n public static void main(String[] var0) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n\n int[] p = new int[N];\n\n for (int i = 0; i < N; i++) {\n p[i] = scanner.nextInt();\n }\n\n Arrays.sort(p);\n\n int ans = 0;\n\n for (int i = 0; i < K; i++) {\n ans += p[i];\n }\n\n System.out.println(ans);\n }\n}", "public class Main {\n public static void main(String[] var0) {\n Scanner scanner = new Scanner(System.in);\n\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n\n int[] p = new int[N];\n\n for (int i = 0; i < N; i++) {\n p[i] = scanner.nextInt();\n }\n\n Arrays.sort(p);\n\n int ans = 0;\n\n for (int i = 0; i < K; i++) {\n ans += p[i];\n }\n\n System.out.println(ans);\n }\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] var0) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int K = scanner.nextInt(); int[] p = new int[N]; for (int i = 0; i < N; i++) { p[i] = scanner.nextInt(); } Arrays.sort(p); int ans = 0; for (int i = 0; i < K; i++) { ans += p[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 41, 13, 4, 18, 13, 18, 13, 17, 0, 13, 4, 18, 4, 18, 13, 17, 41, 13, 20, 28, 13, 13, 30, 30, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 119, 20 ], [ 119, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 24, 26 ], [ 23, 27 ], [ 27, 28 ], [ 27, 29 ], [ 23, 30 ], [ 30, 31 ], [ 30, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 35, 36 ], [ 32, 37 ], [ 23, 38 ], [ 38, 39 ], [ 38, 40 ], [ 40, 41 ], [ 41, 42 ], [ 40, 43 ], [ 43, 44 ], [ 43, 45 ], [ 23, 46 ], [ 46, 47 ], [ 46, 48 ], [ 48, 49 ], [ 49, 50 ], [ 48, 51 ], [ 51, 52 ], [ 51, 53 ], [ 23, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 56, 61 ], [ 23, 62 ], [ 62, 63 ], [ 62, 64 ], [ 23, 65 ], [ 65, 66 ], [ 65, 67 ], [ 65, 68 ], [ 69, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 70, 73 ], [ 73, 74 ], [ 74, 75 ], [ 73, 76 ], [ 23, 77 ], [ 77, 78 ], [ 78, 79 ], [ 23, 80 ], [ 80, 81 ], [ 81, 82 ], [ 80, 83 ], [ 23, 84 ], [ 84, 85 ], [ 84, 86 ], [ 23, 87 ], [ 87, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 87, 92 ], [ 92, 93 ], [ 92, 94 ], [ 87, 95 ], [ 95, 96 ], [ 96, 97 ], [ 87, 98 ], [ 99, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 102, 103 ], [ 103, 104 ], [ 102, 105 ], [ 23, 106 ], [ 106, 107 ], [ 107, 108 ], [ 106, 109 ], [ 109, 110 ], [ 110, 111 ], [ 109, 112 ], [ 23, 113 ], [ 113, 114 ], [ 114, 115 ], [ 21, 116 ], [ 116, 117 ], [ 0, 118 ], [ 118, 119 ], [ 118, 120 ] ]
[ "import java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.util.ArrayList;\nimport java.util.Collections;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n ArrayList<Integer> list = new ArrayList<>();\n for (String i : in) {\n list.add(Integer.parseInt(i));\n }\n\n br.close();\n\n Collections.sort(list);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += list.get(i);\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.BufferedWriter;", "BufferedWriter", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.OutputStreamWriter;", "OutputStreamWriter", "java.io", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n ArrayList<Integer> list = new ArrayList<>();\n for (String i : in) {\n list.add(Integer.parseInt(i));\n }\n\n br.close();\n\n Collections.sort(list);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += list.get(i);\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }\n}", "Main", "public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n ArrayList<Integer> list = new ArrayList<>();\n for (String i : in) {\n list.add(Integer.parseInt(i));\n }\n\n br.close();\n\n Collections.sort(list);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += list.get(i);\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }", "main", "{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n ArrayList<Integer> list = new ArrayList<>();\n for (String i : in) {\n list.add(Integer.parseInt(i));\n }\n\n br.close();\n\n Collections.sort(list);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += list.get(i);\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));", "bw", "new BufferedWriter(new OutputStreamWriter(System.out))", "String[] in = br.readLine().split(\" \");", "in", "br.readLine().split(\" \")", "br.readLine().split", "br.readLine()", "br.readLine", "br", "\" \"", "int n = Integer.parseInt(in[0]);", "n", "Integer.parseInt(in[0])", "Integer.parseInt", "Integer", "in[0]", "in", "0", "int k = Integer.parseInt(in[1]);", "k", "Integer.parseInt(in[1])", "Integer.parseInt", "Integer", "in[1]", "in", "1", "in = br.readLine().split(\" \")", "in", "br.readLine().split(\" \")", "br.readLine().split", "br.readLine()", "br.readLine", "br", "\" \"", "ArrayList<Integer> list = new ArrayList<>();", "list", "new ArrayList<>()", "for (String i : in) {\n list.add(Integer.parseInt(i));\n }", "String i", "in", "{\n list.add(Integer.parseInt(i));\n }", "{\n list.add(Integer.parseInt(i));\n }", "list.add(Integer.parseInt(i))", "list.add", "list", "Integer.parseInt(i)", "Integer.parseInt", "Integer", "i", "br.close()", "br.close", "br", "Collections.sort(list)", "Collections.sort", "Collections", "list", "int ans = 0;", "ans", "0", "for (int i = 0; i < k; i++) {\n ans += list.get(i);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n ans += list.get(i);\n }", "{\n ans += list.get(i);\n }", "ans += list.get(i)", "ans", "list.get(i)", "list.get", "list", "i", "bw.write(String.valueOf(ans))", "bw.write", "bw", "String.valueOf(ans)", "String.valueOf", "String", "ans", "bw.flush()", "bw.flush", "bw", "String[] args", "args", "public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n ArrayList<Integer> list = new ArrayList<>();\n for (String i : in) {\n list.add(Integer.parseInt(i));\n }\n\n br.close();\n\n Collections.sort(list);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += list.get(i);\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }\n}", "public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n ArrayList<Integer> list = new ArrayList<>();\n for (String i : in) {\n list.add(Integer.parseInt(i));\n }\n\n br.close();\n\n Collections.sort(list);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += list.get(i);\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }\n}", "Main" ]
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Collections; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String[] in = br.readLine().split(" "); int n = Integer.parseInt(in[0]); int k = Integer.parseInt(in[1]); in = br.readLine().split(" "); ArrayList<Integer> list = new ArrayList<>(); for (String i : in) { list.add(Integer.parseInt(i)); } br.close(); Collections.sort(list); int ans = 0; for (int i = 0; i < k; i++) { ans += list.get(i); } bw.write(String.valueOf(ans)); bw.flush(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 41, 13, 17, 42, 2, 40, 13, 17, 30, 0, 13, 18, 13, 13, 40, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 53, 55 ], [ 8, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 57, 60 ], [ 56, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 64, 66 ], [ 61, 67 ], [ 67, 68 ], [ 8, 69 ], [ 69, 70 ], [ 70, 71 ], [ 71, 72 ], [ 71, 73 ], [ 69, 74 ], [ 6, 75 ], [ 75, 76 ] ]
[ "import java.util.*;\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt(); \n }\n Arrays.sort(a);\n int sum=0;\n int j=0;\n while(k-->0){\n sum+=a[j];\n j++;\n }\n System.out.println(sum);\n \n \n }\n \n \n \n}", "import java.util.*;", "util.*", "java", "class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt(); \n }\n Arrays.sort(a);\n int sum=0;\n int j=0;\n while(k-->0){\n sum+=a[j];\n j++;\n }\n System.out.println(sum);\n \n \n }\n \n \n \n}", "Main", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt(); \n }\n Arrays.sort(a);\n int sum=0;\n int j=0;\n while(k-->0){\n sum+=a[j];\n j++;\n }\n System.out.println(sum);\n \n \n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int a[] = new int[n];\n for(int i=0;i<n;i++){\n a[i]=sc.nextInt(); \n }\n Arrays.sort(a);\n int sum=0;\n int j=0;\n while(k-->0){\n sum+=a[j];\n j++;\n }\n System.out.println(sum);\n \n \n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int a[] = new int[n];", "a", "new int[n]", "n", "for(int i=0;i<n;i++){\n a[i]=sc.nextInt(); \n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n a[i]=sc.nextInt(); \n }", "{\n a[i]=sc.nextInt(); \n }", "a[i]=sc.nextInt()", "a[i]", "a", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "int sum=0;", "sum", "0", "int j=0;", "j", "0", "while(k-->0){\n sum+=a[j];\n j++;\n }", "k-->0", "k--", "k", "0", "{\n sum+=a[j];\n j++;\n }", "sum+=a[j]", "sum", "a[j]", "a", "j", "j++", "j", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args" ]
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int a[] = new int[n]; for(int i=0;i<n;i++){ a[i]=sc.nextInt(); } Arrays.sort(a); int sum=0; int j=0; while(k-->0){ sum+=a[j]; j++; } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 2, 18, 13, 13, 17, 1, 40, 13, 30, 30, 11, 1, 41, 13, 17, 2, 13, 2, 2, 18, 13, 13, 13, 17, 1, 40, 13, 30, 30, 14, 2, 18, 13, 13, 18, 13, 2, 13, 17, 30, 41, 13, 18, 13, 13, 0, 18, 13, 13, 18, 13, 2, 13, 17, 0, 18, 13, 2, 13, 17, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 146, 5 ], [ 146, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 26, 28 ], [ 8, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 49, 54 ], [ 54, 55 ], [ 54, 56 ], [ 56, 57 ], [ 57, 58 ], [ 57, 59 ], [ 56, 60 ], [ 49, 61 ], [ 61, 62 ], [ 62, 63 ], [ 49, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 68, 69 ], [ 68, 70 ], [ 66, 71 ], [ 71, 72 ], [ 71, 73 ], [ 74, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 74, 78 ], [ 74, 79 ], [ 66, 80 ], [ 80, 81 ], [ 81, 82 ], [ 66, 83 ], [ 84, 84 ], [ 84, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 90, 91 ], [ 90, 92 ], [ 92, 93 ], [ 92, 94 ], [ 85, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 98, 100 ], [ 95, 101 ], [ 101, 102 ], [ 102, 103 ], [ 102, 104 ], [ 101, 105 ], [ 105, 106 ], [ 105, 107 ], [ 107, 108 ], [ 107, 109 ], [ 95, 110 ], [ 110, 111 ], [ 111, 112 ], [ 111, 113 ], [ 113, 114 ], [ 113, 115 ], [ 110, 116 ], [ 8, 117 ], [ 117, 118 ], [ 118, 119 ], [ 119, 120 ], [ 119, 121 ], [ 117, 122 ], [ 122, 123 ], [ 122, 124 ], [ 117, 125 ], [ 125, 126 ], [ 126, 127 ], [ 117, 128 ], [ 129, 129 ], [ 129, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 132, 134 ], [ 134, 135 ], [ 134, 136 ], [ 8, 137 ], [ 137, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 137, 142 ], [ 6, 143 ], [ 143, 144 ], [ 0, 145 ], [ 145, 146 ], [ 145, 147 ] ]
[ "import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int c = 0;\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n for(int i=0; i < p.length-1; i++) {\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }\n for (int i = 0; i < K; i++) {\n c = c + p[i];\n }\n System.out.println(c);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int c = 0;\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n for(int i=0; i < p.length-1; i++) {\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }\n for (int i = 0; i < K; i++) {\n c = c + p[i];\n }\n System.out.println(c);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int c = 0;\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n for(int i=0; i < p.length-1; i++) {\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }\n for (int i = 0; i < K; i++) {\n c = c + p[i];\n }\n System.out.println(c);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int c = 0;\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n for(int i=0; i < p.length-1; i++) {\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }\n for (int i = 0; i < K; i++) {\n c = c + p[i];\n }\n System.out.println(c);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] p = new int[N];", "p", "new int[N]", "N", "int c = 0;", "c", "0", "for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n p[i] = sc.nextInt();\n }", "{\n p[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "for(int i=0; i < p.length-1; i++) {\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }", "int i=0;", "int i=0;", "i", "0", "i < p.length-1", "i", "p.length-1", "p.length", "p", "p.length", "1", "i++", "i++", "i", "{\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }", "{\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }", "for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }", "int j=0;", "int j=0;", "j", "0", "j < p.length-i-1", "j", "p.length-i-1", "p.length-i-1", "p.length", "p", "p.length", "i", "1", "j++", "j++", "j", "{\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }", "{\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }", "if(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }", "p[j] > p[j+1]", "p[j]", "p", "j", "p[j+1]", "p", "j+1", "j", "1", "{\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }", "int asc = p[j];", "asc", "p[j]", "p", "j", "p[j] = p[j+1]", "p[j]", "p", "j", "p[j+1]", "p", "j+1", "j", "1", "p[j+1] = asc", "p[j+1]", "p", "j+1", "j", "1", "asc", "for (int i = 0; i < K; i++) {\n c = c + p[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n c = c + p[i];\n }", "{\n c = c + p[i];\n }", "c = c + p[i]", "c", "c + p[i]", "c", "p[i]", "p", "i", "System.out.println(c)", "System.out.println", "System.out", "System", "System.out", "c", "String[] args", "args", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int c = 0;\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n for(int i=0; i < p.length-1; i++) {\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }\n for (int i = 0; i < K; i++) {\n c = c + p[i];\n }\n System.out.println(c);\n }\n}", "public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n int c = 0;\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n for(int i=0; i < p.length-1; i++) {\n for(int j=0; j < p.length-i-1; j++) {\n \tif(p[j] > p[j+1]) {\n \t\tint asc = p[j];\n \t\tp[j] = p[j+1];\n p[j+1] = asc;\n }\n }\n }\n for (int i = 0; i < K; i++) {\n c = c + p[i];\n }\n System.out.println(c);\n }\n}", "Main" ]
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] p = new int[N]; int c = 0; for (int i = 0; i < N; i++) { p[i] = sc.nextInt(); } for(int i=0; i < p.length-1; i++) { for(int j=0; j < p.length-i-1; j++) { if(p[j] > p[j+1]) { int asc = p[j]; p[j] = p[j+1]; p[j+1] = asc; } } } for (int i = 0; i < K; i++) { c = c + p[i]; } System.out.println(c); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 14, 2, 13, 13, 30, 4, 18, 18, 13, 13, 40, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 97, 8 ], [ 97, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 29, 31 ], [ 11, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 32, 36 ], [ 36, 37 ], [ 37, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 37, 42 ], [ 42, 43 ], [ 11, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 44, 49 ], [ 49, 50 ], [ 49, 51 ], [ 44, 52 ], [ 52, 53 ], [ 53, 54 ], [ 44, 55 ], [ 56, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 57, 61 ], [ 61, 62 ], [ 62, 63 ], [ 11, 64 ], [ 64, 65 ], [ 65, 66 ], [ 64, 67 ], [ 11, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 68, 73 ], [ 73, 74 ], [ 73, 75 ], [ 68, 76 ], [ 76, 77 ], [ 77, 78 ], [ 68, 79 ], [ 80, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 85, 87 ], [ 11, 88 ], [ 88, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 88, 93 ], [ 9, 94 ], [ 94, 95 ], [ 0, 96 ], [ 96, 97 ], [ 96, 98 ] ]
[ "import java.util.*;\nimport java.io.*;\npublic class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint k=sc.nextInt();\n\t\tint arr[]=new int[n];\n\t\tint sum=0;\n\t\tif(n<k)\n\t\t{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t for(int i=0;i<n;i++)\n\t {\n\t \tarr[i]=sc.nextInt();\n\t }\n\t Arrays.sort(arr);\n\t for(int i=0;i<k;i++)\n\t {\n\t \tsum=sum+arr[i];\n\t }\n\t System.out.println(sum);\n\t\t\n\t}\n\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint k=sc.nextInt();\n\t\tint arr[]=new int[n];\n\t\tint sum=0;\n\t\tif(n<k)\n\t\t{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t for(int i=0;i<n;i++)\n\t {\n\t \tarr[i]=sc.nextInt();\n\t }\n\t Arrays.sort(arr);\n\t for(int i=0;i<k;i++)\n\t {\n\t \tsum=sum+arr[i];\n\t }\n\t System.out.println(sum);\n\t\t\n\t}\n\n}", "Main", "public static void main(String[] args)\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint k=sc.nextInt();\n\t\tint arr[]=new int[n];\n\t\tint sum=0;\n\t\tif(n<k)\n\t\t{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t for(int i=0;i<n;i++)\n\t {\n\t \tarr[i]=sc.nextInt();\n\t }\n\t Arrays.sort(arr);\n\t for(int i=0;i<k;i++)\n\t {\n\t \tsum=sum+arr[i];\n\t }\n\t System.out.println(sum);\n\t\t\n\t}", "main", "{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint k=sc.nextInt();\n\t\tint arr[]=new int[n];\n\t\tint sum=0;\n\t\tif(n<k)\n\t\t{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t for(int i=0;i<n;i++)\n\t {\n\t \tarr[i]=sc.nextInt();\n\t }\n\t Arrays.sort(arr);\n\t for(int i=0;i<k;i++)\n\t {\n\t \tsum=sum+arr[i];\n\t }\n\t System.out.println(sum);\n\t\t\n\t}", "Scanner sc=new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n=sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k=sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int arr[]=new int[n];", "arr", "new int[n]", "n", "int sum=0;", "sum", "0", "if(n<k)\n\t\t{\n\t\t\tSystem.out.println(-1);\n\t\t}", "n<k", "n", "k", "{\n\t\t\tSystem.out.println(-1);\n\t\t}", "System.out.println(-1)", "System.out.println", "System.out", "System", "System.out", "-1", "1", "for(int i=0;i<n;i++)\n\t {\n\t \tarr[i]=sc.nextInt();\n\t }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t \tarr[i]=sc.nextInt();\n\t }", "{\n\t \tarr[i]=sc.nextInt();\n\t }", "arr[i]=sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "for(int i=0;i<k;i++)\n\t {\n\t \tsum=sum+arr[i];\n\t }", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n\t \tsum=sum+arr[i];\n\t }", "{\n\t \tsum=sum+arr[i];\n\t }", "sum=sum+arr[i]", "sum", "sum+arr[i]", "sum", "arr[i]", "arr", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint k=sc.nextInt();\n\t\tint arr[]=new int[n];\n\t\tint sum=0;\n\t\tif(n<k)\n\t\t{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t for(int i=0;i<n;i++)\n\t {\n\t \tarr[i]=sc.nextInt();\n\t }\n\t Arrays.sort(arr);\n\t for(int i=0;i<k;i++)\n\t {\n\t \tsum=sum+arr[i];\n\t }\n\t System.out.println(sum);\n\t\t\n\t}\n\n}", "public class Main{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint k=sc.nextInt();\n\t\tint arr[]=new int[n];\n\t\tint sum=0;\n\t\tif(n<k)\n\t\t{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t for(int i=0;i<n;i++)\n\t {\n\t \tarr[i]=sc.nextInt();\n\t }\n\t Arrays.sort(arr);\n\t for(int i=0;i<k;i++)\n\t {\n\t \tsum=sum+arr[i];\n\t }\n\t System.out.println(sum);\n\t\t\n\t}\n\n}", "Main" ]
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=sc.nextInt(); int arr[]=new int[n]; int sum=0; if(n<k) { System.out.println(-1); } for(int i=0;i<n;i++) { arr[i]=sc.nextInt(); } Arrays.sort(arr); for(int i=0;i<k;i++) { sum=sum+arr[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 6, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 41, 13, 20, 4, 18, 13, 13, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 4, 18, 13, 23, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 41, 13, 20, 4, 18, 13, 13, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 4, 18, 13, 23, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 41, 13, 20, 4, 18, 13, 13, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 4, 18, 13, 23, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 41, 13, 20, 4, 18, 13, 8, 13, 13, 13, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 4, 18, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 4, 18, 13, 23, 13, 23, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 17, 4, 18, 13, 4, 18, 13, 4, 18, 13, 23, 13, 23, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 497, 8 ], [ 497, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 27, 28 ], [ 28, 29 ], [ 27, 30 ], [ 11, 31 ], [ 31, 32 ], [ 32, 33 ], [ 31, 34 ], [ 11, 35 ], [ 35, 36 ], [ 35, 37 ], [ 11, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 38, 43 ], [ 43, 44 ], [ 43, 45 ], [ 38, 46 ], [ 46, 47 ], [ 47, 48 ], [ 38, 49 ], [ 50, 50 ], [ 50, 51 ], [ 51, 52 ], [ 51, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 56, 59 ], [ 9, 60 ], [ 60, 61 ], [ 497, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 62, 66 ], [ 66, 67 ], [ 62, 68 ], [ 68, 69 ], [ 62, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 72, 76 ], [ 76, 77 ], [ 76, 78 ], [ 62, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 82, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 82, 89 ], [ 89, 90 ], [ 90, 91 ], [ 90, 92 ], [ 89, 93 ], [ 93, 94 ], [ 94, 95 ], [ 93, 96 ], [ 89, 97 ], [ 97, 98 ], [ 98, 99 ], [ 97, 100 ], [ 89, 101 ], [ 101, 102 ], [ 102, 103 ], [ 101, 104 ], [ 104, 105 ], [ 105, 106 ], [ 89, 107 ], [ 107, 108 ], [ 108, 109 ], [ 79, 110 ], [ 110, 111 ], [ 62, 112 ], [ 112, 113 ], [ 112, 114 ], [ 114, 115 ], [ 115, 116 ], [ 116, 117 ], [ 116, 118 ], [ 118, 119 ], [ 119, 120 ], [ 120, 121 ], [ 115, 122 ], [ 122, 123 ], [ 123, 124 ], [ 123, 125 ], [ 122, 126 ], [ 126, 127 ], [ 127, 128 ], [ 126, 129 ], [ 122, 130 ], [ 130, 131 ], [ 131, 132 ], [ 130, 133 ], [ 122, 134 ], [ 134, 135 ], [ 135, 136 ], [ 134, 137 ], [ 137, 138 ], [ 138, 139 ], [ 122, 140 ], [ 140, 141 ], [ 141, 142 ], [ 112, 143 ], [ 143, 144 ], [ 62, 145 ], [ 145, 146 ], [ 145, 147 ], [ 147, 148 ], [ 148, 149 ], [ 149, 150 ], [ 149, 151 ], [ 151, 152 ], [ 152, 153 ], [ 153, 154 ], [ 148, 155 ], [ 155, 156 ], [ 156, 157 ], [ 156, 158 ], [ 155, 159 ], [ 159, 160 ], [ 160, 161 ], [ 159, 162 ], [ 155, 163 ], [ 163, 164 ], [ 164, 165 ], [ 163, 166 ], [ 155, 167 ], [ 167, 168 ], [ 168, 169 ], [ 167, 170 ], [ 170, 171 ], [ 171, 172 ], [ 155, 173 ], [ 173, 174 ], [ 174, 175 ], [ 145, 176 ], [ 176, 177 ], [ 62, 178 ], [ 178, 179 ], [ 178, 180 ], [ 180, 181 ], [ 181, 182 ], [ 182, 183 ], [ 182, 184 ], [ 184, 185 ], [ 185, 186 ], [ 186, 187 ], [ 181, 188 ], [ 188, 189 ], [ 189, 190 ], [ 189, 191 ], [ 188, 192 ], [ 192, 193 ], [ 193, 194 ], [ 192, 195 ], [ 195, 196 ], [ 195, 197 ], [ 195, 198 ], [ 188, 199 ], [ 199, 200 ], [ 200, 201 ], [ 199, 202 ], [ 188, 203 ], [ 203, 204 ], [ 204, 205 ], [ 203, 206 ], [ 206, 207 ], [ 207, 208 ], [ 188, 209 ], [ 209, 210 ], [ 210, 211 ], [ 178, 212 ], [ 212, 213 ], [ 178, 214 ], [ 214, 215 ], [ 178, 216 ], [ 216, 217 ], [ 62, 218 ], [ 218, 219 ], [ 218, 220 ], [ 220, 221 ], [ 221, 222 ], [ 222, 223 ], [ 222, 224 ], [ 224, 225 ], [ 225, 226 ], [ 226, 227 ], [ 221, 228 ], [ 228, 229 ], [ 229, 230 ], [ 229, 231 ], [ 228, 232 ], [ 232, 233 ], [ 233, 234 ], [ 234, 235 ], [ 234, 236 ], [ 232, 237 ], [ 237, 238 ], [ 237, 239 ], [ 239, 240 ], [ 239, 241 ], [ 232, 242 ], [ 242, 243 ], [ 243, 244 ], [ 232, 245 ], [ 246, 246 ], [ 246, 247 ], [ 247, 248 ], [ 248, 249 ], [ 247, 250 ], [ 250, 251 ], [ 250, 252 ], [ 246, 253 ], [ 253, 254 ], [ 254, 255 ], [ 253, 256 ], [ 228, 257 ], [ 257, 258 ], [ 258, 259 ], [ 257, 260 ], [ 228, 261 ], [ 261, 262 ], [ 262, 263 ], [ 261, 264 ], [ 264, 265 ], [ 265, 266 ], [ 228, 267 ], [ 267, 268 ], [ 268, 269 ], [ 218, 270 ], [ 270, 271 ], [ 218, 272 ], [ 272, 273 ], [ 62, 274 ], [ 274, 275 ], [ 274, 276 ], [ 276, 277 ], [ 277, 278 ], [ 278, 279 ], [ 278, 280 ], [ 280, 281 ], [ 281, 282 ], [ 282, 283 ], [ 277, 284 ], [ 284, 285 ], [ 285, 286 ], [ 285, 287 ], [ 284, 288 ], [ 288, 289 ], [ 289, 290 ], [ 290, 291 ], [ 290, 292 ], [ 288, 293 ], [ 293, 294 ], [ 293, 295 ], [ 295, 296 ], [ 295, 297 ], [ 288, 298 ], [ 298, 299 ], [ 299, 300 ], [ 288, 301 ], [ 302, 302 ], [ 302, 303 ], [ 303, 304 ], [ 304, 305 ], [ 303, 306 ], [ 306, 307 ], [ 306, 308 ], [ 302, 309 ], [ 309, 310 ], [ 310, 311 ], [ 309, 312 ], [ 284, 313 ], [ 313, 314 ], [ 314, 315 ], [ 313, 316 ], [ 284, 317 ], [ 317, 318 ], [ 318, 319 ], [ 317, 320 ], [ 320, 321 ], [ 321, 322 ], [ 284, 323 ], [ 323, 324 ], [ 324, 325 ], [ 274, 326 ], [ 326, 327 ], [ 274, 328 ], [ 328, 329 ], [ 62, 330 ], [ 330, 331 ], [ 330, 332 ], [ 332, 333 ], [ 333, 334 ], [ 334, 335 ], [ 335, 336 ], [ 335, 337 ], [ 334, 338 ], [ 338, 339 ], [ 339, 340 ], [ 340, 341 ], [ 333, 342 ], [ 342, 343 ], [ 343, 344 ], [ 344, 345 ], [ 344, 346 ], [ 346, 347 ], [ 347, 348 ], [ 348, 349 ], [ 343, 350 ], [ 350, 351 ], [ 351, 352 ], [ 351, 353 ], [ 332, 354 ], [ 354, 355 ], [ 355, 356 ], [ 356, 357 ], [ 62, 358 ], [ 358, 359 ], [ 358, 360 ], [ 360, 361 ], [ 361, 362 ], [ 362, 363 ], [ 363, 364 ], [ 362, 365 ], [ 365, 366 ], [ 62, 367 ], [ 367, 368 ], [ 367, 369 ], [ 369, 370 ], [ 370, 371 ], [ 370, 372 ], [ 369, 374 ], [ 374, 375 ], [ 375, 376 ], [ 376, 377 ], [ 376, 378 ], [ 374, 379 ], [ 379, 380 ], [ 379, 381 ], [ 374, 382 ], [ 382, 383 ], [ 383, 384 ], [ 374, 385 ], [ 386, 386 ], [ 386, 387 ], [ 387, 388 ], [ 388, 389 ], [ 388, 390 ], [ 387, 391 ], [ 391, 392 ], [ 369, 393 ], [ 393, 394 ], [ 367, 395 ], [ 395, 396 ], [ 62, 397 ], [ 397, 398 ], [ 397, 399 ], [ 399, 400 ], [ 400, 401 ], [ 400, 402 ], [ 399, 404 ], [ 404, 405 ], [ 405, 406 ], [ 406, 407 ], [ 406, 408 ], [ 404, 409 ], [ 409, 410 ], [ 409, 411 ], [ 404, 412 ], [ 412, 413 ], [ 413, 414 ], [ 404, 415 ], [ 416, 416 ], [ 416, 417 ], [ 417, 418 ], [ 418, 419 ], [ 418, 420 ], [ 417, 421 ], [ 421, 422 ], [ 399, 423 ], [ 423, 424 ], [ 397, 425 ], [ 425, 426 ], [ 62, 427 ], [ 427, 428 ], [ 427, 429 ], [ 429, 430 ], [ 430, 431 ], [ 430, 432 ], [ 429, 434 ], [ 434, 435 ], [ 435, 436 ], [ 436, 437 ], [ 436, 438 ], [ 434, 439 ], [ 439, 440 ], [ 439, 441 ], [ 434, 442 ], [ 442, 443 ], [ 443, 444 ], [ 434, 445 ], [ 446, 446 ], [ 446, 447 ], [ 447, 448 ], [ 448, 449 ], [ 448, 450 ], [ 447, 451 ], [ 451, 452 ], [ 429, 453 ], [ 453, 454 ], [ 427, 455 ], [ 455, 456 ], [ 62, 457 ], [ 457, 458 ], [ 457, 459 ], [ 459, 460 ], [ 460, 461 ], [ 461, 462 ], [ 462, 463 ], [ 461, 464 ], [ 464, 465 ], [ 62, 466 ], [ 466, 467 ], [ 466, 468 ], [ 468, 469 ], [ 469, 470 ], [ 470, 471 ], [ 471, 472 ], [ 470, 473 ], [ 473, 474 ], [ 62, 475 ], [ 475, 476 ], [ 475, 477 ], [ 477, 478 ], [ 478, 479 ], [ 478, 480 ], [ 477, 481 ], [ 481, 482 ], [ 482, 483 ], [ 482, 484 ], [ 484, 485 ], [ 485, 486 ], [ 486, 487 ], [ 481, 488 ], [ 488, 489 ], [ 489, 490 ], [ 489, 491 ], [ 491, 492 ], [ 492, 493 ], [ 477, 494 ], [ 494, 495 ], [ 0, 496 ], [ 496, 497 ], [ 496, 498 ] ]
[ "import java.io.*;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n\n IO io = new IO();\n\n int n = io.nextInt();\n int k = io.nextInt();\n\n int[] a = io.nIntA(n);\n\n Arrays.sort(a);\n\n long sum = 0;\n\n for (int i= 0; i < k; i++) {\n sum += a[i];\n }\n\n io.write(sum);\n }\n \n static class IO {\n BufferedWriter bw;\n BufferedReader br;\n StringTokenizer st;\n\n public IO() {\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n }\n\n public void write(String s) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n } \n }\n\n public void write(long value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(boolean b, String truev, String falsv) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(long[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n \n public String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nIntA(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public long[] nLongA(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }\n return a;\n }\n\n public double[] nDoubleA(int n) {\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }\n return a;\n }\n \n public long nextLong() {\n return Long.parseLong(next());\n }\n \n public double nextDouble() {\n return Double.parseDouble(next());\n }\n \n public String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args) {\n\n IO io = new IO();\n\n int n = io.nextInt();\n int k = io.nextInt();\n\n int[] a = io.nIntA(n);\n\n Arrays.sort(a);\n\n long sum = 0;\n\n for (int i= 0; i < k; i++) {\n sum += a[i];\n }\n\n io.write(sum);\n }\n \n static class IO {\n BufferedWriter bw;\n BufferedReader br;\n StringTokenizer st;\n\n public IO() {\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n }\n\n public void write(String s) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n } \n }\n\n public void write(long value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(boolean b, String truev, String falsv) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(long[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n \n public String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nIntA(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public long[] nLongA(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }\n return a;\n }\n\n public double[] nDoubleA(int n) {\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }\n return a;\n }\n \n public long nextLong() {\n return Long.parseLong(next());\n }\n \n public double nextDouble() {\n return Double.parseDouble(next());\n }\n \n public String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}", "Main", "public static void main(String[] args) {\n\n IO io = new IO();\n\n int n = io.nextInt();\n int k = io.nextInt();\n\n int[] a = io.nIntA(n);\n\n Arrays.sort(a);\n\n long sum = 0;\n\n for (int i= 0; i < k; i++) {\n sum += a[i];\n }\n\n io.write(sum);\n }", "main", "{\n\n IO io = new IO();\n\n int n = io.nextInt();\n int k = io.nextInt();\n\n int[] a = io.nIntA(n);\n\n Arrays.sort(a);\n\n long sum = 0;\n\n for (int i= 0; i < k; i++) {\n sum += a[i];\n }\n\n io.write(sum);\n }", "IO io = new IO();", "io", "new IO()", "int n = io.nextInt();", "n", "io.nextInt()", "io.nextInt", "io", "int k = io.nextInt();", "k", "io.nextInt()", "io.nextInt", "io", "int[] a = io.nIntA(n);", "a", "io.nIntA(n)", "io.nIntA", "io", "n", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "long sum = 0;", "sum", "0", "for (int i= 0; i < k; i++) {\n sum += a[i];\n }", "int i= 0;", "int i= 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n sum += a[i];\n }", "{\n sum += a[i];\n }", "sum += a[i]", "sum", "a[i]", "a", "i", "io.write(sum)", "io.write", "io", "sum", "String[] args", "args", "static class IO {\n BufferedWriter bw;\n BufferedReader br;\n StringTokenizer st;\n\n public IO() {\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n }\n\n public void write(String s) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n } \n }\n\n public void write(long value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(boolean b, String truev, String falsv) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(long[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n \n public String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nIntA(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public long[] nLongA(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }\n return a;\n }\n\n public double[] nDoubleA(int n) {\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }\n return a;\n }\n \n public long nextLong() {\n return Long.parseLong(next());\n }\n \n public double nextDouble() {\n return Double.parseDouble(next());\n }\n \n public String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }", "IO", "BufferedWriter bw;", "bw", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public IO() {\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n }", "IO", "{\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "bw = new BufferedWriter(new OutputStreamWriter(System.out))", "bw", "new BufferedWriter(new OutputStreamWriter(System.out))", "public void write(String s) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n } \n }", "write", "{\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n } \n }", "try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }", "catch(Exception e) {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n }", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "sb.append(s)", "sb.append", "sb", "s", "sb.append(\"\\n\")", "sb.append", "sb", "\"\\n\"", "bw.write(sb.toString())", "bw.write", "bw", "sb.toString()", "sb.toString", "sb", "bw.flush()", "bw.flush", "bw", "String s", "s", "public void write(long value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "write", "{\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }", "catch(Exception e) {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n }", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "sb.append(value)", "sb.append", "sb", "value", "sb.append(\"\\n\")", "sb.append", "sb", "\"\\n\"", "bw.write(sb.toString())", "bw.write", "bw", "sb.toString()", "sb.toString", "sb", "bw.flush()", "bw.flush", "bw", "long value", "value", "public void write(int value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "write", "{\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }", "catch(Exception e) {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n }", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "sb.append(value)", "sb.append", "sb", "value", "sb.append(\"\\n\")", "sb.append", "sb", "\"\\n\"", "bw.write(sb.toString())", "bw.write", "bw", "sb.toString()", "sb.toString", "sb", "bw.flush()", "bw.flush", "bw", "int value", "value", "public void write(boolean b, String truev, String falsv) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "write", "{\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }", "catch(Exception e) {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n }", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "sb.append(b ? truev : falsv)", "sb.append", "sb", "b ? truev : falsv", "b", "truev", "falsv", "sb.append(\"\\n\")", "sb.append", "sb", "\"\\n\"", "bw.write(sb.toString())", "bw.write", "bw", "sb.toString()", "sb.toString", "sb", "bw.flush()", "bw.flush", "bw", "boolean b", "b", "String truev", "truev", "String falsv", "falsv", "public void write(int[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "write", "{\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }", "catch(Exception e) {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n }", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < a.length", "i", "a.length", "a", "a.length", "i++", "i++", "i", "{\n sb.append(a[i]);\n sb.append(sep);\n }", "{\n sb.append(a[i]);\n sb.append(sep);\n }", "sb.append(a[i])", "sb.append", "sb", "a[i]", "a", "i", "sb.append(sep)", "sb.append", "sb", "sep", "sb.append(\"\\n\")", "sb.append", "sb", "\"\\n\"", "bw.write(sb.toString())", "bw.write", "bw", "sb.toString()", "sb.toString", "sb", "bw.flush()", "bw.flush", "bw", "int[] a", "a", "char sep", "sep", "public void write(long[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "write", "{\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }", "catch(Exception e) {\n e.printStackTrace();\n }", "Exception e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n }", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < a.length", "i", "a.length", "a", "a.length", "i++", "i++", "i", "{\n sb.append(a[i]);\n sb.append(sep);\n }", "{\n sb.append(a[i]);\n sb.append(sep);\n }", "sb.append(a[i])", "sb.append", "sb", "a[i]", "a", "i", "sb.append(sep)", "sb.append", "sb", "sep", "sb.append(\"\\n\")", "sb.append", "sb", "\"\\n\"", "bw.write(sb.toString())", "bw.write", "bw", "sb.toString()", "sb.toString", "sb", "bw.flush()", "bw.flush", "bw", "long[] a", "a", "char sep", "sep", "public String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "public int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "public int[] nIntA(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }", "nIntA", "{\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }", "int[] a = new int[n];", "a", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n a[i] = nextInt();\n }", "{\n a[i] = nextInt();\n }", "a[i] = nextInt()", "a[i]", "a", "i", "nextInt()", "nextInt", "return a;", "a", "int n", "n", "public long[] nLongA(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }\n return a;\n }", "nLongA", "{\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }\n return a;\n }", "long[] a = new long[n];", "a", "new long[n]", "n", "for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n a[i] = nextLong();\n }", "{\n a[i] = nextLong();\n }", "a[i] = nextLong()", "a[i]", "a", "i", "nextLong()", "nextLong", "return a;", "a", "int n", "n", "public double[] nDoubleA(int n) {\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }\n return a;\n }", "nDoubleA", "{\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }\n return a;\n }", "double[] a = new double[n];", "a", "new double[n]", "n", "for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n a[i] = nextDouble();\n }", "{\n a[i] = nextDouble();\n }", "a[i] = nextDouble()", "a[i]", "a", "i", "nextDouble()", "nextDouble", "return a;", "a", "int n", "n", "public long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "public double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "public String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main {\n public static void main(String[] args) {\n\n IO io = new IO();\n\n int n = io.nextInt();\n int k = io.nextInt();\n\n int[] a = io.nIntA(n);\n\n Arrays.sort(a);\n\n long sum = 0;\n\n for (int i= 0; i < k; i++) {\n sum += a[i];\n }\n\n io.write(sum);\n }\n \n static class IO {\n BufferedWriter bw;\n BufferedReader br;\n StringTokenizer st;\n\n public IO() {\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n }\n\n public void write(String s) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n } \n }\n\n public void write(long value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(boolean b, String truev, String falsv) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(long[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n \n public String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nIntA(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public long[] nLongA(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }\n return a;\n }\n\n public double[] nDoubleA(int n) {\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }\n return a;\n }\n \n public long nextLong() {\n return Long.parseLong(next());\n }\n \n public double nextDouble() {\n return Double.parseDouble(next());\n }\n \n public String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}", "public class Main {\n public static void main(String[] args) {\n\n IO io = new IO();\n\n int n = io.nextInt();\n int k = io.nextInt();\n\n int[] a = io.nIntA(n);\n\n Arrays.sort(a);\n\n long sum = 0;\n\n for (int i= 0; i < k; i++) {\n sum += a[i];\n }\n\n io.write(sum);\n }\n \n static class IO {\n BufferedWriter bw;\n BufferedReader br;\n StringTokenizer st;\n\n public IO() {\n br = new BufferedReader(new InputStreamReader(System.in));\n bw = new BufferedWriter(new OutputStreamWriter(System.out));\n }\n\n public void write(String s) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(s);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n } \n }\n\n public void write(long value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int value) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(value);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(boolean b, String truev, String falsv) {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append(b ? truev : falsv);\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(int[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n\n public void write(long[] a, char sep) {\n try {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < a.length; i++) {\n sb.append(a[i]);\n sb.append(sep);\n }\n sb.append(\"\\n\");\n bw.write(sb.toString());\n bw.flush();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n \n public String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nIntA(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public long[] nLongA(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextLong();\n }\n return a;\n }\n\n public double[] nDoubleA(int n) {\n double[] a = new double[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextDouble();\n }\n return a;\n }\n \n public long nextLong() {\n return Long.parseLong(next());\n }\n \n public double nextDouble() {\n return Double.parseDouble(next());\n }\n \n public String nextLine() {\n String str = \"\";\n try{\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}", "Main" ]
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { IO io = new IO(); int n = io.nextInt(); int k = io.nextInt(); int[] a = io.nIntA(n); Arrays.sort(a); long sum = 0; for (int i= 0; i < k; i++) { sum += a[i]; } io.write(sum); } static class IO { BufferedWriter bw; BufferedReader br; StringTokenizer st; public IO() { br = new BufferedReader(new InputStreamReader(System.in)); bw = new BufferedWriter(new OutputStreamWriter(System.out)); } public void write(String s) { try { StringBuilder sb = new StringBuilder(); sb.append(s); sb.append("\n"); bw.write(sb.toString()); bw.flush(); } catch(Exception e) { e.printStackTrace(); } } public void write(long value) { try { StringBuilder sb = new StringBuilder(); sb.append(value); sb.append("\n"); bw.write(sb.toString()); bw.flush(); } catch(Exception e) { e.printStackTrace(); } } public void write(int value) { try { StringBuilder sb = new StringBuilder(); sb.append(value); sb.append("\n"); bw.write(sb.toString()); bw.flush(); } catch(Exception e) { e.printStackTrace(); } } public void write(boolean b, String truev, String falsv) { try { StringBuilder sb = new StringBuilder(); sb.append(b ? truev : falsv); sb.append("\n"); bw.write(sb.toString()); bw.flush(); } catch(Exception e) { e.printStackTrace(); } } public void write(int[] a, char sep) { try { StringBuilder sb = new StringBuilder(); for (int i = 0; i < a.length; i++) { sb.append(a[i]); sb.append(sep); } sb.append("\n"); bw.write(sb.toString()); bw.flush(); } catch(Exception e) { e.printStackTrace(); } } public void write(long[] a, char sep) { try { StringBuilder sb = new StringBuilder(); for (int i = 0; i < a.length; i++) { sb.append(a[i]); sb.append(sep); } sb.append("\n"); bw.write(sb.toString()); bw.flush(); } catch(Exception e) { e.printStackTrace(); } } public String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public int[] nIntA(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = nextInt(); } return a; } public long[] nLongA(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) { a[i] = nextLong(); } return a; } public double[] nDoubleA(int n) { double[] a = new double[n]; for (int i = 0; i < n; i++) { a[i] = nextDouble(); } return a; } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String nextLine() { String str = ""; try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 80, 5 ], [ 80, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 8, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 6, 77 ], [ 77, 78 ], [ 0, 79 ], [ 79, 80 ], [ 79, 81 ] ]
[ "import java.util.*;\n\npublic class Main {\n public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] all = new int[N];\n for(int i = 0;i < N;i++) {\n all[i] = sc.nextInt();\n }\n Arrays.sort(all);\n int buy = 0;\n for(int i = 0;i < K;i++){\n buy += all[i];\n }\n System.out.println(buy);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] all = new int[N];\n for(int i = 0;i < N;i++) {\n all[i] = sc.nextInt();\n }\n Arrays.sort(all);\n int buy = 0;\n for(int i = 0;i < K;i++){\n buy += all[i];\n }\n System.out.println(buy);\n }\n}", "Main", "public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] all = new int[N];\n for(int i = 0;i < N;i++) {\n all[i] = sc.nextInt();\n }\n Arrays.sort(all);\n int buy = 0;\n for(int i = 0;i < K;i++){\n buy += all[i];\n }\n System.out.println(buy);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] all = new int[N];\n for(int i = 0;i < N;i++) {\n all[i] = sc.nextInt();\n }\n Arrays.sort(all);\n int buy = 0;\n for(int i = 0;i < K;i++){\n buy += all[i];\n }\n System.out.println(buy);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] all = new int[N];", "all", "new int[N]", "N", "for(int i = 0;i < N;i++) {\n all[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n all[i] = sc.nextInt();\n }", "{\n all[i] = sc.nextInt();\n }", "all[i] = sc.nextInt()", "all[i]", "all", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(all)", "Arrays.sort", "Arrays", "all", "int buy = 0;", "buy", "0", "for(int i = 0;i < K;i++){\n buy += all[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n buy += all[i];\n }", "{\n buy += all[i];\n }", "buy += all[i]", "buy", "all[i]", "all", "i", "System.out.println(buy)", "System.out.println", "System.out", "System", "System.out", "buy", "String[] args", "args", "public class Main {\n public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] all = new int[N];\n for(int i = 0;i < N;i++) {\n all[i] = sc.nextInt();\n }\n Arrays.sort(all);\n int buy = 0;\n for(int i = 0;i < K;i++){\n buy += all[i];\n }\n System.out.println(buy);\n }\n}", "public class Main {\n public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] all = new int[N];\n for(int i = 0;i < N;i++) {\n all[i] = sc.nextInt();\n }\n Arrays.sort(all);\n int buy = 0;\n for(int i = 0;i < K;i++){\n buy += all[i];\n }\n System.out.println(buy);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args ) throws Exception { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] all = new int[N]; for(int i = 0;i < N;i++) { all[i] = sc.nextInt(); } Arrays.sort(all); int buy = 0; for(int i = 0;i < K;i++){ buy += all[i]; } System.out.println(buy); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 4, 18, 13, 4, 18, 13, 4, 18, 13, 23, 13, 12, 13, 30, 0, 18, 36, 13, 13, 0, 18, 36, 13, 4, 18, 13, 0, 18, 36, 13, 4, 18, 13, 0, 18, 36, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 23, 13, 12, 13, 30, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 29, 13, 12, 13, 30, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 129, 8 ], [ 129, 9 ], [ 9, 10 ], [ 129, 11 ], [ 11, 12 ], [ 129, 13 ], [ 13, 14 ], [ 129, 15 ], [ 15, 16 ], [ 129, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 20, 22 ], [ 19, 23 ], [ 23, 24 ], [ 23, 25 ], [ 19, 26 ], [ 26, 27 ], [ 27, 28 ], [ 26, 29 ], [ 29, 30 ], [ 30, 31 ], [ 19, 32 ], [ 32, 33 ], [ 33, 34 ], [ 17, 35 ], [ 35, 36 ], [ 129, 37 ], [ 37, 38 ], [ 37, 39 ], [ 39, 40 ], [ 40, 41 ], [ 41, 42 ], [ 41, 43 ], [ 40, 44 ], [ 39, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 39, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 52, 56 ], [ 56, 57 ], [ 57, 58 ], [ 39, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 59, 63 ], [ 39, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 65, 70 ], [ 70, 71 ], [ 70, 72 ], [ 65, 73 ], [ 73, 74 ], [ 74, 75 ], [ 65, 76 ], [ 77, 77 ], [ 77, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 78, 82 ], [ 82, 83 ], [ 83, 84 ], [ 37, 85 ], [ 85, 86 ], [ 129, 87 ], [ 87, 88 ], [ 87, 89 ], [ 89, 90 ], [ 90, 91 ], [ 91, 92 ], [ 90, 93 ], [ 89, 94 ], [ 94, 95 ], [ 94, 96 ], [ 89, 97 ], [ 97, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 97, 102 ], [ 102, 103 ], [ 102, 104 ], [ 97, 105 ], [ 105, 106 ], [ 106, 107 ], [ 97, 108 ], [ 109, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 112, 113 ], [ 112, 114 ], [ 89, 115 ], [ 115, 116 ], [ 129, 117 ], [ 117, 118 ], [ 117, 119 ], [ 119, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 120, 125 ], [ 117, 126 ], [ 126, 127 ], [ 0, 128 ], [ 128, 129 ], [ 128, 130 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n Main m = new Main(sc);\n m.show(m.solve());\n sc.close();\n }\n \n\t//フィールド\n Scanner sc;\n int N;\n int K;\n int[] p;\n \n //入力\n Main(Scanner sc) {\n this.sc = sc;\n this.N = sc.nextInt();\n this.K = sc.nextInt();\n this.p = new int[N];\n for (int i=0; i<N; i++) {\n \tp[i] = sc.nextInt();\n }\n }\n \n //解答処理\n private int solve() {\n Arrays.sort(p);\n \tint answer = 0;\n for (int i=0; i<K; i++) {\n \tanswer += p[i];\n }\n \n return answer;\n }\n \n //出力\n public void show(int answer) {\n System.out.println(answer);\n }\n\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n Main m = new Main(sc);\n m.show(m.solve());\n sc.close();\n }\n \n\t//フィールド\n Scanner sc;\n int N;\n int K;\n int[] p;\n \n //入力\n Main(Scanner sc) {\n this.sc = sc;\n this.N = sc.nextInt();\n this.K = sc.nextInt();\n this.p = new int[N];\n for (int i=0; i<N; i++) {\n \tp[i] = sc.nextInt();\n }\n }\n \n //解答処理\n private int solve() {\n Arrays.sort(p);\n \tint answer = 0;\n for (int i=0; i<K; i++) {\n \tanswer += p[i];\n }\n \n return answer;\n }\n \n //出力\n public void show(int answer) {\n System.out.println(answer);\n }\n\n}", "Main", "//フィールド\n Scanner sc;", "sc", "int N;", "N", "int K;", "K", "int[] p;", "p", "public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n Main m = new Main(sc);\n m.show(m.solve());\n sc.close();\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n Main m = new Main(sc);\n m.show(m.solve());\n sc.close();\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "Main m = new Main(sc);", "m", "new Main(sc)", "m.show(m.solve())", "m.show", "m", "m.solve()", "m.solve", "m", "sc.close()", "sc.close", "sc", "String[] args", "args", "//入力\n Main(Scanner sc) {\n this.sc = sc;\n this.N = sc.nextInt();\n this.K = sc.nextInt();\n this.p = new int[N];\n for (int i=0; i<N; i++) {\n \tp[i] = sc.nextInt();\n }\n }", "Main", "{\n this.sc = sc;\n this.N = sc.nextInt();\n this.K = sc.nextInt();\n this.p = new int[N];\n for (int i=0; i<N; i++) {\n \tp[i] = sc.nextInt();\n }\n }", "this.sc = sc", "this.sc", "this", "this.sc", "sc", "this.N = sc.nextInt()", "this.N", "this", "this.N", "sc.nextInt()", "sc.nextInt", "sc", "this.K = sc.nextInt()", "this.K", "this", "this.K", "sc.nextInt()", "sc.nextInt", "sc", "this.p = new int[N]", "this.p", "this", "this.p", "new int[N]", "N", "for (int i=0; i<N; i++) {\n \tp[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n \tp[i] = sc.nextInt();\n }", "{\n \tp[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "Scanner sc", "sc", "//解答処理\n private int solve() {\n Arrays.sort(p);\n \tint answer = 0;\n for (int i=0; i<K; i++) {\n \tanswer += p[i];\n }\n \n return answer;\n }", "solve", "{\n Arrays.sort(p);\n \tint answer = 0;\n for (int i=0; i<K; i++) {\n \tanswer += p[i];\n }\n \n return answer;\n }", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "int answer = 0;", "answer", "0", "for (int i=0; i<K; i++) {\n \tanswer += p[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n \tanswer += p[i];\n }", "{\n \tanswer += p[i];\n }", "answer += p[i]", "answer", "p[i]", "p", "i", "return answer;", "answer", "//出力\n public void show(int answer) {\n System.out.println(answer);\n }", "show", "{\n System.out.println(answer);\n }", "System.out.println(answer)", "System.out.println", "System.out", "System", "System.out", "answer", "int answer", "answer", "public class Main {\n\tpublic static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n Main m = new Main(sc);\n m.show(m.solve());\n sc.close();\n }\n \n\t//フィールド\n Scanner sc;\n int N;\n int K;\n int[] p;\n \n //入力\n Main(Scanner sc) {\n this.sc = sc;\n this.N = sc.nextInt();\n this.K = sc.nextInt();\n this.p = new int[N];\n for (int i=0; i<N; i++) {\n \tp[i] = sc.nextInt();\n }\n }\n \n //解答処理\n private int solve() {\n Arrays.sort(p);\n \tint answer = 0;\n for (int i=0; i<K; i++) {\n \tanswer += p[i];\n }\n \n return answer;\n }\n \n //出力\n public void show(int answer) {\n System.out.println(answer);\n }\n\n}", "public class Main {\n\tpublic static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n Main m = new Main(sc);\n m.show(m.solve());\n sc.close();\n }\n \n\t//フィールド\n Scanner sc;\n int N;\n int K;\n int[] p;\n \n //入力\n Main(Scanner sc) {\n this.sc = sc;\n this.N = sc.nextInt();\n this.K = sc.nextInt();\n this.p = new int[N];\n for (int i=0; i<N; i++) {\n \tp[i] = sc.nextInt();\n }\n }\n \n //解答処理\n private int solve() {\n Arrays.sort(p);\n \tint answer = 0;\n for (int i=0; i<K; i++) {\n \tanswer += p[i];\n }\n \n return answer;\n }\n \n //出力\n public void show(int answer) {\n System.out.println(answer);\n }\n\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); Main m = new Main(sc); m.show(m.solve()); sc.close(); } //フィールド Scanner sc; int N; int K; int[] p; //入力 Main(Scanner sc) { this.sc = sc; this.N = sc.nextInt(); this.K = sc.nextInt(); this.p = new int[N]; for (int i=0; i<N; i++) { p[i] = sc.nextInt(); } } //解答処理 private int solve() { Arrays.sort(p); int answer = 0; for (int i=0; i<K; i++) { answer += p[i]; } return answer; } //出力 public void show(int answer) { System.out.println(answer); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 0, 13, 20, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 13, 2, 13, 17, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 119, 23 ], [ 119, 24 ], [ 24, 25 ], [ 24, 26 ], [ 26, 27 ], [ 27, 28 ], [ 27, 29 ], [ 26, 30 ], [ 30, 31 ], [ 30, 32 ], [ 26, 33 ], [ 33, 34 ], [ 33, 35 ], [ 26, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 38, 41 ], [ 41, 42 ], [ 42, 43 ], [ 26, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 49, 50 ], [ 50, 51 ], [ 26, 52 ], [ 52, 53 ], [ 52, 54 ], [ 26, 56 ], [ 56, 57 ], [ 56, 58 ], [ 26, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 66, 68 ], [ 59, 69 ], [ 69, 70 ], [ 70, 71 ], [ 59, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 73, 77 ], [ 77, 78 ], [ 78, 79 ], [ 77, 80 ], [ 80, 81 ], [ 81, 82 ], [ 26, 83 ], [ 83, 84 ], [ 84, 85 ], [ 83, 86 ], [ 26, 87 ], [ 87, 88 ], [ 87, 89 ], [ 26, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 92, 94 ], [ 90, 95 ], [ 95, 96 ], [ 95, 97 ], [ 90, 98 ], [ 98, 99 ], [ 99, 100 ], [ 90, 101 ], [ 101, 102 ], [ 102, 103 ], [ 102, 104 ], [ 104, 105 ], [ 104, 106 ], [ 26, 107 ], [ 107, 108 ], [ 108, 109 ], [ 107, 110 ], [ 110, 111 ], [ 110, 112 ], [ 26, 113 ], [ 113, 114 ], [ 114, 115 ], [ 24, 116 ], [ 116, 117 ], [ 0, 118 ], [ 118, 119 ], [ 118, 120 ] ]
[ "import java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint K = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] prices = new int[N];\n\t\t\n\t\tst = new StringTokenizer(br.readLine());\n\t\t\n\t\tfor(int i=0;i <prices.length; i++)\n\t\t\tprices[i] = Integer.parseInt(st.nextToken());\n\t\t\n\t\tArrays.sort(prices);\n\t\t\n\t\tint sum = 0;\n\t\tfor(int i=0; i<K; i++)\n\t\t\tsum += prices[i];\n\t\t\n\t\tbw.write(sum + \"\\n\");\n\t\tbw.flush();\n\t}\n\n}", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.BufferedWriter;", "BufferedWriter", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.OutputStreamWriter;", "OutputStreamWriter", "java.io", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint K = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] prices = new int[N];\n\t\t\n\t\tst = new StringTokenizer(br.readLine());\n\t\t\n\t\tfor(int i=0;i <prices.length; i++)\n\t\t\tprices[i] = Integer.parseInt(st.nextToken());\n\t\t\n\t\tArrays.sort(prices);\n\t\t\n\t\tint sum = 0;\n\t\tfor(int i=0; i<K; i++)\n\t\t\tsum += prices[i];\n\t\t\n\t\tbw.write(sum + \"\\n\");\n\t\tbw.flush();\n\t}\n\n}", "Main", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint K = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] prices = new int[N];\n\t\t\n\t\tst = new StringTokenizer(br.readLine());\n\t\t\n\t\tfor(int i=0;i <prices.length; i++)\n\t\t\tprices[i] = Integer.parseInt(st.nextToken());\n\t\t\n\t\tArrays.sort(prices);\n\t\t\n\t\tint sum = 0;\n\t\tfor(int i=0; i<K; i++)\n\t\t\tsum += prices[i];\n\t\t\n\t\tbw.write(sum + \"\\n\");\n\t\tbw.flush();\n\t}", "main", "{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint K = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] prices = new int[N];\n\t\t\n\t\tst = new StringTokenizer(br.readLine());\n\t\t\n\t\tfor(int i=0;i <prices.length; i++)\n\t\t\tprices[i] = Integer.parseInt(st.nextToken());\n\t\t\n\t\tArrays.sort(prices);\n\t\t\n\t\tint sum = 0;\n\t\tfor(int i=0; i<K; i++)\n\t\t\tsum += prices[i];\n\t\t\n\t\tbw.write(sum + \"\\n\");\n\t\tbw.flush();\n\t}", "BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));", "bw", "new BufferedWriter(new OutputStreamWriter(System.out))", "StringTokenizer st = new StringTokenizer(br.readLine());", "st", "new StringTokenizer(br.readLine())", "int N = Integer.parseInt(st.nextToken());", "N", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "int K = Integer.parseInt(st.nextToken());", "K", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "int[] prices = new int[N];", "prices", "new int[N]", "N", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "for(int i=0;i <prices.length; i++)\n\t\t\tprices[i] = Integer.parseInt(st.nextToken());", "int i=0;", "int i=0;", "i", "0", "i <prices.length", "i", "prices.length", "prices", "prices.length", "i++", "i++", "i", "prices[i] = Integer.parseInt(st.nextToken());", "prices[i] = Integer.parseInt(st.nextToken())", "prices[i]", "prices", "i", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "Arrays.sort(prices)", "Arrays.sort", "Arrays", "prices", "int sum = 0;", "sum", "0", "for(int i=0; i<K; i++)\n\t\t\tsum += prices[i];", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "sum += prices[i];", "sum += prices[i]", "sum", "prices[i]", "prices", "i", "bw.write(sum + \"\\n\")", "bw.write", "bw", "sum + \"\\n\"", "sum", "\"\\n\"", "bw.flush()", "bw.flush", "bw", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint K = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] prices = new int[N];\n\t\t\n\t\tst = new StringTokenizer(br.readLine());\n\t\t\n\t\tfor(int i=0;i <prices.length; i++)\n\t\t\tprices[i] = Integer.parseInt(st.nextToken());\n\t\t\n\t\tArrays.sort(prices);\n\t\t\n\t\tint sum = 0;\n\t\tfor(int i=0; i<K; i++)\n\t\t\tsum += prices[i];\n\t\t\n\t\tbw.write(sum + \"\\n\");\n\t\tbw.flush();\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N = Integer.parseInt(st.nextToken());\n\t\tint K = Integer.parseInt(st.nextToken());\n\t\t\n\t\tint[] prices = new int[N];\n\t\t\n\t\tst = new StringTokenizer(br.readLine());\n\t\t\n\t\tfor(int i=0;i <prices.length; i++)\n\t\t\tprices[i] = Integer.parseInt(st.nextToken());\n\t\t\n\t\tArrays.sort(prices);\n\t\t\n\t\tint sum = 0;\n\t\tfor(int i=0; i<K; i++)\n\t\t\tsum += prices[i];\n\t\t\n\t\tbw.write(sum + \"\\n\");\n\t\tbw.flush();\n\t}\n\n}", "Main" ]
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); int K = Integer.parseInt(st.nextToken()); int[] prices = new int[N]; st = new StringTokenizer(br.readLine()); for(int i=0;i <prices.length; i++) prices[i] = Integer.parseInt(st.nextToken()); Arrays.sort(prices); int sum = 0; for(int i=0; i<K; i++) sum += prices[i]; bw.write(sum + "\n"); bw.flush(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 88, 11 ], [ 88, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 14, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 14, 56 ], [ 56, 57 ], [ 56, 58 ], [ 14, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 64, 65 ], [ 64, 66 ], [ 59, 67 ], [ 67, 68 ], [ 68, 69 ], [ 59, 70 ], [ 71, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 14, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 12, 85 ], [ 85, 86 ], [ 0, 87 ], [ 87, 88 ], [ 87, 89 ] ]
[ "\n\nimport java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\n\npublic class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k; i++)\n\t\t{\n\t\t\tsum = sum+arr[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "import java.io.*;", "io.*", "java", "public class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k; i++)\n\t\t{\n\t\t\tsum = sum+arr[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "Main", "public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k; i++)\n\t\t{\n\t\t\tsum = sum+arr[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k; i++)\n\t\t{\n\t\t\tsum = sum+arr[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int arr[] = new int[n];", "arr", "new int[n]", "n", "for(int i = 0; i<n; i++)\n\t\t{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}", "{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}", "arr[i] = sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int sum = 0;", "sum", "0", "for(int i = 0; i<k; i++)\n\t\t{\n\t\t\tsum = sum+arr[i];\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n\t\t\tsum = sum+arr[i];\n\t\t}", "{\n\t\t\tsum = sum+arr[i];\n\t\t}", "sum = sum+arr[i]", "sum", "sum+arr[i]", "sum", "arr[i]", "arr", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k; i++)\n\t\t{\n\t\t\tsum = sum+arr[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "public class Main\n{\n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i<n; i++)\n\t\t{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k; i++)\n\t\t{\n\t\t\tsum = sum+arr[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}", "Main" ]
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int arr[] = new int[n]; for(int i = 0; i<n; i++) { arr[i] = sc.nextInt(); } Arrays.sort(arr); int sum = 0; for(int i = 0; i<k; i++) { sum = sum+arr[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 17, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 88, 11 ], [ 88, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 31, 33 ], [ 14, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 35, 40 ], [ 40, 41 ], [ 40, 42 ], [ 35, 43 ], [ 43, 44 ], [ 44, 45 ], [ 35, 46 ], [ 47, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 52, 53 ], [ 53, 54 ], [ 14, 55 ], [ 55, 56 ], [ 56, 57 ], [ 55, 58 ], [ 14, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 64, 65 ], [ 64, 66 ], [ 59, 67 ], [ 67, 68 ], [ 68, 69 ], [ 59, 70 ], [ 71, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 14, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 12, 85 ], [ 85, 86 ], [ 0, 87 ], [ 87, 88 ], [ 87, 89 ] ]
[ "import java.util.Scanner;\nimport java.util.Random;\nimport java.util.Arrays;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0;\n int[] p = new int[n];\n for(int i=0; i<n; i++){\n p[i]=sc.nextInt();\n } \n Arrays.sort(p);\n for(int i=0; i<k; i++){\n sum=sum+p[i];\n }\n System.out.println(sum);\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.Random;", "Random", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "public class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0;\n int[] p = new int[n];\n for(int i=0; i<n; i++){\n p[i]=sc.nextInt();\n } \n Arrays.sort(p);\n for(int i=0; i<k; i++){\n sum=sum+p[i];\n }\n System.out.println(sum);\n }\n}", "Main", "public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0;\n int[] p = new int[n];\n for(int i=0; i<n; i++){\n p[i]=sc.nextInt();\n } \n Arrays.sort(p);\n for(int i=0; i<k; i++){\n sum=sum+p[i];\n }\n System.out.println(sum);\n }", "main", "{\n Scanner sc =new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0;\n int[] p = new int[n];\n for(int i=0; i<n; i++){\n p[i]=sc.nextInt();\n } \n Arrays.sort(p);\n for(int i=0; i<k; i++){\n sum=sum+p[i];\n }\n System.out.println(sum);\n }", "Scanner sc =new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int sum = 0;", "sum", "0", "int[] p = new int[n];", "p", "new int[n]", "n", "for(int i=0; i<n; i++){\n p[i]=sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n p[i]=sc.nextInt();\n }", "{\n p[i]=sc.nextInt();\n }", "p[i]=sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(p)", "Arrays.sort", "Arrays", "p", "for(int i=0; i<k; i++){\n sum=sum+p[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n sum=sum+p[i];\n }", "{\n sum=sum+p[i];\n }", "sum=sum+p[i]", "sum", "sum+p[i]", "sum", "p[i]", "p", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0;\n int[] p = new int[n];\n for(int i=0; i<n; i++){\n p[i]=sc.nextInt();\n } \n Arrays.sort(p);\n for(int i=0; i<k; i++){\n sum=sum+p[i];\n }\n System.out.println(sum);\n }\n}", "public class Main{\n public static void main(String[] args){\n Scanner sc =new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0;\n int[] p = new int[n];\n for(int i=0; i<n; i++){\n p[i]=sc.nextInt();\n } \n Arrays.sort(p);\n for(int i=0; i<k; i++){\n sum=sum+p[i];\n }\n System.out.println(sum);\n }\n}", "Main" ]
import java.util.Scanner; import java.util.Random; import java.util.Arrays; public class Main{ public static void main(String[] args){ Scanner sc =new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int sum = 0; int[] p = new int[n]; for(int i=0; i<n; i++){ p[i]=sc.nextInt(); } Arrays.sort(p); for(int i=0; i<k; i++){ sum=sum+p[i]; } System.out.println(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 17, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 94, 5 ], [ 94, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 14, 17 ], [ 17, 18 ], [ 18, 19 ], [ 8, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 22, 25 ], [ 25, 26 ], [ 26, 27 ], [ 8, 28 ], [ 28, 29 ], [ 28, 30 ], [ 8, 31 ], [ 31, 32 ], [ 31, 33 ], [ 8, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 37, 39 ], [ 35, 40 ], [ 40, 41 ], [ 40, 42 ], [ 35, 43 ], [ 43, 44 ], [ 44, 45 ], [ 35, 46 ], [ 47, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 48, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 55, 56 ], [ 56, 57 ], [ 8, 58 ], [ 58, 59 ], [ 59, 60 ], [ 8, 61 ], [ 61, 62 ], [ 62, 63 ], [ 61, 64 ], [ 8, 65 ], [ 65, 66 ], [ 66, 67 ], [ 67, 68 ], [ 67, 69 ], [ 65, 70 ], [ 70, 71 ], [ 70, 72 ], [ 65, 73 ], [ 73, 74 ], [ 74, 75 ], [ 65, 76 ], [ 77, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 82, 84 ], [ 8, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 85, 90 ], [ 6, 91 ], [ 91, 92 ], [ 0, 93 ], [ 93, 94 ], [ 93, 95 ] ]
[ "import java.util.*;\n\npublic class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n final int N = Integer.parseInt(sc.next());\n final int K = Integer.parseInt(sc.next());\n int result = 0;\n int[] pricelist = new int[N];\n for (int i = 0; i < N; i++) {\n pricelist[i] = Integer.parseInt(sc.next());\n }\n sc.close();\n Arrays.sort(pricelist);\n for (int i = 0; i < K; i++) {\n result = result + pricelist[i];\n }\n System.out.println(result);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n final int N = Integer.parseInt(sc.next());\n final int K = Integer.parseInt(sc.next());\n int result = 0;\n int[] pricelist = new int[N];\n for (int i = 0; i < N; i++) {\n pricelist[i] = Integer.parseInt(sc.next());\n }\n sc.close();\n Arrays.sort(pricelist);\n for (int i = 0; i < K; i++) {\n result = result + pricelist[i];\n }\n System.out.println(result);\n }\n}", "Main", "public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n final int N = Integer.parseInt(sc.next());\n final int K = Integer.parseInt(sc.next());\n int result = 0;\n int[] pricelist = new int[N];\n for (int i = 0; i < N; i++) {\n pricelist[i] = Integer.parseInt(sc.next());\n }\n sc.close();\n Arrays.sort(pricelist);\n for (int i = 0; i < K; i++) {\n result = result + pricelist[i];\n }\n System.out.println(result);\n }", "main", "{\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n final int N = Integer.parseInt(sc.next());\n final int K = Integer.parseInt(sc.next());\n int result = 0;\n int[] pricelist = new int[N];\n for (int i = 0; i < N; i++) {\n pricelist[i] = Integer.parseInt(sc.next());\n }\n sc.close();\n Arrays.sort(pricelist);\n for (int i = 0; i < K; i++) {\n result = result + pricelist[i];\n }\n System.out.println(result);\n }", "final Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "final int N = Integer.parseInt(sc.next());", "N", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "final int K = Integer.parseInt(sc.next());", "K", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "int result = 0;", "result", "0", "int[] pricelist = new int[N];", "pricelist", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n pricelist[i] = Integer.parseInt(sc.next());\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n pricelist[i] = Integer.parseInt(sc.next());\n }", "{\n pricelist[i] = Integer.parseInt(sc.next());\n }", "pricelist[i] = Integer.parseInt(sc.next())", "pricelist[i]", "pricelist", "i", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "sc.close()", "sc.close", "sc", "Arrays.sort(pricelist)", "Arrays.sort", "Arrays", "pricelist", "for (int i = 0; i < K; i++) {\n result = result + pricelist[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n result = result + pricelist[i];\n }", "{\n result = result + pricelist[i];\n }", "result = result + pricelist[i]", "result", "result + pricelist[i]", "result", "pricelist[i]", "pricelist", "i", "System.out.println(result)", "System.out.println", "System.out", "System", "System.out", "result", "final String[] args", "args", "public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n final int N = Integer.parseInt(sc.next());\n final int K = Integer.parseInt(sc.next());\n int result = 0;\n int[] pricelist = new int[N];\n for (int i = 0; i < N; i++) {\n pricelist[i] = Integer.parseInt(sc.next());\n }\n sc.close();\n Arrays.sort(pricelist);\n for (int i = 0; i < K; i++) {\n result = result + pricelist[i];\n }\n System.out.println(result);\n }\n}", "public class Main {\n public static void main(final String[] args) {\n final Scanner sc = new Scanner(System.in);\n // 整数の入力\n // final int a = sc.nextInt();\n // 文字列の入力\n // final String s1 = sc.next();\n final int N = Integer.parseInt(sc.next());\n final int K = Integer.parseInt(sc.next());\n int result = 0;\n int[] pricelist = new int[N];\n for (int i = 0; i < N; i++) {\n pricelist[i] = Integer.parseInt(sc.next());\n }\n sc.close();\n Arrays.sort(pricelist);\n for (int i = 0; i < K; i++) {\n result = result + pricelist[i];\n }\n System.out.println(result);\n }\n}", "Main" ]
import java.util.*; public class Main { public static void main(final String[] args) { final Scanner sc = new Scanner(System.in); // 整数の入力 // final int a = sc.nextInt(); // 文字列の入力 // final String s1 = sc.next(); final int N = Integer.parseInt(sc.next()); final int K = Integer.parseInt(sc.next()); int result = 0; int[] pricelist = new int[N]; for (int i = 0; i < N; i++) { pricelist[i] = Integer.parseInt(sc.next()); } sc.close(); Arrays.sort(pricelist); for (int i = 0; i < K; i++) { result = result + pricelist[i]; } System.out.println(result); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 41, 13, 17, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 1, 40, 13, 30, 30, 14, 2, 13, 4, 18, 13, 13, 30, 0, 13, 4, 18, 13, 13, 0, 13, 13, 4, 18, 13, 13, 0, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 120, 11 ], [ 120, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 44, 47 ], [ 47, 48 ], [ 48, 49 ], [ 14, 50 ], [ 50, 51 ], [ 50, 52 ], [ 14, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 65, 69 ], [ 69, 70 ], [ 69, 71 ], [ 65, 72 ], [ 72, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 79, 80 ], [ 80, 81 ], [ 72, 82 ], [ 82, 83 ], [ 83, 84 ], [ 72, 85 ], [ 86, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 91, 92 ], [ 90, 93 ], [ 87, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 97, 98 ], [ 98, 99 ], [ 97, 100 ], [ 94, 101 ], [ 101, 102 ], [ 101, 103 ], [ 65, 104 ], [ 104, 105 ], [ 105, 106 ], [ 104, 107 ], [ 65, 108 ], [ 108, 109 ], [ 108, 110 ], [ 14, 111 ], [ 111, 112 ], [ 112, 113 ], [ 113, 114 ], [ 113, 115 ], [ 111, 116 ], [ 12, 117 ], [ 117, 118 ], [ 0, 119 ], [ 119, 120 ], [ 119, 121 ] ]
[ "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint K = scan.nextInt();\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\t\tint total = 0;\n\t\tfor (int i = 0; i < K ; i++) {\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.List;", "List", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint K = scan.nextInt();\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\t\tint total = 0;\n\t\tfor (int i = 0; i < K ; i++) {\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint K = scan.nextInt();\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\t\tint total = 0;\n\t\tfor (int i = 0; i < K ; i++) {\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}\n\t\tSystem.out.println(total);\n\t}", "main", "{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint K = scan.nextInt();\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\t\tint total = 0;\n\t\tfor (int i = 0; i < K ; i++) {\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}\n\t\tSystem.out.println(total);\n\t}", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int N = scan.nextInt();", "N", "scan.nextInt()", "scan.nextInt", "scan", "int K = scan.nextInt();", "K", "scan.nextInt()", "scan.nextInt", "scan", "List<Integer> list = new ArrayList<Integer>();", "list", "new ArrayList<Integer>()", "for (int i = 0; i < N; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tlist.add(scan.nextInt());\n\t\t}", "{\n\t\t\tlist.add(scan.nextInt());\n\t\t}", "list.add(scan.nextInt())", "list.add", "list", "scan.nextInt()", "scan.nextInt", "scan", "int total = 0;", "total", "0", "for (int i = 0; i < K ; i++) {\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}", "{\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}", "int price = 1001;", "price", "1001", "int idx = 0;", "idx", "0", "for (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}", "int j = 0;", "int j = 0;", "j", "0", "j < list.size()", "j", "list.size()", "list.size", "list", "j++", "j++", "j", "{\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}", "{\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}", "if (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}", "price > list.get(j)", "price", "list.get(j)", "list.get", "list", "j", "{\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}", "price = list.get(j)", "price", "list.get(j)", "list.get", "list", "j", "idx = j", "idx", "j", "list.remove(idx)", "list.remove", "list", "idx", "total += price", "total", "price", "System.out.println(total)", "System.out.println", "System.out", "System", "System.out", "total", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint K = scan.nextInt();\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\t\tint total = 0;\n\t\tfor (int i = 0; i < K ; i++) {\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint K = scan.nextInt();\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\t\tint total = 0;\n\t\tfor (int i = 0; i < K ; i++) {\n\t\t\tint price = 1001;\n\t\t\tint idx = 0;\n\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\tif (price > list.get(j)) {\n\t\t\t\t\tprice = list.get(j);\n\t\t\t\t\tidx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.remove(idx);\n\t\t\ttotal += price;\n\t\t}\n\t\tSystem.out.println(total);\n\t}\n\n}", "Main" ]
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int K = scan.nextInt(); List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < N; i++) { list.add(scan.nextInt()); } int total = 0; for (int i = 0; i < K ; i++) { int price = 1001; int idx = 0; for (int j = 0; j < list.size(); j++) { if (price > list.get(j)) { price = list.get(j); idx = j; } } list.remove(idx); total += price; } System.out.println(total); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 41, 13, 17, 42, 2, 40, 13, 17, 30, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 4, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 12, 13, 30, 14, 2, 13, 17, 29, 13, 14, 2, 13, 17, 29, 13, 29, 8, 2, 13, 13, 4, 13, 2, 13, 13, 13, 4, 13, 13, 2, 13, 13, 23, 13, 23, 13, 12, 13, 30, 29, 2, 2, 13, 13, 4, 13, 13, 13, 23, 13, 23, 13, 12, 13, 30, 14, 2, 13, 13, 29, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 14, 2, 13, 13, 29, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 14, 2, 13, 17, 29, 2, 13, 40, 17, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 2, 13, 17, 4, 18, 13, 13, 17, 11, 1, 41, 13, 17, 2, 2, 13, 13, 13, 1, 40, 13, 30, 30, 14, 18, 13, 13, 30, 11, 1, 41, 13, 2, 13, 17, 2, 13, 13, 1, 0, 13, 13, 30, 30, 0, 18, 13, 13, 17, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 14, 18, 13, 13, 30, 4, 18, 13, 13, 29, 13, 23, 13, 12, 13, 30, 14, 2, 2, 13, 17, 2, 13, 17, 30, 29, 17, 14, 2, 13, 17, 30, 29, 17, 11, 1, 41, 13, 17, 2, 13, 2, 4, 18, 13, 13, 17, 1, 40, 13, 30, 30, 14, 2, 2, 13, 13, 17, 30, 29, 17, 29, 17, 23, 13, 12, 13, 30, 41, 13, 20, 11, 1, 41, 13, 17, 2, 2, 13, 13, 13, 1, 40, 13, 30, 30, 14, 2, 2, 13, 13, 17, 30, 4, 18, 13, 13, 14, 2, 2, 13, 13, 13, 4, 18, 13, 2, 13, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 18, 13, 13, 13, 4, 18, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 41, 13, 20, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 18, 13, 13, 13, 4, 18, 13, 29, 13, 23, 13, 23, 13, 12, 13, 30, 28, 13, 13, 30, 4, 18, 13, 2, 13, 17, 4, 18, 13, 23, 13, 12, 13, 30, 28, 13, 13, 30, 4, 18, 13, 2, 13, 17, 4, 18, 13, 23, 13, 12, 13, 30, 28, 13, 13, 30, 30, 28, 13, 13, 30, 4, 18, 13, 2, 13, 17, 4, 18, 13, 23, 13, 12, 13, 30, 28, 13, 13, 30, 30, 28, 13, 13, 30, 4, 18, 13, 2, 13, 17, 4, 18, 13, 23, 13, 12, 13, 30, 4, 18, 13, 2, 2, 2, 17, 2, 13, 17, 17, 13, 23, 13, 23, 13, 12, 13, 30, 4, 18, 13, 2, 2, 2, 17, 2, 13, 17, 17, 13, 23, 13, 23, 13, 12, 13, 30, 4, 18, 13, 2, 2, 17, 2, 13, 17, 17, 28, 13, 13, 30, 4, 18, 13, 2, 13, 17, 4, 18, 13, 23, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 0, 18, 36, 13, 13, 23, 13, 23, 13, 12, 13, 30, 14, 2, 18, 36, 13, 18, 13, 13, 29, 17, 14, 2, 18, 36, 13, 18, 13, 13, 29, 17, 29, 40, 17, 23, 13, 12, 13, 30, 29, 2, 18, 36, 13, 18, 13, 13, 23, 13, 13, 6, 13, 41, 13, 41, 13, 41, 13, 12, 13, 30, 0, 18, 36, 13, 13, 0, 18, 36, 13, 13, 0, 18, 36, 13, 13, 23, 13, 23, 13, 23, 13, 12, 13, 30, 14, 2, 18, 36, 13, 18, 13, 13, 29, 17, 14, 2, 18, 36, 13, 18, 13, 13, 29, 17, 29, 40, 17, 23, 13, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 884, 11 ], [ 884, 12 ], [ 12, 13 ], [ 884, 14 ], [ 14, 15 ], [ 884, 16 ], [ 16, 17 ], [ 16, 18 ], [ 18, 19 ], [ 19, 20 ], [ 19, 21 ], [ 18, 22 ], [ 22, 23 ], [ 22, 24 ], [ 18, 25 ], [ 25, 26 ], [ 25, 27 ], [ 18, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 29, 32 ], [ 28, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 36, 37 ], [ 37, 38 ], [ 33, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 42, 43 ], [ 33, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 46, 48 ], [ 33, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 33, 53 ], [ 53, 54 ], [ 53, 55 ], [ 33, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 33, 74 ], [ 74, 75 ], [ 75, 76 ], [ 74, 77 ], [ 18, 78 ], [ 78, 79 ], [ 79, 80 ], [ 16, 81 ], [ 81, 82 ], [ 884, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 86, 87 ], [ 87, 88 ], [ 87, 89 ], [ 86, 90 ], [ 90, 91 ], [ 85, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 92, 96 ], [ 96, 97 ], [ 85, 98 ], [ 98, 99 ], [ 99, 100 ], [ 100, 101 ], [ 100, 102 ], [ 99, 103 ], [ 103, 104 ], [ 103, 105 ], [ 105, 106 ], [ 105, 107 ], [ 103, 108 ], [ 99, 109 ], [ 109, 110 ], [ 109, 111 ], [ 109, 112 ], [ 112, 113 ], [ 112, 114 ], [ 83, 115 ], [ 115, 116 ], [ 83, 117 ], [ 117, 118 ], [ 884, 119 ], [ 119, 120 ], [ 119, 121 ], [ 121, 122 ], [ 122, 123 ], [ 123, 124 ], [ 124, 125 ], [ 124, 126 ], [ 123, 127 ], [ 127, 128 ], [ 127, 129 ], [ 127, 130 ], [ 119, 131 ], [ 131, 132 ], [ 119, 133 ], [ 133, 134 ], [ 884, 135 ], [ 135, 136 ], [ 135, 137 ], [ 137, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 138, 142 ], [ 142, 143 ], [ 138, 144 ], [ 144, 145 ], [ 135, 146 ], [ 146, 147 ], [ 135, 148 ], [ 148, 149 ], [ 884, 150 ], [ 150, 151 ], [ 150, 152 ], [ 152, 153 ], [ 153, 154 ], [ 154, 155 ], [ 154, 156 ], [ 153, 157 ], [ 157, 158 ], [ 153, 159 ], [ 159, 160 ], [ 150, 161 ], [ 161, 162 ], [ 150, 163 ], [ 163, 164 ], [ 884, 165 ], [ 165, 166 ], [ 165, 167 ], [ 167, 168 ], [ 168, 169 ], [ 169, 170 ], [ 169, 171 ], [ 168, 172 ], [ 172, 173 ], [ 173, 174 ], [ 173, 175 ], [ 175, 176 ], [ 168, 177 ], [ 177, 178 ], [ 165, 179 ], [ 179, 180 ], [ 884, 181 ], [ 181, 182 ], [ 181, 183 ], [ 183, 184 ], [ 184, 185 ], [ 184, 186 ], [ 187, 188 ], [ 187, 189 ], [ 183, 190 ], [ 190, 191 ], [ 191, 192 ], [ 190, 193 ], [ 190, 194 ], [ 183, 195 ], [ 195, 196 ], [ 196, 197 ], [ 197, 198 ], [ 197, 199 ], [ 195, 200 ], [ 200, 201 ], [ 201, 202 ], [ 201, 203 ], [ 200, 204 ], [ 195, 205 ], [ 205, 206 ], [ 206, 207 ], [ 195, 208 ], [ 209, 209 ], [ 209, 210 ], [ 210, 211 ], [ 211, 212 ], [ 211, 213 ], [ 210, 214 ], [ 214, 215 ], [ 215, 216 ], [ 216, 217 ], [ 217, 218 ], [ 217, 219 ], [ 219, 220 ], [ 219, 221 ], [ 215, 222 ], [ 222, 223 ], [ 222, 224 ], [ 215, 225 ], [ 225, 226 ], [ 226, 227 ], [ 226, 228 ], [ 215, 229 ], [ 230, 230 ], [ 230, 231 ], [ 231, 232 ], [ 232, 233 ], [ 232, 234 ], [ 231, 235 ], [ 183, 236 ], [ 236, 237 ], [ 236, 238 ], [ 183, 239 ], [ 239, 240 ], [ 240, 241 ], [ 241, 242 ], [ 241, 243 ], [ 239, 244 ], [ 244, 245 ], [ 244, 246 ], [ 239, 247 ], [ 247, 248 ], [ 248, 249 ], [ 239, 250 ], [ 251, 251 ], [ 251, 252 ], [ 252, 253 ], [ 253, 254 ], [ 253, 255 ], [ 252, 256 ], [ 256, 257 ], [ 257, 258 ], [ 258, 259 ], [ 257, 260 ], [ 183, 261 ], [ 261, 262 ], [ 181, 263 ], [ 263, 264 ], [ 884, 265 ], [ 265, 266 ], [ 265, 267 ], [ 267, 268 ], [ 268, 269 ], [ 269, 270 ], [ 270, 271 ], [ 270, 272 ], [ 269, 273 ], [ 273, 274 ], [ 273, 275 ], [ 268, 276 ], [ 276, 277 ], [ 277, 278 ], [ 267, 279 ], [ 279, 280 ], [ 280, 281 ], [ 280, 282 ], [ 279, 283 ], [ 283, 284 ], [ 284, 285 ], [ 267, 286 ], [ 286, 287 ], [ 287, 288 ], [ 288, 289 ], [ 288, 290 ], [ 286, 291 ], [ 291, 292 ], [ 291, 293 ], [ 293, 294 ], [ 294, 295 ], [ 295, 296 ], [ 294, 297 ], [ 293, 298 ], [ 286, 299 ], [ 299, 300 ], [ 300, 301 ], [ 286, 302 ], [ 303, 303 ], [ 303, 304 ], [ 304, 305 ], [ 305, 306 ], [ 306, 307 ], [ 306, 308 ], [ 305, 309 ], [ 304, 310 ], [ 310, 311 ], [ 311, 312 ], [ 267, 313 ], [ 313, 314 ], [ 265, 315 ], [ 315, 316 ], [ 884, 317 ], [ 317, 318 ], [ 317, 319 ], [ 319, 320 ], [ 320, 321 ], [ 320, 322 ], [ 319, 323 ], [ 323, 324 ], [ 324, 325 ], [ 325, 326 ], [ 325, 327 ], [ 323, 328 ], [ 328, 329 ], [ 329, 330 ], [ 329, 331 ], [ 328, 332 ], [ 323, 333 ], [ 333, 334 ], [ 334, 335 ], [ 323, 336 ], [ 337, 337 ], [ 337, 338 ], [ 338, 339 ], [ 339, 340 ], [ 340, 341 ], [ 340, 342 ], [ 339, 343 ], [ 338, 344 ], [ 344, 345 ], [ 345, 346 ], [ 346, 347 ], [ 345, 348 ], [ 344, 349 ], [ 349, 350 ], [ 350, 351 ], [ 351, 352 ], [ 351, 353 ], [ 350, 354 ], [ 349, 355 ], [ 355, 356 ], [ 356, 357 ], [ 355, 358 ], [ 358, 359 ], [ 358, 360 ], [ 319, 361 ], [ 361, 362 ], [ 317, 363 ], [ 363, 364 ], [ 884, 365 ], [ 365, 366 ], [ 365, 367 ], [ 367, 368 ], [ 368, 369 ], [ 368, 370 ], [ 367, 372 ], [ 372, 373 ], [ 373, 374 ], [ 374, 375 ], [ 374, 376 ], [ 372, 377 ], [ 377, 378 ], [ 377, 379 ], [ 372, 380 ], [ 380, 381 ], [ 381, 382 ], [ 372, 383 ], [ 383, 384 ], [ 384, 385 ], [ 385, 386 ], [ 385, 387 ], [ 384, 388 ], [ 388, 389 ], [ 389, 390 ], [ 367, 391 ], [ 391, 392 ], [ 365, 393 ], [ 393, 394 ], [ 884, 395 ], [ 395, 396 ], [ 395, 397 ], [ 397, 398 ], [ 398, 399 ], [ 398, 400 ], [ 397, 402 ], [ 402, 403 ], [ 403, 404 ], [ 404, 405 ], [ 404, 406 ], [ 402, 407 ], [ 407, 408 ], [ 407, 409 ], [ 402, 410 ], [ 410, 411 ], [ 411, 412 ], [ 402, 413 ], [ 413, 414 ], [ 414, 415 ], [ 415, 416 ], [ 415, 417 ], [ 414, 418 ], [ 418, 419 ], [ 419, 420 ], [ 397, 421 ], [ 421, 422 ], [ 395, 423 ], [ 423, 424 ], [ 884, 425 ], [ 425, 426 ], [ 425, 427 ], [ 427, 428 ], [ 428, 429 ], [ 428, 430 ], [ 427, 433 ], [ 433, 434 ], [ 434, 435 ], [ 435, 436 ], [ 435, 437 ], [ 433, 438 ], [ 438, 439 ], [ 438, 440 ], [ 433, 441 ], [ 441, 442 ], [ 442, 443 ], [ 433, 444 ], [ 444, 445 ], [ 445, 446 ], [ 446, 447 ], [ 447, 448 ], [ 447, 449 ], [ 445, 450 ], [ 450, 451 ], [ 450, 452 ], [ 445, 453 ], [ 453, 454 ], [ 454, 455 ], [ 445, 456 ], [ 456, 457 ], [ 457, 458 ], [ 458, 459 ], [ 459, 460 ], [ 459, 461 ], [ 458, 462 ], [ 457, 463 ], [ 463, 464 ], [ 464, 465 ], [ 427, 466 ], [ 466, 467 ], [ 425, 468 ], [ 468, 469 ], [ 425, 470 ], [ 470, 471 ], [ 884, 472 ], [ 472, 473 ], [ 472, 474 ], [ 474, 475 ], [ 475, 476 ], [ 475, 477 ], [ 474, 480 ], [ 480, 481 ], [ 481, 482 ], [ 482, 483 ], [ 482, 484 ], [ 480, 485 ], [ 485, 486 ], [ 485, 487 ], [ 480, 488 ], [ 488, 489 ], [ 489, 490 ], [ 480, 491 ], [ 491, 492 ], [ 492, 493 ], [ 493, 494 ], [ 494, 495 ], [ 494, 496 ], [ 492, 497 ], [ 497, 498 ], [ 497, 499 ], [ 492, 500 ], [ 500, 501 ], [ 501, 502 ], [ 492, 503 ], [ 503, 504 ], [ 504, 505 ], [ 505, 506 ], [ 506, 507 ], [ 506, 508 ], [ 505, 509 ], [ 504, 510 ], [ 510, 511 ], [ 511, 512 ], [ 474, 513 ], [ 513, 514 ], [ 472, 515 ], [ 515, 516 ], [ 472, 517 ], [ 517, 518 ], [ 884, 519 ], [ 519, 520 ], [ 519, 521 ], [ 521, 522 ], [ 522, 523 ], [ 522, 524 ], [ 522, 525 ], [ 525, 526 ], [ 526, 527 ], [ 527, 528 ], [ 526, 529 ], [ 529, 530 ], [ 529, 531 ], [ 521, 532 ], [ 532, 533 ], [ 533, 534 ], [ 519, 535 ], [ 535, 536 ], [ 884, 537 ], [ 537, 538 ], [ 537, 539 ], [ 539, 540 ], [ 540, 541 ], [ 540, 542 ], [ 540, 543 ], [ 543, 544 ], [ 544, 545 ], [ 545, 546 ], [ 544, 547 ], [ 547, 548 ], [ 547, 549 ], [ 539, 550 ], [ 550, 551 ], [ 551, 552 ], [ 537, 553 ], [ 553, 554 ], [ 884, 555 ], [ 555, 556 ], [ 555, 557 ], [ 557, 558 ], [ 558, 559 ], [ 558, 560 ], [ 558, 561 ], [ 562, 562 ], [ 562, 563 ], [ 563, 564 ], [ 563, 565 ], [ 563, 566 ], [ 566, 567 ], [ 567, 568 ], [ 568, 569 ], [ 567, 570 ], [ 570, 571 ], [ 570, 572 ], [ 562, 573 ], [ 573, 574 ], [ 574, 575 ], [ 555, 576 ], [ 576, 577 ], [ 884, 578 ], [ 578, 579 ], [ 578, 580 ], [ 580, 581 ], [ 581, 582 ], [ 581, 583 ], [ 581, 584 ], [ 585, 585 ], [ 585, 586 ], [ 586, 587 ], [ 586, 588 ], [ 586, 589 ], [ 589, 590 ], [ 590, 591 ], [ 591, 592 ], [ 590, 593 ], [ 593, 594 ], [ 593, 595 ], [ 585, 596 ], [ 596, 597 ], [ 597, 598 ], [ 578, 599 ], [ 599, 600 ], [ 884, 601 ], [ 601, 602 ], [ 601, 603 ], [ 603, 604 ], [ 604, 605 ], [ 605, 606 ], [ 604, 607 ], [ 609, 608 ], [ 608, 609 ], [ 609, 610 ], [ 609, 611 ], [ 611, 612 ], [ 611, 613 ], [ 608, 614 ], [ 609, 615 ], [ 601, 616 ], [ 616, 617 ], [ 601, 618 ], [ 618, 619 ], [ 884, 620 ], [ 620, 621 ], [ 620, 622 ], [ 622, 623 ], [ 623, 624 ], [ 624, 625 ], [ 623, 626 ], [ 628, 627 ], [ 627, 628 ], [ 628, 629 ], [ 628, 630 ], [ 630, 631 ], [ 630, 632 ], [ 627, 633 ], [ 628, 634 ], [ 620, 635 ], [ 635, 636 ], [ 620, 637 ], [ 637, 638 ], [ 884, 639 ], [ 639, 640 ], [ 639, 641 ], [ 641, 642 ], [ 642, 643 ], [ 643, 644 ], [ 642, 645 ], [ 646, 646 ], [ 646, 647 ], [ 646, 648 ], [ 648, 649 ], [ 648, 650 ], [ 646, 651 ], [ 641, 652 ], [ 652, 653 ], [ 652, 654 ], [ 652, 655 ], [ 655, 656 ], [ 656, 657 ], [ 657, 658 ], [ 656, 659 ], [ 659, 660 ], [ 659, 661 ], [ 641, 662 ], [ 662, 663 ], [ 663, 664 ], [ 639, 665 ], [ 665, 666 ], [ 639, 667 ], [ 667, 668 ], [ 884, 669 ], [ 669, 670 ], [ 669, 671 ], [ 671, 672 ], [ 669, 673 ], [ 673, 674 ], [ 669, 675 ], [ 675, 676 ], [ 675, 677 ], [ 677, 678 ], [ 678, 679 ], [ 679, 680 ], [ 679, 681 ], [ 678, 682 ], [ 677, 683 ], [ 683, 684 ], [ 684, 685 ], [ 684, 686 ], [ 683, 687 ], [ 675, 688 ], [ 688, 689 ], [ 675, 690 ], [ 690, 691 ], [ 669, 692 ], [ 692, 693 ], [ 692, 694 ], [ 694, 695 ], [ 695, 696 ], [ 696, 697 ], [ 697, 698 ], [ 697, 699 ], [ 696, 700 ], [ 700, 701 ], [ 700, 702 ], [ 695, 703 ], [ 703, 704 ], [ 695, 705 ], [ 705, 706 ], [ 706, 707 ], [ 707, 708 ], [ 707, 709 ], [ 706, 710 ], [ 710, 711 ], [ 710, 712 ], [ 705, 713 ], [ 713, 714 ], [ 705, 715 ], [ 715, 716 ], [ 716, 717 ], [ 692, 718 ], [ 718, 719 ], [ 669, 720 ], [ 720, 721 ], [ 720, 722 ], [ 722, 723 ], [ 723, 724 ], [ 724, 725 ], [ 725, 726 ], [ 725, 727 ], [ 724, 728 ], [ 728, 729 ], [ 728, 730 ], [ 720, 731 ], [ 731, 732 ], [ 669, 733 ], [ 884, 734 ], [ 734, 735 ], [ 734, 736 ], [ 736, 737 ], [ 734, 738 ], [ 738, 739 ], [ 734, 740 ], [ 740, 741 ], [ 734, 742 ], [ 742, 743 ], [ 742, 744 ], [ 744, 745 ], [ 745, 746 ], [ 746, 747 ], [ 746, 748 ], [ 745, 749 ], [ 744, 750 ], [ 750, 751 ], [ 751, 752 ], [ 751, 753 ], [ 750, 754 ], [ 744, 755 ], [ 755, 756 ], [ 756, 757 ], [ 756, 758 ], [ 755, 759 ], [ 742, 760 ], [ 760, 761 ], [ 742, 762 ], [ 762, 763 ], [ 742, 764 ], [ 764, 765 ], [ 734, 766 ], [ 766, 767 ], [ 766, 768 ], [ 768, 769 ], [ 769, 770 ], [ 770, 771 ], [ 771, 772 ], [ 771, 773 ], [ 770, 774 ], [ 774, 775 ], [ 774, 776 ], [ 769, 777 ], [ 777, 778 ], [ 769, 779 ], [ 779, 780 ], [ 780, 781 ], [ 781, 782 ], [ 781, 783 ], [ 780, 784 ], [ 784, 785 ], [ 784, 786 ], [ 779, 787 ], [ 787, 788 ], [ 779, 789 ], [ 789, 790 ], [ 790, 791 ], [ 766, 792 ], [ 792, 793 ], [ 734, 794 ], [ 884, 795 ], [ 795, 796 ], [ 795, 797 ], [ 797, 798 ], [ 795, 799 ], [ 799, 800 ], [ 795, 801 ], [ 801, 802 ], [ 801, 803 ], [ 803, 804 ], [ 804, 805 ], [ 804, 806 ], [ 795, 807 ], [ 807, 808 ], [ 807, 809 ], [ 809, 810 ], [ 810, 811 ], [ 811, 812 ], [ 812, 813 ], [ 812, 814 ], [ 811, 815 ], [ 815, 816 ], [ 816, 817 ], [ 817, 818 ], [ 810, 819 ], [ 819, 820 ], [ 820, 821 ], [ 821, 822 ], [ 821, 823 ], [ 823, 824 ], [ 824, 825 ], [ 825, 826 ], [ 820, 827 ], [ 827, 828 ], [ 828, 829 ], [ 828, 830 ], [ 809, 831 ], [ 831, 832 ], [ 832, 833 ], [ 833, 834 ], [ 795, 835 ], [ 835, 836 ], [ 835, 837 ], [ 837, 838 ], [ 838, 839 ], [ 839, 840 ], [ 840, 841 ], [ 839, 842 ], [ 842, 843 ], [ 795, 844 ], [ 844, 845 ], [ 844, 846 ], [ 846, 847 ], [ 847, 848 ], [ 848, 849 ], [ 849, 850 ], [ 848, 851 ], [ 851, 852 ], [ 795, 853 ], [ 853, 854 ], [ 853, 855 ], [ 855, 856 ], [ 856, 857 ], [ 857, 858 ], [ 858, 859 ], [ 857, 860 ], [ 860, 861 ], [ 795, 862 ], [ 862, 863 ], [ 862, 864 ], [ 864, 865 ], [ 865, 866 ], [ 865, 867 ], [ 864, 868 ], [ 868, 869 ], [ 869, 870 ], [ 869, 871 ], [ 871, 872 ], [ 872, 873 ], [ 873, 874 ], [ 868, 875 ], [ 875, 876 ], [ 876, 877 ], [ 876, 878 ], [ 878, 879 ], [ 879, 880 ], [ 864, 881 ], [ 881, 882 ], [ 0, 883 ], [ 883, 884 ], [ 883, 885 ] ]
[ "import java.io.*;\nimport java.util.*;\nimport java.lang.*;\n\npublic class Main {\n public static MyScanner scan;\n public static PrintWriter out;\n public static void main(String[] args) {\n scan=new MyScanner();\n out=new PrintWriter(new BufferedOutputStream(System.out));\n\n int t=1;\n// int t=scan.nextInt();\n while(t-->0) {\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }\n out.close();\n }\n\n //-----------------------------------------------------COMP-SPACE-----------------------------------------------------\n\n\n\n //--------------------------------------------------------------------------------------------------------------------\n\n //node\n static class Node implements Comparable<Node> {\n public int x,y;\n public Node(int x,int y) {\n this.x=x;\n this.y=y;\n }\n\n public int compareTo(Node other) {\n if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;\n }\n\n public boolean equals(Node other) {\n return this.x==other.x;\n }\n\n// public int compareTo(Node other) {\n// if(this.y==other.y) return 0;\n// else if(this.y>other.y) return 1;\n// else return -1;\n// }\n//\n// public boolean equals(Node other) {\n// return this.y==other.y;\n// }\n }\n //edge\n static class Edge implements Comparable<Edge> {\n public Node a,b;\n public int weight;\n\n public Edge(Node a,Node b,int weight) {\n this.a=a;\n this.b=b;\n this.weight=weight;\n }\n\n public int compareTo(Edge other) {\n if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;\n }\n }\n\n //util\n public static int gcd(int a, int b) {\n if (b == 0)\n return a;\n if (a == 0)\n return b;\n return (a > b) ? gcd(a % b, b) : gcd(a, b % a);\n }\n\n public static int lcm(int a, int b) {\n return a * b / gcd(a, b);\n }\n\n public static int min(int a,int b) {\n if(a<=b) return a;\n else return b;\n }\n\n public static int max(int a,int b) {\n if(a>=b) return a;\n else return b;\n }\n\n public static int abs(int a) {\n if(a<0) return a*-1;\n else return a;\n }\n\n public static ArrayList<Integer> getPrimes(int n) {\n boolean prime[]=new boolean[n+1];\n Arrays.fill(prime,true);\n for (int p=2;p*p<=n;p++) {\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }\n ArrayList<Integer> primeNumbers=new ArrayList<Integer>();\n for (int i = 2; i <= n; i++) {\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }\n return primeNumbers;\n }\n\n public static boolean isPrime(int a) {\n if (a == 0 || a == 1) {\n return false;\n }\n if (a == 2) {\n return true;\n }\n for (int i = 2; i < Math.sqrt(a) + 1; i++) {\n if (a % i == 0) {\n return false;\n }\n }\n return true;\n }\n\n public static ArrayList<Integer> getDivisors(int n) {\n ArrayList<Integer> div = new ArrayList<Integer>();\n for (int i=1;i*i<=n;i++) {\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }\n return div;\n }\n\n //scanner\n public static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static int[] nextIntArray(int n) {\n int[] a=new int[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static Integer[] nextIntegerArray(int n) {\n Integer[] a=new Integer[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static int[][] nextIntMatrix(int n,int m) {\n int[][] a=new int[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n public static Integer[][] nextIntegerMatrix(int n,int m) {\n Integer[][] a=new Integer[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n //print\n public static void printIntArray(int[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntegerArray(Integer[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntMatrix(int[][] a) {\n for(int[] i:a) {\n for(int j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void printIntegerMatrix(Integer[][] a) {\n for(Integer[] i:a) {\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void help(int t,int n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,String n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,char[] n) { out.print(\"Test Case: \"+(t+1)+\" | Variable Output: \"); for(char c:n) out.print(c+\" \"); out.println(); }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "public class Main {\n public static MyScanner scan;\n public static PrintWriter out;\n public static void main(String[] args) {\n scan=new MyScanner();\n out=new PrintWriter(new BufferedOutputStream(System.out));\n\n int t=1;\n// int t=scan.nextInt();\n while(t-->0) {\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }\n out.close();\n }\n\n //-----------------------------------------------------COMP-SPACE-----------------------------------------------------\n\n\n\n //--------------------------------------------------------------------------------------------------------------------\n\n //node\n static class Node implements Comparable<Node> {\n public int x,y;\n public Node(int x,int y) {\n this.x=x;\n this.y=y;\n }\n\n public int compareTo(Node other) {\n if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;\n }\n\n public boolean equals(Node other) {\n return this.x==other.x;\n }\n\n// public int compareTo(Node other) {\n// if(this.y==other.y) return 0;\n// else if(this.y>other.y) return 1;\n// else return -1;\n// }\n//\n// public boolean equals(Node other) {\n// return this.y==other.y;\n// }\n }\n //edge\n static class Edge implements Comparable<Edge> {\n public Node a,b;\n public int weight;\n\n public Edge(Node a,Node b,int weight) {\n this.a=a;\n this.b=b;\n this.weight=weight;\n }\n\n public int compareTo(Edge other) {\n if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;\n }\n }\n\n //util\n public static int gcd(int a, int b) {\n if (b == 0)\n return a;\n if (a == 0)\n return b;\n return (a > b) ? gcd(a % b, b) : gcd(a, b % a);\n }\n\n public static int lcm(int a, int b) {\n return a * b / gcd(a, b);\n }\n\n public static int min(int a,int b) {\n if(a<=b) return a;\n else return b;\n }\n\n public static int max(int a,int b) {\n if(a>=b) return a;\n else return b;\n }\n\n public static int abs(int a) {\n if(a<0) return a*-1;\n else return a;\n }\n\n public static ArrayList<Integer> getPrimes(int n) {\n boolean prime[]=new boolean[n+1];\n Arrays.fill(prime,true);\n for (int p=2;p*p<=n;p++) {\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }\n ArrayList<Integer> primeNumbers=new ArrayList<Integer>();\n for (int i = 2; i <= n; i++) {\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }\n return primeNumbers;\n }\n\n public static boolean isPrime(int a) {\n if (a == 0 || a == 1) {\n return false;\n }\n if (a == 2) {\n return true;\n }\n for (int i = 2; i < Math.sqrt(a) + 1; i++) {\n if (a % i == 0) {\n return false;\n }\n }\n return true;\n }\n\n public static ArrayList<Integer> getDivisors(int n) {\n ArrayList<Integer> div = new ArrayList<Integer>();\n for (int i=1;i*i<=n;i++) {\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }\n return div;\n }\n\n //scanner\n public static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static int[] nextIntArray(int n) {\n int[] a=new int[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static Integer[] nextIntegerArray(int n) {\n Integer[] a=new Integer[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static int[][] nextIntMatrix(int n,int m) {\n int[][] a=new int[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n public static Integer[][] nextIntegerMatrix(int n,int m) {\n Integer[][] a=new Integer[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n //print\n public static void printIntArray(int[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntegerArray(Integer[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntMatrix(int[][] a) {\n for(int[] i:a) {\n for(int j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void printIntegerMatrix(Integer[][] a) {\n for(Integer[] i:a) {\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void help(int t,int n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,String n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,char[] n) { out.print(\"Test Case: \"+(t+1)+\" | Variable Output: \"); for(char c:n) out.print(c+\" \"); out.println(); }\n}", "Main", "public static MyScanner scan;", "scan", "public static PrintWriter out;", "out", "public static void main(String[] args) {\n scan=new MyScanner();\n out=new PrintWriter(new BufferedOutputStream(System.out));\n\n int t=1;\n// int t=scan.nextInt();\n while(t-->0) {\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }\n out.close();\n }", "main", "{\n scan=new MyScanner();\n out=new PrintWriter(new BufferedOutputStream(System.out));\n\n int t=1;\n// int t=scan.nextInt();\n while(t-->0) {\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }\n out.close();\n }", "scan=new MyScanner()", "scan", "new MyScanner()", "out=new PrintWriter(new BufferedOutputStream(System.out))", "out", "new PrintWriter(new BufferedOutputStream(System.out))", "int t=1;", "t", "1", "while(t-->0) {\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }", "t-->0", "t--", "t", "0", "{\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }", "int n=scan.nextInt()", "n", "scan.nextInt()", "scan.nextInt", "scan", "k=scan.nextInt();", "k", "scan.nextInt()", "scan.nextInt", "scan", "int[] a=nextIntArray(n);", "a", "nextIntArray(n)", "nextIntArray", "n", "Arrays.sort(a)", "Arrays.sort", "Arrays", "a", "int sum=0;", "sum", "0", "for(int c=0;c<k;c++) {\n sum+=a[c];\n }", "int c=0;", "int c=0;", "c", "0", "c<k", "c", "k", "c++", "c++", "c", "{\n sum+=a[c];\n }", "{\n sum+=a[c];\n }", "sum+=a[c]", "sum", "a[c]", "a", "c", "out.println(sum)", "out.println", "out", "sum", "out.close()", "out.close", "out", "String[] args", "args", "//util\n public static int gcd(int a, int b) {\n if (b == 0)\n return a;\n if (a == 0)\n return b;\n return (a > b) ? gcd(a % b, b) : gcd(a, b % a);\n }", "gcd", "{\n if (b == 0)\n return a;\n if (a == 0)\n return b;\n return (a > b) ? gcd(a % b, b) : gcd(a, b % a);\n }", "if (b == 0)\n return a;", "b == 0", "b", "0", "return a;", "a", "if (a == 0)\n return b;", "a == 0", "a", "0", "return b;", "b", "return (a > b) ? gcd(a % b, b) : gcd(a, b % a);", "(a > b) ? gcd(a % b, b) : gcd(a, b % a)", "(a > b)", "a", "b", "gcd(a % b, b)", "gcd", "a % b", "a", "b", "b", "gcd(a, b % a)", "gcd", "a", "b % a", "b", "a", "int a", "a", "int b", "b", "public static int lcm(int a, int b) {\n return a * b / gcd(a, b);\n }", "lcm", "{\n return a * b / gcd(a, b);\n }", "return a * b / gcd(a, b);", "a * b / gcd(a, b)", "a * b", "a", "b", "gcd(a, b)", "gcd", "a", "b", "int a", "a", "int b", "b", "public static int min(int a,int b) {\n if(a<=b) return a;\n else return b;\n }", "min", "{\n if(a<=b) return a;\n else return b;\n }", "if(a<=b) return a;\n else return b;", "a<=b", "a", "b", "return a;", "a", "return b;", "b", "int a", "a", "int b", "b", "public static int max(int a,int b) {\n if(a>=b) return a;\n else return b;\n }", "max", "{\n if(a>=b) return a;\n else return b;\n }", "if(a>=b) return a;\n else return b;", "a>=b", "a", "b", "return a;", "a", "return b;", "b", "int a", "a", "int b", "b", "public static int abs(int a) {\n if(a<0) return a*-1;\n else return a;\n }", "abs", "{\n if(a<0) return a*-1;\n else return a;\n }", "if(a<0) return a*-1;\n else return a;", "a<0", "a", "0", "return a*-1;", "a*-1", "a", "-1", "1", "return a;", "a", "int a", "a", "public static ArrayList<Integer> getPrimes(int n) {\n boolean prime[]=new boolean[n+1];\n Arrays.fill(prime,true);\n for (int p=2;p*p<=n;p++) {\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }\n ArrayList<Integer> primeNumbers=new ArrayList<Integer>();\n for (int i = 2; i <= n; i++) {\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }\n return primeNumbers;\n }", "getPrimes", "{\n boolean prime[]=new boolean[n+1];\n Arrays.fill(prime,true);\n for (int p=2;p*p<=n;p++) {\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }\n ArrayList<Integer> primeNumbers=new ArrayList<Integer>();\n for (int i = 2; i <= n; i++) {\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }\n return primeNumbers;\n }", "boolean prime[]=new boolean[n+1];", "prime", "new boolean[n+1]", "n+1", "n", "1", "Arrays.fill(prime,true)", "Arrays.fill", "Arrays", "prime", "true", "for (int p=2;p*p<=n;p++) {\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }", "int p=2;", "int p=2;", "p", "2", "p*p<=n", "p*p", "p", "p", "n", "p++", "p++", "p", "{\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }", "{\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }", "if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }", "prime[p]", "prime", "p", "{\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }", "for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }", "int i=p*2;", "int i=p*2;", "i", "p*2", "p", "2", "i<=n", "i", "n", "i+=p", "i+=p", "i", "p", "{\n prime[i]=false;\n }", "{\n prime[i]=false;\n }", "prime[i]=false", "prime[i]", "prime", "i", "false", "ArrayList<Integer> primeNumbers=new ArrayList<Integer>();", "primeNumbers", "new ArrayList<Integer>()", "for (int i = 2; i <= n; i++) {\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }", "int i = 2;", "int i = 2;", "i", "2", "i <= n", "i", "n", "i++", "i++", "i", "{\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }", "{\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }", "if (prime[i]) {\n primeNumbers.add(i);\n }", "prime[i]", "prime", "i", "{\n primeNumbers.add(i);\n }", "primeNumbers.add(i)", "primeNumbers.add", "primeNumbers", "i", "return primeNumbers;", "primeNumbers", "int n", "n", "public static boolean isPrime(int a) {\n if (a == 0 || a == 1) {\n return false;\n }\n if (a == 2) {\n return true;\n }\n for (int i = 2; i < Math.sqrt(a) + 1; i++) {\n if (a % i == 0) {\n return false;\n }\n }\n return true;\n }", "isPrime", "{\n if (a == 0 || a == 1) {\n return false;\n }\n if (a == 2) {\n return true;\n }\n for (int i = 2; i < Math.sqrt(a) + 1; i++) {\n if (a % i == 0) {\n return false;\n }\n }\n return true;\n }", "if (a == 0 || a == 1) {\n return false;\n }", "a == 0 || a == 1", "a == 0", "a", "0", "a == 1", "a", "1", "{\n return false;\n }", "return false;", "false", "if (a == 2) {\n return true;\n }", "a == 2", "a", "2", "{\n return true;\n }", "return true;", "true", "for (int i = 2; i < Math.sqrt(a) + 1; i++) {\n if (a % i == 0) {\n return false;\n }\n }", "int i = 2;", "int i = 2;", "i", "2", "i < Math.sqrt(a) + 1", "i", "Math.sqrt(a) + 1", "Math.sqrt(a)", "Math.sqrt", "Math", "a", "1", "i++", "i++", "i", "{\n if (a % i == 0) {\n return false;\n }\n }", "{\n if (a % i == 0) {\n return false;\n }\n }", "if (a % i == 0) {\n return false;\n }", "a % i == 0", "a % i", "a", "i", "0", "{\n return false;\n }", "return false;", "false", "return true;", "true", "int a", "a", "public static ArrayList<Integer> getDivisors(int n) {\n ArrayList<Integer> div = new ArrayList<Integer>();\n for (int i=1;i*i<=n;i++) {\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }\n return div;\n }", "getDivisors", "{\n ArrayList<Integer> div = new ArrayList<Integer>();\n for (int i=1;i*i<=n;i++) {\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }\n return div;\n }", "ArrayList<Integer> div = new ArrayList<Integer>();", "div", "new ArrayList<Integer>()", "for (int i=1;i*i<=n;i++) {\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }", "int i=1;", "int i=1;", "i", "1", "i*i<=n", "i*i", "i", "i", "n", "i++", "i++", "i", "{\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }", "{\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }", "if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }", "n%i==0", "n%i", "n", "i", "0", "{\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }", "div.add(i)", "div.add", "div", "i", "if (n/i!=i)\n div.add(n/i);", "n/i!=i", "n/i", "n", "i", "i", "div.add(n/i)", "div.add", "div", "n/i", "n", "i", "return div;", "div", "int n", "n", "public static int[] nextIntArray(int n) {\n int[] a=new int[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }", "nextIntArray", "{\n int[] a=new int[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }", "int[] a=new int[n];", "a", "new int[n]", "n", "for(int c=0;c<n;c++) a[c]=scan.nextInt();", "int c=0;", "int c=0;", "c", "0", "c<n", "c", "n", "c++", "c++", "c", "a[c]=scan.nextInt();", "a[c]=scan.nextInt()", "a[c]", "a", "c", "scan.nextInt()", "scan.nextInt", "scan", "return a;", "a", "int n", "n", "public static Integer[] nextIntegerArray(int n) {\n Integer[] a=new Integer[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }", "nextIntegerArray", "{\n Integer[] a=new Integer[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }", "Integer[] a=new Integer[n];", "a", "new Integer[n]", "n", "for(int c=0;c<n;c++) a[c]=scan.nextInt();", "int c=0;", "int c=0;", "c", "0", "c<n", "c", "n", "c++", "c++", "c", "a[c]=scan.nextInt();", "a[c]=scan.nextInt()", "a[c]", "a", "c", "scan.nextInt()", "scan.nextInt", "scan", "return a;", "a", "int n", "n", "public static int[][] nextIntMatrix(int n,int m) {\n int[][] a=new int[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }", "nextIntMatrix", "{\n int[][] a=new int[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }", "int[][] a=new int[n][m];", "a", "new int[n][m]", "n", "m", "for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "for(int j=0;j<m;j++) a[i][j]=scan.nextInt();", "for(int j=0;j<m;j++) a[i][j]=scan.nextInt();", "int j=0;", "int j=0;", "j", "0", "j<m", "j", "m", "j++", "j++", "j", "a[i][j]=scan.nextInt();", "a[i][j]=scan.nextInt()", "a[i][j]", "a[i]", "a", "i", "j", "scan.nextInt()", "scan.nextInt", "scan", "return a;", "a", "int n", "n", "int m", "m", "public static Integer[][] nextIntegerMatrix(int n,int m) {\n Integer[][] a=new Integer[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }", "nextIntegerMatrix", "{\n Integer[][] a=new Integer[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }", "Integer[][] a=new Integer[n][m];", "a", "new Integer[n][m]", "n", "m", "for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "for(int j=0;j<m;j++) a[i][j]=scan.nextInt();", "for(int j=0;j<m;j++) a[i][j]=scan.nextInt();", "int j=0;", "int j=0;", "j", "0", "j<m", "j", "m", "j++", "j++", "j", "a[i][j]=scan.nextInt();", "a[i][j]=scan.nextInt()", "a[i][j]", "a[i]", "a", "i", "j", "scan.nextInt()", "scan.nextInt", "scan", "return a;", "a", "int n", "n", "int m", "m", "//print\n public static void printIntArray(int[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }", "printIntArray", "{\n for(int c:a) out.print(c+\" \");\n out.println();\n }", "for(int c:a) out.print(c+\" \");", "int c", "a", "out.print(c+\" \");", "out.print(c+\" \")", "out.print", "out", "c+\" \"", "c", "\" \"", "out.println()", "out.println", "out", "int[] a", "a", "public static void printIntegerArray(Integer[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }", "printIntegerArray", "{\n for(int c:a) out.print(c+\" \");\n out.println();\n }", "for(int c:a) out.print(c+\" \");", "int c", "a", "out.print(c+\" \");", "out.print(c+\" \")", "out.print", "out", "c+\" \"", "c", "\" \"", "out.println()", "out.println", "out", "Integer[] a", "a", "public static void printIntMatrix(int[][] a) {\n for(int[] i:a) {\n for(int j:i) out.print(j+\" \");\n out.println();\n }\n }", "printIntMatrix", "{\n for(int[] i:a) {\n for(int j:i) out.print(j+\" \");\n out.println();\n }\n }", "for(int[] i:a) {\n for(int j:i) out.print(j+\" \");\n out.println();\n }", "int[] i", "a", "{\n for(int j:i) out.print(j+\" \");\n out.println();\n }", "{\n for(int j:i) out.print(j+\" \");\n out.println();\n }", "for(int j:i) out.print(j+\" \");", "int j", "i", "out.print(j+\" \");", "out.print(j+\" \")", "out.print", "out", "j+\" \"", "j", "\" \"", "out.println()", "out.println", "out", "int[][] a", "a", "public static void printIntegerMatrix(Integer[][] a) {\n for(Integer[] i:a) {\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }\n }", "printIntegerMatrix", "{\n for(Integer[] i:a) {\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }\n }", "for(Integer[] i:a) {\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }", "Integer[] i", "a", "{\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }", "{\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }", "for(Integer j:i) out.print(j+\" \");", "Integer j", "i", "out.print(j+\" \");", "out.print(j+\" \")", "out.print", "out", "j+\" \"", "j", "\" \"", "out.println()", "out.println", "out", "Integer[][] a", "a", "public static void help(int t,int n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }", "help", "{ out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }", "out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n)", "out.println", "out", "\"Test Case: \"+(t+1)+\" | Variable Output: \"+n", "\" | Variable Output: \"", "\"Test Case: \"+(t+1)+\" | Variable Output: \"+n", "\"Test Case: \"", "(t+1)", "t", "1", "\" | Variable Output: \"", "n", "int t", "t", "int n", "n", "public static void help(int t,String n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }", "help", "{ out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }", "out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n)", "out.println", "out", "\"Test Case: \"+(t+1)+\" | Variable Output: \"+n", "\" | Variable Output: \"", "\"Test Case: \"+(t+1)+\" | Variable Output: \"+n", "\"Test Case: \"", "(t+1)", "t", "1", "\" | Variable Output: \"", "n", "int t", "t", "String n", "n", "public static void help(int t,char[] n) { out.print(\"Test Case: \"+(t+1)+\" | Variable Output: \"); for(char c:n) out.print(c+\" \"); out.println(); }", "help", "{ out.print(\"Test Case: \"+(t+1)+\" | Variable Output: \"); for(char c:n) out.print(c+\" \"); out.println(); }", "out.print(\"Test Case: \"+(t+1)+\" | Variable Output: \")", "out.print", "out", "\"Test Case: \"+(t+1)+\" | Variable Output: \"", "\"Test Case: \"+(t+1)+\" | Variable Output: \"", "\"Test Case: \"", "(t+1)", "t", "1", "\" | Variable Output: \"", "for(char c:n) out.print(c+\" \");", "char c", "n", "out.print(c+\" \");", "out.print(c+\" \")", "out.print", "out", "c+\" \"", "c", "\" \"", "out.println()", "out.println", "out", "int t", "t", "char[] n", "n", "static class Node implements Comparable<Node> {\n public int x,y;\n public Node(int x,int y) {\n this.x=x;\n this.y=y;\n }\n\n public int compareTo(Node other) {\n if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;\n }\n\n public boolean equals(Node other) {\n return this.x==other.x;\n }\n\n// public int compareTo(Node other) {\n// if(this.y==other.y) return 0;\n// else if(this.y>other.y) return 1;\n// else return -1;\n// }\n//\n// public boolean equals(Node other) {\n// return this.y==other.y;\n// }\n }", "Node", "public int x", "x", "y;", "y", "public Node(int x,int y) {\n this.x=x;\n this.y=y;\n }", "Node", "{\n this.x=x;\n this.y=y;\n }", "this.x=x", "this.x", "this", "this.x", "x", "this.y=y", "this.y", "this", "this.y", "y", "int x", "x", "int y", "y", "public int compareTo(Node other) {\n if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;\n }", "compareTo", "{\n if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;\n }", "if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;", "this.x==other.x", "this.x", "this", "this.x", "other.x", "other", "other.x", "return 0;", "0", "if(this.x>other.x) return 1;\n else return -1;", "this.x>other.x", "this.x", "this", "this.x", "other.x", "other", "other.x", "return 1;", "1", "return -1;", "-1", "1", "Node other", "other", "public boolean equals(Node other) {\n return this.x==other.x;\n }", "equals", "{\n return this.x==other.x;\n }", "return this.x==other.x;", "this.x==other.x", "this.x", "this", "this.x", "other.x", "other", "other.x", "Node other", "other", "Comparable", "static class Edge implements Comparable<Edge> {\n public Node a,b;\n public int weight;\n\n public Edge(Node a,Node b,int weight) {\n this.a=a;\n this.b=b;\n this.weight=weight;\n }\n\n public int compareTo(Edge other) {\n if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;\n }\n }", "Edge", "public Node a", "a", "b;", "b", "public int weight;", "weight", "public Edge(Node a,Node b,int weight) {\n this.a=a;\n this.b=b;\n this.weight=weight;\n }", "Edge", "{\n this.a=a;\n this.b=b;\n this.weight=weight;\n }", "this.a=a", "this.a", "this", "this.a", "a", "this.b=b", "this.b", "this", "this.b", "b", "this.weight=weight", "this.weight", "this", "this.weight", "weight", "Node a", "a", "Node b", "b", "int weight", "weight", "public int compareTo(Edge other) {\n if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;\n }", "compareTo", "{\n if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;\n }", "if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;", "this.weight==other.weight", "this.weight", "this", "this.weight", "other.weight", "other", "other.weight", "return 0;", "0", "if(this.weight>other.weight) return 1;\n else return -1;", "this.weight>other.weight", "this.weight", "this", "this.weight", "other.weight", "other", "other.weight", "return 1;", "1", "return -1;", "-1", "1", "Edge other", "other", "Comparable", "public static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }", "MyScanner", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "MyScanner", "{\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str", "public class Main {\n public static MyScanner scan;\n public static PrintWriter out;\n public static void main(String[] args) {\n scan=new MyScanner();\n out=new PrintWriter(new BufferedOutputStream(System.out));\n\n int t=1;\n// int t=scan.nextInt();\n while(t-->0) {\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }\n out.close();\n }\n\n //-----------------------------------------------------COMP-SPACE-----------------------------------------------------\n\n\n\n //--------------------------------------------------------------------------------------------------------------------\n\n //node\n static class Node implements Comparable<Node> {\n public int x,y;\n public Node(int x,int y) {\n this.x=x;\n this.y=y;\n }\n\n public int compareTo(Node other) {\n if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;\n }\n\n public boolean equals(Node other) {\n return this.x==other.x;\n }\n\n// public int compareTo(Node other) {\n// if(this.y==other.y) return 0;\n// else if(this.y>other.y) return 1;\n// else return -1;\n// }\n//\n// public boolean equals(Node other) {\n// return this.y==other.y;\n// }\n }\n //edge\n static class Edge implements Comparable<Edge> {\n public Node a,b;\n public int weight;\n\n public Edge(Node a,Node b,int weight) {\n this.a=a;\n this.b=b;\n this.weight=weight;\n }\n\n public int compareTo(Edge other) {\n if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;\n }\n }\n\n //util\n public static int gcd(int a, int b) {\n if (b == 0)\n return a;\n if (a == 0)\n return b;\n return (a > b) ? gcd(a % b, b) : gcd(a, b % a);\n }\n\n public static int lcm(int a, int b) {\n return a * b / gcd(a, b);\n }\n\n public static int min(int a,int b) {\n if(a<=b) return a;\n else return b;\n }\n\n public static int max(int a,int b) {\n if(a>=b) return a;\n else return b;\n }\n\n public static int abs(int a) {\n if(a<0) return a*-1;\n else return a;\n }\n\n public static ArrayList<Integer> getPrimes(int n) {\n boolean prime[]=new boolean[n+1];\n Arrays.fill(prime,true);\n for (int p=2;p*p<=n;p++) {\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }\n ArrayList<Integer> primeNumbers=new ArrayList<Integer>();\n for (int i = 2; i <= n; i++) {\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }\n return primeNumbers;\n }\n\n public static boolean isPrime(int a) {\n if (a == 0 || a == 1) {\n return false;\n }\n if (a == 2) {\n return true;\n }\n for (int i = 2; i < Math.sqrt(a) + 1; i++) {\n if (a % i == 0) {\n return false;\n }\n }\n return true;\n }\n\n public static ArrayList<Integer> getDivisors(int n) {\n ArrayList<Integer> div = new ArrayList<Integer>();\n for (int i=1;i*i<=n;i++) {\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }\n return div;\n }\n\n //scanner\n public static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static int[] nextIntArray(int n) {\n int[] a=new int[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static Integer[] nextIntegerArray(int n) {\n Integer[] a=new Integer[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static int[][] nextIntMatrix(int n,int m) {\n int[][] a=new int[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n public static Integer[][] nextIntegerMatrix(int n,int m) {\n Integer[][] a=new Integer[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n //print\n public static void printIntArray(int[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntegerArray(Integer[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntMatrix(int[][] a) {\n for(int[] i:a) {\n for(int j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void printIntegerMatrix(Integer[][] a) {\n for(Integer[] i:a) {\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void help(int t,int n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,String n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,char[] n) { out.print(\"Test Case: \"+(t+1)+\" | Variable Output: \"); for(char c:n) out.print(c+\" \"); out.println(); }\n}", "public class Main {\n public static MyScanner scan;\n public static PrintWriter out;\n public static void main(String[] args) {\n scan=new MyScanner();\n out=new PrintWriter(new BufferedOutputStream(System.out));\n\n int t=1;\n// int t=scan.nextInt();\n while(t-->0) {\n\n int n=scan.nextInt(),k=scan.nextInt();\n int[] a=nextIntArray(n);\n\n Arrays.sort(a);\n int sum=0;\n for(int c=0;c<k;c++) {\n sum+=a[c];\n }\n out.println(sum);\n }\n out.close();\n }\n\n //-----------------------------------------------------COMP-SPACE-----------------------------------------------------\n\n\n\n //--------------------------------------------------------------------------------------------------------------------\n\n //node\n static class Node implements Comparable<Node> {\n public int x,y;\n public Node(int x,int y) {\n this.x=x;\n this.y=y;\n }\n\n public int compareTo(Node other) {\n if(this.x==other.x) return 0;\n else if(this.x>other.x) return 1;\n else return -1;\n }\n\n public boolean equals(Node other) {\n return this.x==other.x;\n }\n\n// public int compareTo(Node other) {\n// if(this.y==other.y) return 0;\n// else if(this.y>other.y) return 1;\n// else return -1;\n// }\n//\n// public boolean equals(Node other) {\n// return this.y==other.y;\n// }\n }\n //edge\n static class Edge implements Comparable<Edge> {\n public Node a,b;\n public int weight;\n\n public Edge(Node a,Node b,int weight) {\n this.a=a;\n this.b=b;\n this.weight=weight;\n }\n\n public int compareTo(Edge other) {\n if(this.weight==other.weight) return 0;\n else if(this.weight>other.weight) return 1;\n else return -1;\n }\n }\n\n //util\n public static int gcd(int a, int b) {\n if (b == 0)\n return a;\n if (a == 0)\n return b;\n return (a > b) ? gcd(a % b, b) : gcd(a, b % a);\n }\n\n public static int lcm(int a, int b) {\n return a * b / gcd(a, b);\n }\n\n public static int min(int a,int b) {\n if(a<=b) return a;\n else return b;\n }\n\n public static int max(int a,int b) {\n if(a>=b) return a;\n else return b;\n }\n\n public static int abs(int a) {\n if(a<0) return a*-1;\n else return a;\n }\n\n public static ArrayList<Integer> getPrimes(int n) {\n boolean prime[]=new boolean[n+1];\n Arrays.fill(prime,true);\n for (int p=2;p*p<=n;p++) {\n if (prime[p]) {\n for (int i=p*2;i<=n;i+=p) {\n prime[i]=false;\n }\n }\n }\n ArrayList<Integer> primeNumbers=new ArrayList<Integer>();\n for (int i = 2; i <= n; i++) {\n if (prime[i]) {\n primeNumbers.add(i);\n }\n }\n return primeNumbers;\n }\n\n public static boolean isPrime(int a) {\n if (a == 0 || a == 1) {\n return false;\n }\n if (a == 2) {\n return true;\n }\n for (int i = 2; i < Math.sqrt(a) + 1; i++) {\n if (a % i == 0) {\n return false;\n }\n }\n return true;\n }\n\n public static ArrayList<Integer> getDivisors(int n) {\n ArrayList<Integer> div = new ArrayList<Integer>();\n for (int i=1;i*i<=n;i++) {\n if (n%i==0) {\n div.add(i);\n if (n/i!=i)\n div.add(n/i);\n }\n }\n return div;\n }\n\n //scanner\n public static class MyScanner {\n BufferedReader br;\n StringTokenizer st;\n\n public MyScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n public static int[] nextIntArray(int n) {\n int[] a=new int[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static Integer[] nextIntegerArray(int n) {\n Integer[] a=new Integer[n];\n for(int c=0;c<n;c++) a[c]=scan.nextInt();\n return a;\n }\n\n public static int[][] nextIntMatrix(int n,int m) {\n int[][] a=new int[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n public static Integer[][] nextIntegerMatrix(int n,int m) {\n Integer[][] a=new Integer[n][m];\n for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt();\n return a;\n }\n\n //print\n public static void printIntArray(int[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntegerArray(Integer[] a) {\n for(int c:a) out.print(c+\" \");\n out.println();\n }\n\n public static void printIntMatrix(int[][] a) {\n for(int[] i:a) {\n for(int j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void printIntegerMatrix(Integer[][] a) {\n for(Integer[] i:a) {\n for(Integer j:i) out.print(j+\" \");\n out.println();\n }\n }\n\n public static void help(int t,int n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,String n) { out.println(\"Test Case: \"+(t+1)+\" | Variable Output: \"+n); }\n public static void help(int t,char[] n) { out.print(\"Test Case: \"+(t+1)+\" | Variable Output: \"); for(char c:n) out.print(c+\" \"); out.println(); }\n}", "Main" ]
import java.io.*; import java.util.*; import java.lang.*; public class Main { public static MyScanner scan; public static PrintWriter out; public static void main(String[] args) { scan=new MyScanner(); out=new PrintWriter(new BufferedOutputStream(System.out)); int t=1; // int t=scan.nextInt(); while(t-->0) { int n=scan.nextInt(),k=scan.nextInt(); int[] a=nextIntArray(n); Arrays.sort(a); int sum=0; for(int c=0;c<k;c++) { sum+=a[c]; } out.println(sum); } out.close(); } //-----------------------------------------------------COMP-SPACE----------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------- //node static class Node implements Comparable<Node> { public int x,y; public Node(int x,int y) { this.x=x; this.y=y; } public int compareTo(Node other) { if(this.x==other.x) return 0; else if(this.x>other.x) return 1; else return -1; } public boolean equals(Node other) { return this.x==other.x; } // public int compareTo(Node other) { // if(this.y==other.y) return 0; // else if(this.y>other.y) return 1; // else return -1; // } // // public boolean equals(Node other) { // return this.y==other.y; // } } //edge static class Edge implements Comparable<Edge> { public Node a,b; public int weight; public Edge(Node a,Node b,int weight) { this.a=a; this.b=b; this.weight=weight; } public int compareTo(Edge other) { if(this.weight==other.weight) return 0; else if(this.weight>other.weight) return 1; else return -1; } } //util public static int gcd(int a, int b) { if (b == 0) return a; if (a == 0) return b; return (a > b) ? gcd(a % b, b) : gcd(a, b % a); } public static int lcm(int a, int b) { return a * b / gcd(a, b); } public static int min(int a,int b) { if(a<=b) return a; else return b; } public static int max(int a,int b) { if(a>=b) return a; else return b; } public static int abs(int a) { if(a<0) return a*-1; else return a; } public static ArrayList<Integer> getPrimes(int n) { boolean prime[]=new boolean[n+1]; Arrays.fill(prime,true); for (int p=2;p*p<=n;p++) { if (prime[p]) { for (int i=p*2;i<=n;i+=p) { prime[i]=false; } } } ArrayList<Integer> primeNumbers=new ArrayList<Integer>(); for (int i = 2; i <= n; i++) { if (prime[i]) { primeNumbers.add(i); } } return primeNumbers; } public static boolean isPrime(int a) { if (a == 0 || a == 1) { return false; } if (a == 2) { return true; } for (int i = 2; i < Math.sqrt(a) + 1; i++) { if (a % i == 0) { return false; } } return true; } public static ArrayList<Integer> getDivisors(int n) { ArrayList<Integer> div = new ArrayList<Integer>(); for (int i=1;i*i<=n;i++) { if (n%i==0) { div.add(i); if (n/i!=i) div.add(n/i); } } return div; } //scanner public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } public static int[] nextIntArray(int n) { int[] a=new int[n]; for(int c=0;c<n;c++) a[c]=scan.nextInt(); return a; } public static Integer[] nextIntegerArray(int n) { Integer[] a=new Integer[n]; for(int c=0;c<n;c++) a[c]=scan.nextInt(); return a; } public static int[][] nextIntMatrix(int n,int m) { int[][] a=new int[n][m]; for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt(); return a; } public static Integer[][] nextIntegerMatrix(int n,int m) { Integer[][] a=new Integer[n][m]; for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=scan.nextInt(); return a; } //print public static void printIntArray(int[] a) { for(int c:a) out.print(c+" "); out.println(); } public static void printIntegerArray(Integer[] a) { for(int c:a) out.print(c+" "); out.println(); } public static void printIntMatrix(int[][] a) { for(int[] i:a) { for(int j:i) out.print(j+" "); out.println(); } } public static void printIntegerMatrix(Integer[][] a) { for(Integer[] i:a) { for(Integer j:i) out.print(j+" "); out.println(); } } public static void help(int t,int n) { out.println("Test Case: "+(t+1)+" | Variable Output: "+n); } public static void help(int t,String n) { out.println("Test Case: "+(t+1)+" | Variable Output: "+n); } public static void help(int t,char[] n) { out.print("Test Case: "+(t+1)+" | Variable Output: "); for(char c:n) out.print(c+" "); out.println(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 85, 11 ], [ 85, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 45, 46 ], [ 44, 47 ], [ 47, 48 ], [ 48, 49 ], [ 14, 50 ], [ 50, 51 ], [ 51, 52 ], [ 50, 53 ], [ 14, 54 ], [ 54, 55 ], [ 54, 56 ], [ 14, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 62, 63 ], [ 62, 64 ], [ 57, 65 ], [ 65, 66 ], [ 66, 67 ], [ 57, 68 ], [ 69, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 72, 75 ], [ 14, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 12, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\npublic class Main {\n\n public static void main(String[] args) {\n // TODO 自動生成されたメソッド・スタブ\n Scanner sc = new Scanner(System.in);\n // 果物の種類\n int fruit_type = sc.nextInt();\n // 購入数\n int count = sc.nextInt();\n //果物毎の価格リスト\n ArrayList<Integer> fruit_list = new ArrayList<>();\n for(int i = 0; i < fruit_type;i++) {\n fruit_list.add(sc.nextInt());\n }\n // 価格リストを昇順ソート\n Collections.sort(fruit_list);\n //価格リストの先頭から購入数の数だけ加算\n int sum = 0;\n for(int i = 0; i<count;i++) {\n sum += fruit_list.get(i);\n }\n System.out.println(sum);\n\n }\n\n}", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Collections;", "Collections", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n // TODO 自動生成されたメソッド・スタブ\n Scanner sc = new Scanner(System.in);\n // 果物の種類\n int fruit_type = sc.nextInt();\n // 購入数\n int count = sc.nextInt();\n //果物毎の価格リスト\n ArrayList<Integer> fruit_list = new ArrayList<>();\n for(int i = 0; i < fruit_type;i++) {\n fruit_list.add(sc.nextInt());\n }\n // 価格リストを昇順ソート\n Collections.sort(fruit_list);\n //価格リストの先頭から購入数の数だけ加算\n int sum = 0;\n for(int i = 0; i<count;i++) {\n sum += fruit_list.get(i);\n }\n System.out.println(sum);\n\n }\n\n}", "Main", "public static void main(String[] args) {\n // TODO 自動生成されたメソッド・スタブ\n Scanner sc = new Scanner(System.in);\n // 果物の種類\n int fruit_type = sc.nextInt();\n // 購入数\n int count = sc.nextInt();\n //果物毎の価格リスト\n ArrayList<Integer> fruit_list = new ArrayList<>();\n for(int i = 0; i < fruit_type;i++) {\n fruit_list.add(sc.nextInt());\n }\n // 価格リストを昇順ソート\n Collections.sort(fruit_list);\n //価格リストの先頭から購入数の数だけ加算\n int sum = 0;\n for(int i = 0; i<count;i++) {\n sum += fruit_list.get(i);\n }\n System.out.println(sum);\n\n }", "main", "{\n // TODO 自動生成されたメソッド・スタブ\n Scanner sc = new Scanner(System.in);\n // 果物の種類\n int fruit_type = sc.nextInt();\n // 購入数\n int count = sc.nextInt();\n //果物毎の価格リスト\n ArrayList<Integer> fruit_list = new ArrayList<>();\n for(int i = 0; i < fruit_type;i++) {\n fruit_list.add(sc.nextInt());\n }\n // 価格リストを昇順ソート\n Collections.sort(fruit_list);\n //価格リストの先頭から購入数の数だけ加算\n int sum = 0;\n for(int i = 0; i<count;i++) {\n sum += fruit_list.get(i);\n }\n System.out.println(sum);\n\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int fruit_type = sc.nextInt();", "fruit_type", "sc.nextInt()", "sc.nextInt", "sc", "int count = sc.nextInt();", "count", "sc.nextInt()", "sc.nextInt", "sc", "ArrayList<Integer> fruit_list = new ArrayList<>();", "fruit_list", "new ArrayList<>()", "for(int i = 0; i < fruit_type;i++) {\n fruit_list.add(sc.nextInt());\n }", "int i = 0;", "int i = 0;", "i", "0", "i < fruit_type", "i", "fruit_type", "i++", "i++", "i", "{\n fruit_list.add(sc.nextInt());\n }", "{\n fruit_list.add(sc.nextInt());\n }", "fruit_list.add(sc.nextInt())", "fruit_list.add", "fruit_list", "sc.nextInt()", "sc.nextInt", "sc", "Collections.sort(fruit_list)", "Collections.sort", "Collections", "fruit_list", "int sum = 0;", "sum", "0", "for(int i = 0; i<count;i++) {\n sum += fruit_list.get(i);\n }", "int i = 0;", "int i = 0;", "i", "0", "i<count", "i", "count", "i++", "i++", "i", "{\n sum += fruit_list.get(i);\n }", "{\n sum += fruit_list.get(i);\n }", "sum += fruit_list.get(i)", "sum", "fruit_list.get(i)", "fruit_list.get", "fruit_list", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n // TODO 自動生成されたメソッド・スタブ\n Scanner sc = new Scanner(System.in);\n // 果物の種類\n int fruit_type = sc.nextInt();\n // 購入数\n int count = sc.nextInt();\n //果物毎の価格リスト\n ArrayList<Integer> fruit_list = new ArrayList<>();\n for(int i = 0; i < fruit_type;i++) {\n fruit_list.add(sc.nextInt());\n }\n // 価格リストを昇順ソート\n Collections.sort(fruit_list);\n //価格リストの先頭から購入数の数だけ加算\n int sum = 0;\n for(int i = 0; i<count;i++) {\n sum += fruit_list.get(i);\n }\n System.out.println(sum);\n\n }\n\n}", "public class Main {\n\n public static void main(String[] args) {\n // TODO 自動生成されたメソッド・スタブ\n Scanner sc = new Scanner(System.in);\n // 果物の種類\n int fruit_type = sc.nextInt();\n // 購入数\n int count = sc.nextInt();\n //果物毎の価格リスト\n ArrayList<Integer> fruit_list = new ArrayList<>();\n for(int i = 0; i < fruit_type;i++) {\n fruit_list.add(sc.nextInt());\n }\n // 価格リストを昇順ソート\n Collections.sort(fruit_list);\n //価格リストの先頭から購入数の数だけ加算\n int sum = 0;\n for(int i = 0; i<count;i++) {\n sum += fruit_list.get(i);\n }\n System.out.println(sum);\n\n }\n\n}", "Main" ]
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); // 果物の種類 int fruit_type = sc.nextInt(); // 購入数 int count = sc.nextInt(); //果物毎の価格リスト ArrayList<Integer> fruit_list = new ArrayList<>(); for(int i = 0; i < fruit_type;i++) { fruit_list.add(sc.nextInt()); } // 価格リストを昇順ソート Collections.sort(fruit_list); //価格リストの先頭から購入数の数だけ加算 int sum = 0; for(int i = 0; i<count;i++) { sum += fruit_list.get(i); } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 18, 13, 13, 41, 13, 18, 13, 13, 41, 13, 20, 41, 13, 20, 41, 13, 20, 4, 18, 13, 13, 13, 4, 18, 13, 23, 13, 6, 13, 12, 13, 30, 41, 13, 41, 13, 41, 13, 17, 0, 13, 4, 18, 13, 0, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 23, 13, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 17, 23, 13, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 37, 20, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 0, 13 ], [ 13, 14 ], [ 13, 15 ], [ 0, 16 ], [ 16, 17 ], [ 16, 18 ], [ 0, 19 ], [ 19, 20 ], [ 19, 21 ], [ 0, 22 ], [ 22, 23 ], [ 22, 24 ], [ 0, 25 ], [ 25, 26 ], [ 25, 27 ], [ 0, 28 ], [ 28, 29 ], [ 28, 30 ], [ 0, 31 ], [ 31, 32 ], [ 31, 33 ], [ 0, 34 ], [ 209, 35 ], [ 209, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 41, 43 ], [ 38, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 46, 48 ], [ 38, 49 ], [ 49, 50 ], [ 49, 51 ], [ 38, 52 ], [ 52, 53 ], [ 52, 54 ], [ 38, 55 ], [ 55, 56 ], [ 55, 57 ], [ 38, 58 ], [ 58, 59 ], [ 59, 60 ], [ 58, 61 ], [ 58, 62 ], [ 38, 63 ], [ 63, 64 ], [ 64, 65 ], [ 36, 66 ], [ 66, 67 ], [ 209, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 72, 73 ], [ 73, 74 ], [ 72, 75 ], [ 75, 76 ], [ 72, 77 ], [ 77, 78 ], [ 77, 79 ], [ 72, 80 ], [ 80, 81 ], [ 80, 82 ], [ 82, 83 ], [ 83, 84 ], [ 72, 85 ], [ 85, 86 ], [ 85, 87 ], [ 87, 88 ], [ 88, 89 ], [ 72, 90 ], [ 90, 91 ], [ 90, 92 ], [ 72, 94 ], [ 94, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 94, 99 ], [ 99, 100 ], [ 99, 101 ], [ 101, 102 ], [ 101, 103 ], [ 94, 104 ], [ 104, 105 ], [ 105, 106 ], [ 94, 107 ], [ 108, 108 ], [ 108, 109 ], [ 109, 110 ], [ 110, 111 ], [ 110, 112 ], [ 109, 113 ], [ 113, 114 ], [ 114, 115 ], [ 72, 116 ], [ 116, 117 ], [ 117, 118 ], [ 116, 119 ], [ 72, 120 ], [ 120, 121 ], [ 121, 122 ], [ 122, 123 ], [ 122, 124 ], [ 120, 125 ], [ 125, 126 ], [ 125, 127 ], [ 120, 128 ], [ 128, 129 ], [ 129, 130 ], [ 120, 131 ], [ 132, 132 ], [ 132, 133 ], [ 133, 134 ], [ 133, 135 ], [ 135, 136 ], [ 135, 137 ], [ 72, 138 ], [ 138, 139 ], [ 139, 140 ], [ 138, 141 ], [ 70, 142 ], [ 142, 143 ], [ 70, 144 ], [ 144, 145 ], [ 209, 146 ], [ 146, 147 ], [ 146, 148 ], [ 148, 149 ], [ 146, 150 ], [ 150, 151 ], [ 146, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 155, 156 ], [ 155, 157 ], [ 154, 158 ], [ 158, 159 ], [ 158, 160 ], [ 152, 161 ], [ 161, 162 ], [ 146, 163 ], [ 163, 164 ], [ 163, 165 ], [ 165, 166 ], [ 166, 167 ], [ 167, 168 ], [ 168, 169 ], [ 168, 170 ], [ 167, 171 ], [ 171, 172 ], [ 172, 173 ], [ 173, 174 ], [ 166, 175 ], [ 175, 176 ], [ 176, 177 ], [ 177, 178 ], [ 177, 179 ], [ 179, 180 ], [ 180, 181 ], [ 176, 182 ], [ 182, 183 ], [ 183, 184 ], [ 183, 185 ], [ 165, 186 ], [ 186, 187 ], [ 187, 188 ], [ 188, 189 ], [ 146, 190 ], [ 190, 191 ], [ 190, 192 ], [ 192, 193 ], [ 193, 194 ], [ 194, 195 ], [ 195, 196 ], [ 194, 197 ], [ 197, 198 ], [ 146, 199 ], [ 199, 200 ], [ 199, 201 ], [ 201, 202 ], [ 202, 203 ], [ 203, 204 ], [ 204, 205 ], [ 203, 206 ], [ 206, 207 ], [ 0, 208 ], [ 208, 209 ], [ 208, 210 ] ]
[ "import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\nimport java.io.IOException;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.InputStream;\n\npublic class Main {\n\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskA solver = new TaskA();\n solver.call(in,out);\n out.close();\n }\n\n static class TaskA {\n public void call(InputReader in, PrintWriter out) {\n int n ,k ,sum=0 ;\n n = in.nextInt();\n k = in.nextInt() ;\n int[] arr= new int[n];\n for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }\n\n Arrays.sort(arr);\n for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }\n out.println(sum);\n\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong(){\n return Long.parseLong(next());\n }\n\n }\n}", "import java.io.OutputStream;", "OutputStream", "java.io", "import java.io.IOException;", "IOException", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "import java.io.PrintWriter;", "PrintWriter", "java.io", "import java.util.ArrayList;", "ArrayList", "java.util", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.StringTokenizer;", "StringTokenizer", "java.util", "import java.io.IOException;", "IOException", "java.io", "import java.io.BufferedReader;", "BufferedReader", "java.io", "import java.io.InputStreamReader;", "InputStreamReader", "java.io", "import java.io.InputStream;", "InputStream", "java.io", "public class Main {\n\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskA solver = new TaskA();\n solver.call(in,out);\n out.close();\n }\n\n static class TaskA {\n public void call(InputReader in, PrintWriter out) {\n int n ,k ,sum=0 ;\n n = in.nextInt();\n k = in.nextInt() ;\n int[] arr= new int[n];\n for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }\n\n Arrays.sort(arr);\n for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }\n out.println(sum);\n\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong(){\n return Long.parseLong(next());\n }\n\n }\n}", "Main", "public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskA solver = new TaskA();\n solver.call(in,out);\n out.close();\n }", "main", "{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskA solver = new TaskA();\n solver.call(in,out);\n out.close();\n }", "InputStream inputStream = System.in;", "inputStream", "System.in", "System", "System.in", "OutputStream outputStream = System.out;", "outputStream", "System.out", "System", "System.out", "InputReader in = new InputReader(inputStream);", "in", "new InputReader(inputStream)", "PrintWriter out = new PrintWriter(outputStream);", "out", "new PrintWriter(outputStream)", "TaskA solver = new TaskA();", "solver", "new TaskA()", "solver.call(in,out)", "solver.call", "solver", "in", "out", "out.close()", "out.close", "out", "String[] args", "args", "static class TaskA {\n public void call(InputReader in, PrintWriter out) {\n int n ,k ,sum=0 ;\n n = in.nextInt();\n k = in.nextInt() ;\n int[] arr= new int[n];\n for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }\n\n Arrays.sort(arr);\n for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }\n out.println(sum);\n\n }\n }", "TaskA", "public void call(InputReader in, PrintWriter out) {\n int n ,k ,sum=0 ;\n n = in.nextInt();\n k = in.nextInt() ;\n int[] arr= new int[n];\n for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }\n\n Arrays.sort(arr);\n for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }\n out.println(sum);\n\n }", "call", "{\n int n ,k ,sum=0 ;\n n = in.nextInt();\n k = in.nextInt() ;\n int[] arr= new int[n];\n for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }\n\n Arrays.sort(arr);\n for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }\n out.println(sum);\n\n }", "int n", "n", "k", "k", "sum=0 ;", "sum", "0", "n = in.nextInt()", "n", "in.nextInt()", "in.nextInt", "in", "k = in.nextInt()", "k", "in.nextInt()", "in.nextInt", "in", "int[] arr= new int[n];", "arr", "new int[n]", "n", "for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i <arr.length", "i", "arr.length", "arr", "arr.length", "i++", "i++", "i", "{\n arr[i] = in.nextInt();\n }", "{\n arr[i] = in.nextInt();\n }", "arr[i] = in.nextInt()", "arr[i]", "arr", "i", "in.nextInt()", "in.nextInt", "in", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }", "int i = 0;", "int i = 0;", "i", "0", "i <k", "i", "k", "i++", "i++", "i", "{\n sum+=arr[i];\n\n }", "{\n sum+=arr[i];\n\n }", "sum+=arr[i]", "sum", "arr[i]", "arr", "i", "out.println(sum)", "out.println", "out", "sum", "InputReader in", "in", "PrintWriter out", "out", "static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong(){\n return Long.parseLong(next());\n }\n\n }", "InputReader", "public BufferedReader reader;", "reader", "public StringTokenizer tokenizer;", "tokenizer", "public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }", "InputReader", "{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }", "reader = new BufferedReader(new InputStreamReader(stream), 32768)", "reader", "new BufferedReader(new InputStreamReader(stream), 32768)", "tokenizer = null", "tokenizer", "null", "InputStream stream", "stream", "public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }", "next", "{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }", "while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "tokenizer == null || !tokenizer.hasMoreTokens()", "tokenizer == null", "tokenizer", "null", "!tokenizer.hasMoreTokens()", "tokenizer.hasMoreTokens()", "tokenizer.hasMoreTokens", "tokenizer", "{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }", "catch (IOException e) {\n throw new RuntimeException(e);\n }", "IOException e", "{\n throw new RuntimeException(e);\n }", "throw new RuntimeException(e);", "new RuntimeException(e)", "{\n tokenizer = new StringTokenizer(reader.readLine());\n }", "tokenizer = new StringTokenizer(reader.readLine())", "tokenizer", "new StringTokenizer(reader.readLine())", "return tokenizer.nextToken();", "tokenizer.nextToken()", "tokenizer.nextToken", "tokenizer", "public int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "public long nextLong(){\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "public class Main {\n\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskA solver = new TaskA();\n solver.call(in,out);\n out.close();\n }\n\n static class TaskA {\n public void call(InputReader in, PrintWriter out) {\n int n ,k ,sum=0 ;\n n = in.nextInt();\n k = in.nextInt() ;\n int[] arr= new int[n];\n for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }\n\n Arrays.sort(arr);\n for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }\n out.println(sum);\n\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong(){\n return Long.parseLong(next());\n }\n\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n TaskA solver = new TaskA();\n solver.call(in,out);\n out.close();\n }\n\n static class TaskA {\n public void call(InputReader in, PrintWriter out) {\n int n ,k ,sum=0 ;\n n = in.nextInt();\n k = in.nextInt() ;\n int[] arr= new int[n];\n for (int i = 0; i <arr.length ; i++) {\n arr[i] = in.nextInt();\n }\n\n Arrays.sort(arr);\n for (int i = 0; i <k ; i++) {\n sum+=arr[i];\n\n }\n out.println(sum);\n\n }\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public long nextLong(){\n return Long.parseLong(next());\n }\n\n }\n}", "Main" ]
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskA solver = new TaskA(); solver.call(in,out); out.close(); } static class TaskA { public void call(InputReader in, PrintWriter out) { int n ,k ,sum=0 ; n = in.nextInt(); k = in.nextInt() ; int[] arr= new int[n]; for (int i = 0; i <arr.length ; i++) { arr[i] = in.nextInt(); } Arrays.sort(arr); for (int i = 0; i <k ; i++) { sum+=arr[i]; } out.println(sum); } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong(){ return Long.parseLong(next()); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 41, 13, 17, 41, 13, 17, 42, 2, 2, 13, 2, 18, 13, 13, 17, 2, 13, 13, 30, 0, 13, 2, 13, 18, 13, 13, 40, 13, 40, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 92, 5 ], [ 92, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 53, 55 ], [ 8, 56 ], [ 56, 57 ], [ 56, 58 ], [ 8, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 63, 67 ], [ 60, 68 ], [ 68, 69 ], [ 68, 70 ], [ 59, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 71, 79 ], [ 79, 80 ], [ 71, 81 ], [ 81, 82 ], [ 8, 83 ], [ 83, 84 ], [ 84, 85 ], [ 85, 86 ], [ 85, 87 ], [ 83, 88 ], [ 6, 89 ], [ 89, 90 ], [ 0, 91 ], [ 91, 92 ], [ 91, 93 ] ]
[ "import java.util.*;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tint arr[]=new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarr[i]=in.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint mid=0,s=0,c=0;\n\t\twhile(mid<=arr.length-1 && c!=k)\n\t\t{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}\n\t\tSystem.out.println(s);\n\n\t}\n\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tint arr[]=new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarr[i]=in.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint mid=0,s=0,c=0;\n\t\twhile(mid<=arr.length-1 && c!=k)\n\t\t{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}\n\t\tSystem.out.println(s);\n\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tint arr[]=new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarr[i]=in.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint mid=0,s=0,c=0;\n\t\twhile(mid<=arr.length-1 && c!=k)\n\t\t{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}\n\t\tSystem.out.println(s);\n\n\t}", "main", "{\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tint arr[]=new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarr[i]=in.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint mid=0,s=0,c=0;\n\t\twhile(mid<=arr.length-1 && c!=k)\n\t\t{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}\n\t\tSystem.out.println(s);\n\n\t}", "Scanner in = new Scanner(System.in);", "in", "new Scanner(System.in)", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int k=in.nextInt();", "k", "in.nextInt()", "in.nextInt", "in", "int arr[]=new int[n];", "arr", "new int[n]", "n", "for(int i=0;i<n;i++)\n\t\t{\n\t\t\tarr[i]=in.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tarr[i]=in.nextInt();\n\t\t}", "{\n\t\t\tarr[i]=in.nextInt();\n\t\t}", "arr[i]=in.nextInt()", "arr[i]", "arr", "i", "in.nextInt()", "in.nextInt", "in", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int mid=0", "mid", "0", "s=0", "s", "0", "c=0;", "c", "0", "while(mid<=arr.length-1 && c!=k)\n\t\t{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}", "mid<=arr.length-1 && c!=k", "mid<=arr.length-1", "mid", "arr.length-1", "arr.length", "arr", "arr.length", "1", "c!=k", "c", "k", "{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}", "s=s+arr[mid]", "s", "s+arr[mid]", "s", "arr[mid]", "arr", "mid", "c++", "c", "mid++", "mid", "System.out.println(s)", "System.out.println", "System.out", "System", "System.out", "s", "String[] args", "args", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tint arr[]=new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarr[i]=in.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint mid=0,s=0,c=0;\n\t\twhile(mid<=arr.length-1 && c!=k)\n\t\t{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}\n\t\tSystem.out.println(s);\n\n\t}\n\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tint arr[]=new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarr[i]=in.nextInt();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tint mid=0,s=0,c=0;\n\t\twhile(mid<=arr.length-1 && c!=k)\n\t\t{\n\t\t\ts=s+arr[mid];\n\t\t\tc++;\n\t\t\tmid++;\n\t\t}\n\t\tSystem.out.println(s);\n\n\t}\n\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int n=in.nextInt(); int k=in.nextInt(); int arr[]=new int[n]; for(int i=0;i<n;i++) { arr[i]=in.nextInt(); } Arrays.sort(arr); int mid=0,s=0,c=0; while(mid<=arr.length-1 && c!=k) { s=s+arr[mid]; c++; mid++; } System.out.println(s); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 2, 13, 13, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 90, 8 ], [ 90, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 61, 65 ], [ 65, 66 ], [ 65, 67 ], [ 56, 68 ], [ 68, 69 ], [ 69, 70 ], [ 56, 71 ], [ 72, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 75, 77 ], [ 11, 78 ], [ 78, 79 ], [ 79, 80 ], [ 80, 81 ], [ 80, 82 ], [ 78, 83 ], [ 11, 84 ], [ 84, 85 ], [ 85, 86 ], [ 9, 87 ], [ 87, 88 ], [ 0, 89 ], [ 89, 90 ], [ 89, 91 ] ]
[ "import java.util.Scanner;\nimport java.util.*;\n public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\nint n =sc.nextInt();\nint k = sc.nextInt();\nint[] arr = new int[n];\nfor(int i = 0;i<n;i++){\narr[i]= sc.nextInt();\n\n}\nArrays.sort(arr);\nint sum =0;\nfor(int i=0;i<k &&i<n;i++){\nsum+=arr[i];\n}\nSystem.out.println(sum);\n sc.close();\n }\n}", "import java.util.Scanner;", "Scanner", "java.util", "import java.util.*;", "util.*", "java", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\nint n =sc.nextInt();\nint k = sc.nextInt();\nint[] arr = new int[n];\nfor(int i = 0;i<n;i++){\narr[i]= sc.nextInt();\n\n}\nArrays.sort(arr);\nint sum =0;\nfor(int i=0;i<k &&i<n;i++){\nsum+=arr[i];\n}\nSystem.out.println(sum);\n sc.close();\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\nint n =sc.nextInt();\nint k = sc.nextInt();\nint[] arr = new int[n];\nfor(int i = 0;i<n;i++){\narr[i]= sc.nextInt();\n\n}\nArrays.sort(arr);\nint sum =0;\nfor(int i=0;i<k &&i<n;i++){\nsum+=arr[i];\n}\nSystem.out.println(sum);\n sc.close();\n }", "main", "{\n Scanner sc = new Scanner(System.in);\nint n =sc.nextInt();\nint k = sc.nextInt();\nint[] arr = new int[n];\nfor(int i = 0;i<n;i++){\narr[i]= sc.nextInt();\n\n}\nArrays.sort(arr);\nint sum =0;\nfor(int i=0;i<k &&i<n;i++){\nsum+=arr[i];\n}\nSystem.out.println(sum);\n sc.close();\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n =sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] arr = new int[n];", "arr", "new int[n]", "n", "for(int i = 0;i<n;i++){\narr[i]= sc.nextInt();\n\n}", "int i = 0;", "int i = 0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\narr[i]= sc.nextInt();\n\n}", "{\narr[i]= sc.nextInt();\n\n}", "arr[i]= sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int sum =0;", "sum", "0", "for(int i=0;i<k &&i<n;i++){\nsum+=arr[i];\n}", "int i=0;", "int i=0;", "i", "0", "i<k &&i<n", "i<k", "i", "k", "i<n", "i", "n", "i++", "i++", "i", "{\nsum+=arr[i];\n}", "{\nsum+=arr[i];\n}", "sum+=arr[i]", "sum", "arr[i]", "arr", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\nint n =sc.nextInt();\nint k = sc.nextInt();\nint[] arr = new int[n];\nfor(int i = 0;i<n;i++){\narr[i]= sc.nextInt();\n\n}\nArrays.sort(arr);\nint sum =0;\nfor(int i=0;i<k &&i<n;i++){\nsum+=arr[i];\n}\nSystem.out.println(sum);\n sc.close();\n }\n}", "public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\nint n =sc.nextInt();\nint k = sc.nextInt();\nint[] arr = new int[n];\nfor(int i = 0;i<n;i++){\narr[i]= sc.nextInt();\n\n}\nArrays.sort(arr);\nint sum =0;\nfor(int i=0;i<k &&i<n;i++){\nsum+=arr[i];\n}\nSystem.out.println(sum);\n sc.close();\n }\n}", "Main" ]
import java.util.Scanner; import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n =sc.nextInt(); int k = sc.nextInt(); int[] arr = new int[n]; for(int i = 0;i<n;i++){ arr[i]= sc.nextInt(); } Arrays.sort(arr); int sum =0; for(int i=0;i<k &&i<n;i++){ sum+=arr[i]; } System.out.println(sum); sc.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 83, 8 ], [ 83, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 29, 31 ], [ 11, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 11, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 9, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int total = sc.nextInt();\n int pickCount = sc.nextInt();\n int[] numbers = new int[total];\n int result = 0;\n for(int i = 0 ; i < total ; i++){\n numbers[i] = sc.nextInt();\n }\n Arrays.sort(numbers);\n for(int i = 0; i < pickCount ; i++){\n result += numbers[i];\n }\n System.out.println(result);\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int total = sc.nextInt();\n int pickCount = sc.nextInt();\n int[] numbers = new int[total];\n int result = 0;\n for(int i = 0 ; i < total ; i++){\n numbers[i] = sc.nextInt();\n }\n Arrays.sort(numbers);\n for(int i = 0; i < pickCount ; i++){\n result += numbers[i];\n }\n System.out.println(result);\n }\n}", "Main", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int total = sc.nextInt();\n int pickCount = sc.nextInt();\n int[] numbers = new int[total];\n int result = 0;\n for(int i = 0 ; i < total ; i++){\n numbers[i] = sc.nextInt();\n }\n Arrays.sort(numbers);\n for(int i = 0; i < pickCount ; i++){\n result += numbers[i];\n }\n System.out.println(result);\n }", "main", "{\n\n Scanner sc = new Scanner(System.in);\n int total = sc.nextInt();\n int pickCount = sc.nextInt();\n int[] numbers = new int[total];\n int result = 0;\n for(int i = 0 ; i < total ; i++){\n numbers[i] = sc.nextInt();\n }\n Arrays.sort(numbers);\n for(int i = 0; i < pickCount ; i++){\n result += numbers[i];\n }\n System.out.println(result);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int total = sc.nextInt();", "total", "sc.nextInt()", "sc.nextInt", "sc", "int pickCount = sc.nextInt();", "pickCount", "sc.nextInt()", "sc.nextInt", "sc", "int[] numbers = new int[total];", "numbers", "new int[total]", "total", "int result = 0;", "result", "0", "for(int i = 0 ; i < total ; i++){\n numbers[i] = sc.nextInt();\n }", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < total", "i", "total", "i++", "i++", "i", "{\n numbers[i] = sc.nextInt();\n }", "{\n numbers[i] = sc.nextInt();\n }", "numbers[i] = sc.nextInt()", "numbers[i]", "numbers", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(numbers)", "Arrays.sort", "Arrays", "numbers", "for(int i = 0; i < pickCount ; i++){\n result += numbers[i];\n }", "int i = 0;", "int i = 0;", "i", "0", "i < pickCount", "i", "pickCount", "i++", "i++", "i", "{\n result += numbers[i];\n }", "{\n result += numbers[i];\n }", "result += numbers[i]", "result", "numbers[i]", "numbers", "i", "System.out.println(result)", "System.out.println", "System.out", "System", "System.out", "result", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int total = sc.nextInt();\n int pickCount = sc.nextInt();\n int[] numbers = new int[total];\n int result = 0;\n for(int i = 0 ; i < total ; i++){\n numbers[i] = sc.nextInt();\n }\n Arrays.sort(numbers);\n for(int i = 0; i < pickCount ; i++){\n result += numbers[i];\n }\n System.out.println(result);\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n int total = sc.nextInt();\n int pickCount = sc.nextInt();\n int[] numbers = new int[total];\n int result = 0;\n for(int i = 0 ; i < total ; i++){\n numbers[i] = sc.nextInt();\n }\n Arrays.sort(numbers);\n for(int i = 0; i < pickCount ; i++){\n result += numbers[i];\n }\n System.out.println(result);\n }\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int total = sc.nextInt(); int pickCount = sc.nextInt(); int[] numbers = new int[total]; int result = 0; for(int i = 0 ; i < total ; i++){ numbers[i] = sc.nextInt(); } Arrays.sort(numbers); for(int i = 0; i < pickCount ; i++){ result += numbers[i]; } System.out.println(result); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 4, 13, 23, 13, 12, 13, 30, 38, 5, 13, 30, 4, 18, 18, 13, 13, 17, 30, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 111, 11 ], [ 111, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 12, 17 ], [ 17, 18 ], [ 111, 19 ], [ 19, 20 ], [ 19, 21 ], [ 21, 22 ], [ 22, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 22, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 32, 36 ], [ 36, 37 ], [ 36, 38 ], [ 38, 39 ], [ 39, 40 ], [ 38, 41 ], [ 41, 42 ], [ 42, 43 ], [ 32, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 49, 50 ], [ 50, 51 ], [ 32, 52 ], [ 52, 53 ], [ 52, 54 ], [ 32, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 70, 71 ], [ 70, 72 ], [ 69, 73 ], [ 73, 74 ], [ 74, 75 ], [ 73, 76 ], [ 76, 77 ], [ 77, 78 ], [ 32, 79 ], [ 79, 80 ], [ 80, 81 ], [ 79, 82 ], [ 32, 83 ], [ 83, 84 ], [ 83, 85 ], [ 32, 86 ], [ 86, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 86, 91 ], [ 91, 92 ], [ 91, 93 ], [ 86, 94 ], [ 94, 95 ], [ 95, 96 ], [ 86, 97 ], [ 98, 98 ], [ 98, 99 ], [ 99, 100 ], [ 99, 101 ], [ 101, 102 ], [ 101, 103 ], [ 32, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 104, 109 ], [ 0, 110 ], [ 110, 111 ], [ 110, 112 ] ]
[ "import java.util.Arrays;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n b();\n }\n public static void b() {\n try (Scanner sc = new Scanner(System.in)) {\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n } catch (Exception E) {\n System.out.println(\"エラー\");\n }\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.List;", "List", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n public static void main(String[] args) {\n b();\n }\n public static void b() {\n try (Scanner sc = new Scanner(System.in)) {\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n } catch (Exception E) {\n System.out.println(\"エラー\");\n }\n }\n}", "Main", "public static void main(String[] args) {\n b();\n }", "main", "{\n b();\n }", "b()", "b", "String[] args", "args", "public static void b() {\n try (Scanner sc = new Scanner(System.in)) {\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n } catch (Exception E) {\n System.out.println(\"エラー\");\n }\n }", "b", "{\n try (Scanner sc = new Scanner(System.in)) {\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n } catch (Exception E) {\n System.out.println(\"エラー\");\n }\n }", "try (Scanner sc = new Scanner(System.in)) {\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n } catch (Exception E) {\n System.out.println(\"エラー\");\n }", "catch (Exception E) {\n System.out.println(\"エラー\");\n }", "Exception E", "{\n System.out.println(\"エラー\");\n }", "System.out.println(\"エラー\")", "System.out.println", "System.out", "System", "System.out", "\"エラー\"", "{\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n }", "Scanner sc = new Scanner(System.in)", "Scanner sc = new Scanner(System.in)", "new Scanner(System.in)", "int n = Integer.parseInt(sc.next());", "n", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "int k = Integer.parseInt(sc.next());", "k", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "int[] p = new int[n];", "p", "new int[n]", "n", "for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }", "int xx = 0;", "int xx = 0;", "xx", "0", "xx < n", "xx", "n", "xx++", "xx++", "xx", "{\n p[xx] = Integer.parseInt(sc.next());\n }", "{\n p[xx] = Integer.parseInt(sc.next());\n }", "p[xx] = Integer.parseInt(sc.next())", "p[xx]", "p", "xx", "Integer.parseInt(sc.next())", "Integer.parseInt", "Integer", "sc.next()", "sc.next", "sc", "Arrays.parallelSort(p)", "Arrays.parallelSort", "Arrays", "p", "int goukei = 0;", "goukei", "0", "for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }", "int ans = 0;", "int ans = 0;", "ans", "0", "ans < k", "ans", "k", "ans++", "ans++", "ans", "{\n goukei += p[ans];\n }", "{\n goukei += p[ans];\n }", "goukei += p[ans]", "goukei", "p[ans]", "p", "ans", "System.out.println(goukei)", "System.out.println", "System.out", "System", "System.out", "goukei", "public class Main {\n public static void main(String[] args) {\n b();\n }\n public static void b() {\n try (Scanner sc = new Scanner(System.in)) {\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n } catch (Exception E) {\n System.out.println(\"エラー\");\n }\n }\n}", "public class Main {\n public static void main(String[] args) {\n b();\n }\n public static void b() {\n try (Scanner sc = new Scanner(System.in)) {\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n int[] p = new int[n];\n for (int xx = 0; xx < n; xx++) {\n p[xx] = Integer.parseInt(sc.next());\n }\n Arrays.parallelSort(p);\n\n int goukei = 0;\n for (int ans = 0; ans < k; ans++) {\n goukei += p[ans];\n }\n\n System.out.println(goukei);\n\n } catch (Exception E) {\n System.out.println(\"エラー\");\n }\n }\n}", "Main" ]
import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { b(); } public static void b() { try (Scanner sc = new Scanner(System.in)) { int n = Integer.parseInt(sc.next()); int k = Integer.parseInt(sc.next()); int[] p = new int[n]; for (int xx = 0; xx < n; xx++) { p[xx] = Integer.parseInt(sc.next()); } Arrays.parallelSort(p); int goukei = 0; for (int ans = 0; ans < k; ans++) { goukei += p[ans]; } System.out.println(goukei); } catch (Exception E) { System.out.println("エラー"); } } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 12, 13, 30, 41, 13, 20, 0, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 23, 13, 12, 13, 30, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 1, 40, 13, 30, 30, 14, 40, 4, 18, 13, 4, 18, 13, 13, 30, 29, 17, 29, 17, 23, 13, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 12, 13, 30, 42, 2, 2, 13, 17, 40, 4, 18, 13, 30, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 20, 29, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 29, 4, 18, 13, 4, 13, 12, 13, 30, 41, 13, 17, 38, 5, 13, 30, 4, 18, 13, 30, 0, 13, 4, 18, 13, 29, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 9, 10 ], [ 7, 11 ], [ 11, 12 ], [ 11, 13 ], [ 13, 14 ], [ 14, 15 ], [ 14, 16 ], [ 13, 17 ], [ 17, 18 ], [ 17, 19 ], [ 13, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 13, 25 ], [ 25, 26 ], [ 25, 27 ], [ 27, 28 ], [ 28, 29 ], [ 13, 30 ], [ 30, 31 ], [ 30, 32 ], [ 13, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 36, 38 ], [ 34, 39 ], [ 39, 40 ], [ 39, 41 ], [ 34, 42 ], [ 42, 43 ], [ 43, 44 ], [ 34, 45 ], [ 46, 46 ], [ 46, 47 ], [ 47, 48 ], [ 48, 49 ], [ 48, 50 ], [ 47, 51 ], [ 51, 52 ], [ 52, 53 ], [ 13, 54 ], [ 54, 55 ], [ 55, 56 ], [ 54, 57 ], [ 13, 58 ], [ 58, 59 ], [ 58, 60 ], [ 13, 61 ], [ 61, 62 ], [ 62, 63 ], [ 63, 64 ], [ 63, 65 ], [ 61, 66 ], [ 66, 67 ], [ 66, 68 ], [ 61, 69 ], [ 69, 70 ], [ 70, 71 ], [ 61, 72 ], [ 73, 73 ], [ 73, 74 ], [ 74, 75 ], [ 74, 76 ], [ 76, 77 ], [ 76, 78 ], [ 13, 79 ], [ 79, 80 ], [ 80, 81 ], [ 79, 82 ], [ 13, 83 ], [ 83, 84 ], [ 84, 85 ], [ 11, 86 ], [ 86, 87 ], [ 7, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 91, 92 ], [ 92, 93 ], [ 93, 94 ], [ 93, 95 ], [ 91, 96 ], [ 96, 97 ], [ 96, 98 ], [ 98, 99 ], [ 99, 100 ], [ 91, 101 ], [ 101, 102 ], [ 102, 103 ], [ 91, 104 ], [ 105, 105 ], [ 105, 106 ], [ 106, 107 ], [ 107, 108 ], [ 108, 109 ], [ 109, 110 ], [ 108, 111 ], [ 111, 112 ], [ 112, 113 ], [ 111, 114 ], [ 106, 115 ], [ 115, 116 ], [ 116, 117 ], [ 90, 118 ], [ 118, 119 ], [ 88, 120 ], [ 120, 121 ], [ 7, 122 ], [ 122, 123 ], [ 122, 124 ], [ 124, 125 ], [ 122, 126 ], [ 126, 127 ], [ 122, 128 ], [ 128, 129 ], [ 128, 130 ], [ 130, 131 ], [ 131, 132 ], [ 131, 133 ], [ 122, 134 ], [ 134, 135 ], [ 134, 136 ], [ 136, 137 ], [ 137, 138 ], [ 138, 139 ], [ 139, 140 ], [ 139, 141 ], [ 138, 142 ], [ 142, 143 ], [ 143, 144 ], [ 144, 145 ], [ 137, 146 ], [ 146, 147 ], [ 147, 148 ], [ 148, 149 ], [ 148, 150 ], [ 150, 151 ], [ 151, 152 ], [ 152, 153 ], [ 147, 154 ], [ 154, 155 ], [ 155, 156 ], [ 155, 157 ], [ 136, 158 ], [ 158, 159 ], [ 159, 160 ], [ 160, 161 ], [ 122, 162 ], [ 162, 163 ], [ 162, 164 ], [ 164, 165 ], [ 165, 166 ], [ 166, 167 ], [ 167, 168 ], [ 166, 169 ], [ 169, 170 ], [ 122, 171 ], [ 171, 172 ], [ 171, 173 ], [ 173, 174 ], [ 174, 175 ], [ 175, 176 ], [ 176, 177 ], [ 175, 178 ], [ 178, 179 ], [ 122, 180 ], [ 180, 181 ], [ 180, 182 ], [ 182, 183 ], [ 183, 184 ], [ 184, 185 ], [ 185, 186 ], [ 184, 187 ], [ 187, 188 ], [ 122, 189 ], [ 189, 190 ], [ 189, 191 ], [ 191, 192 ], [ 192, 193 ], [ 192, 194 ], [ 191, 195 ], [ 195, 196 ], [ 196, 197 ], [ 196, 198 ], [ 198, 199 ], [ 199, 200 ], [ 200, 201 ], [ 195, 202 ], [ 202, 203 ], [ 203, 204 ], [ 203, 205 ], [ 205, 206 ], [ 206, 207 ], [ 191, 208 ], [ 208, 209 ] ]
[ "\nimport java.io.*;\nimport java.util.*;\n \n \nclass Main{\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n int n = sc.nextInt();\n int k=sc.nextInt();\n int[] arr=new int[n];\n for(int i=0;i<n;i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<k;i++) {\n sum+=arr[i];\n }\n out.println(sum);\n out.close();\n }\n \n public static boolean isUpperCase(String s)\n {\n for (int i=0; i<s.length(); i++)\n {\n if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }\n\n \n\n //-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;\n \n //-----------MyScanner class for faster input----------\n public static class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n \n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt() {\n return Integer.parseInt(next());\n }\n \n long nextLong() {\n return Long.parseLong(next());\n }\n \n double nextDouble() {\n return Double.parseDouble(next());\n }\n \n String nextLine(){\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "class Main{\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n int n = sc.nextInt();\n int k=sc.nextInt();\n int[] arr=new int[n];\n for(int i=0;i<n;i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<k;i++) {\n sum+=arr[i];\n }\n out.println(sum);\n out.close();\n }\n \n public static boolean isUpperCase(String s)\n {\n for (int i=0; i<s.length(); i++)\n {\n if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }\n\n \n\n //-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;\n \n //-----------MyScanner class for faster input----------\n public static class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n \n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt() {\n return Integer.parseInt(next());\n }\n \n long nextLong() {\n return Long.parseLong(next());\n }\n \n double nextDouble() {\n return Double.parseDouble(next());\n }\n \n String nextLine(){\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }\n}", "Main", "//-----------PrintWriter for faster output---------------------------------\n public static PrintWriter out;", "out", "public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n int n = sc.nextInt();\n int k=sc.nextInt();\n int[] arr=new int[n];\n for(int i=0;i<n;i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<k;i++) {\n sum+=arr[i];\n }\n out.println(sum);\n out.close();\n }", "main", "{\n FastScanner sc = new FastScanner();\n out = new PrintWriter(new BufferedOutputStream(System.out));\n int n = sc.nextInt();\n int k=sc.nextInt();\n int[] arr=new int[n];\n for(int i=0;i<n;i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<k;i++) {\n sum+=arr[i];\n }\n out.println(sum);\n out.close();\n }", "FastScanner sc = new FastScanner();", "sc", "new FastScanner()", "out = new PrintWriter(new BufferedOutputStream(System.out))", "out", "new PrintWriter(new BufferedOutputStream(System.out))", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k=sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int[] arr=new int[n];", "arr", "new int[n]", "n", "for(int i=0;i<n;i++) {\n arr[i] = sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n arr[i] = sc.nextInt();\n }", "{\n arr[i] = sc.nextInt();\n }", "arr[i] = sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int sum=0;", "sum", "0", "for(int i=0;i<k;i++) {\n sum+=arr[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n sum+=arr[i];\n }", "{\n sum+=arr[i];\n }", "sum+=arr[i]", "sum", "arr[i]", "arr", "i", "out.println(sum)", "out.println", "out", "sum", "out.close()", "out.close", "out", "String[] args", "args", "public static boolean isUpperCase(String s)\n {\n for (int i=0; i<s.length(); i++)\n {\n if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "isUpperCase", "{\n for (int i=0; i<s.length(); i++)\n {\n if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "for (int i=0; i<s.length(); i++)\n {\n if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }\n }", "int i=0;", "int i=0;", "i", "0", "i<s.length()", "i", "s.length()", "s.length", "s", "i++", "i++", "i", "{\n if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }\n }", "{\n if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }\n }", "if (!Character.isUpperCase(s.charAt(i)))\n {\n return false;\n }", "!Character.isUpperCase(s.charAt(i))", "Character.isUpperCase(s.charAt(i))", "Character.isUpperCase", "Character", "s.charAt(i)", "s.charAt", "s", "i", "{\n return false;\n }", "return false;", "false", "return true;", "true", "String s", "s", "public static class FastScanner {\n BufferedReader br;\n StringTokenizer st;\n \n public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n \n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n \n int nextInt() {\n return Integer.parseInt(next());\n }\n \n long nextLong() {\n return Long.parseLong(next());\n }\n \n double nextDouble() {\n return Double.parseDouble(next());\n }\n \n String nextLine(){\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n\n }", "FastScanner", "BufferedReader br;", "br", "StringTokenizer st;", "st", "public FastScanner() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "FastScanner", "{\n br = new BufferedReader(new InputStreamReader(System.in));\n }", "br = new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "next", "{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }", "while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "st == null || !st.hasMoreElements()", "st == null", "st", "null", "!st.hasMoreElements()", "st.hasMoreElements()", "st.hasMoreElements", "st", "{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n st = new StringTokenizer(br.readLine());\n }", "st = new StringTokenizer(br.readLine())", "st", "new StringTokenizer(br.readLine())", "return st.nextToken();", "st.nextToken()", "st.nextToken", "st", "int nextInt() {\n return Integer.parseInt(next());\n }", "nextInt", "{\n return Integer.parseInt(next());\n }", "return Integer.parseInt(next());", "Integer.parseInt(next())", "Integer.parseInt", "Integer", "next()", "next", "long nextLong() {\n return Long.parseLong(next());\n }", "nextLong", "{\n return Long.parseLong(next());\n }", "return Long.parseLong(next());", "Long.parseLong(next())", "Long.parseLong", "Long", "next()", "next", "double nextDouble() {\n return Double.parseDouble(next());\n }", "nextDouble", "{\n return Double.parseDouble(next());\n }", "return Double.parseDouble(next());", "Double.parseDouble(next())", "Double.parseDouble", "Double", "next()", "next", "String nextLine(){\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "nextLine", "{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }", "String str = \"\";", "str", "\"\"", "try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }", "catch (IOException e) {\n e.printStackTrace();\n }", "IOException e", "{\n e.printStackTrace();\n }", "e.printStackTrace()", "e.printStackTrace", "e", "{\n str = br.readLine();\n }", "str = br.readLine()", "str", "br.readLine()", "br.readLine", "br", "return str;", "str" ]
import java.io.*; import java.util.*; class Main{ public static void main(String[] args) { FastScanner sc = new FastScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n = sc.nextInt(); int k=sc.nextInt(); int[] arr=new int[n]; for(int i=0;i<n;i++) { arr[i] = sc.nextInt(); } Arrays.sort(arr); int sum=0; for(int i=0;i<k;i++) { sum+=arr[i]; } out.println(sum); out.close(); } public static boolean isUpperCase(String s) { for (int i=0; i<s.length(); i++) { if (!Character.isUpperCase(s.charAt(i))) { return false; } } return true; } //-----------PrintWriter for faster output--------------------------------- public static PrintWriter out; //-----------MyScanner class for faster input---------- public static class FastScanner { BufferedReader br; StringTokenizer st; public FastScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine(){ String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 20, 21 ], [ 21, 22 ], [ 14, 23 ], [ 23, 24 ], [ 23, 25 ], [ 25, 26 ], [ 26, 27 ], [ 14, 28 ], [ 28, 29 ], [ 28, 30 ], [ 14, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 14, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 14, 56 ], [ 56, 57 ], [ 56, 58 ], [ 14, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 59, 64 ], [ 64, 65 ], [ 64, 66 ], [ 59, 67 ], [ 67, 68 ], [ 68, 69 ], [ 59, 70 ], [ 71, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 74, 75 ], [ 74, 76 ], [ 14, 77 ], [ 77, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 77, 82 ], [ 12, 83 ], [ 83, 84 ] ]
[ "import java.util.*;\nimport java.io.*;\nimport java.lang.*;\n\n\nclass Main{\n\tpublic static void main(String args[]){\n \tScanner in = new Scanner(System.in);\n \tint n = in.nextInt();\n\t\tint m = in.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++){\n\t\t\tar[i] = in.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(ar);\n\n\t\tint cost = 0;\n\t\tfor(int i = 0 ; i < m ; i++){\n\t\t\tcost += ar[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cost);\n }\n \n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "import java.lang.*;", "lang.*", "java", "class Main{\n\tpublic static void main(String args[]){\n \tScanner in = new Scanner(System.in);\n \tint n = in.nextInt();\n\t\tint m = in.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++){\n\t\t\tar[i] = in.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(ar);\n\n\t\tint cost = 0;\n\t\tfor(int i = 0 ; i < m ; i++){\n\t\t\tcost += ar[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cost);\n }\n \n}", "Main", "public static void main(String args[]){\n \tScanner in = new Scanner(System.in);\n \tint n = in.nextInt();\n\t\tint m = in.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++){\n\t\t\tar[i] = in.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(ar);\n\n\t\tint cost = 0;\n\t\tfor(int i = 0 ; i < m ; i++){\n\t\t\tcost += ar[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cost);\n }", "main", "{\n \tScanner in = new Scanner(System.in);\n \tint n = in.nextInt();\n\t\tint m = in.nextInt();\n\t\tint[] ar = new int[n];\n\t\tfor(int i = 0 ; i < n ; i++){\n\t\t\tar[i] = in.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(ar);\n\n\t\tint cost = 0;\n\t\tfor(int i = 0 ; i < m ; i++){\n\t\t\tcost += ar[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(cost);\n }", "Scanner in = new Scanner(System.in);", "in", "new Scanner(System.in)", "int n = in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int m = in.nextInt();", "m", "in.nextInt()", "in.nextInt", "in", "int[] ar = new int[n];", "ar", "new int[n]", "n", "for(int i = 0 ; i < n ; i++){\n\t\t\tar[i] = in.nextInt();\n\t\t}", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\t\t\tar[i] = in.nextInt();\n\t\t}", "{\n\t\t\tar[i] = in.nextInt();\n\t\t}", "ar[i] = in.nextInt()", "ar[i]", "ar", "i", "in.nextInt()", "in.nextInt", "in", "Arrays.sort(ar)", "Arrays.sort", "Arrays", "ar", "int cost = 0;", "cost", "0", "for(int i = 0 ; i < m ; i++){\n\t\t\tcost += ar[i];\n\t\t}", "int i = 0 ;", "int i = 0 ;", "i", "0", "i < m", "i", "m", "i++", "i++", "i", "{\n\t\t\tcost += ar[i];\n\t\t}", "{\n\t\t\tcost += ar[i];\n\t\t}", "cost += ar[i]", "cost", "ar[i]", "ar", "i", "System.out.println(cost)", "System.out.println", "System.out", "System", "System.out", "cost", "String args[]", "args" ]
import java.util.*; import java.io.*; import java.lang.*; class Main{ public static void main(String args[]){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); int[] ar = new int[n]; for(int i = 0 ; i < n ; i++){ ar[i] = in.nextInt(); } Arrays.sort(ar); int cost = 0; for(int i = 0 ; i < m ; i++){ cost += ar[i]; } System.out.println(cost); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 41, 13, 12, 13, 30, 0, 13, 20, 0, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 13, 0, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 10, 11 ], [ 10, 12 ], [ 12, 13 ], [ 10, 14 ], [ 14, 15 ], [ 10, 16 ], [ 16, 17 ], [ 16, 18 ], [ 18, 19 ], [ 19, 20 ], [ 19, 21 ], [ 18, 22 ], [ 22, 23 ], [ 22, 24 ], [ 18, 25 ], [ 25, 26 ], [ 25, 27 ], [ 27, 28 ], [ 28, 29 ], [ 27, 30 ], [ 30, 31 ], [ 31, 32 ], [ 18, 33 ], [ 33, 34 ], [ 33, 35 ], [ 35, 36 ], [ 36, 37 ], [ 35, 38 ], [ 38, 39 ], [ 39, 40 ], [ 18, 41 ], [ 41, 42 ], [ 41, 43 ], [ 18, 45 ], [ 45, 46 ], [ 45, 47 ], [ 18, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 50, 52 ], [ 48, 53 ], [ 53, 54 ], [ 53, 55 ], [ 48, 56 ], [ 56, 57 ], [ 57, 58 ], [ 48, 59 ], [ 59, 60 ], [ 60, 61 ], [ 61, 62 ], [ 61, 63 ], [ 60, 64 ], [ 64, 65 ], [ 65, 66 ], [ 64, 67 ], [ 67, 68 ], [ 68, 69 ], [ 18, 70 ], [ 70, 71 ], [ 71, 72 ], [ 70, 73 ], [ 18, 74 ], [ 74, 75 ], [ 74, 76 ], [ 18, 77 ], [ 77, 78 ], [ 78, 79 ], [ 79, 80 ], [ 79, 81 ], [ 77, 82 ], [ 82, 83 ], [ 82, 84 ], [ 77, 85 ], [ 85, 86 ], [ 86, 87 ], [ 77, 88 ], [ 88, 89 ], [ 89, 90 ], [ 89, 91 ], [ 91, 92 ], [ 91, 93 ], [ 18, 94 ], [ 94, 95 ], [ 95, 96 ], [ 96, 97 ], [ 96, 98 ], [ 94, 99 ], [ 16, 100 ], [ 100, 101 ] ]
[ "import java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\nclass Main {\n \n private static BufferedReader br;\n private static StringTokenizer strz;\n \n\tpublic static void main (String[] args) throws java.lang.Exception {\n\t\tbr= new BufferedReader(new InputStreamReader(System.in));\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tint n = Integer.parseInt(strz.nextToken());\n\t\tint k = Integer.parseInt(strz.nextToken());\n\t\t\n\t\tint[] arr = new int[n];\n\t\t\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tfor(int i= 0; i < n; ++i)\n\t\t arr[i] = Integer.parseInt(strz.nextToken());\n\t\t \n\t\tArrays.sort(arr);\n\t\t \n\t\tint cost = 0;\n\t\tfor(int i = 0; i < k; ++i)\n\t\t cost += arr[i];\n\t\tSystem.out.println(cost);\n\t}\n}", "import java.util.*;", "util.*", "java", "import java.lang.*;", "lang.*", "java", "import java.io.*;", "io.*", "java", "class Main {\n \n private static BufferedReader br;\n private static StringTokenizer strz;\n \n\tpublic static void main (String[] args) throws java.lang.Exception {\n\t\tbr= new BufferedReader(new InputStreamReader(System.in));\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tint n = Integer.parseInt(strz.nextToken());\n\t\tint k = Integer.parseInt(strz.nextToken());\n\t\t\n\t\tint[] arr = new int[n];\n\t\t\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tfor(int i= 0; i < n; ++i)\n\t\t arr[i] = Integer.parseInt(strz.nextToken());\n\t\t \n\t\tArrays.sort(arr);\n\t\t \n\t\tint cost = 0;\n\t\tfor(int i = 0; i < k; ++i)\n\t\t cost += arr[i];\n\t\tSystem.out.println(cost);\n\t}\n}", "Main", "private static BufferedReader br;", "br", "private static StringTokenizer strz;", "strz", "public static void main (String[] args) throws java.lang.Exception {\n\t\tbr= new BufferedReader(new InputStreamReader(System.in));\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tint n = Integer.parseInt(strz.nextToken());\n\t\tint k = Integer.parseInt(strz.nextToken());\n\t\t\n\t\tint[] arr = new int[n];\n\t\t\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tfor(int i= 0; i < n; ++i)\n\t\t arr[i] = Integer.parseInt(strz.nextToken());\n\t\t \n\t\tArrays.sort(arr);\n\t\t \n\t\tint cost = 0;\n\t\tfor(int i = 0; i < k; ++i)\n\t\t cost += arr[i];\n\t\tSystem.out.println(cost);\n\t}", "main", "{\n\t\tbr= new BufferedReader(new InputStreamReader(System.in));\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tint n = Integer.parseInt(strz.nextToken());\n\t\tint k = Integer.parseInt(strz.nextToken());\n\t\t\n\t\tint[] arr = new int[n];\n\t\t\n\t\tstrz = new StringTokenizer(br.readLine());\n\t\tfor(int i= 0; i < n; ++i)\n\t\t arr[i] = Integer.parseInt(strz.nextToken());\n\t\t \n\t\tArrays.sort(arr);\n\t\t \n\t\tint cost = 0;\n\t\tfor(int i = 0; i < k; ++i)\n\t\t cost += arr[i];\n\t\tSystem.out.println(cost);\n\t}", "br= new BufferedReader(new InputStreamReader(System.in))", "br", "new BufferedReader(new InputStreamReader(System.in))", "strz = new StringTokenizer(br.readLine())", "strz", "new StringTokenizer(br.readLine())", "int n = Integer.parseInt(strz.nextToken());", "n", "Integer.parseInt(strz.nextToken())", "Integer.parseInt", "Integer", "strz.nextToken()", "strz.nextToken", "strz", "int k = Integer.parseInt(strz.nextToken());", "k", "Integer.parseInt(strz.nextToken())", "Integer.parseInt", "Integer", "strz.nextToken()", "strz.nextToken", "strz", "int[] arr = new int[n];", "arr", "new int[n]", "n", "strz = new StringTokenizer(br.readLine())", "strz", "new StringTokenizer(br.readLine())", "for(int i= 0; i < n; ++i)\n\t\t arr[i] = Integer.parseInt(strz.nextToken());", "int i= 0;", "int i= 0;", "i", "0", "i < n", "i", "n", "++i", "++i", "i", "arr[i] = Integer.parseInt(strz.nextToken());", "arr[i] = Integer.parseInt(strz.nextToken())", "arr[i]", "arr", "i", "Integer.parseInt(strz.nextToken())", "Integer.parseInt", "Integer", "strz.nextToken()", "strz.nextToken", "strz", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int cost = 0;", "cost", "0", "for(int i = 0; i < k; ++i)\n\t\t cost += arr[i];", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "++i", "++i", "i", "cost += arr[i];", "cost += arr[i]", "cost", "arr[i]", "arr", "i", "System.out.println(cost)", "System.out.println", "System.out", "System", "System.out", "cost", "String[] args", "args" ]
import java.util.*; import java.lang.*; import java.io.*; class Main { private static BufferedReader br; private static StringTokenizer strz; public static void main (String[] args) throws java.lang.Exception { br= new BufferedReader(new InputStreamReader(System.in)); strz = new StringTokenizer(br.readLine()); int n = Integer.parseInt(strz.nextToken()); int k = Integer.parseInt(strz.nextToken()); int[] arr = new int[n]; strz = new StringTokenizer(br.readLine()); for(int i= 0; i < n; ++i) arr[i] = Integer.parseInt(strz.nextToken()); Arrays.sort(arr); int cost = 0; for(int i = 0; i < k; ++i) cost += arr[i]; System.out.println(cost); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 41, 13, 20, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 4, 18, 13, 12, 13, 30, 29, 4, 18, 13, 12, 13, 30, 41, 13, 20, 28, 13, 13, 30, 4, 18, 13, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 20, 28, 13, 13, 30, 4, 18, 13, 13, 4, 18, 13, 13, 4, 18, 13, 11, 1, 41, 13, 17, 2, 13, 4, 18, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 13, 29, 13, 23, 13, 12, 13, 30, 41, 13, 4, 18, 4, 18, 13, 17, 41, 13, 20, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 18, 13, 13, 29, 13, 12, 13, 30, 11, 1, 41, 13, 17, 2, 13, 18, 13, 13, 1, 40, 13, 30, 4, 18, 18, 13, 13, 13, 23, 13, 12, 13, 30, 41, 13, 17, 42, 2, 40, 13, 17, 30, 41, 13, 4, 13, 41, 13, 18, 13, 17, 41, 13, 18, 13, 17, 41, 13, 20, 41, 13, 4, 13, 28, 13, 13, 30, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 273, 8 ], [ 273, 9 ], [ 9, 10 ], [ 9, 11 ], [ 273, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 16, 17 ], [ 17, 18 ], [ 16, 19 ], [ 19, 20 ], [ 20, 21 ], [ 273, 22 ], [ 22, 23 ], [ 22, 24 ], [ 24, 25 ], [ 25, 26 ], [ 26, 27 ], [ 27, 28 ], [ 26, 29 ], [ 29, 30 ], [ 30, 31 ], [ 273, 32 ], [ 32, 33 ], [ 32, 34 ], [ 34, 35 ], [ 35, 36 ], [ 36, 37 ], [ 37, 38 ], [ 273, 39 ], [ 39, 40 ], [ 39, 41 ], [ 41, 42 ], [ 42, 43 ], [ 42, 44 ], [ 41, 45 ], [ 45, 46 ], [ 45, 47 ], [ 45, 48 ], [ 48, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 41, 53 ], [ 53, 54 ], [ 54, 55 ], [ 53, 56 ], [ 41, 57 ], [ 57, 58 ], [ 58, 59 ], [ 59, 60 ], [ 59, 61 ], [ 57, 62 ], [ 62, 63 ], [ 62, 64 ], [ 64, 65 ], [ 65, 66 ], [ 57, 67 ], [ 67, 68 ], [ 68, 69 ], [ 57, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 71, 75 ], [ 75, 76 ], [ 76, 77 ], [ 75, 78 ], [ 41, 79 ], [ 79, 80 ], [ 39, 81 ], [ 81, 82 ], [ 273, 83 ], [ 83, 84 ], [ 83, 85 ], [ 85, 86 ], [ 86, 87 ], [ 86, 88 ], [ 85, 89 ], [ 89, 90 ], [ 89, 91 ], [ 89, 92 ], [ 92, 93 ], [ 93, 94 ], [ 94, 95 ], [ 93, 96 ], [ 85, 97 ], [ 97, 98 ], [ 98, 99 ], [ 97, 100 ], [ 97, 101 ], [ 101, 102 ], [ 102, 103 ], [ 85, 104 ], [ 104, 105 ], [ 105, 106 ], [ 106, 107 ], [ 106, 108 ], [ 104, 109 ], [ 109, 110 ], [ 109, 111 ], [ 111, 112 ], [ 112, 113 ], [ 104, 114 ], [ 114, 115 ], [ 115, 116 ], [ 104, 117 ], [ 117, 118 ], [ 118, 119 ], [ 119, 120 ], [ 119, 121 ], [ 118, 122 ], [ 122, 123 ], [ 123, 124 ], [ 122, 125 ], [ 85, 126 ], [ 126, 127 ], [ 83, 128 ], [ 128, 129 ], [ 273, 130 ], [ 130, 131 ], [ 130, 132 ], [ 132, 133 ], [ 133, 134 ], [ 133, 135 ], [ 135, 136 ], [ 136, 137 ], [ 137, 138 ], [ 138, 139 ], [ 135, 140 ], [ 132, 141 ], [ 141, 142 ], [ 141, 143 ], [ 144, 145 ], [ 144, 146 ], [ 132, 147 ], [ 147, 148 ], [ 148, 149 ], [ 149, 150 ], [ 149, 151 ], [ 147, 152 ], [ 152, 153 ], [ 152, 154 ], [ 154, 155 ], [ 154, 156 ], [ 147, 157 ], [ 157, 158 ], [ 158, 159 ], [ 147, 160 ], [ 160, 161 ], [ 161, 162 ], [ 162, 163 ], [ 162, 164 ], [ 161, 165 ], [ 165, 166 ], [ 166, 167 ], [ 165, 168 ], [ 168, 169 ], [ 168, 170 ], [ 132, 171 ], [ 171, 172 ], [ 273, 173 ], [ 173, 174 ], [ 173, 175 ], [ 175, 176 ], [ 176, 177 ], [ 177, 178 ], [ 178, 179 ], [ 178, 180 ], [ 176, 181 ], [ 181, 182 ], [ 181, 183 ], [ 183, 184 ], [ 183, 185 ], [ 176, 186 ], [ 186, 187 ], [ 187, 188 ], [ 176, 189 ], [ 189, 190 ], [ 190, 191 ], [ 191, 192 ], [ 192, 193 ], [ 192, 194 ], [ 190, 195 ], [ 173, 196 ], [ 196, 197 ], [ 273, 198 ], [ 198, 199 ], [ 198, 200 ], [ 200, 201 ], [ 201, 202 ], [ 201, 203 ], [ 200, 204 ], [ 204, 205 ], [ 205, 206 ], [ 206, 207 ], [ 205, 208 ], [ 204, 209 ], [ 209, 210 ], [ 210, 211 ], [ 210, 212 ], [ 212, 213 ], [ 209, 214 ], [ 214, 215 ], [ 214, 216 ], [ 216, 217 ], [ 216, 218 ], [ 209, 219 ], [ 219, 220 ], [ 219, 221 ], [ 221, 222 ], [ 221, 223 ], [ 209, 224 ], [ 224, 225 ], [ 224, 226 ], [ 209, 227 ], [ 227, 228 ], [ 227, 229 ], [ 229, 230 ], [ 209, 231 ], [ 231, 232 ], [ 231, 233 ], [ 231, 234 ], [ 234, 235 ], [ 235, 236 ], [ 236, 237 ], [ 235, 238 ], [ 209, 239 ], [ 239, 240 ], [ 240, 241 ], [ 239, 242 ], [ 209, 243 ], [ 243, 244 ], [ 243, 245 ], [ 209, 246 ], [ 246, 247 ], [ 247, 248 ], [ 248, 249 ], [ 248, 250 ], [ 246, 251 ], [ 251, 252 ], [ 251, 253 ], [ 246, 254 ], [ 254, 255 ], [ 255, 256 ], [ 246, 257 ], [ 257, 258 ], [ 258, 259 ], [ 258, 260 ], [ 260, 261 ], [ 261, 262 ], [ 260, 263 ], [ 209, 264 ], [ 264, 265 ], [ 265, 266 ], [ 266, 267 ], [ 266, 268 ], [ 264, 269 ], [ 198, 270 ], [ 270, 271 ], [ 0, 272 ], [ 272, 273 ], [ 272, 274 ] ]
[ "import java.io.*;\nimport java.util.*;\n\npublic class Main{\n\n\n\tstatic BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static int nextInt() throws IOException {\n\t\treturn Integer.parseInt(br.readLine());\n\t}\n\n\tpublic static long nextLong() throws IOException {\n\t\treturn Long.parseLong(br.readLine());\n\t}\n\n\tpublic static String next() throws IOException {\n\t\treturn br.readLine();\n\t}\n\n\tpublic static int[] sortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a);\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] desortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a, Collections.reverseOrder());\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] nextArr() throws IOException {\n\t\tString elements[] = br.readLine().split(\" \");\n\t\tint arr[] = new int[elements.length];\n\t\tfor (int j = 0; j < elements.length; j++)\n\t\t\tarr[j] = Integer.parseInt(elements[j]);\n\t\treturn arr;\n\t}\n\n\tpublic static void printArr(int arr[]) {\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr);\n\t}\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tint T = 1;\n\t\n\t\twhile (T-- > 0) {\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}\n\t}\n\n\n}", "import java.io.*;", "io.*", "java", "import java.util.*;", "util.*", "java", "public class Main{\n\n\n\tstatic BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static int nextInt() throws IOException {\n\t\treturn Integer.parseInt(br.readLine());\n\t}\n\n\tpublic static long nextLong() throws IOException {\n\t\treturn Long.parseLong(br.readLine());\n\t}\n\n\tpublic static String next() throws IOException {\n\t\treturn br.readLine();\n\t}\n\n\tpublic static int[] sortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a);\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] desortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a, Collections.reverseOrder());\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] nextArr() throws IOException {\n\t\tString elements[] = br.readLine().split(\" \");\n\t\tint arr[] = new int[elements.length];\n\t\tfor (int j = 0; j < elements.length; j++)\n\t\t\tarr[j] = Integer.parseInt(elements[j]);\n\t\treturn arr;\n\t}\n\n\tpublic static void printArr(int arr[]) {\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr);\n\t}\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tint T = 1;\n\t\n\t\twhile (T-- > 0) {\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}\n\t}\n\n\n}", "Main", "static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));", "br", "new BufferedReader(new InputStreamReader(System.in))", "public static int nextInt() throws IOException {\n\t\treturn Integer.parseInt(br.readLine());\n\t}", "nextInt", "{\n\t\treturn Integer.parseInt(br.readLine());\n\t}", "return Integer.parseInt(br.readLine());", "Integer.parseInt(br.readLine())", "Integer.parseInt", "Integer", "br.readLine()", "br.readLine", "br", "public static long nextLong() throws IOException {\n\t\treturn Long.parseLong(br.readLine());\n\t}", "nextLong", "{\n\t\treturn Long.parseLong(br.readLine());\n\t}", "return Long.parseLong(br.readLine());", "Long.parseLong(br.readLine())", "Long.parseLong", "Long", "br.readLine()", "br.readLine", "br", "public static String next() throws IOException {\n\t\treturn br.readLine();\n\t}", "next", "{\n\t\treturn br.readLine();\n\t}", "return br.readLine();", "br.readLine()", "br.readLine", "br", "public static int[] sortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a);\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}", "sortArr", "{\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a);\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}", "ArrayList<Integer> a = new ArrayList<Integer>();", "a", "new ArrayList<Integer>()", "for (int i : arr)\n\t\t\ta.add(i);", "int i", "arr", "a.add(i);", "a.add(i)", "a.add", "a", "i", "Collections.sort(a)", "Collections.sort", "Collections", "a", "for (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);", "int i = 0;", "int i = 0;", "i", "0", "i < a.size()", "i", "a.size()", "a.size", "a", "i++", "i++", "i", "arr[i] = a.get(i);", "arr[i] = a.get(i)", "arr[i]", "arr", "i", "a.get(i)", "a.get", "a", "i", "return arr;", "arr", "int arr[]", "arr", "public static int[] desortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a, Collections.reverseOrder());\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}", "desortArr", "{\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a, Collections.reverseOrder());\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}", "ArrayList<Integer> a = new ArrayList<Integer>();", "a", "new ArrayList<Integer>()", "for (int i : arr)\n\t\t\ta.add(i);", "int i", "arr", "a.add(i);", "a.add(i)", "a.add", "a", "i", "Collections.sort(a, Collections.reverseOrder())", "Collections.sort", "Collections", "a", "Collections.reverseOrder()", "Collections.reverseOrder", "Collections", "for (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);", "int i = 0;", "int i = 0;", "i", "0", "i < a.size()", "i", "a.size()", "a.size", "a", "i++", "i++", "i", "arr[i] = a.get(i);", "arr[i] = a.get(i)", "arr[i]", "arr", "i", "a.get(i)", "a.get", "a", "i", "return arr;", "arr", "int arr[]", "arr", "public static int[] nextArr() throws IOException {\n\t\tString elements[] = br.readLine().split(\" \");\n\t\tint arr[] = new int[elements.length];\n\t\tfor (int j = 0; j < elements.length; j++)\n\t\t\tarr[j] = Integer.parseInt(elements[j]);\n\t\treturn arr;\n\t}", "nextArr", "{\n\t\tString elements[] = br.readLine().split(\" \");\n\t\tint arr[] = new int[elements.length];\n\t\tfor (int j = 0; j < elements.length; j++)\n\t\t\tarr[j] = Integer.parseInt(elements[j]);\n\t\treturn arr;\n\t}", "String elements[] = br.readLine().split(\" \");", "elements", "br.readLine().split(\" \")", "br.readLine().split", "br.readLine()", "br.readLine", "br", "\" \"", "int arr[] = new int[elements.length];", "arr", "new int[elements.length]", "elements.length", "elements", "elements.length", "for (int j = 0; j < elements.length; j++)\n\t\t\tarr[j] = Integer.parseInt(elements[j]);", "int j = 0;", "int j = 0;", "j", "0", "j < elements.length", "j", "elements.length", "elements", "elements.length", "j++", "j++", "j", "arr[j] = Integer.parseInt(elements[j]);", "arr[j] = Integer.parseInt(elements[j])", "arr[j]", "arr", "j", "Integer.parseInt(elements[j])", "Integer.parseInt", "Integer", "elements[j]", "elements", "j", "return arr;", "arr", "public static void printArr(int arr[]) {\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr);\n\t}", "printArr", "{\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr);\n\t}", "for (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr);", "int i = 0;", "int i = 0;", "i", "0", "i < arr.length", "i", "arr.length", "arr", "arr.length", "i++", "i++", "i", "System.out.print(arr);", "System.out.print(arr)", "System.out.print", "System.out", "System", "System.out", "arr", "int arr[]", "arr", "public static void main(String[] args) throws IOException {\n\n\t\tint T = 1;\n\t\n\t\twhile (T-- > 0) {\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}\n\t}", "main", "{\n\n\t\tint T = 1;\n\t\n\t\twhile (T-- > 0) {\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}\n\t}", "int T = 1;", "T", "1", "while (T-- > 0) {\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}", "T-- > 0", "T--", "T", "0", "{\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}", "int input[] = nextArr();", "input", "nextArr()", "nextArr", "int n = input[0];", "n", "input[0]", "input", "0", "int k = input[1];", "k", "input[1]", "input", "1", "ArrayList<Integer> arr = new ArrayList<Integer>();", "arr", "new ArrayList<Integer>()", "int b[] = nextArr();", "b", "nextArr()", "nextArr", "for (int i : b)\n\t\t\t\tarr.add(i);", "int i", "b", "arr.add(i);", "arr.add(i)", "arr.add", "arr", "i", "Collections.sort(arr)", "Collections.sort", "Collections", "arr", "int ans = 0;", "ans", "0", "for (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "ans += arr.get(i);", "ans += arr.get(i)", "ans", "arr.get(i)", "arr.get", "arr", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main{\n\n\n\tstatic BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static int nextInt() throws IOException {\n\t\treturn Integer.parseInt(br.readLine());\n\t}\n\n\tpublic static long nextLong() throws IOException {\n\t\treturn Long.parseLong(br.readLine());\n\t}\n\n\tpublic static String next() throws IOException {\n\t\treturn br.readLine();\n\t}\n\n\tpublic static int[] sortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a);\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] desortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a, Collections.reverseOrder());\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] nextArr() throws IOException {\n\t\tString elements[] = br.readLine().split(\" \");\n\t\tint arr[] = new int[elements.length];\n\t\tfor (int j = 0; j < elements.length; j++)\n\t\t\tarr[j] = Integer.parseInt(elements[j]);\n\t\treturn arr;\n\t}\n\n\tpublic static void printArr(int arr[]) {\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr);\n\t}\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tint T = 1;\n\t\n\t\twhile (T-- > 0) {\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}\n\t}\n\n\n}", "public class Main{\n\n\n\tstatic BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic static int nextInt() throws IOException {\n\t\treturn Integer.parseInt(br.readLine());\n\t}\n\n\tpublic static long nextLong() throws IOException {\n\t\treturn Long.parseLong(br.readLine());\n\t}\n\n\tpublic static String next() throws IOException {\n\t\treturn br.readLine();\n\t}\n\n\tpublic static int[] sortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a);\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] desortArr(int arr[]) throws IOException {\n\t\tArrayList<Integer> a = new ArrayList<Integer>();\n\t\tfor (int i : arr)\n\t\t\ta.add(i);\n\n\t\tCollections.sort(a, Collections.reverseOrder());\n\n\t\tfor (int i = 0; i < a.size(); i++)\n\t\t\tarr[i] = a.get(i);\n\t\treturn arr;\n\t}\n\n\tpublic static int[] nextArr() throws IOException {\n\t\tString elements[] = br.readLine().split(\" \");\n\t\tint arr[] = new int[elements.length];\n\t\tfor (int j = 0; j < elements.length; j++)\n\t\t\tarr[j] = Integer.parseInt(elements[j]);\n\t\treturn arr;\n\t}\n\n\tpublic static void printArr(int arr[]) {\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tSystem.out.print(arr);\n\t}\n\n\tpublic static void main(String[] args) throws IOException {\n\n\t\tint T = 1;\n\t\n\t\twhile (T-- > 0) {\n\n\t\t\tint input[] = nextArr();\n\t\t\tint n = input[0];\n\t\t\tint k = input[1];\n\t\t\tArrayList<Integer> arr = new ArrayList<Integer>();\n\t\t\tint b[] = nextArr();\n\n\t\t\tfor (int i : b)\n\t\t\t\tarr.add(i);\n\t\t\tCollections.sort(arr);\n\n\t\t\tint ans = 0;\n\t\t\tfor (int i = 0; i < k; i++)\n\t\t\t\tans += arr.get(i);\n\t\t\tSystem.out.println(ans);\n\n\t\t}\n\t}\n\n\n}", "Main" ]
import java.io.*; import java.util.*; public class Main{ static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static int nextInt() throws IOException { return Integer.parseInt(br.readLine()); } public static long nextLong() throws IOException { return Long.parseLong(br.readLine()); } public static String next() throws IOException { return br.readLine(); } public static int[] sortArr(int arr[]) throws IOException { ArrayList<Integer> a = new ArrayList<Integer>(); for (int i : arr) a.add(i); Collections.sort(a); for (int i = 0; i < a.size(); i++) arr[i] = a.get(i); return arr; } public static int[] desortArr(int arr[]) throws IOException { ArrayList<Integer> a = new ArrayList<Integer>(); for (int i : arr) a.add(i); Collections.sort(a, Collections.reverseOrder()); for (int i = 0; i < a.size(); i++) arr[i] = a.get(i); return arr; } public static int[] nextArr() throws IOException { String elements[] = br.readLine().split(" "); int arr[] = new int[elements.length]; for (int j = 0; j < elements.length; j++) arr[j] = Integer.parseInt(elements[j]); return arr; } public static void printArr(int arr[]) { for (int i = 0; i < arr.length; i++) System.out.print(arr); } public static void main(String[] args) throws IOException { int T = 1; while (T-- > 0) { int input[] = nextArr(); int n = input[0]; int k = input[1]; ArrayList<Integer> arr = new ArrayList<Integer>(); int b[] = nextArr(); for (int i : b) arr.add(i); Collections.sort(arr); int ans = 0; for (int i = 0; i < k; i++) ans += arr.get(i); System.out.println(ans); } } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 41, 13, 0, 13, 4, 18, 13, 0, 13, 4, 18, 13, 41, 13, 20, 41, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 4, 18, 13, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 88, 5 ], [ 88, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 8, 14 ], [ 14, 15 ], [ 8, 16 ], [ 16, 17 ], [ 16, 18 ], [ 18, 19 ], [ 19, 20 ], [ 8, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 8, 26 ], [ 26, 27 ], [ 26, 28 ], [ 8, 29 ], [ 29, 30 ], [ 8, 31 ], [ 31, 32 ], [ 32, 33 ], [ 33, 34 ], [ 33, 35 ], [ 31, 36 ], [ 36, 37 ], [ 36, 38 ], [ 31, 39 ], [ 39, 40 ], [ 40, 41 ], [ 31, 42 ], [ 43, 43 ], [ 43, 44 ], [ 44, 45 ], [ 44, 46 ], [ 46, 47 ], [ 47, 48 ], [ 43, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 53, 56 ], [ 8, 57 ], [ 57, 58 ], [ 57, 59 ], [ 8, 60 ], [ 60, 61 ], [ 61, 62 ], [ 62, 63 ], [ 62, 64 ], [ 60, 65 ], [ 65, 66 ], [ 65, 67 ], [ 60, 68 ], [ 68, 69 ], [ 69, 70 ], [ 60, 71 ], [ 72, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 75, 76 ], [ 76, 77 ], [ 75, 78 ], [ 8, 79 ], [ 79, 80 ], [ 80, 81 ], [ 81, 82 ], [ 81, 83 ], [ 79, 84 ], [ 6, 85 ], [ 85, 86 ], [ 0, 87 ], [ 87, 88 ], [ 87, 89 ] ]
[ "import java.util.*;\n\npublic class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int n,k;\n n = scanner.nextInt();\n k = scanner.nextInt();\n \n ArrayList<Integer> p = new ArrayList<Integer>();\n \n int x;\n for(int i = 0;i < n ; i++) { \n x = scanner.nextInt();\n p.add(x);\n }\n \n Collections.sort(p);\n \n int ans = 0;\n for(int i = 0; i < k;i++) { \n ans+=p.get(i);\n }\n \n System.out.println(ans);\n}\n}", "import java.util.*;", "util.*", "java", "public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int n,k;\n n = scanner.nextInt();\n k = scanner.nextInt();\n \n ArrayList<Integer> p = new ArrayList<Integer>();\n \n int x;\n for(int i = 0;i < n ; i++) { \n x = scanner.nextInt();\n p.add(x);\n }\n \n Collections.sort(p);\n \n int ans = 0;\n for(int i = 0; i < k;i++) { \n ans+=p.get(i);\n }\n \n System.out.println(ans);\n}\n}", "Main", "public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int n,k;\n n = scanner.nextInt();\n k = scanner.nextInt();\n \n ArrayList<Integer> p = new ArrayList<Integer>();\n \n int x;\n for(int i = 0;i < n ; i++) { \n x = scanner.nextInt();\n p.add(x);\n }\n \n Collections.sort(p);\n \n int ans = 0;\n for(int i = 0; i < k;i++) { \n ans+=p.get(i);\n }\n \n System.out.println(ans);\n}", "main", "{\n Scanner scanner = new Scanner(System.in);\n int n,k;\n n = scanner.nextInt();\n k = scanner.nextInt();\n \n ArrayList<Integer> p = new ArrayList<Integer>();\n \n int x;\n for(int i = 0;i < n ; i++) { \n x = scanner.nextInt();\n p.add(x);\n }\n \n Collections.sort(p);\n \n int ans = 0;\n for(int i = 0; i < k;i++) { \n ans+=p.get(i);\n }\n \n System.out.println(ans);\n}", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "int n", "n", "k;", "k", "n = scanner.nextInt()", "n", "scanner.nextInt()", "scanner.nextInt", "scanner", "k = scanner.nextInt()", "k", "scanner.nextInt()", "scanner.nextInt", "scanner", "ArrayList<Integer> p = new ArrayList<Integer>();", "p", "new ArrayList<Integer>()", "int x;", "x", "for(int i = 0;i < n ; i++) { \n x = scanner.nextInt();\n p.add(x);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{ \n x = scanner.nextInt();\n p.add(x);\n }", "{ \n x = scanner.nextInt();\n p.add(x);\n }", "x = scanner.nextInt()", "x", "scanner.nextInt()", "scanner.nextInt", "scanner", "p.add(x)", "p.add", "p", "x", "Collections.sort(p)", "Collections.sort", "Collections", "p", "int ans = 0;", "ans", "0", "for(int i = 0; i < k;i++) { \n ans+=p.get(i);\n }", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{ \n ans+=p.get(i);\n }", "{ \n ans+=p.get(i);\n }", "ans+=p.get(i)", "ans", "p.get(i)", "p.get", "p", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String args[]", "args", "public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int n,k;\n n = scanner.nextInt();\n k = scanner.nextInt();\n \n ArrayList<Integer> p = new ArrayList<Integer>();\n \n int x;\n for(int i = 0;i < n ; i++) { \n x = scanner.nextInt();\n p.add(x);\n }\n \n Collections.sort(p);\n \n int ans = 0;\n for(int i = 0; i < k;i++) { \n ans+=p.get(i);\n }\n \n System.out.println(ans);\n}\n}", "public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\n int n,k;\n n = scanner.nextInt();\n k = scanner.nextInt();\n \n ArrayList<Integer> p = new ArrayList<Integer>();\n \n int x;\n for(int i = 0;i < n ; i++) { \n x = scanner.nextInt();\n p.add(x);\n }\n \n Collections.sort(p);\n \n int ans = 0;\n for(int i = 0; i < k;i++) { \n ans+=p.get(i);\n }\n \n System.out.println(ans);\n}\n}", "Main" ]
import java.util.*; public class Main { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int n,k; n = scanner.nextInt(); k = scanner.nextInt(); ArrayList<Integer> p = new ArrayList<Integer>(); int x; for(int i = 0;i < n ; i++) { x = scanner.nextInt(); p.add(x); } Collections.sort(p); int ans = 0; for(int i = 0; i < k;i++) { ans+=p.get(i); } System.out.println(ans); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 17, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 80, 5 ], [ 80, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 46, 48 ], [ 8, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 8, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 6, 77 ], [ 77, 78 ], [ 0, 79 ], [ 79, 80 ], [ 79, 81 ] ]
[ "import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for(int i=0; i<N; i++){\n A[i]=sc.nextInt();\n }\n int res=0;\n Arrays.sort(A);\n for(int i=0; i<K; i++){\n res += A[i];\n }\n System.out.println(res);\n }\n }", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for(int i=0; i<N; i++){\n A[i]=sc.nextInt();\n }\n int res=0;\n Arrays.sort(A);\n for(int i=0; i<K; i++){\n res += A[i];\n }\n System.out.println(res);\n }\n }", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for(int i=0; i<N; i++){\n A[i]=sc.nextInt();\n }\n int res=0;\n Arrays.sort(A);\n for(int i=0; i<K; i++){\n res += A[i];\n }\n System.out.println(res);\n }", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for(int i=0; i<N; i++){\n A[i]=sc.nextInt();\n }\n int res=0;\n Arrays.sort(A);\n for(int i=0; i<K; i++){\n res += A[i];\n }\n System.out.println(res);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] A = new int[N];", "A", "new int[N]", "N", "for(int i=0; i<N; i++){\n A[i]=sc.nextInt();\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n A[i]=sc.nextInt();\n }", "{\n A[i]=sc.nextInt();\n }", "A[i]=sc.nextInt()", "A[i]", "A", "i", "sc.nextInt()", "sc.nextInt", "sc", "int res=0;", "res", "0", "Arrays.sort(A)", "Arrays.sort", "Arrays", "A", "for(int i=0; i<K; i++){\n res += A[i];\n }", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n res += A[i];\n }", "{\n res += A[i];\n }", "res += A[i]", "res", "A[i]", "A", "i", "System.out.println(res)", "System.out.println", "System.out", "System", "System.out", "res", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for(int i=0; i<N; i++){\n A[i]=sc.nextInt();\n }\n int res=0;\n Arrays.sort(A);\n for(int i=0; i<K; i++){\n res += A[i];\n }\n System.out.println(res);\n }\n }", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for(int i=0; i<N; i++){\n A[i]=sc.nextInt();\n }\n int res=0;\n Arrays.sort(A);\n for(int i=0; i<K; i++){\n res += A[i];\n }\n System.out.println(res);\n }\n }", "Main" ]
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] A = new int[N]; for(int i=0; i<N; i++){ A[i]=sc.nextInt(); } int res=0; Arrays.sort(A); for(int i=0; i<K; i++){ res += A[i]; } System.out.println(res); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 83, 8 ], [ 83, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 9, 80 ], [ 80, 81 ], [ 0, 82 ], [ 82, 83 ], [ 82, 84 ] ]
[ "import java.util.*;\nimport java.io.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\tint N = sc.nextInt(), K = sc.nextInt();\n\t\tint[] A = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(A);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += A[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\tint N = sc.nextInt(), K = sc.nextInt();\n\t\tint[] A = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(A);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += A[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\tint N = sc.nextInt(), K = sc.nextInt();\n\t\tint[] A = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(A);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += A[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "main", "{\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\tint N = sc.nextInt(), K = sc.nextInt();\n\t\tint[] A = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(A);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += A[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}", "Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));", "sc", "new Scanner(new BufferedReader(new InputStreamReader(System.in)))", "int N = sc.nextInt()", "N", "sc.nextInt()", "sc.nextInt", "sc", "K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "int[] A = new int[N];", "A", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n\t\t\tA[i] = sc.nextInt();\n\t\t}", "{\n\t\t\tA[i] = sc.nextInt();\n\t\t}", "A[i] = sc.nextInt()", "A[i]", "A", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(A)", "Arrays.sort", "Arrays", "A", "int ans = 0;", "ans", "0", "for (int i = 0; i < K; i++) {\n\t\t\tans += A[i];\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "{\n\t\t\tans += A[i];\n\t\t}", "{\n\t\t\tans += A[i];\n\t\t}", "ans += A[i]", "ans", "A[i]", "A", "i", "System.out.println(ans)", "System.out.println", "System.out", "System", "System.out", "ans", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\tint N = sc.nextInt(), K = sc.nextInt();\n\t\tint[] A = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(A);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += A[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n\t\tint N = sc.nextInt(), K = sc.nextInt();\n\t\tint[] A = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tA[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(A);\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += A[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}", "Main" ]
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); int N = sc.nextInt(), K = sc.nextInt(); int[] A = new int[N]; for (int i = 0; i < N; i++) { A[i] = sc.nextInt(); } Arrays.sort(A); int ans = 0; for (int i = 0; i < K; i++) { ans += A[i]; } System.out.println(ans); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 41, 13, 4, 18, 4, 18, 4, 18, 4, 18, 13, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 71, 8 ], [ 71, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 49, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 57, 60 ], [ 53, 61 ], [ 11, 62 ], [ 62, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 62, 67 ], [ 9, 68 ], [ 68, 69 ], [ 0, 70 ], [ 70, 71 ], [ 70, 72 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n \n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n final int N = sc.nextInt();\n final int K = sc.nextInt();\n \n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n \n int answer = Arrays.stream(p).sorted().limit(K).sum();\n \n System.out.println(answer);\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n \n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n final int N = sc.nextInt();\n final int K = sc.nextInt();\n \n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n \n int answer = Arrays.stream(p).sorted().limit(K).sum();\n \n System.out.println(answer);\n }\n}", "Main", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n final int N = sc.nextInt();\n final int K = sc.nextInt();\n \n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n \n int answer = Arrays.stream(p).sorted().limit(K).sum();\n \n System.out.println(answer);\n }", "main", "{\n Scanner sc = new Scanner(System.in);\n \n final int N = sc.nextInt();\n final int K = sc.nextInt();\n \n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n \n int answer = Arrays.stream(p).sorted().limit(K).sum();\n \n System.out.println(answer);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "final int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "final int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "final int[] p = new int[N];", "p", "new int[N]", "N", "for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }", "int i = 0;", "int i = 0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "{\n p[i] = sc.nextInt();\n }", "{\n p[i] = sc.nextInt();\n }", "p[i] = sc.nextInt()", "p[i]", "p", "i", "sc.nextInt()", "sc.nextInt", "sc", "int answer = Arrays.stream(p).sorted().limit(K).sum();", "answer", "Arrays.stream(p).sorted().limit(K).sum()", "Arrays.stream(p).sorted().limit(K).sum", "Arrays.stream(p).sorted().limit(K)", "Arrays.stream(p).sorted().limit", "Arrays.stream(p).sorted()", "Arrays.stream(p).sorted", "Arrays.stream(p)", "Arrays.stream", "Arrays", "p", "K", "System.out.println(answer)", "System.out.println", "System.out", "System", "System.out", "answer", "String[] args", "args", "public class Main {\n \n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n final int N = sc.nextInt();\n final int K = sc.nextInt();\n \n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n \n int answer = Arrays.stream(p).sorted().limit(K).sum();\n \n System.out.println(answer);\n }\n}", "public class Main {\n \n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n final int N = sc.nextInt();\n final int K = sc.nextInt();\n \n final int[] p = new int[N];\n for (int i = 0; i < N; i++) {\n p[i] = sc.nextInt();\n }\n \n int answer = Arrays.stream(p).sorted().limit(K).sum();\n \n System.out.println(answer);\n }\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int K = sc.nextInt(); final int[] p = new int[N]; for (int i = 0; i < N; i++) { p[i] = sc.nextInt(); } int answer = Arrays.stream(p).sorted().limit(K).sum(); System.out.println(answer); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 4, 18, 13, 4, 18, 13, 4, 18, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 4, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 79, 5 ], [ 79, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 25 ], [ 25, 26 ], [ 25, 27 ], [ 8, 28 ], [ 28, 29 ], [ 29, 30 ], [ 30, 31 ], [ 30, 32 ], [ 28, 33 ], [ 33, 34 ], [ 33, 35 ], [ 28, 36 ], [ 36, 37 ], [ 37, 38 ], [ 28, 39 ], [ 40, 40 ], [ 40, 41 ], [ 41, 42 ], [ 42, 43 ], [ 41, 44 ], [ 44, 45 ], [ 45, 46 ], [ 8, 47 ], [ 47, 48 ], [ 48, 49 ], [ 47, 50 ], [ 8, 51 ], [ 51, 52 ], [ 52, 53 ], [ 53, 54 ], [ 53, 55 ], [ 51, 56 ], [ 56, 57 ], [ 56, 58 ], [ 51, 59 ], [ 59, 60 ], [ 60, 61 ], [ 51, 62 ], [ 63, 63 ], [ 63, 64 ], [ 64, 65 ], [ 64, 66 ], [ 66, 67 ], [ 67, 68 ], [ 66, 69 ], [ 8, 70 ], [ 70, 71 ], [ 71, 72 ], [ 72, 73 ], [ 72, 74 ], [ 70, 75 ], [ 6, 76 ], [ 76, 77 ], [ 0, 78 ], [ 78, 79 ], [ 78, 80 ] ]
[ "import java.util.*;\n \npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tint sum=0;\n \n\t\tfor(int i=0; i<N; i++){\n\t\t\tp.add(sc.nextInt());\n }\n\t\tp.sort(null);\n\t\tfor(int i=0; i<K; i++){\n\t\t\tsum += p.get(i);\n }\n\t\tSystem.out.println(sum);\n }\n}", "import java.util.*;", "util.*", "java", "public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tint sum=0;\n \n\t\tfor(int i=0; i<N; i++){\n\t\t\tp.add(sc.nextInt());\n }\n\t\tp.sort(null);\n\t\tfor(int i=0; i<K; i++){\n\t\t\tsum += p.get(i);\n }\n\t\tSystem.out.println(sum);\n }\n}", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tint sum=0;\n \n\t\tfor(int i=0; i<N; i++){\n\t\t\tp.add(sc.nextInt());\n }\n\t\tp.sort(null);\n\t\tfor(int i=0; i<K; i++){\n\t\t\tsum += p.get(i);\n }\n\t\tSystem.out.println(sum);\n }", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tint sum=0;\n \n\t\tfor(int i=0; i<N; i++){\n\t\t\tp.add(sc.nextInt());\n }\n\t\tp.sort(null);\n\t\tfor(int i=0; i<K; i++){\n\t\t\tsum += p.get(i);\n }\n\t\tSystem.out.println(sum);\n }", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int N = sc.nextInt();", "N", "sc.nextInt()", "sc.nextInt", "sc", "int K = sc.nextInt();", "K", "sc.nextInt()", "sc.nextInt", "sc", "ArrayList<Integer> p = new ArrayList<Integer>();", "p", "new ArrayList<Integer>()", "int sum=0;", "sum", "0", "for(int i=0; i<N; i++){\n\t\t\tp.add(sc.nextInt());\n }", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n\t\t\tp.add(sc.nextInt());\n }", "{\n\t\t\tp.add(sc.nextInt());\n }", "p.add(sc.nextInt())", "p.add", "p", "sc.nextInt()", "sc.nextInt", "sc", "p.sort(null)", "p.sort", "p", "null", "for(int i=0; i<K; i++){\n\t\t\tsum += p.get(i);\n }", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n\t\t\tsum += p.get(i);\n }", "{\n\t\t\tsum += p.get(i);\n }", "sum += p.get(i)", "sum", "p.get(i)", "p.get", "p", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String[] args", "args", "public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tint sum=0;\n \n\t\tfor(int i=0; i<N; i++){\n\t\t\tp.add(sc.nextInt());\n }\n\t\tp.sort(null);\n\t\tfor(int i=0; i<K; i++){\n\t\t\tsum += p.get(i);\n }\n\t\tSystem.out.println(sum);\n }\n}", "public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tint sum=0;\n \n\t\tfor(int i=0; i<N; i++){\n\t\t\tp.add(sc.nextInt());\n }\n\t\tp.sort(null);\n\t\tfor(int i=0; i<K; i++){\n\t\t\tsum += p.get(i);\n }\n\t\tSystem.out.println(sum);\n }\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); ArrayList<Integer> p = new ArrayList<Integer>(); int sum=0; for(int i=0; i<N; i++){ p.add(sc.nextInt()); } p.sort(null); for(int i=0; i<K; i++){ sum += p.get(i); } System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 86, 8 ], [ 86, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 11, 80 ], [ 80, 81 ], [ 81, 82 ], [ 9, 83 ], [ 83, 84 ], [ 0, 85 ], [ 85, 86 ], [ 85, 87 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int len = scanner.nextInt();\n int choose = scanner.nextInt();\n int[] prices = new int[len];\n\n for(int index = 0; index < len; index++ ){\n prices[index] = scanner.nextInt();\n }\n\n Arrays.sort(prices);\n int sum = 0;\n for(int index = 0; index < choose; index++ ){\n sum += prices[index];\n }\n System.out.println(sum);\n scanner.close();\n }\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int len = scanner.nextInt();\n int choose = scanner.nextInt();\n int[] prices = new int[len];\n\n for(int index = 0; index < len; index++ ){\n prices[index] = scanner.nextInt();\n }\n\n Arrays.sort(prices);\n int sum = 0;\n for(int index = 0; index < choose; index++ ){\n sum += prices[index];\n }\n System.out.println(sum);\n scanner.close();\n }\n}", "Main", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int len = scanner.nextInt();\n int choose = scanner.nextInt();\n int[] prices = new int[len];\n\n for(int index = 0; index < len; index++ ){\n prices[index] = scanner.nextInt();\n }\n\n Arrays.sort(prices);\n int sum = 0;\n for(int index = 0; index < choose; index++ ){\n sum += prices[index];\n }\n System.out.println(sum);\n scanner.close();\n }", "main", "{\n Scanner scanner = new Scanner(System.in);\n int len = scanner.nextInt();\n int choose = scanner.nextInt();\n int[] prices = new int[len];\n\n for(int index = 0; index < len; index++ ){\n prices[index] = scanner.nextInt();\n }\n\n Arrays.sort(prices);\n int sum = 0;\n for(int index = 0; index < choose; index++ ){\n sum += prices[index];\n }\n System.out.println(sum);\n scanner.close();\n }", "Scanner scanner = new Scanner(System.in);", "scanner", "new Scanner(System.in)", "int len = scanner.nextInt();", "len", "scanner.nextInt()", "scanner.nextInt", "scanner", "int choose = scanner.nextInt();", "choose", "scanner.nextInt()", "scanner.nextInt", "scanner", "int[] prices = new int[len];", "prices", "new int[len]", "len", "for(int index = 0; index < len; index++ ){\n prices[index] = scanner.nextInt();\n }", "int index = 0;", "int index = 0;", "index", "0", "index < len", "index", "len", "index++", "index++", "index", "{\n prices[index] = scanner.nextInt();\n }", "{\n prices[index] = scanner.nextInt();\n }", "prices[index] = scanner.nextInt()", "prices[index]", "prices", "index", "scanner.nextInt()", "scanner.nextInt", "scanner", "Arrays.sort(prices)", "Arrays.sort", "Arrays", "prices", "int sum = 0;", "sum", "0", "for(int index = 0; index < choose; index++ ){\n sum += prices[index];\n }", "int index = 0;", "int index = 0;", "index", "0", "index < choose", "index", "choose", "index++", "index++", "index", "{\n sum += prices[index];\n }", "{\n sum += prices[index];\n }", "sum += prices[index]", "sum", "prices[index]", "prices", "index", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "scanner.close()", "scanner.close", "scanner", "String[] args", "args", "public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int len = scanner.nextInt();\n int choose = scanner.nextInt();\n int[] prices = new int[len];\n\n for(int index = 0; index < len; index++ ){\n prices[index] = scanner.nextInt();\n }\n\n Arrays.sort(prices);\n int sum = 0;\n for(int index = 0; index < choose; index++ ){\n sum += prices[index];\n }\n System.out.println(sum);\n scanner.close();\n }\n}", "public class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int len = scanner.nextInt();\n int choose = scanner.nextInt();\n int[] prices = new int[len];\n\n for(int index = 0; index < len; index++ ){\n prices[index] = scanner.nextInt();\n }\n\n Arrays.sort(prices);\n int sum = 0;\n for(int index = 0; index < choose; index++ ){\n sum += prices[index];\n }\n System.out.println(sum);\n scanner.close();\n }\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int len = scanner.nextInt(); int choose = scanner.nextInt(); int[] prices = new int[len]; for(int index = 0; index < len; index++ ){ prices[index] = scanner.nextInt(); } Arrays.sort(prices); int sum = 0; for(int index = 0; index < choose; index++ ){ sum += prices[index]; } System.out.println(sum); scanner.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 20, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 4, 18, 13, 4, 18, 13, 41, 13, 20, 41, 13, 20, 13, 0, 13, 20, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 7, 8 ], [ 7, 9 ], [ 0, 10 ], [ 102, 11 ], [ 102, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 15, 17 ], [ 14, 18 ], [ 18, 19 ], [ 18, 20 ], [ 14, 21 ], [ 21, 22 ], [ 21, 23 ], [ 23, 24 ], [ 24, 25 ], [ 23, 26 ], [ 26, 27 ], [ 27, 28 ], [ 14, 29 ], [ 29, 30 ], [ 29, 31 ], [ 31, 32 ], [ 32, 33 ], [ 31, 34 ], [ 34, 35 ], [ 35, 36 ], [ 14, 37 ], [ 37, 38 ], [ 37, 39 ], [ 14, 40 ], [ 40, 41 ], [ 40, 42 ], [ 14, 44 ], [ 44, 45 ], [ 44, 46 ], [ 14, 47 ], [ 47, 48 ], [ 48, 49 ], [ 49, 50 ], [ 49, 51 ], [ 47, 52 ], [ 52, 53 ], [ 52, 54 ], [ 47, 55 ], [ 55, 56 ], [ 56, 57 ], [ 47, 58 ], [ 58, 59 ], [ 59, 60 ], [ 60, 61 ], [ 60, 62 ], [ 59, 63 ], [ 63, 64 ], [ 64, 65 ], [ 63, 66 ], [ 66, 67 ], [ 67, 68 ], [ 14, 69 ], [ 69, 70 ], [ 70, 71 ], [ 69, 72 ], [ 14, 73 ], [ 73, 74 ], [ 73, 75 ], [ 14, 76 ], [ 76, 77 ], [ 77, 78 ], [ 78, 79 ], [ 78, 80 ], [ 76, 81 ], [ 81, 82 ], [ 81, 83 ], [ 76, 84 ], [ 84, 85 ], [ 85, 86 ], [ 76, 87 ], [ 87, 88 ], [ 88, 89 ], [ 88, 90 ], [ 90, 91 ], [ 90, 92 ], [ 14, 93 ], [ 93, 94 ], [ 94, 95 ], [ 95, 96 ], [ 95, 97 ], [ 93, 98 ], [ 12, 99 ], [ 99, 100 ], [ 0, 101 ], [ 101, 102 ], [ 101, 103 ] ]
[ "/*\nIf you want to aim high, aim high\nDon't let that studying and grades consume you\nJust live life young\n******************************\nWhat do you think? What do you think?\n1st on Billboard, what do you think of it\nNext is a Grammy, what do you think of it\nHowever you think, I’m sorry, but shit, I have no fcking interest\n*******************************\nI'm standing on top of my Monopoly board\nThat means I'm on top of my game and it don't stop\ntil my hip don't hop anymore\nhttps://www.a2oj.com/Ladder16.html\n*******************************\n300iq as writer = Sad!\n*/\nimport java.util.*;\nimport java.io.*;\nimport java.math.*;\n\n public class Main\n {\n public static void main(String hi[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(infile.readLine());\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n StringBuilder sb = new StringBuilder();\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n Arrays.sort(arr);\n long sum = 0L;\n for(int i=0; i < K; i++)\n sum += arr[i];\n System.out.println(sum);\n }\n }", "import java.util.*;", "util.*", "java", "import java.io.*;", "io.*", "java", "import java.math.*;", "math.*", "java", "public class Main\n {\n public static void main(String hi[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(infile.readLine());\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n StringBuilder sb = new StringBuilder();\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n Arrays.sort(arr);\n long sum = 0L;\n for(int i=0; i < K; i++)\n sum += arr[i];\n System.out.println(sum);\n }\n }", "Main", "public static void main(String hi[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(infile.readLine());\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n StringBuilder sb = new StringBuilder();\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n Arrays.sort(arr);\n long sum = 0L;\n for(int i=0; i < K; i++)\n sum += arr[i];\n System.out.println(sum);\n }", "main", "{\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(infile.readLine());\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n StringBuilder sb = new StringBuilder();\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n Arrays.sort(arr);\n long sum = 0L;\n for(int i=0; i < K; i++)\n sum += arr[i];\n System.out.println(sum);\n }", "BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));", "infile", "new BufferedReader(new InputStreamReader(System.in))", "StringTokenizer st = new StringTokenizer(infile.readLine());", "st", "new StringTokenizer(infile.readLine())", "int N = Integer.parseInt(st.nextToken());", "N", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "int K = Integer.parseInt(st.nextToken());", "K", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "StringBuilder sb = new StringBuilder();", "sb", "new StringBuilder()", "int[] arr = new int[N];", "arr", "new int[N]", "N", "st = new StringTokenizer(infile.readLine())", "st", "new StringTokenizer(infile.readLine())", "for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());", "int i=0;", "int i=0;", "i", "0", "i < N", "i", "N", "i++", "i++", "i", "arr[i] = Integer.parseInt(st.nextToken());", "arr[i] = Integer.parseInt(st.nextToken())", "arr[i]", "arr", "i", "Integer.parseInt(st.nextToken())", "Integer.parseInt", "Integer", "st.nextToken()", "st.nextToken", "st", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "long sum = 0L;", "sum", "0L", "for(int i=0; i < K; i++)\n sum += arr[i];", "int i=0;", "int i=0;", "i", "0", "i < K", "i", "K", "i++", "i++", "i", "sum += arr[i];", "sum += arr[i]", "sum", "arr[i]", "arr", "i", "System.out.println(sum)", "System.out.println", "System.out", "System", "System.out", "sum", "String hi[]", "hi", "public class Main\n {\n public static void main(String hi[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(infile.readLine());\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n StringBuilder sb = new StringBuilder();\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n Arrays.sort(arr);\n long sum = 0L;\n for(int i=0; i < K; i++)\n sum += arr[i];\n System.out.println(sum);\n }\n }", "public class Main\n {\n public static void main(String hi[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(infile.readLine());\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n StringBuilder sb = new StringBuilder();\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n Arrays.sort(arr);\n long sum = 0L;\n for(int i=0; i < K; i++)\n sum += arr[i];\n System.out.println(sum);\n }\n }", "Main" ]
/* If you want to aim high, aim high Don't let that studying and grades consume you Just live life young ****************************** What do you think? What do you think? 1st on Billboard, what do you think of it Next is a Grammy, what do you think of it However you think, I’m sorry, but shit, I have no fcking interest ******************************* I'm standing on top of my Monopoly board That means I'm on top of my game and it don't stop til my hip don't hop anymore https://www.a2oj.com/Ladder16.html ******************************* 300iq as writer = Sad! */ import java.util.*; import java.io.*; import java.math.*; public class Main { public static void main(String hi[]) throws Exception { BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(infile.readLine()); int N = Integer.parseInt(st.nextToken()); int K = Integer.parseInt(st.nextToken()); StringBuilder sb = new StringBuilder(); int[] arr = new int[N]; st = new StringTokenizer(infile.readLine()); for(int i=0; i < N; i++) arr[i] = Integer.parseInt(st.nextToken()); Arrays.sort(arr); long sum = 0L; for(int i=0; i < K; i++) sum += arr[i]; System.out.println(sum); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 86, 8 ], [ 86, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 29, 31 ], [ 11, 32 ], [ 32, 33 ], [ 33, 34 ], [ 34, 35 ], [ 34, 36 ], [ 32, 37 ], [ 37, 38 ], [ 37, 39 ], [ 32, 40 ], [ 40, 41 ], [ 41, 42 ], [ 32, 43 ], [ 44, 44 ], [ 44, 45 ], [ 45, 46 ], [ 46, 47 ], [ 46, 48 ], [ 45, 49 ], [ 49, 50 ], [ 50, 51 ], [ 11, 52 ], [ 52, 53 ], [ 53, 54 ], [ 52, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 75, 76 ], [ 76, 77 ], [ 76, 78 ], [ 74, 79 ], [ 11, 80 ], [ 80, 81 ], [ 81, 82 ], [ 9, 83 ], [ 83, 84 ], [ 0, 85 ], [ 85, 86 ], [ 85, 87 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint[] price = new int[N];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}\n\n\t\tArrays.sort(price);\n\n\t\tfor(int i=0;i<K;i++) {\n\t\t\ttotal += price[i];\n\t\t}\n\n\t\tSystem.out.println(total);\n\t\tstdIn.close();\n\t}\n\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint[] price = new int[N];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}\n\n\t\tArrays.sort(price);\n\n\t\tfor(int i=0;i<K;i++) {\n\t\t\ttotal += price[i];\n\t\t}\n\n\t\tSystem.out.println(total);\n\t\tstdIn.close();\n\t}\n\n}", "Main", "public static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint[] price = new int[N];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}\n\n\t\tArrays.sort(price);\n\n\t\tfor(int i=0;i<K;i++) {\n\t\t\ttotal += price[i];\n\t\t}\n\n\t\tSystem.out.println(total);\n\t\tstdIn.close();\n\t}", "main", "{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint[] price = new int[N];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}\n\n\t\tArrays.sort(price);\n\n\t\tfor(int i=0;i<K;i++) {\n\t\t\ttotal += price[i];\n\t\t}\n\n\t\tSystem.out.println(total);\n\t\tstdIn.close();\n\t}", "Scanner stdIn = new Scanner(System.in);", "stdIn", "new Scanner(System.in)", "int N = stdIn.nextInt();", "N", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "int K = stdIn.nextInt();", "K", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "int[] price = new int[N];", "price", "new int[N]", "N", "int total = 0;", "total", "0", "for(int i=0;i<N;i++) {\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<N", "i", "N", "i++", "i++", "i", "{\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}", "{\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}", "price[i] = stdIn.nextInt()", "price[i]", "price", "i", "stdIn.nextInt()", "stdIn.nextInt", "stdIn", "Arrays.sort(price)", "Arrays.sort", "Arrays", "price", "for(int i=0;i<K;i++) {\n\t\t\ttotal += price[i];\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<K", "i", "K", "i++", "i++", "i", "{\n\t\t\ttotal += price[i];\n\t\t}", "{\n\t\t\ttotal += price[i];\n\t\t}", "total += price[i]", "total", "price[i]", "price", "i", "System.out.println(total)", "System.out.println", "System.out", "System", "System.out", "total", "stdIn.close()", "stdIn.close", "stdIn", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint[] price = new int[N];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}\n\n\t\tArrays.sort(price);\n\n\t\tfor(int i=0;i<K;i++) {\n\t\t\ttotal += price[i];\n\t\t}\n\n\t\tSystem.out.println(total);\n\t\tstdIn.close();\n\t}\n\n}", "public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint K = stdIn.nextInt();\n\t\tint[] price = new int[N];\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tprice[i] = stdIn.nextInt();\n\t\t}\n\n\t\tArrays.sort(price);\n\n\t\tfor(int i=0;i<K;i++) {\n\t\t\ttotal += price[i];\n\t\t}\n\n\t\tSystem.out.println(total);\n\t\tstdIn.close();\n\t}\n\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int N = stdIn.nextInt(); int K = stdIn.nextInt(); int[] price = new int[N]; int total = 0; for(int i=0;i<N;i++) { price[i] = stdIn.nextInt(); } Arrays.sort(price); for(int i=0;i<K;i++) { total += price[i]; } System.out.println(total); stdIn.close(); } }
[ 7, 15, 13, 17, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 13, 13, 23, 13, 12, 13, 30, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 0, 7 ], [ 91, 8 ], [ 91, 9 ], [ 9, 10 ], [ 9, 11 ], [ 11, 12 ], [ 12, 13 ], [ 12, 14 ], [ 11, 15 ], [ 15, 16 ], [ 15, 17 ], [ 17, 18 ], [ 18, 19 ], [ 11, 20 ], [ 20, 21 ], [ 20, 22 ], [ 22, 23 ], [ 23, 24 ], [ 11, 25 ], [ 25, 26 ], [ 25, 27 ], [ 11, 29 ], [ 29, 30 ], [ 30, 31 ], [ 31, 32 ], [ 31, 33 ], [ 29, 34 ], [ 34, 35 ], [ 34, 36 ], [ 29, 37 ], [ 37, 38 ], [ 38, 39 ], [ 29, 40 ], [ 41, 41 ], [ 41, 42 ], [ 42, 43 ], [ 43, 44 ], [ 43, 45 ], [ 42, 46 ], [ 46, 47 ], [ 47, 48 ], [ 11, 49 ], [ 49, 50 ], [ 50, 51 ], [ 49, 52 ], [ 11, 53 ], [ 53, 54 ], [ 53, 55 ], [ 11, 56 ], [ 56, 57 ], [ 57, 58 ], [ 58, 59 ], [ 58, 60 ], [ 56, 61 ], [ 61, 62 ], [ 61, 63 ], [ 56, 64 ], [ 64, 65 ], [ 65, 66 ], [ 56, 67 ], [ 68, 68 ], [ 68, 69 ], [ 69, 70 ], [ 69, 71 ], [ 71, 72 ], [ 71, 73 ], [ 11, 74 ], [ 74, 75 ], [ 74, 76 ], [ 9, 77 ], [ 77, 78 ], [ 91, 79 ], [ 79, 80 ], [ 79, 81 ], [ 81, 82 ], [ 82, 83 ], [ 83, 84 ], [ 84, 85 ], [ 84, 86 ], [ 82, 87 ], [ 79, 88 ], [ 88, 89 ], [ 0, 90 ], [ 90, 91 ], [ 90, 92 ] ]
[ "import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\n\t\tint[] nArray = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(nArray);\n\n\t\tint answer = 0;\n\n\t\tfor (int i = 0; i < k; i++) {\n\n\t\t\tanswer += nArray[i];\n\t\t}\n\n\t\tprintln(answer);\n\t}\n\n\tpublic static void println(Object target) {\n\t\tSystem.out.println(target);\n\t}\n}", "import java.util.Arrays;", "Arrays", "java.util", "import java.util.Scanner;", "Scanner", "java.util", "public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\n\t\tint[] nArray = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(nArray);\n\n\t\tint answer = 0;\n\n\t\tfor (int i = 0; i < k; i++) {\n\n\t\t\tanswer += nArray[i];\n\t\t}\n\n\t\tprintln(answer);\n\t}\n\n\tpublic static void println(Object target) {\n\t\tSystem.out.println(target);\n\t}\n}", "Main", "public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\n\t\tint[] nArray = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(nArray);\n\n\t\tint answer = 0;\n\n\t\tfor (int i = 0; i < k; i++) {\n\n\t\t\tanswer += nArray[i];\n\t\t}\n\n\t\tprintln(answer);\n\t}", "main", "{\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\n\t\tint[] nArray = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(nArray);\n\n\t\tint answer = 0;\n\n\t\tfor (int i = 0; i < k; i++) {\n\n\t\t\tanswer += nArray[i];\n\t\t}\n\n\t\tprintln(answer);\n\t}", "Scanner scan = new Scanner(System.in);", "scan", "new Scanner(System.in)", "int n = scan.nextInt();", "n", "scan.nextInt()", "scan.nextInt", "scan", "int k = scan.nextInt();", "k", "scan.nextInt()", "scan.nextInt", "scan", "int[] nArray = new int[n];", "nArray", "new int[n]", "n", "for (int i = 0; i < n; i++) {\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}", "{\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}", "nArray[i] = scan.nextInt()", "nArray[i]", "nArray", "i", "scan.nextInt()", "scan.nextInt", "scan", "Arrays.sort(nArray)", "Arrays.sort", "Arrays", "nArray", "int answer = 0;", "answer", "0", "for (int i = 0; i < k; i++) {\n\n\t\t\tanswer += nArray[i];\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < k", "i", "k", "i++", "i++", "i", "{\n\n\t\t\tanswer += nArray[i];\n\t\t}", "{\n\n\t\t\tanswer += nArray[i];\n\t\t}", "answer += nArray[i]", "answer", "nArray[i]", "nArray", "i", "println(answer)", "println", "answer", "String[] args", "args", "public static void println(Object target) {\n\t\tSystem.out.println(target);\n\t}", "println", "{\n\t\tSystem.out.println(target);\n\t}", "System.out.println(target)", "System.out.println", "System.out", "System", "System.out", "target", "Object target", "target", "public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\n\t\tint[] nArray = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(nArray);\n\n\t\tint answer = 0;\n\n\t\tfor (int i = 0; i < k; i++) {\n\n\t\t\tanswer += nArray[i];\n\t\t}\n\n\t\tprintln(answer);\n\t}\n\n\tpublic static void println(Object target) {\n\t\tSystem.out.println(target);\n\t}\n}", "public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\n\t\tint[] nArray = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tnArray[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(nArray);\n\n\t\tint answer = 0;\n\n\t\tfor (int i = 0; i < k; i++) {\n\n\t\t\tanswer += nArray[i];\n\t\t}\n\n\t\tprintln(answer);\n\t}\n\n\tpublic static void println(Object target) {\n\t\tSystem.out.println(target);\n\t}\n}", "Main" ]
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int k = scan.nextInt(); int[] nArray = new int[n]; for (int i = 0; i < n; i++) { nArray[i] = scan.nextInt(); } Arrays.sort(nArray); int answer = 0; for (int i = 0; i < k; i++) { answer += nArray[i]; } println(answer); } public static void println(Object target) { System.out.println(target); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 4, 18, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 85, 5 ], [ 85, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 8, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 8, 79 ], [ 79, 80 ], [ 80, 81 ], [ 6, 82 ], [ 82, 83 ], [ 0, 84 ], [ 84, 85 ], [ 84, 86 ] ]
[ "import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tInteger tree[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n tree[i] = sc.nextInt();\n\t\t}\t\t\n\t\tArrays.sort(tree);\n\t\tint r = 0;\n\t\tfor (int j = 0; j < k; j++) {\n\t\t\tr = r + tree[j];\n\t\t}\n\t System.out.println(r);\n\t sc.close();\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tInteger tree[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n tree[i] = sc.nextInt();\n\t\t}\t\t\n\t\tArrays.sort(tree);\n\t\tint r = 0;\n\t\tfor (int j = 0; j < k; j++) {\n\t\t\tr = r + tree[j];\n\t\t}\n\t System.out.println(r);\n\t sc.close();\n\t}\n}", "Main", "public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tInteger tree[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n tree[i] = sc.nextInt();\n\t\t}\t\t\n\t\tArrays.sort(tree);\n\t\tint r = 0;\n\t\tfor (int j = 0; j < k; j++) {\n\t\t\tr = r + tree[j];\n\t\t}\n\t System.out.println(r);\n\t sc.close();\n\t}", "main", "{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tInteger tree[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n tree[i] = sc.nextInt();\n\t\t}\t\t\n\t\tArrays.sort(tree);\n\t\tint r = 0;\n\t\tfor (int j = 0; j < k; j++) {\n\t\t\tr = r + tree[j];\n\t\t}\n\t System.out.println(r);\n\t sc.close();\n\t}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "Integer tree[] = new Integer[n];", "tree", "new Integer[n]", "n", "for (int i = 0; i < n; i++) {\n tree[i] = sc.nextInt();\n\t\t}", "int i = 0;", "int i = 0;", "i", "0", "i < n", "i", "n", "i++", "i++", "i", "{\n tree[i] = sc.nextInt();\n\t\t}", "{\n tree[i] = sc.nextInt();\n\t\t}", "tree[i] = sc.nextInt()", "tree[i]", "tree", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(tree)", "Arrays.sort", "Arrays", "tree", "int r = 0;", "r", "0", "for (int j = 0; j < k; j++) {\n\t\t\tr = r + tree[j];\n\t\t}", "int j = 0;", "int j = 0;", "j", "0", "j < k", "j", "k", "j++", "j++", "j", "{\n\t\t\tr = r + tree[j];\n\t\t}", "{\n\t\t\tr = r + tree[j];\n\t\t}", "r = r + tree[j]", "r", "r + tree[j]", "r", "tree[j]", "tree", "j", "System.out.println(r)", "System.out.println", "System.out", "System", "System.out", "r", "sc.close()", "sc.close", "sc", "String[] args", "args", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tInteger tree[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n tree[i] = sc.nextInt();\n\t\t}\t\t\n\t\tArrays.sort(tree);\n\t\tint r = 0;\n\t\tfor (int j = 0; j < k; j++) {\n\t\t\tr = r + tree[j];\n\t\t}\n\t System.out.println(r);\n\t sc.close();\n\t}\n}", "public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tInteger tree[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n tree[i] = sc.nextInt();\n\t\t}\t\t\n\t\tArrays.sort(tree);\n\t\tint r = 0;\n\t\tfor (int j = 0; j < k; j++) {\n\t\t\tr = r + tree[j];\n\t\t}\n\t System.out.println(r);\n\t sc.close();\n\t}\n}", "Main" ]
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); Integer tree[] = new Integer[n]; for (int i = 0; i < n; i++) { tree[i] = sc.nextInt(); } Arrays.sort(tree); int r = 0; for (int j = 0; j < k; j++) { r = r + tree[j]; } System.out.println(r); sc.close(); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 2, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 4, 5 ], [ 4, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 70, 71 ], [ 70, 72 ], [ 8, 73 ], [ 73, 74 ], [ 74, 75 ], [ 75, 76 ], [ 75, 77 ], [ 73, 78 ], [ 6, 79 ], [ 79, 80 ] ]
[ "import java.util.*; \nclass Main \n{\npublic static void main(String args[]) \n{\nScanner sc = new Scanner(System.in); \nint n = sc.nextInt(); \nint k = sc.nextInt(); \nint arr[] = new int[n]; \n \nfor(int i=0;i<n;i++) \n{\narr[i]=sc.nextInt();\n} \nArrays.sort(arr); \nint sum=0; \nfor(int i=0;i<k;i++) \n{\n sum=sum+arr[i];\n} \nSystem.out.print(sum);\n \n} \n} ", "import java.util.*;", "util.*", "java", "class Main \n{\npublic static void main(String args[]) \n{\nScanner sc = new Scanner(System.in); \nint n = sc.nextInt(); \nint k = sc.nextInt(); \nint arr[] = new int[n]; \n \nfor(int i=0;i<n;i++) \n{\narr[i]=sc.nextInt();\n} \nArrays.sort(arr); \nint sum=0; \nfor(int i=0;i<k;i++) \n{\n sum=sum+arr[i];\n} \nSystem.out.print(sum);\n \n} \n}", "Main", "public static void main(String args[]) \n{\nScanner sc = new Scanner(System.in); \nint n = sc.nextInt(); \nint k = sc.nextInt(); \nint arr[] = new int[n]; \n \nfor(int i=0;i<n;i++) \n{\narr[i]=sc.nextInt();\n} \nArrays.sort(arr); \nint sum=0; \nfor(int i=0;i<k;i++) \n{\n sum=sum+arr[i];\n} \nSystem.out.print(sum);\n \n}", "main", "{\nScanner sc = new Scanner(System.in); \nint n = sc.nextInt(); \nint k = sc.nextInt(); \nint arr[] = new int[n]; \n \nfor(int i=0;i<n;i++) \n{\narr[i]=sc.nextInt();\n} \nArrays.sort(arr); \nint sum=0; \nfor(int i=0;i<k;i++) \n{\n sum=sum+arr[i];\n} \nSystem.out.print(sum);\n \n}", "Scanner sc = new Scanner(System.in);", "sc", "new Scanner(System.in)", "int n = sc.nextInt();", "n", "sc.nextInt()", "sc.nextInt", "sc", "int k = sc.nextInt();", "k", "sc.nextInt()", "sc.nextInt", "sc", "int arr[] = new int[n];", "arr", "new int[n]", "n", "for(int i=0;i<n;i++) \n{\narr[i]=sc.nextInt();\n}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\narr[i]=sc.nextInt();\n}", "{\narr[i]=sc.nextInt();\n}", "arr[i]=sc.nextInt()", "arr[i]", "arr", "i", "sc.nextInt()", "sc.nextInt", "sc", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "int sum=0;", "sum", "0", "for(int i=0;i<k;i++) \n{\n sum=sum+arr[i];\n}", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n sum=sum+arr[i];\n}", "{\n sum=sum+arr[i];\n}", "sum=sum+arr[i]", "sum", "sum+arr[i]", "sum", "arr[i]", "arr", "i", "System.out.print(sum)", "System.out.print", "System.out", "System", "System.out", "sum", "String args[]", "args" ]
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int arr[] = new int[n]; for(int i=0;i<n;i++) { arr[i]=sc.nextInt(); } Arrays.sort(arr); int sum=0; for(int i=0;i<k;i++) { sum=sum+arr[i]; } System.out.print(sum); } }
[ 7, 15, 13, 17, 6, 13, 12, 13, 30, 41, 13, 20, 41, 13, 4, 18, 13, 41, 13, 4, 18, 13, 41, 13, 20, 13, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 18, 13, 13, 4, 18, 13, 4, 18, 13, 13, 41, 13, 17, 11, 1, 41, 13, 17, 2, 13, 13, 1, 40, 13, 30, 30, 0, 13, 18, 13, 13, 4, 18, 18, 13, 13, 13, 23, 13, 10, 6, 13 ]
[ [ 0, 1 ], [ 1, 2 ], [ 1, 3 ], [ 0, 4 ], [ 80, 5 ], [ 80, 6 ], [ 6, 7 ], [ 6, 8 ], [ 8, 9 ], [ 9, 10 ], [ 9, 11 ], [ 8, 12 ], [ 12, 13 ], [ 12, 14 ], [ 14, 15 ], [ 15, 16 ], [ 8, 17 ], [ 17, 18 ], [ 17, 19 ], [ 19, 20 ], [ 20, 21 ], [ 8, 22 ], [ 22, 23 ], [ 22, 24 ], [ 8, 26 ], [ 26, 27 ], [ 27, 28 ], [ 28, 29 ], [ 28, 30 ], [ 26, 31 ], [ 31, 32 ], [ 31, 33 ], [ 26, 34 ], [ 34, 35 ], [ 35, 36 ], [ 26, 37 ], [ 38, 38 ], [ 38, 39 ], [ 39, 40 ], [ 40, 41 ], [ 40, 42 ], [ 39, 43 ], [ 43, 44 ], [ 44, 45 ], [ 8, 46 ], [ 46, 47 ], [ 47, 48 ], [ 46, 49 ], [ 8, 50 ], [ 50, 51 ], [ 50, 52 ], [ 8, 53 ], [ 53, 54 ], [ 54, 55 ], [ 55, 56 ], [ 55, 57 ], [ 53, 58 ], [ 58, 59 ], [ 58, 60 ], [ 53, 61 ], [ 61, 62 ], [ 62, 63 ], [ 53, 64 ], [ 65, 65 ], [ 65, 66 ], [ 66, 67 ], [ 66, 68 ], [ 68, 69 ], [ 68, 70 ], [ 8, 71 ], [ 71, 72 ], [ 72, 73 ], [ 73, 74 ], [ 73, 75 ], [ 71, 76 ], [ 6, 77 ], [ 77, 78 ], [ 0, 79 ], [ 79, 80 ], [ 79, 81 ] ]
[ "import java.util.*;\npublic class Main{\n\tpublic static void main(String args[]){\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tLong[] arr=new Long[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=in.nextLong();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tlong ans=0;\n\t\tfor(int i=0;i<k;i++){\n\t\t\tans+=arr[i];\n\t\t}\n\t\tSystem.out.print(ans);\n\t}\n}", "import java.util.*;", "util.*", "java", "public class Main{\n\tpublic static void main(String args[]){\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tLong[] arr=new Long[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=in.nextLong();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tlong ans=0;\n\t\tfor(int i=0;i<k;i++){\n\t\t\tans+=arr[i];\n\t\t}\n\t\tSystem.out.print(ans);\n\t}\n}", "Main", "public static void main(String args[]){\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tLong[] arr=new Long[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=in.nextLong();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tlong ans=0;\n\t\tfor(int i=0;i<k;i++){\n\t\t\tans+=arr[i];\n\t\t}\n\t\tSystem.out.print(ans);\n\t}", "main", "{\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tLong[] arr=new Long[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=in.nextLong();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tlong ans=0;\n\t\tfor(int i=0;i<k;i++){\n\t\t\tans+=arr[i];\n\t\t}\n\t\tSystem.out.print(ans);\n\t}", "Scanner in = new Scanner(System.in);", "in", "new Scanner(System.in)", "int n=in.nextInt();", "n", "in.nextInt()", "in.nextInt", "in", "int k=in.nextInt();", "k", "in.nextInt()", "in.nextInt", "in", "Long[] arr=new Long[n];", "arr", "new Long[n]", "n", "for(int i=0;i<n;i++){\n\t\t\tarr[i]=in.nextLong();\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<n", "i", "n", "i++", "i++", "i", "{\n\t\t\tarr[i]=in.nextLong();\n\t\t}", "{\n\t\t\tarr[i]=in.nextLong();\n\t\t}", "arr[i]=in.nextLong()", "arr[i]", "arr", "i", "in.nextLong()", "in.nextLong", "in", "Arrays.sort(arr)", "Arrays.sort", "Arrays", "arr", "long ans=0;", "ans", "0", "for(int i=0;i<k;i++){\n\t\t\tans+=arr[i];\n\t\t}", "int i=0;", "int i=0;", "i", "0", "i<k", "i", "k", "i++", "i++", "i", "{\n\t\t\tans+=arr[i];\n\t\t}", "{\n\t\t\tans+=arr[i];\n\t\t}", "ans+=arr[i]", "ans", "arr[i]", "arr", "i", "System.out.print(ans)", "System.out.print", "System.out", "System", "System.out", "ans", "String args[]", "args", "public class Main{\n\tpublic static void main(String args[]){\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tLong[] arr=new Long[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=in.nextLong();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tlong ans=0;\n\t\tfor(int i=0;i<k;i++){\n\t\t\tans+=arr[i];\n\t\t}\n\t\tSystem.out.print(ans);\n\t}\n}", "public class Main{\n\tpublic static void main(String args[]){\n\t\tScanner in = new Scanner(System.in);\n\t\tint n=in.nextInt();\n\t\tint k=in.nextInt();\n\t\tLong[] arr=new Long[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tarr[i]=in.nextLong();\n\t\t}\n\t\tArrays.sort(arr);\n\t\tlong ans=0;\n\t\tfor(int i=0;i<k;i++){\n\t\t\tans+=arr[i];\n\t\t}\n\t\tSystem.out.print(ans);\n\t}\n}", "Main" ]
import java.util.*; public class Main{ public static void main(String args[]){ Scanner in = new Scanner(System.in); int n=in.nextInt(); int k=in.nextInt(); Long[] arr=new Long[n]; for(int i=0;i<n;i++){ arr[i]=in.nextLong(); } Arrays.sort(arr); long ans=0; for(int i=0;i<k;i++){ ans+=arr[i]; } System.out.print(ans); } }