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