HDOJ 1977 consecutive sum II

Source: Internet
Author: User

Consecutive sum II

Time limit:3000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 2523 Accepted Submission (s): 1219


Problem descriptionconsecutive sum come again. Is it ready? Go ~ ~
1 = 0 + 1
2+3+4 = 1 + 8
5+6+7+8+9 = 8 + 27
...
You can see the consecutive sum can is representing like that. The nth line'll has 2*n+1 consecutive numbers on the left and the first number on the right equal with the second number I n last line, and the sum of the left numbers equal with the number ' s sum in the right.
Your task is this tell me the right numbers in the nth line.

Inputthe First integer is T, and T lines would follow.
Each line would contain an integer n (0 <= n <= 2100000).

Outputfor each case, output the right numbers in the Nth line.
All answer in the range of signed 64-bits Integer.

Sample Input3012

Sample Output0 11 88 27 Find the Law

  

HDOJ 1977 consecutive sum II

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.