-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloop2.java
More file actions
25 lines (23 loc) · 718 Bytes
/
loop2.java
File metadata and controls
25 lines (23 loc) · 718 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
import java.io.*;
import java.util.*;
import java.lang.Math;
public class loop2 {
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 n = sc.nextInt();
for(int i = 0; i < n;i++)
{
int n1 = sc.nextInt();
int n2 = sc.nextInt();
int n3 = sc.nextInt();
int ans = n1;
for(int j = 0;j < n3;j++)
{
ans =(int)(ans + (Math.pow(2,j) * n2) );
System.out.print(ans+" ");
}
System.out.println();
}
}
}