## Doremy’s Connecting Plan Solution

Doremy lives in a country consisting of n cities numbered from 1 to n , with ai people living in the i -th city. It can be modeled as an undirected graph with n nodes.

Doremy resides in a country composed of $n$ cities, numbered from 1 to $n$, each housing $a_{i}$ people in the $i$-th city. This country can be represented as an undirected graph with $n$ nodes.

Initially, the graph is devoid of any edges. Doremy’s objective is to create a connected graph. To achieve this, she can connect nodes $i$ and $j$ by adding an edge if the condition $∑_{k∈S}a_{k}≥i⋅j⋅c$ is satisfied, where $S$ represents the set of all nodes within the same connected component as either $i$ or $j$, and $c$ is a given constant.

Can Doremy effectively establish a connected graph?

The input entails multiple test cases. The first line contains a single integer $t$ ($1≤t≤1_{4}$), denoting the number of test cases. The subsequent lines describe each test case.

### For each test case: Doremy’s Connecting Plan Solution

- The first line holds two integers: $n$ and $c$ ($2≤n≤2×1_{5}$, $1≤c≤1_{6}$)—the number of nodes and the constant, respectively.
- The second line of each test case comprises $n$ integers $a_{1},a_{2},…,a_{n}$ ($0≤a_{i}≤1_{12}$)—representing the population in each city.

Output is “YES” if it’s possible to make the graph connected, or “NO” otherwise.

For instance, in the first test case, Doremy can establish connections as follows:

- Connect (1,2) as $a_{1}+a_{2}=20≥i⋅j⋅c=20$.
- Connect (1,3) as $a_{1}+a_{2}+a_{3}=35≥i⋅j⋅c=30$.
- Connect (1,4) as $a_{1}+a_{2}+a_{3}+a_{4}=45≥i⋅j⋅c=40$.

The other test cases follow similar conditions and connectivity rules.