Consecutively Increasing Sequences

Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)

Problem Description

给出无限长的序列1,1,3,1,3,5,7,1,3,5,7,9,11,13,15,1,3,5,7,9...,问对于序列的前N个数,所有的连续上升子序列的和是多少.
如N = 6的时候,序列是{1,1,3,1,3,5},它的所有连续上升子序列是{1},{1},{1,3},{3},{1},{1,3},{1,3,5},{3},{3,5},{5},结果为39.

Input

多组数据(约1000组),每组数据:

一行N (1 <= N <= 10^9)

Output

对于每个N,输出结果

Sample Input

1
2
6
10

Sample Output

1
2
39
119

Source

sweetzero

Manager

Information
Solved Number72
Submit Number367
Problem Tags
math
No tag edit access
温馨提示:AC后可以编辑标签哦. ^-^
Login
LoginCancel