#C11164. Equal Distribution of Fruits
Equal Distribution of Fruits
Equal Distribution of Fruits
You are given T test cases. Each test case consists of an integer \(N\) followed by \(N\) integers representing the number of fruits in different baskets. You need to determine whether all baskets in each test case contain the same number of fruits.
If all baskets have an equal number of fruits, print YES
; otherwise, print NO
.
Input Format: The first integer is \(T\), the number of test cases. Each test case starts with an integer \(N\) denoting the number of baskets, followed by \(N\) space-separated integers representing the fruit counts.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains a single integer \(T\), the number of test cases.
- For each test case, the first number is an integer \(N\) representing the number of baskets, followed by \(N\) space-separated integers indicating the fruit counts.
outputFormat
For each test case, output a single line containing either YES
if all baskets have the same number of fruits, or NO
otherwise.
1
3
6 6 6
YES
</p>