- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.java
More file actions
Latest commit
21 lines (19 loc) · 559 Bytes
/
Copy pathSolution.java
File metadata and controls
21 lines (19 loc) · 559 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
importjava.util.Scanner;
publicclassSolution {
publicstaticvoidmain(String[] argh) {
Scannerin = newScanner(System.in);
intt = in.nextInt();
for (inti = 0; i < t; i++) {
inta = in.nextInt();
intb = in.nextInt();
intn = in.nextInt();
intsum = 0;
for (intj = 0; j < n; j++) {
sum += Math.pow(2, j) * b;
System.out.printf("%d ", a + sum);
}
System.out.println();
}
in.close();
}
}