package org.goro.uva;
import java.util.Scanner;
//11364 - Parking
public class Parking {
static short testCases, shops;
static short min;
static short max;
static short val;
static Scanner scanner;
public static void main(String[] args) {
scanner = new Scanner(System.in);
testCases = scanner.nextShort();
while((testCases--) != 0) {
shops = scanner.nextShort();
min = 100;
max = 0;
while((shops--) != 0) {
val = scanner.nextShort();
if(val > max) max = val;
if(val < min) min = val;
}
System.out.println((max - min) * 2);
}
}
}
10/08/2013
11364 - Parking - Java
11364 - Parking - Java
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment