inputs = input() inputs_arr = inputs.split(" ") T = int(inputs_arr[0]) datas = [] for i in range(T): inputs = input() inputs_arr = inputs.split(" ") datas.append([int(inputs_arr[0]), int(inputs_arr[1])]) answer = [] def generate_combinations(numbers, current_combination, remaining_elements, target_sum): if remaining_elements == 0: if sum(current_combination) == target_sum: answer.append(current_combination) return for i in range(len(numbers)): if not current_combination or numbers[i] > current_combination[-1]: generate_combinations(numbers[i+1:], current_combination + [numbers[i]], remaining_elements - 1, target_sum) for d in datas: N = d[0] X = d[1] display_num = "" numbers = list(range(1, X - N + 1)) combination_size = N target_sum = X answer = [] generate_combinations(numbers, [], combination_size, target_sum) if len(answer) == 0: print("-1") else: for num in answer[0]: display_num = display_num + str(num) + " " print(display_num[:-1])