Pro.ID21632 TitleXiaoshi's Problem Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21632 AC0 Submit0 Ratio- 时间&空间限制描述Xiaoshi is a silly boy, but he has a mathematical mind. Occasionally he will have some crazy idea on math problems. This time he gives out such a problem: Please work out the summation of the following formula, Sum = 1 + 2 + ... + n, which satisfies n ≤ 10100000. "Don't try to do a snow job on me. I know you couldn't solve it efficiently." I say to him. "Ah~~~ actually the formula is Sum = 1 + 2 + ... + 10n, which satisfies n ≤ 100000. Then can you effectively solve it?" 输入There are multiple test cases. For each case, there is a line contains n which has been described above. ( 0 ≤ n ≤ 100000 ) Input is terminated by one line contains "-1". 输出Description Xiaoshi is a silly boy, but he has a mathematical mind. Occasionally he will have some crazy idea on math problems. This time he gives out such a problem: Please work out the summation of the following formula, Sum = 1 + 2 + ... + n, which satisfies n ≤ 10100000. "Don't try to do a snow job on me. I know you couldn't solve it efficiently." I say to him. "Ah~~~ actually the formula is Sum = 1 + 2 + ... + 10n, which satisfies n ≤ 100000. Then can you effectively solve it?" Input There are multiple test cases. For each case, there is a line contains n which has been described above. ( 0 ≤ n ≤ 100000 ) Input is terminated by one line contains "-1". Output Output the summation corresponding to each input n. Sample Input 1 Sample Output 50 Source 样例输入1 样例输出50 作者 |