Mr Ishtiaque is in trouble. A few months ago, he bought 2 rabbits. He wanted to have two pet rabbits. But he did not know that rabbits reproduce so fast. Now, his little balcony has been filled up with rabbits. So he decided to build a big house for his pets. But he needs an estimation about how many rabbits will be there by the end of the year. As he is a teacher and moreover he has to take care of his rabbits everyday, he do not have much time to make the estimation. So he needs your help regarding this issue. He will provide some information about the rabbits.

I wanted to say that, the main solve is O(n) and as there are test cases, So the full solve becomes O(n*t). For the worst case, can it work in 1 second?

Increase the time limit for python.
Here is my code: [It’s getting cle in last case]

num_test = int(input())
for i in range(num_test):
a, b, c = map(int, input().split())
num_rabbit = a
for j in range(1, c):
num_rabbit += a * b**j
print(num_rabbit)