using static System.Math;
using System;

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var b = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, double.Parse);
        var ans1 = 0d;
        var ans2 = 0d;
        for (int i = 0; i < n; i++)
        {
            ans1 += a[i] * Pow(b, a[i] - 1);
            ans2 += (1 / (a[i] + 1) * Pow(b, a[i] + 1));
        }
        Console.WriteLine("{0}\n{1}", ans1, ans2);
    }
}