Skip to content

Instantly share code, notes, and snippets.

@TheoKlein
Last active February 27, 2016 03:27
Show Gist options
  • Select an option

  • Save TheoKlein/c444f14538a7119615a4 to your computer and use it in GitHub Desktop.

Select an option

Save TheoKlein/c444f14538a7119615a4 to your computer and use it in GitHub Desktop.
ZeroJudge_a005_C
#include <stdio.h>
int main (){
int a,b,c,d,e,n,i;
while(scanf("%d",&n)!= EOF){
for ( i = 0 ; i < n ; i ++){
scanf("%d%d%d%d",&a,&b,&c,&d);
if (c - b == b - a)
printf("%d %d %d %d %d\n",a,b,c,d,d*2 - c);
else if (c / b == b / a)
printf("%d %d %d %d %d\n",a,b,c,d,(d*d)/c);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment