blob: 444284b0ec3840ce0d6e7168ae597304cf755266 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
use std::io::BufRead;
fn main() {
let stdin = std::io::stdin();
let mut lines = stdin.lock().lines();
for _t in 0..lines.next().unwrap().unwrap().trim().parse::<u8>().unwrap() {
let _n = lines.next().unwrap().unwrap();
let line = lines.next().unwrap().unwrap();
let i = line.split(' ').map(|x| x.trim().parse().unwrap());
let a: Vec<i64> = i.collect();
println!("{}", (a.iter().max().unwrap() - a.iter().min().unwrap()) * 2);
}
}
|