CF715A.Plus and Square Root

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' ++ ' (plus) and '' (square root). Initially, the number 22 is displayed on the screen. There are n+1n+1 levels in the game and ZS the Coder start at the level 11 .

When ZS the Coder is at level kk , he can :

  1. Press the ' ++ ' button. This increases the number on the screen by exactly kk . So, if the number on the screen was xx , it becomes x+kx+k .
  2. Press the '' button. Let the number on the screen be xx . After pressing this button, the number becomes . After that, ZS the Coder levels up, so his current level becomes k+1k+1 . This button can only be pressed when xx is a perfect square, i.e. x=m2x=m^{2} for some positive integer mm .

Additionally, after each move, if ZS the Coder is at level kk , and the number on the screen is mm , then mm must be a multiple of kk . Note that this condition is only checked after performing the press. For example, if ZS the Coder is at level 44 and current number is 100100 , he presses the '' button and the number turns into 1010 . Note that at this moment, 1010 is not divisible by 44 , but this press is still valid, because after it, ZS the Coder is at level 55 , and 1010 is divisible by 55 .

ZS the Coder needs your help in beating the game — he wants to reach level n+1n+1 . In other words, he needs to press the '' button nn times. Help him determine the number of times he should press the ' ++ ' button before pressing the '' button at each level.

Please note that ZS the Coder wants to find just any sequence of presses allowing him to reach level n+1n+1 , but not necessarily a sequence minimizing the number of presses.

输入格式

The first and only line of the input contains a single integer nn ( 1<=n<=1000001<=n<=100000 ), denoting that ZS the Coder wants to reach level n+1n+1 .

输出格式

Print nn non-negative integers, one per line. ii -th of them should be equal to the number of times that ZS the Coder needs to press the ' ++ ' button before pressing the '' button at level ii .

Each number in the output should not exceed 101810^{18} . However, the number on the screen can be greater than 101810^{18} .

It is guaranteed that at least one solution exists. If there are multiple solutions, print any of them.

输入输出样例

  • 输入#1

    3
    

    输出#1

    14
    16
    46
    
  • 输入#2

    2
    

    输出#2

    999999999999999998
    44500000000
    
  • 输入#3

    4
    

    输出#3

    2
    17
    46
    97
    

说明/提示

In the first sample case:

On the first level, ZS the Coder pressed the ' ++ ' button 1414 times (and the number on screen is initially 22 ), so the number became 2+141=162+14·1=16 . Then, ZS the Coder pressed the '' button, and the number became .

After that, on the second level, ZS pressed the ' ++ ' button 1616 times, so the number becomes 4+162=364+16·2=36 . Then, ZS pressed the '' button, levelling up and changing the number into .

After that, on the third level, ZS pressed the ' ++ ' button 4646 times, so the number becomes 6+463=1446+46·3=144 . Then, ZS pressed the '' button, levelling up and changing the number into .

Note that 1212 is indeed divisible by 44 , so ZS the Coder can reach level 44 .

Also, note that pressing the ' ++ ' button 1010 times on the third level before levelling up does not work, because the number becomes 6+103=366+10·3=36 , and when the '' button is pressed, the number becomes and ZS the Coder is at Level 44 . However, 66 is not divisible by 44 now, so this is not a valid solution.

In the second sample case:

On the first level, ZS the Coder pressed the ' ++ ' button 999999999999999998999999999999999998 times (and the number on screen is initially 22 ), so the number became 2+9999999999999999981=10182+999999999999999998·1=10^{18} . Then, ZS the Coder pressed the '' button, and the number became .

After that, on the second level, ZS pressed the ' ++ ' button 4450000000044500000000 times, so the number becomes 109+445000000002=9101010^{9}+44500000000·2=9·10^{10} . Then, ZS pressed the '' button, levelling up and changing the number into .

Note that 300000300000 is a multiple of 33 , so ZS the Coder can reach level 33 .

首页