Tính tổng S = ~x~ + ~x^2~ + ... + ~x^n~

View as PDF

Submit solution

Points: 100.00
Time limit: 1.0s
Memory limit: 100M
Input: stdin
Output: stdout

Author:
Problem type
Allowed languages
C, C++, GAS64, Pascal, Perl, PHP, Python, Sed, TCL, Text

Tính ~S(x,n)~ = ~x~ + ~x^2~ + ~x^3~ + ... + ~x^n~. Với ~x~, ~n~ là số nguyên dương cho trước.

  • Đầu vào là 2 số ~x~ ~n~
  • Đầu ra là kết quả ~S~

Input

2 4

Output

30

Comments

Please read the guidelines before commenting.


There are no comments at the moment.