We use the integers , , and to create the following series:

You are given queries in the form of , , and . For each query, print the series corresponding to the given , , and values as a single line of space-separated integers.

Input Format

The first line contains an integer, , denoting the number of queries.
Each line of the subsequent lines contains three space-separated integers describing the respective , , and values for that query.

Constraints

Output Format

For each query, print the corresponding series on a new line. Each series must be printed in order as a single line of space-separated I

in Java code

Here is the Java code to solve the problem:

```java
import java.util.Scanner;

public class Series {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

int queries = scanner.nextInt();

for (int i = 0; i < queries; i++) {
int a = scanner.nextInt();
int b = scanner.nextInt();
int n = scanner.nextInt();

int sum = a;

for (int j = 0; j < n; j++) {
sum += (int)Math.pow(2, j) * b;
System.out.print(sum + " ");
}

System.out.println();
}

scanner.close();
}
}
```

Explanation:
- First, we read the number of queries from the input.
- Then, we iterate through each query.
- For each query, we read three integers - a, b, and n.
- We initialize a variable `sum` with the value of `a`.
- Then, we iterate from 0 to n-1 and calculate the sum for each term of the series using the formula: `sum += (int)Math.pow(2, j) * b`.
- Finally, we print the calculated sum for each term of the series separated by a space and move to the next line for the next query.

Here is a Java code that solves the problem:

```java
import java.util.Scanner;

public class Series {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int queries = scanner.nextInt();

for (int i = 0; i < queries; i++) {
int a = scanner.nextInt();
int b = scanner.nextInt();
int n = scanner.nextInt();

int sum = a;

for (int j = 0; j < n; j++) {
sum += Math.pow(2, j) * b;
System.out.print(sum + " ");
}

System.out.println();
}
}
}
```

Explanation:
- `Scanner` class is used to read input from the user.
- We first read the number of queries using `scanner.nextInt()`.
- We then loop through each query and read the values of `a`, `b`, and `n` using `scanner.nextInt()`.
- We initialize `sum` variable with the value of `a`.
- We then iterate `n` number of times and on each iteration, we calculate the next term in the series using the formula `sum += Math.pow(2, j) * b` and print it using `System.out.print()`.
- After printing all the terms in the series, we move to the next line using `System.out.println()`.
- This process is repeated for all the queries.

Note: Make sure to import the `java.util.Scanner` class at the beginning of the code.

Here is the code in Java to solve the problem:

```java
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int q = scanner.nextInt(); // number of queries

for (int i = 0; i < q; i++) {
int a = scanner.nextInt(); // first integer
int b = scanner.nextInt(); // second integer
int n = scanner.nextInt(); // number of terms

// Print the series
int sum = a;
for (int j = 0; j < n; j++) {
sum += Math.pow(2, j) * b;
System.out.print(sum + " ");
}
System.out.println();
}

scanner.close();
}
}
```