Skip to content

Instantly share code, notes, and snippets.

@completejavascript
Created September 15, 2018 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save completejavascript/c4f4c9277cdf00b775f7af710c9b107b to your computer and use it in GitHub Desktop.
Save completejavascript/c4f4c9277cdf00b775f7af710c9b107b to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
//freopen("input.txt","r",stdin);
int Testcase, n, sum;
cin >> Testcase;
for(int tc = 0; tc < Testcase; tc++)
{
cin >> n;
sum = 0;
for(int i = 0; i < n; i++)
{
int temp;
cin >> temp;
sum += temp;
}
if(sum % n == 0) cout << n << endl;
else cout << n - 1 << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment