[Solution] Average Gift CodeChef Solution | CodeChef Problem Solution 2022
Chef has a set containing distinct integers.
Chef wants to gift Chefina an array of any finite length such that the following conditions hold true:
- . In other words, each element of the array should belong to the set .
- Mean value of all the elements in is exactly .
Solution Click Below:- CLICK HERE
Find whether there exists an array of finite length satisfying the above conditions.
Input Format
- First line will contain , the number of test cases. Then the test cases follow.
- First line of each test case contains two integers and - denoting the size of set and the mean value of the required array.
- Second line contains distinct integers - denoting the set .
Output Format
For each test case, output in a single line, YES
if there exists an array satisfying the given conditions, NO
otherwise.
You may print each character of the string in uppercase or lowercase (for example, the strings YES
, yEs
, yes
, and yeS
will all be treated as identical).
Constraints
- for
- Sum of over all test case do not exceed .
Join Now for Solution:-
No comments:
Post a Comment