#include<bits/stdc++.h>
using namespace std;

int main()
{
	int t;
	cin>>t;
	while(t--){
		int n,a[51];
		double avg,to=0.0;
	    cin >> n;
	    for(int i=0;i<n;i++){
	        cin>>a[i];
	        to=to+a[i];
	    }
	    avg=to/n;
	    //cout << avg<<endl;
	   bool exist=find(a,a+n,avg)!=a+n;
	   if(exist){
	       cout<<"YES"<<endl;
	   }else{
	       cout<<"NO"<<endl;
	   }
	   avg=0;
	   	}
	
	return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: