CF327B.Hungry Sequence

普及-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 consisting of n integers.

A sequence _a_1, _a_2, ..., a__n, consisting of n integers, is Hungry if and only if:

  • Its elements are in increasing order. That is an inequality a__i < a__j holds for any two indices i, j (i < j).
  • For any two indices i and j (i < j), a__j must not be divisible by a__i.

Iahub is in trouble, so he asks you for help. Find a Hungry sequence with n elements.

伊阿胡布和伊阿胡比娜去了一家高档餐厅约会。一切都很顺利,直到结账时出了问题。服务员没有收钱,而是要求伊阿胡布写出一个由 nn 个整数组成的“饥饿序列”(Hungry sequence)。

一个由 nn 个整数构成的序列 a1,a2,…,ana_1, a_2, \dots, a_n 被称为饥饿序列,当且仅当满足以下两个条件:

  • 序列元素严格递增:对任意两个下标 i,ji, j(其中 i<ji < j),均有不等式 ai<aja_i < a_j 成立;
  • 对任意两个下标 ii 和 jj(其中 i<ji < j),aja_j 不能被 aia_i 整除。

伊阿胡布陷入了困境,于是向你求助。请构造一个包含 nn 个元素的饥饿序列。

输入格式

The input contains a single integer: n (1 ≤ n ≤ 105).

输入包含一个整数:nn(1 ≤ n ≤ 1051 \leq n \leq 10^5)。

输出格式

Output a line that contains n space-separated integers _a_1 _a_2, ..., a__n (1 ≤ a__i ≤ 107), representing a possible Hungry sequence. Note, that each a__i must not be greater than 10000000 (107) and less than 1.

If there are multiple solutions you can output any one.

输出一行包含 n 个空格分隔的整数 _a_₁ _a_₂, ..., a__n(1 ≤ a__i ≤ 10⁷),表示一个可能的“饥饿序列”(Hungry sequence)。注意,每个 a__i 必须满足不大于 10000000(即 10⁷)且不小于 1。

若存在多个解,可输出任意一个。

输入输出样例

  • 输入#1

    3

    输出#1

    2 9 15
  • 输入#2

    5

    输出#2

    11 14 20 27 31

输入解题思路,AI测评打分。不知道怎么写?

首页