You are viewing a single comment's thread. Return to all comments →
import java.util.Scanner; import java.lang.*; class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int j,i,q; q = sc.nextInt(); for(i=0;i<q;i++) { int a = sc.nextInt(); int b = sc.nextInt(); int n = sc.nextInt(); for(j=0;j<n;j++) { a = a + (int)Math.pow(2,j) * b; System.out.print(a + " "); } System.out.println(); } sc.close(); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Loops II
You are viewing a single comment's thread. Return to all comments →