codeforces-scrape

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

148C.md (1983B)


      1 Source: https://codeforces.com/problemset/problem/148/C
      2 
      3 C. Terse princess
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 «Next please», — the princess called and cast an estimating glance at the next groom.
     22 
     23 The princess intends to choose the most worthy groom, this is, the richest one. Whenever she sees a groom who is more rich than each of the previous ones, she says a measured «Oh...». Whenever the groom is richer than all previous ones added together, she exclaims «Wow!» (no «Oh...» in this case). At the sight of the first groom the princess stays calm and says nothing.
     24 
     25 The fortune of each groom is described with an integer between 1 and 50000. You know that during the day the princess saw *n* grooms, said «Oh...» exactly *a* times and exclaimed «Wow!» exactly *b* times. Your task is to output a sequence of *n* integers *t*1, *t*2, ..., *t**n*, where *t**i* describes the fortune of *i*-th groom. If several sequences are possible, output any of them. If no sequence exists that would satisfy all the requirements, output a single number -1.
     26 
     27 Input
     28 
     29 The only line of input data contains three integer numbers *n*, *a* and *b* (1 ≤ *n* ≤ 100, 0 ≤ *a*, *b* ≤ 15, *n* > *a* + *b*), separated with single spaces.
     30 
     31 Output
     32 
     33 Output any sequence of integers *t*1, *t*2, ..., *t**n*, where *t**i* (1 ≤ *t**i* ≤ 50000) is the fortune of *i*-th groom, that satisfies the given constraints. If no sequence exists that would satisfy all the requirements, output a single number -1.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 10 2 3
     41 ```
     42 
     43 Output
     44 
     45 ```
     46 5 1 3 6 16 35 46 4 200 99
     47 ```
     48 
     49 Input
     50 
     51 ```
     52 5 0 0
     53 ```
     54 
     55 Output
     56 
     57 ```
     58 10 10 6 6 5
     59 ```
     60 
     61 Note
     62 
     63 Let's have a closer look at the answer for the first sample test.
     64 
     65 * The princess said «Oh...» (highlighted in bold): 5 1 3 6 16 35 46 4 200 99.
     66 * The princess exclaimed «Wow!» (highlighted in bold): 5 1 3 6 16 35 46 4 200 99.