P22382 [CodeChef] ICM2002
提高-
题目描述

You are given an array $A$ consisting of $N$ Integers which are initially all $0$. You are also given an array $B$ consisting of $N$ Integers. You have to tell whether you can make $A$ equal to $B$ or not by performing the following operation any number of times.

In one operation you can choose exactly $K$ distinct indices in the array A and increase the value at these indices by $1$.

------ Input: ------

First line will contain $T$, the number of testcases. Then the testcases follow.
Each testcase contains two lines of input.
First line contains two Integers $N$ and $K$.
Second line contains $N$ Integers denoting array $B$.

------ Output: ------
For each testcase, output in a single line YES if $A$ can be converted to $B$, otherwise print NO.

------ Constraints ------
$1 ≤ T ≤ 1000$
$1 ≤ N ≤ 10^{5}$
$1 ≤ K ≤ N$
$1 ≤ B[i] ≤ 10^{9}$
Sum of N over all Testcases does not exceed $10^{6}$.

----- Sample Input 1 ------
2
5 3
5 4 3 2 1
3 2
4 1 1
----- Sample Output 1 ------
YES
NO

输入格式

见题面

输出格式

见题面

样例输入
2 5 3 5 4 3 2 1 3 2 4 1 1
样例输出
YES NO