A Good Set
All submissions for this problem are available.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
A set of integers is called good if there does not exist three distinct elements a, b, c in it such that a + b = c.
Your task is simple. Just output any good set of n integers. All the elements in this set should be distinct and should lie between 1 and 500, both inclusive.
- The first line of the input contains an integer T denoting number of test cases. The descriptions of T test cases follow.
- The only line of each test case contains an integer n, denoting the size of the needed good set.
- 1 ≤ T, n ≤ 100
- Subtask #1 (50 points): 1 ≤ T, n ≤ 10
- Subtask #2 (50 points): original constraints
For each test case, output a single line containing n integers denoting the elements of the good set, in any order. There can be more than one possible good set, and you can output any one of them.
Input 5 1 2 3 4 5 Output 7 1 2 1 2 4 1 2 4 16 3 2 15 6 10
Example 1 and 2. Any set of size less than or equal to 2 is good by definition.
Example 3 onwards. For each pair of elements in the set, you can see that their sum doesn't exist in the set.
|Tags||admin2, cakewalk, june17|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.