t = int(input()) for _ in range(t): n, x = map(int, input().split()) mn = n*(n+1)//2 if x