import java.util.Scanner; public class Test { public static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); double x = sc.nextDouble(), t, ans1 = 0, ans2 = 0; for (int i = 0; i < n; i++) { t = sc.nextDouble(); ans1 += t * Math.pow(x, t - 1); if (t == -1) { ans2 += Math.log(x); } else { ans2 += Math.pow(x, t + 1) / (t + 1); } } System.out.println(ans1); System.out.println(ans2); } }