-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathloops2.java
More file actions
31 lines (24 loc) · 767 Bytes
/
loops2.java
File metadata and controls
31 lines (24 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.*;
public class loops2 {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc=new Scanner(System.in);
int q = sc.nextInt();
for(int i=0;i<q;i++)
{
int a=sc.nextInt();
int b=sc.nextInt();
int n=sc.nextInt();
for(int j=0;j<n;j++)
{
a+=b;
if(j>0)
System.out.print(" ");
System.out.print(a);
b=b*2;
}
System.out.println(" ");
}
sc.close();
}
}