You have N balls and K boxes. You want to divide the N balls into K boxes such that: 
Each box contains ≥ 1 balls.
No two boxes contain the same number of balls.

Determine if it is possible to do so.

------ Input Format ------ 

- The first line contains a single integer T — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two space-separated integers N and K — the number of balls and the number of boxes respectively.

------ Output Format ------ 

For each test case, output YES if it is possible to divide the N balls into K boxes such that the conditions are satisfied. Otherwise, output NO.

You may print each character of YES and NO in uppercase or lowercase (for example, yes, yEs, Yes will be considered identical).

------ Constraints ------ 

$1 ≤ T ≤ 10^{5}$
$1 ≤N ≤10^{9}$
$1 ≤K ≤10^{4}$

----- Sample Input 1 ------ 
4
3 4
30 3
2 2
1 1

----- Sample Output 1 ------ 
NO
YES
NO
YES

----- explanation 1 ------ 
Test Case 1: It is not possible to divide the $3$ balls into $4$ boxes such that each box contains $≥ 1$ balls.

Test Case 2: One way to divide the $30$ balls into $3$ boxes is the following: $[5, 9, 16]$.

Test Case 3: It is not possible to divide the $2$ balls into $2$ boxes such that no two boxes contain the same number of balls.

Test Case 4: We can divide $1$ ball into $1$ box.

Source: codechef | Difficulty: EASY
Tags: Mathematics


Solutions:
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	if n >= k * (k + 1) / 2:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(o, p) = map(int, input().split())
	r = p * (p + 1) // 2
	if o >= r:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	req = k * (k + 1) // 2
	if n >= req:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(ball, box) = map(int, input().split())
	if ball <= box and (ball != 1 and box != 1):
		print('NO')
	elif ball >= box * (box + 1) / 2:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	x = [int(x) for x in input().split()]
	num = x[1] * (x[1] + 1) / 2
	if num <= x[0]:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if a >= b * (b + 1) // 2:
		print('YES')
	else:
		print('NO')


for i in range(int(input(''))):
	(R, S) = map(int, input().split())
	c = 2 * R
	l = S * (S + 1)
	if S > R:
		print('NO')
	elif S == R and S == 1:
		print('YES')
	elif c >= l:
		print('YES')
	else:
		print('NO')


T = int(input())
for i in range(T):
	(N, K) = map(int, input().split())
	a = K * (K + 1) // 2
	if N >= a:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	(n, k) = (int(x) for x in input().split())
	a = k / 2 * (k + 1)
	if n == 2:
		print('NO')
	elif n >= a:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	(N, K) = list(map(int, input().split()))
	if N >= K * (K + 1) // 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(N, K) = map(int, input().split())
	if K <= (-1 + (8 * N + 1) ** 0.5) // 2:
		print('YES')
	else:
		print('NO')


x = int(input())
for i in range(0, x):
	(A, B) = map(int, input().split())
	m = B * (B + 1) / 2
	if m <= A:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	if N < K:
		print('NO')
	elif N == 1 and K == 1:
		print('YES')
	elif N == K:
		print('NO')
	elif N > K:
		result = K * (K + 1) / 2
		if N >= result:
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	(n, b) = map(int, input().split())
	x = b * (b + 1) // 2
	if n >= x:
		print('YES')
	else:
		print('NO')


Test = int(input())
for Cases in range(Test):
	(NumbeofBalls, NumberofBoxes) = map(int, input().split())
	Result = NumberofBoxes * (NumberofBoxes + 1) / 2
	if Result <= NumbeofBalls:
		print('YES')
	else:
		print('NO')


t = int(input())
for z in range(t):
	(b, x) = map(int, input().split())
	tot = x / 2 * (x + 1)
	if b >= tot:
		print('YES')
	else:
		print('NO')


t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	if n <= k and (n != 1 and k != 1):
		print('NO')
	elif n >= k * (k + 1) / 2:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	sum = K * (K + 1) / 2
	if N < sum:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	p = b * (b + 1) / 2
	if a < b:
		print('NO')
	elif a == b:
		if a == 1 and b == 1:
			print('YES')
		else:
			print('NO')
	elif a >= p:
		print('YES')
	else:
		print('NO')


T = int(input())
for i in range(T):
	inp = list(map(int, input().split()))
	(ba, bo) = (inp[0], inp[1])

	def check(ba, bo):
		if ba == 1 and bo == 1:
			return 'YES'
		if ba < bo or ba == bo:
			return 'NO'
		if ba >= bo * (bo + 1) // 2:
			return 'YES'
		return 'NO'
	print(check(ba, bo))


for i in range(int(input())):
	(balls, boxes) = map(int, input().split())
	if balls >= boxes * (boxes + 1) // 2:
		print('YES')
	else:
		print('NO')


x = int(input())
for _ in range(x):
	(a, b) = map(int, input().split())
	c = b * (b + 1) // 2
	if a >= c:
		print('YES')
	else:
		print('NO')


t = int(input())
while t != 0:
	(N, K) = map(int, input().split(' '))
	s = K * (K + 1) / 2
	if N >= s:
		print('YES')
	else:
		print('NO')
	t = t - 1