fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char a[]="None";
  5. char b[]="Arithmetic Progression";
  6. char c[]="Geometric Progression";
  7. char d[]="Both";
  8. int test,x,y,z,i;
  9.  
  10. scanf("%d",&test);
  11.  
  12. for(i=1;i<=test;i++)
  13. {
  14. scanf("%d%d%d",&x,&y,&z);
  15.  
  16. if((2*y)==(x+z))
  17. {
  18. if((x==y)&&(y==z))
  19. puts(d);
  20. else
  21. puts(b);
  22. }
  23. else if((y*y)==(x*z))
  24. {
  25. if((x==y)&&(y==z))
  26. puts(d);
  27. else
  28. puts(c);
  29. }
  30.  
  31.  
  32. else
  33. puts(a);
  34. }
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0s 2160KB
stdin
4
1 2 5
1 3 5
2 4 8
2 2 2
stdout
None
Arithmetic Progression
Geometric Progression
Both