import java.util.Scanner; public class No347 { 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]; for(int i = 0;i < N;i++) { a[i] = sc.nextDouble(); } double sumbibun = 0; double sumsekibun = 0; for(int i = 0;i < N;i++) { if(a[i] != 0) { sumbibun += a[i] * Math.pow(B, a[i]-1); } if(a[i] != -1) { sumsekibun += Math.pow(B, a[i]+1) / (a[i]+1); }else if(a[i] == -1) { sumsekibun += Math.log(B); } } System.out.println(sumbibun); System.out.println(sumsekibun); } }