B. Hungry Sequencetime 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, Consisting
OfNIntegers, 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
First, I will post a question about the quality of cf water. The following is the code:
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;long long a[100000];int main(){ int n; while(scanf("%d",&n)!=EOF){ int count=1; int i=n+1; while(1){ a[count]=i; i++; count++; if(count==n+1) break; } for(int j=1;j<=n;j++) printf("%lld ",a[j]); printf("\n"); }}