AtCoder Beginner Contest 127 - Algae

The development of algae in a pond is as follows.
Let the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:
 - x_{i+1} = rx_i - D
You are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.

-----Constraints-----
 - 2 ≤ r ≤ 5
 - 1 ≤ D ≤ 100
 - D < x_{2000} ≤ 200
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
r D x_{2000}

-----Output-----
Print 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.

-----Sample Input-----
2 10 20

-----Sample Output-----
30
50
90
170
330
650
1290
2570
5130
10250

For example, x_{2001} = rx_{2000} - D = 2 \times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \times 30 - 10 = 50.

Difficulty: EASY

Starter code:

Solutions:
(r, D, x) = map(int, input().split())
for n in range(10):
	t = r * x - D
	print(t)
	x = t


(r, d, x) = map(int, input().split())
for i in range(10):
	x = r * x - d
	print(x)


(r, D, x) = list(map(int, input().split()))
for i in range(10):
	xi = r * x - D
	print(xi)
	x = r * x - D


(r, d, xi) = list(map(int, input().split()))
for k in range(10):
	xi = r * xi - d
	print(xi)


(R, D, X) = map(int, input().split())
for i in range(1, 11):
	a = X * R - D
	print(a)
	X = a


(R, D, X) = map(int, input().split())
for _ in range(10):
	X = X * R - D
	print(X)


(r, D, x) = map(int, input().split())
for i in range(1, 11, 1):
	x = r * x - D
	print(x)


(r, d, x) = (int(i) for i in input().split())
ans = x
for i in range(0, 10):
	ans = r * ans - d
	print(ans)


(x, D, xx) = map(int, input().split())
for i in range(10):
	xx = x * xx - D
	print(xx)


(r, d, x) = map(int, input().split())
weights = []
for i in range(10):
	if i == 0:
		weights.append(r * x - d)
		print(weights[i])
	else:
		weights.append(r * weights[i - 1] - d)
		print(weights[i])


(r, d, x2k) = map(int, input().split())
for i in range(0, 10):
	x2k = x2k * r - d
	print(x2k)


details = list(map(int, input().split()))
r = details[0]
D = details[1]
xtemp = details[2]
for i in range(0, 10):
	x_next = xtemp * r - D
	print(x_next)
	xtemp = x_next


d = input().split()
r = int(d[0])
D = int(d[1])
x = int(d[2])
for i in range(10):
	x = x * r - D
	print(x)


(r, d, x) = map(int, input().split())
ans = x
for _ in range(10):
	ans = r * ans - d
	print(ans)


(r, D, x) = map(int, input().split())
for i in range(10):
	if i == 0:
		weight = r * x - D
		print(weight)
	else:
		weight = r * weight - D
		print(weight)


(r, D, X) = map(int, input().split())
for i in range(10):
	print(r * X - D)
	X = r * X - D


(r, D, x) = list(map(int, input().split()))
for _ in range(10):
	x = r * x - D
	print(x)


(r, d, a) = map(int, input().split())
for k in range(10):
	a = a * r - d
	print(a)


(r, D, x) = map(int, input().split())
mo = x
for i in range(10):
	mo = r * mo - D
	print(mo)


(r, d, x) = map(int, input().split())
f = x
i = 0
while i < 10:
	f = f * r - d
	print(f)
	i += 1


(r, d, x2000) = map(int, input().split())
a = x2000
for x in range(10):
	a = r * a - d
	print(a)


(r, D, x) = map(int, input().split())
A = []
for i in range(11):
	if i == 0:
		A.append(x)
	else:
		A.append(r * A[i - 1] - D)
for j in range(10):
	print(A[j + 1])


(r, D, x) = map(int, input().split())

def function(y):
	y = r * y - D
	return y
z = 1
while z <= 10:
	z += 1
	ans = function(x)
	x = function(x)
	print(ans)


(r, D, x) = map(int, input().split())

def f(r, D, x):
	return r * x - D
for i in range(10):
	x = f(r, D, x)
	print(x)


(r, D, x2000) = map(int, input().split())
n = x2000
for i in range(10):
	x = r * n - D
	print(x)
	n = x


(a, b, c) = (int(i) for i in input().split())
for i in range(10):
	c = a * c - b
	print(c)


(r, d, x) = map(int, input().split())
exec('x=r*x-d;print(x);' * 10)


details = list(map(int, input().split()))
r = details[0]
D = details[1]
x = details[2]
current = x
for i in range(10):
	thing = r * current - D
	print(thing)
	current = thing


[r, D, x] = [int(_) for _ in input().split()]
for i in [0] * 10:
	print((x := (r * x - D)))


(r, d, x) = map(int, input().split())
weights = []
for i in range(10):
	try:
		weights.append(r * weights[i - 1] - d)
		print(weights[i])
	except:
		weights.append(r * x - d)
		print(weights[i])


(r, D, a_2000) = input().split()
r = int(r)
D = int(D)
a_2000 = int(a_2000)
b = D / (r - 1)
for i in range(1, 11):
	print(int(r ** i * (a_2000 - b) + b))


(a, b, x) = map(int, input().split())
for i in range(10):
	x = a * x - b
	print(x)


lst = input()
lst = lst.split()
for i in range(len(lst)):
	lst[i] = int(lst[i])
r = lst[0]
D = lst[1]
x = lst[2]
for i in range(10):
	x = r * x - D
	print(x)


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(r, d, x) = Input()
	for _ in range(10):
		x = x * r - d
		print(x)
main()


(r, d, x) = list(map(int, input().split()))
ans = []
for i in range(10):
	x = r * x - d
	ans.append(x)
for i in ans:
	print(i)


(r, D, x_2000) = map(int, input().split())
x = [x_2000] * 11
for i in range(10):
	x[i + 1] = r * x[i] - D
print(*x[1:], sep='\n')


(r, D, x) = map(int, input().split())
for i in range(2001, 2011):
	x = r * x - D
	print(x)


(A, B, C) = map(int, input().split())
N = C
for i in range(1, 11):
	N = A * N - B
	print(N)


(r, d, x) = map(int, input().split())
for _ in range(1, 11):
	x = r * x - d
	print(x)


(r, D, x2) = map(int, input().split())
for x in range(10):
	x2 = r * x2 - D
	print(x2)


(r, D, x) = [int(s) for s in input().split()]
for i in range(10):
	x = r * x - D
	print(x)


(r, d, a) = map(int, input().split())
for i in range(1, 11):
	a = r * a - d
	print(a)


(n, m, k) = map(int, input().split())
for i in range(10):
	k = n * k - m
	print(k)


(r, D, x) = (int(x) for x in input().split())
for a in range(10):
	x = r * x - D
	print(x)


(r, D, x) = map(int, input().split())
i = 1
a = r * x - D
while i <= 10:
	print(a)
	a = r * a - D
	i += 1


(r, d, x) = list(map(int, input().split()))
for i in range(1, 11):
	x = r * x - d
	print(x)


(r, d, x) = map(int, input().split())
ans = 0
for i in range(1, 11):
	x = r * x - d
	print(x)


(R, D, x2000) = map(int, input().split())
prev = x2000
for i in range(10):
	x = prev * R - D
	print(x)
	prev = x


(R, D, C) = (int(i) for i in input().split())
for i in range(10):
	C = R * C - D
	print(C)


(r, D, x) = map(int, input().split())
c = 1
while c <= 10:
	x = r * x - D
	print(x)
	c = c + 1


(x, y, z) = map(int, input().split())
a = z
for b in range(10):
	a = x * a - y
	print(a)


(x, y, z) = map(int, input().split())
for _ in range(10):
	z = z * x - y
	print(z)


(r, d, x) = [int(_) for _ in input().split()]
for iii in range(10):
	x = r * x - d
	print(x)


(r, d, x0) = map(int, input().split())
t = x0
for i in range(10):
	t = r * t - d
	print(t)


(r, d, X) = [int(i) for i in input().split()]
for i in range(10):
	X = r * X - d
	print(X)


(a, s, d) = map(int, input().split())
for i in range(10):
	d = a * d - s
	print(d)


(r, d, x) = map(int, input().split())
for _ in [0] * 10:
	x = r * x - d
	print(x)


(r, d, x) = map(int, input().split())
e = 10
while e > 0:
	x = r * x - d
	print(x)
	e -= 1


(r, d, x) = list(map(int, input().split()))
print(r * x - d)
for _ in range(9):
	x = r * x - d
	print(r * x - d)


(r, D, x2000) = map(int, input().split())
ans = [x2000]
for i in range(10):
	ans.append(r * ans[i] - D)
for h in range(1, 11):
	print(ans[h])


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
i = 0
while i < 10:
	i = i + 1
	c = a * c - b
	print(c)


(R, D, X) = map(int, input().split())
a = X
for n in range(10):
	a = R * a - D
	print(a)


(a, b, c) = map(int, input().split())
d = 0
while d < 10:
	c = a * c - b
	print(c)
	d += 1


(r, D, X2000) = list(map(int, input().split()))
for i in range(10):
	X2000 = r * X2000 - D
	print(X2000)


(r, D, X) = map(int, input().split())
i = 0
while i <= 9:
	X = r * X - D
	print(X)
	i += 1


(r, d, x) = list(map(int, input().split()))
su = 0
for i in range(10):
	su = r * x - d
	print(su)
	x = su
	su = 0


from typing import List

def answer(r: int, d: int, x: int) -> List[int]:
	result = []
	for _ in range(10):
		x = r * x - d
		result.append(x)
	return result

def main():
	(r, x, d) = list(map(int, input().split()))
	for i in answer(r, x, d):
		print(i)

def __starting_point():
	main()
__starting_point()


(r, d, x) = map(int, input().split())
a = r * x - d
print(a)
for i in range(9):
	a = r * a - d
	print(a)


(A, B, C) = map(int, input().split())
for i in range(10):
	C = A * C - B
	print(C)


(r, d, ini) = map(int, input().split())
v = 0
while v != 10:
	ini = ini * r - d
	v += 1
	print(ini)


x = []
(r, D, a) = map(int, input().split())
x.append(a)
for i in range(10):
	x.append(r * x[i] - D)
	print(x[i + 1])


[r, d, x] = [int(x) for x in input().split()]
for n in range(10):
	x = r * x - d
	print(x)


a = 1
(A, B, C) = map(int, input().split())
for _ in range(10):
	C = C * A - B
	print(C)


(r, D, x0) = map(int, input().split())
ans = x0
for i in range(10):
	ans = r * ans - D
	print(ans)


(r, D, x) = map(int, input().split())
for i in range(2000, 2010):
	x = r * x - D
	print(x)


(r, d, s) = list(map(int, input().split()))
for i in range(10):
	s = r * s - d
	print(s)