//https://www.hackerrank.com/challenges/manasa-and-stones
//See: https://www.hackerrank.com/contests/w2/challenges/manasa-and-stones
import java.io.*;

public class Solution{
    
    public static void main(String[] args) throws IOException {
        StringBuffer sb = new StringBuffer();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        for(byte T = Byte.parseByte(br.readLine()); T > 0; --T){
            short N = Short.parseShort(br.readLine());
            short A = Short.parseShort(br.readLine());
            short B = Short.parseShort(br.readLine());

            if (A > B){
                short temp = A;
                A = B;
                B = temp;
            }

            int val = ((int)--N)*A;
            short dval = (short)(B - A);

            sb.append(val);
            if (dval > 0){
                while(N-- > 0){
                    sb.append(" " + (val += dval));
                }
            }
            sb.append("\n");
        }

        System.out.print(sb);
    }
}
@@ -177,14 +177,8 @@
 n%7B%0D%0A
-    %0D%0A
     
@@ -364,24 +364,62 @@
 stem.in));%0D%0A
+        %0D%0A        //For each test case
 %0D%0A        fo
@@ -470,24 +470,63 @@
 %3E 0; --T)%7B%0D%0A
+            %0D%0A            //Get input%0D%0A
             
@@ -679,24 +679,56 @@
 Line());%0D%0A%0D%0A
+            //Make sure A %3C= B%0D%0A
             
@@ -760,22 +760,14 @@
     
-short temp = A
+A %5E= B
 ;%0D%0A 
@@ -785,13 +785,14 @@
     
-A = B
+B %5E= A
 ;%0D%0A 
@@ -810,16 +810,14 @@
     
-B = temp
+A %5E= B
 ;%0D%0A 
@@ -822,32 +822,44 @@
 %0A            %7D%0D%0A
+            
 %0D%0A            in
@@ -860,31 +860,56 @@
     
-int val = ((int)--N)*A;
+//Find the minimum value the last stone could be
 %0D%0A  
@@ -922,38 +922,30 @@
     
-shor
+in
 t 
-d
 val = (
-short)(B - A);%0D%0A
+N - 1) * A;
 %0D%0A  
@@ -987,76 +987,179 @@
     
-if (dval %3E 0)%7B%0D%0A                while(N-- %3E 0)%7B%0D%0A                   
+%0D%0A            //Find the other values the last stone could be in increasing order%0D%0A            if(A != B)%7B%0D%0A                for(final short dval = (short)(B - A); --N %3E 0;
  sb.
@@ -1185,26 +1185,36 @@
 = dval))
-;%0D%0A
+)%7B%7D%0D%0A  
        
+   %7D%0D%0A
         
@@ -1206,33 +1206,35 @@
     %7D%0D%0A         
-%7D
+   
 %0D%0A            %7D%0D
@@ -1223,33 +1223,46 @@
   %0D%0A            
-%7D
+//Print output
 %0D%0A            sb
@@ -1288,18 +1288,16 @@
      %7D%0D%0A
-%0D%0A
         
@@ -1327,8 +1327,10 @@
     %7D%0D%0A%7D
+%0D%0A

Update manasa-and-stones.java