n, x = int(input()), int(input())
s = 0
for i in range(1, n+1):
s += x ** i
print(s)
n = int(input()); x = int(input()); s = 0;
for i in range (1,n+1): s += x**i;
print(s);
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
n, x = int(input()), int(input())
s = 0
for i in range(1, n+1):
s += x ** i
print(s)
Ответ:
n = int(input()); x = int(input()); s = 0;
for i in range (1,n+1): s += x**i;
print(s);