Created
August 28, 2017 18:19
-
-
Save fazd/1f987d1a9ee4789ddc388500e146a346 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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