P11014 [HackerEarth] mst and idc
普及
题目描述

Mid semester exams are approaching and 'IDC' wants to study with the toppers of the batch.
So he decide to take a temporary room near all the toppers of the computer science batch.

All room are on a straight line and room numbers are integers.
Since he is very lazy and doesnt want to walk. He wants to visit all the toppers everyday
to collect notes so selects a room which minimises the distance he has to walk everyday.

Constraints:
1 ≤ T ≤ 100
1 ≤ Room Number(Integer) ≤ 100
1 ≤ N ≤20

Input:
First line of input contains T, number of testcases.
First line of each line of testcase contains N, number of toppers. Next line contains room numbers of N toppers space separated.

Output:
Output contains T lines, each line will contains the minimum distance he has to walk each day.

SAMPLE INPUT
2
4
24 13 89 37
6
7 30 41 14 39 42

SAMPLE OUTPUT
152
70

输入格式

见题面

输出格式

见题面

样例输入
2 4 24 13 89 37 6 7 30 41 14 39 42 SAMPLE
样例输出
152 70