@@ -0,0 +1,1229 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    // Complete the stones function below.%0A    static int%5B%5D stones(int n, int a, int b) %7B%0A        int%5B%5D possibilities = new int%5Bn%5D;%0A        int N = possibilities.length;%0A        int k=n-1;%0A        int l=0;%0A        for(int i=0;i%3Cn;i++)%7B%0A            possibilities%5Bi%5D = a*k+b*l;%0A            //System.out.println(i+%22 %22+possibilities%5Bi%5D);%0A            k--; l++;%0A        %7D%0A        Arrays.sort(possibilities);%0A        return possibilities;%0A    %7D%0A    public static void main(String%5B%5D args) %7B%0A        Scanner sc = new Scanner(System.in);%0A        int T = sc.nextInt();%0A        for (int TItr = 0; TItr %3C T; TItr++) %7B%0A            int n = sc.nextInt();%0A            int a = sc.nextInt();%0A            int b = sc.nextInt();%0A            int%5B%5D result = stones(n, a, b);%0A            int prev = -1;%0A            for (int i = 0; i %3C result.length; i++) %7B%0A                //if(result%5Bi%5D==0) break;%0A                if(prev!=result%5Bi%5D) System.out.print(result%5Bi%5D+%22 %22);%0A                prev = result%5Bi%5D;%0A            %7D%0A            System.out.println();%0A        %7D%0A%0A    %7D%0A%7D%0A

add ManasaAndStones.java