import sys
from os import path
def input():
return sys.stdin.readline().strip()
def solve(k, n):
def make_d(f, k):
return [(i + 2 if i < f - 1 else 1) for i in range(k)]
ans = 1
for f in range(1, k):
d = make_d(f, k - 1)
if sum(d) <= n - 1:
dd = d
r = [1]
for x in dd:
r.append(r[-1] + x)
print(*r)
def main():
testcases = int(input()) for _ in range(testcases):
k, n = list(map(int, input().split()))
solve(k, n)
if __name__ == "__main__":
if path.exists('Tests'):
sys.stdin = open("Tests/input_1.txt", "r")
sys.stdout = open("Tests/output_1a.txt", "w")
main()
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ll lcm(ll a, ll b) { return a * b / __gcd(a, b); }
ll expo(ll a, ll b, ll mod) {
ll res = 1;
while (b > 0) {
if (b & 1)
res = (res * a) % mod;
a = (a * a) % mod;
b = b >> 1;
}
return res;
}
void extendgcd(ll a, ll b, ll *arr) { //ax+by=gcd(a,b);
if (b == 0) {
arr[0] = 1;
arr[1] = 0;
arr[2] = a;
return;
}
extendgcd(b, a % b, arr);
ll x1 = arr[1];
arr[1] = arr[0] - (a / b) * arr[1];
arr[0] = x1;
return;
}
ll mminv(ll a, ll m) {
ll arr[3];
extendgcd(a, m, arr);
if (arr[2] != 1) {
return -1;
}
return (arr[0] % m + m) % m;
} // if m is non prime
ll mminvprime(ll a, ll m) { // if a is prime
return expo(a, m - 2, m);
}
vector<ll> sieve(int n) {int*arr = new int[n + 1](); vector<ll> vect; for (int i = 2; i <= n; i++)if (arr[i] == 0) {vect.push_back(i); for (int j = 2 * i; j <= n; j += i)arr[j] = 1;} return vect;}
ll mod_add(ll a, ll b, ll m) {
a = a % m;
b = b % m;
return (((a + b) % m + m) % m);
}
ll mod_sub(ll a, ll b, ll m) {
a = a % m;
b = b % m;
return (((a - b) % m + m) % m);
}
ll mod_mul(ll a, ll b, ll m) {
a = a % m;
b = b % m;
return (((a * b) % m + m) % m);
}
ll mod_div(ll a, ll b, ll m) {
a = a % m;
b = b % m;
return (mod_mul(a, mminvprime(b, m), m) + m) % m;
}
ll ncr(ll n, ll r, vector<ll> fact, ll m) {
return mod_mul(mod_mul(fact[n], mminvprime(fact[r], m),m),
mminvprime(fact[n - r],m),m);
}
void solve() {
int k,n;
cin>> k >> n;
int d = n-k;
int i=1;
int j=2;
cout<<"1"<<" ";
int cnt=1;
while(cnt<k && i<=n && d>0) {
i=i+j;
cout<<i<<" ";
j++;
d=d-j+1;
cnt++;
}
while(i<=n && cnt<k) {
i++;
cout<<i<<" ";
cnt++;
}
cout<<"\n";
}
signed main() {
ll t = 1;
cin>>t;
while(t--) {
solve();
}
}
1822. Sign of the Product of an Array | 1464. Maximum Product of Two Elements in an Array |
1323. Maximum 69 Number | 832. Flipping an Image |
1295. Find Numbers with Even Number of Digits | 1704. Determine if String Halves Are Alike |
1732. Find the Highest Altitude | 709. To Lower Case |
1688. Count of Matches in Tournament | 1684. Count the Number of Consistent Strings |
1588. Sum of All Odd Length Subarrays | 1662. Check If Two String Arrays are Equivalent |
1832. Check if the Sentence Is Pangram | 1678. Goal Parser Interpretation |
1389. Create Target Array in the Given Order | 1313. Decompress Run-Length Encoded List |
1281. Subtract the Product and Sum of Digits of an Integer | 1342. Number of Steps to Reduce a Number to Zero |
1528. Shuffle String | 1365. How Many Numbers Are Smaller Than the Current Number |
771. Jewels and Stones | 1512. Number of Good Pairs |
672. Richest Customer Wealth | 1470. Shuffle the Array |
1431. Kids With the Greatest Number of Candies | 1480. Running Sum of 1d Array |
682. Baseball Game | 496. Next Greater Element I |
232. Implement Queue using Stacks | 844. Backspace String Compare |