[Solution] Everything Everywhere All But One Codeforces Solution | Codeforces Problem Solution 2022
You are given an array of integers . After you watched the amazing film "Everything Everywhere All At Once", you came up with the following operation.
In one operation, you choose elements of the array and replace each of them with their arithmetic mean (which doesn't have to be an integer). For example, from the array we can get the array , if we choose the first three elements, or we can get the array , if we choose all elements except the third.
Is it possible to make all elements of the array equal by performing a finite number of such operations?
The first line of each test case contains a single integer () — the number of integers.
The second line of each test case contains integers ().
For each test case, if it is possible to make all elements equal after some number of operations, output . Otherwise, output .
You can output and in any case (for example, strings , , will be recognized as a positive response).
No comments:
Post a Comment