codeforces-scrape

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

327B.md (1265B)


      1 Source: https://codeforces.com/problemset/problem/327/B
      2 
      3 B. Hungry Sequence
      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 Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of *n* integers.
     22 
     23 A sequence *a*1, *a*2, ..., *a**n*, consisting of *n* integers, is Hungry if and only if:
     24 
     25 * Its elements are in increasing order. That is an inequality *a**i* < *a**j* holds for any two indices *i*, *j* (*i* < *j*).
     26 * For any two indices *i* and *j* (*i* < *j*), *a**j* must not be divisible by *a**i*.
     27 
     28 Iahub is in trouble, so he asks you for help. Find a Hungry sequence with *n* elements.
     29 
     30 Input
     31 
     32 The input contains a single integer: *n* (1 ≤ *n* ≤ 105).
     33 
     34 Output
     35 
     36 Output a line that contains *n* space-separated integers *a*1 *a*2, ..., *a**n* (1 ≤ *a**i* ≤ 107), representing a possible Hungry sequence. Note, that each *a**i* must not be greater than 10000000 (107) and less than 1.
     37 
     38 If there are multiple solutions you can output any one.
     39 
     40 Examples
     41 
     42 Input
     43 
     44 ```
     45 3
     46 ```
     47 
     48 Output
     49 
     50 ```
     51 2 9 15
     52 ```
     53 
     54 Input
     55 
     56 ```
     57 5
     58 ```
     59 
     60 Output
     61 
     62 ```
     63 11 14 20 27 31
     64 ```