Skip to content

Instantly share code, notes, and snippets.

@fazd
Created August 28, 2017 18:19
Show Gist options
  • Save fazd/1f987d1a9ee4789ddc388500e146a346 to your computer and use it in GitHub Desktop.
Save fazd/1f987d1a9ee4789ddc388500e146a346 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <math.h>
using namespace std;
int main() {
int T,k=0;
scanf("%d",&T);
bool sw=true;
int copia=T,u=0;
while(u<T){
int w,i=0;
int A[2];
scanf("%d",&w);
sw=true;
int y=0;
while(y<w){
scanf("%d",&A[i]);
i++;
int l=fabs(A[0]-A[1]);
if(T==copia){
k=l;
}
else{
if(k!=l){
printf("no\n");
sw=false;
break;
}
}
if(sw){
printf("yes\n");
}
y++;
}
u++;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment