Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 16843 | Accepted: 10302 |
Description
Input
Output
Sample Input
2 1 2 3 4 1 2 4 8
Sample Output
1 2 3 4 5 1 2 4 8 16
Source
# include<stdio.h> # include<string.h> int main() { int t,a,b,c,d; scanf("%d",&t); while(t--) { scanf("%d%d%d%d",&a,&b,&c,&d); if((a-b)==(b-c) && (a-b)==(c-d)) printf("%d %d %d %d %d\n",a,b,c,d,2*d-c); else printf("%d %d %d %d %d\n",a,b,c,d,d*d/c); } return 0; }