import java.util.Scanner; public class Main_yukicoder347 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int b = sc.nextInt(); double[] a = new double[n]; double x1 = 0; double x2 = 0; for (int i = 0; i < n; i++) { a[i] = sc.nextDouble(); x1 += a[i] * Math.pow(b, a[i] - 1); if (a[i] == -1) { x2 += Math.log(b); } else { x2 += Math.pow(b, a[i] + 1) / (a[i] + 1); } } System.out.printf("%.5f\n", x1); System.out.printf("%.5f\n", x2); sc.close(); } }