Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- //freopen("input.txt", "r", stdin);
- int testCase, n;
- cin >> testCase;
- for (int tc = 1; tc <= testCase; tc++)
- {
- cin >> n;
- int* a = new int[n];
- int sum = 0;
- double average = 0;
- for (int i = 0; i < n; i++)
- {
- cin >> a[i];
- sum += a[i];
- }
- average = sum * 1.0 / n;
- if (average == (int)average) cout << n << endl;
- else cout << (n-1) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement