<commit_before>/**
 * 
 */
package algorithms.implementation;

import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Challenge: https://www.hackerrank.com/challenges/manasa-and-stones
 * 
 * @author <NAME>
 */
public class ManasaAndStones {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int t = in.nextInt();

    while (t-- > 0) {
      int n = in.nextInt() - 1;
      int a = in.nextInt();
      int b = in.nextInt();
      Set<Integer> valuesSet = new LinkedHashSet<Integer>();

      int min = Math.min(a, b);
      int max = Math.max(a, b);

      valuesSet.add(n * min);
      for (int i = 0; i < n; i++) {
        valuesSet.add((max * (i + 1)) + (n - i - 1) * min);
      }

      for (Integer val : valuesSet) {
        System.out.print(val + " ");
      }
      System.out.println();

    }
    in.close();
  }
}<commit_msg>Solve even without using HashSet<commit_after>/**
 * 
 */
package algorithms.implementation;

import java.util.Scanner;

/**
 * Challenge: https://www.hackerrank.com/challenges/manasa-and-stones
 * 
 * @author <NAME>
 */
public class ManasaAndStones {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int t = in.nextInt();

    while (t-- > 0) {
      int n = in.nextInt() - 1;
      int a = in.nextInt();
      int b = in.nextInt();

      int min = Math.min(a, b);
      int max = Math.max(a, b);

      if(a == b) {
        System.out.println(n * a);
        continue;
      }
      
      System.out.print((n * min) + " ");
      for (int i = 0; i < n; i++) {
        System.out.print(((max * (i + 1)) + (n - i - 1) * min) + " ");
      }

      System.out.println();

    }
    in.close();
  }
}
{'fraction_non_alphanumeric': 0.17620137299771166, 'fraction_numerical': 0.005720823798627002, 'mean_word_length': 2.0846560846560847, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6718962', 'n_tokens_mistral': 653, 'n_tokens_neox': 618, 'n_words': 148}