codeforces-scrape

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

111A.md (1120B)


      1 Source: https://codeforces.com/problemset/problem/111/A
      2 
      3 A. Petya and Inequiations
      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 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Little Petya loves inequations. Help him find *n* positive integers *a*1, *a*2, ..., *a**n*, such that the following two conditions are satisfied:
     22 
     23 * *a*12 + *a*22 + ... + *a**n*2 ≥ *x*
     24 * *a*1 + *a*2 + ... + *a**n* ≤ *y*
     25 
     26 Input
     27 
     28 The first line contains three space-separated integers *n*, *x* and *y* (1 ≤ *n* ≤ 105, 1 ≤ *x* ≤ 1012, 1 ≤ *y* ≤ 106).
     29 
     30 Please do not use the %lld specificator to read or write 64-bit integers in С++. It is recommended to use cin, cout streams or the %I64d specificator.
     31 
     32 Output
     33 
     34 Print *n* positive integers that satisfy the conditions, one integer per line. If such numbers do not exist, print a single number "-1". If there are several solutions, print any of them.
     35 
     36 Examples
     37 
     38 Input
     39 
     40 ```
     41 5 15 15
     42 ```
     43 
     44 Output
     45 
     46 ```
     47 4  
     48 4  
     49 1  
     50 1  
     51 2
     52 ```
     53 
     54 Input
     55 
     56 ```
     57 2 3 2
     58 ```
     59 
     60 Output
     61 
     62 ```
     63 -1
     64 ```
     65 
     66 Input
     67 
     68 ```
     69 1 99 11
     70 ```
     71 
     72 Output
     73 
     74 ```
     75 11
     76 ```