1 2 3 4 5
#!/usr/bin/env python for i in range(int(input())): input() a = list(map(int, input().split())) print(max(a)-min(a)<<1)