// Program by Akash Tripathi (@proakash256)
import java.io.*;
public class For_loop2
{
public static void main(String[] args) throws IOException
{
BufferedReader sc = new BufferedReader
(new InputStreamReader(System.in));
int t = Integer.parseInt(sc.readLine());
int sum = 0 , d = 1;
for(int i = 1; i <= t; i = i + 1)
{
int a = Integer.parseInt(sc.readLine());
int b = Integer.parseInt(sc.readLine());
int n = Integer.parseInt(sc.readLine());
for(int j = 1; j <= n; j = j + 1)
{
for(int k = 1; k <= j; k = k + 1)
{
sum = sum + (d * b);
d = d * 2;
}
System.out.printf("%d " , (sum + a));
sum = 0;
d = 1;
}
System.out.println();
}
sc.close();
}
}
Comments
Post a Comment