using System; namespace No347 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int b = int.Parse(Console.ReadLine()); string[] sa = Console.ReadLine().Split(' '); double diff = 0.0, inte = 0.0; double a; for (int i = 0; i < n; i++) { a = double.Parse(sa[i]); diff += a * Math.Pow((double)b, a - 1.0); if (a == -1.0) inte += Math.Log10(Math.Abs(a)); else inte += Math.Pow((double)b, a + 1.0) / (a + 1.0); } Console.WriteLine(diff); Console.WriteLine(inte); } } }