406748: GYM102535 E Potent Plants
Description
Some agents attack with knives, others use only their bare fists. Several use guns of some sort, from small pistols to long range rifles. Then there are those who use very flashy explosions.
You smirk to yourself as you think of those guys. "They could hardly call themselves Agents of Covert Missions."
As for you, you pride yourself in using herbs—special plants that you grow yourself. These plants of yours produce potent leaves which could be turned into powder and pills for different uses: causing paralysis, inducing sleep, and extracting the truth from people.
Unfortunately, the Center for Interior Architecture wasn't that meticulous when designing your headquarters. You have many plants of differing weights, but the area where you are growing your plants can only handle up to a maximum weight $$$w$$$. Will you be able to grow all of your plants?
InputThe first line of input contains a single integer $$$t$$$ denoting the number of test cases.
Each test case is on one line, starting with an integer $$$w$$$ as described above, then a string $$$S$$$ representing your collection of plants.
Each plant is represented by an uppercase letter, from "A" to "Z". Plants denoted by "A" are of weight $$$1$$$, "B" of weight $$$2$$$, and so on until "Z" with weight $$$26$$$.
Constraints
- $$$1 \leq t \leq 10^5$$$
- $$$0 \leq w \leq 10^9$$$
- $$$1 \leq |S| \leq 10^6$$$
- Sum of $$$|S|$$$ in all cases will not exceed $$$10^6$$$
- $$$S$$$ is composed of uppercase English characters
For each test case, print a line stating if you could grow all the plants. Output only "YES" or "NO" (without the quotes).
ExampleInput4 130 ACMALGOLYMPICS 2020 TWENTYTWENTY 472 THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG 473 THEQUICKBROWNFOXJUMPSOVERTHELAZYDOGOutput
NO YES NO YES