You are given two integers $n$ and $k$. Your task is to find if $n$ can be represented as a sum of $k$ distinct positive odd (not divisible by $2$) integers or not.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 10^5$) — the number of test cases.

The next $t$ lines describe test cases. The only line of the test case contains two integers $n$ and $k$ ($1 \le n, k \le 10^7$).


-----Output-----

For each test case, print the answer — "YES" (without quotes) if $n$ can be represented as a sum of $k$ distinct positive odd (not divisible by $2$) integers and "NO" otherwise.


-----Example-----
Input
6
3 1
4 2
10 3
10 2
16 4
16 5

Output
YES
YES
NO
YES
YES
NO



-----Note-----

In the first test case, you can represent $3$ as $3$.

In the second test case, the only way to represent $4$ is $1+3$.

In the third test case, you cannot represent $10$ as the sum of three distinct positive odd integers.

In the fourth test case, you can represent $10$ as $3+7$, for example.

In the fifth test case, you can represent $16$ as $1+3+5+7$.

In the sixth test case, you cannot represent $16$ as the sum of five distinct positive odd integers.

Difficulty: interview

Starter code:

Solutions:
t = int(input())
for _ in range(t):
	n, k = map(int, input().split())
	n -= k**2
	if n<0:
		print("NO")
	elif n%2 == 0:
		print("YES")
	else:
		print("NO")

for _ in range(int(input())):
	n,k = map(int,input().split())
	if(n >= k*k and n%2 == (k*k)%2):
		print("YES")
	else:
		print("NO")	

def solve():
    n, k = list(map(int, input().split()))
    s = k ** 2
    if n < s:
        print("NO")
    else:
        if (k % 2) ^ (n % 2) == 0:
            print("YES")
        else:
            print("NO")


for i in range(int(input())):
    solve()


t = int(input())
for i in range(t):
    n, k = list(map(int, input().split()))
    kek = k ** 2
    if n < kek:
        print('NO')
        continue
    n -= (k - 1)
    k = 1
    if k == 1 and n % 2 == 0:
        print('NO')
        continue
    else:
        print('YES')


t = int(input())
for i in range(t):
    n, k = list(map(int, input().split()))
    if k ** 2 <= n and k % 2 == n % 2:
        print("YES")
    else:
        print("NO")


q = int(input())
for rweur in range(q):
	n,k = map(int,input().split())
	if (n-k)%2 == 1:
		print("NO")
	else:
		if n >= k**2:
			print("YES")
		else:
			print("NO")

T = int(input())
for case in range(T):
	n,k = [int(x) for x in input().split(" ")]
	if (n-k)%2 == 0 and n >= k * k:
		print("YES")
	else:
		print("NO")

import sys
def input():
	return sys.stdin.readline()[:-1]

t = int(input())
for _ in range(t):
	n, k = map(int, input().split())
	if n%2 == k%2 and n >= k*k:
		print("YES")
	else:
		print("NO")

t = int(input())
for _ in range(t):
    n,k = map(int, input().split())
    if n >= k*k and n % 2 == k % 2:
        print("YES")
    else:
        print("NO")

import sys
import math
import bisect

def solve(n, k):
    m = k ** 2
    return n >= m and (n - m) % 2 == 0

def main():
    for _ in range(int(input())):
        n, k = list(map(int, input().split()))
        if solve(n, k):
            print('YES')
        else:
            print('NO')

def __starting_point():
    main()

__starting_point()

t = int(input())

for case in range(t):
    n, k = list(map(int, input().split()))
    sum_k = k * k
    if n % 2 == sum_k % 2 and n >= sum_k:
        print("YES")
    else:
        print("NO")

from math import *
for zz in range(int(input())):
    n, k = list(map(int, input().split()))
    if n < k**2 or n % 2 == 1 - (k % 2):
        print('NO')
    else:
        print('YES')


T = int(input())
for _ in range(T):
    N, K = map(int, input().split())
    if N >= K * K and (N - K) % 2 == 0:
        print("YES")
    else:
        print("NO")

t = int(input())
for test_i in range(t):
    n, k = map(int, input().split())
    if n % 2 == k % 2 and n >= k * k:
        print('YES')
    else:
        print('NO')

for i in range(int(input())):
    n,k=map(int,input().split())
    if (k%2)^(n%2)==0:
        if n>=k**2:
            print("YES")
        else:
            print("NO")
    else:
        print("NO")

t = int(input())

for _ in range(t):
    n, k = list(map(int, input().split()))

    n -= k**2
    if (n >= 0) and (n % 2 == 0):
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):       
    n, k = map(int, input().split())
    if k&1 == n&1 and n >= k*k:     
        print("YES")                
    else:                           
        print("NO")                 

#!/usr/bin/env python
#-*- coding:utf-8 -*-

# Code by H~$~C

from sys import stdin
input = stdin.readline
import math

for i in range(int(input())):
  n, k = map(int, input().split())
  print(['NO', 'YES'][n >= k * k and (n - k) % 2 == 0])

n = int(input())
for i in range(n):
    a, b = list(map(int, input().split()))

    if (a - b) % 2 == 0 and b <= int(a**0.5):
        print("YES")
    else:
        print("NO")
        


import sys
input = sys.stdin.readline

t = int(input())
for _ in range(t):
    n, k = list(map(int, input().split()))
    if n >= k * k and (n % 2 == k % 2):
        print('YES')
    else:
        print('NO')