codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

802M1.md (1328B)


      1 Source: https://codeforces.com/problemset/problem/802/M1
      2 
      3 M1. April Fools' Problem (easy)
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 The marmots have prepared a very easy problem for this year's HC2 – this one. It involves numbers *n*, *k* and a sequence of *n* positive integers *a*1, *a*2, ..., *a**n*. They also came up with a beautiful and riveting story for the problem statement. It explains what the input means, what the program should output, and it also reads like a good criminal.
     22 
     23 However I, Heidi, will have none of that. As my joke for today, I am removing the story from the statement and replacing it with these two unhelpful paragraphs. Now solve the problem, fools!
     24 
     25 Input
     26 
     27 The first line of the input contains two space-separated integers *n* and *k* (1 ≤ *k* ≤ *n* ≤ 2200). The second line contains *n* space-separated integers *a*1, ..., *a**n* (1 ≤ *a**i* ≤ 104).
     28 
     29 Output
     30 
     31 Output one number.
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 8 5  
     39 1 1 1 1 1 1 1 1
     40 ```
     41 
     42 Output
     43 
     44 ```
     45 5
     46 ```
     47 
     48 Input
     49 
     50 ```
     51 10 3  
     52 16 8 2 4 512 256 32 128 64 1
     53 ```
     54 
     55 Output
     56 
     57 ```
     58 7
     59 ```
     60 
     61 Input
     62 
     63 ```
     64 5 1  
     65 20 10 50 30 46
     66 ```
     67 
     68 Output
     69 
     70 ```
     71 10
     72 ```
     73 
     74 Input
     75 
     76 ```
     77 6 6  
     78 6 6 6 6 6 6
     79 ```
     80 
     81 Output
     82 
     83 ```
     84 36
     85 ```
     86 
     87 Input
     88 
     89 ```
     90 1 1  
     91 100
     92 ```
     93 
     94 Output
     95 
     96 ```
     97 100
     98 ```