def lscan; gets.split.map(&:to_i); end n, x = lscan aa = lscan p aa.reduce(:+)-x*(n-1)