Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int x, y, z,i, max,min,d;
- scanf("%d",&x);
- while (x--)
- {
- scanf("%d",&y);
- max=0;
- min=50000;
- for (i=0;i<y;i++)
- {
- scanf("%d",&z);
- if (max<z) max=z;
- if (min>z) min=z;
- }
- d=(max-min)*2;
- printf("%d\n",d);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement