B. Hungry Sequence

Source: Internet
Author: User
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;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.