Different Pairwise Sums
Hard
Execution time limit is 1 second
Runtime memory usage limit is 8 megabytes
Given a natural number n, your task is to construct a sequence of distinct natural numbers a_1, a_2, ..., a_n, each not exceeding 2n^2+4n, such that all their pairwise sums are unique. Specifically, all n(n-1)/2 sums of the form a_i+a_j, where 1 ≤ i < j ≤ n, must be distinct. It is guaranteed that such a sequence can be constructed.
Input
The input consists of a single line containing a natural number n ≤ 5000.
Output
Output a single line containing the numbers a_1, a_2, ..., a_n, separated by spaces. If there are multiple valid sequences, you may output any one of them.
Examples
Input #1
Answer #1
Submissions 63
Acceptance rate 16%