Pairwise

2

1 votes
Problem

Given a positive integer n such that 3n2000, find n positive integers between 1 and 4×107 (both inclusive) such that all pairwise sums of those n integers are distinct, or print -1 if such integers don't exist.

Input format: A single integer n with the given constraints.
Output format: n space separated integers satisfying the problem conditions or -1.

Problem author: Navneel Singhal

Sample Input
3
Sample Output
1 3 5
Time Limit: 0.5
Memory Limit: 1
Source Limit:
Editor Image

?