#!/usr/bin/env python
#coding:utf8

import math

def read():
    raw_input()
    B = input()
    vList = map(float, raw_input().split())
    return B, vList


def work((B, vList)):
    total = 0
    for i in range(len(vList)):
        total += vList[i] * math.pow(B, vList[i] - 1)
    print "%.10lf" % total
    
    total = 0
    for i in range(len(vList)):
        if vList[i] == -1:
            total += math.log(B)
        else:
            total += math.pow(B, vList[i] + 1) / (vList[i] + 1)
    print "%.10lf" % total
    

if __name__ == "__main__":
    work(read())