#K38277. Equalizing Pollution Levels
Equalizing Pollution Levels
Equalizing Pollution Levels
You are given T test cases. In each test case, there are N cities, each with its own pollution level. Your task is to determine whether it is possible to equalize the pollution levels across all cities. In this problem, you are not allowed to change the pollution levels. Instead, you simply need to check if all given pollution levels are already equal.
Formally, given a test case with pollution levels \(P_1, P_2, \dots, P_N\), output YES if and only if \(P_1 = P_2 = \cdots = P_N\); otherwise, output NO.
Note: Input will be accepted through standard input (stdin) and output should be printed to standard output (stdout).
inputFormat
The first line contains an integer T representing the number of test cases. For each test case:
- The first line contains an integer N, the number of cities.
- The second line contains N space-separated integers representing the pollution levels of the cities.
outputFormat
For each test case, output a single line containing YES if all pollution levels are equal, or NO otherwise.## sample
3
4
6 12 6 18
5
3 3 3 3 3
3
1 2 3
NO
YES
NO
</p>