Time limit per test
1 second
Memory limit per test
256 megabytes
Input
Standard Input
Output
Standard output
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 consistingNIntegers.
A SequenceA1,A2,
...,AN,
ConsistingNIntegers, is hungry if and only if:
- Its elements are in increasing order. That is an inequalityAILatency <latencyAJHolds
For any two indicesI, Bytes,J(ILatency <latencyJ).
- For any two indicesIAndJ(ILatency <latencyJ),AJMust not be
DivisibleAI.
Iahub is in trouble, so he asks you for help. Find a hungry sequenceNElements.
Input
The input contains a single INTEGER:N(1 digit ≤ DigitNLimit ≤ limit 105 ).
Output
Output a line that containsNSpace-separated IntegersA1A2,
...,AN(1 digit ≤ DigitAILimit ≤ limit 107 ),
Representing a possible hungry sequence. Note, that eachAIMust
Not be greater than 10000000 (107)
And less than 1.
If there are multiple solutions you can output any one.
Sample test (s) Input
3
Output
2 9 15
Input
5
Output
11 14 20 27 31
Explanation: This question is to find a series containing n elements. The elements are small to large, and the subsequent numbers cannot be divisible by the preceding numbers. The simplest method is to take the N to 2n-1 numbers. Obviously, the numbers behind them cannot be divisible by the preceding ones, and the elements are arranged in ascending order.
#include <iostream>#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>#include <string>#include<set>#include <algorithm>using namespace std;int main(){int n,i;scanf("%d",&n);for(i=n;i<2*n;i++){printf("%d ",i);}printf("\n");return 0;}