#include #include #include #include #include using namespace std; int main() { int T,n,min,max,avg; scanf("%d",&T); for(int i=0;i=min){ if(n==1){ flag=max==avg&&min==avg; }else if(n==2){ flag=(max+min)==avg*2; }else{ int left=avg*n-max-min; double leftAvg=(double)left/(n-2); flag=leftAvg>=min+0.0&&leftAvg<=max+0.0; } } if(flag) printf("yes\n"); else printf("no\n"); } }