using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static int N, B; static double[] a; static void Main() { N = int.Parse(Console.ReadLine()); B = int.Parse(Console.ReadLine()); a = Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); double X1 = 0, X2 = 0; for(int i = 0; i < N; i++) { X1 += a[i] * Math.Pow(B, a[i] - 1.0); if (a[i] == -1.0) { X2 += Math.Log(Math.Abs(B)); } else { X2 += (1.0 / (a[i] + 1.0)) * Math.Pow(B, a[i] + 1.0); } } Console.WriteLine("{0}\n{1}", X1, X2); } }