mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
19 lines
368 B
C++
19 lines
368 B
C++
|
#include <stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
int T,N,min,max,a;
|
||
|
scanf("%d",&T);
|
||
|
while(T--){
|
||
|
scanf("%d",&N);
|
||
|
min = 0x3f3f3f3f;
|
||
|
max = -0x3f3f3f3f;
|
||
|
while(N--){
|
||
|
scanf("%d",&a);
|
||
|
if(a>max) max = a;
|
||
|
if(a<min) min = a;
|
||
|
}
|
||
|
printf("%d\n",(max-min)*2);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|