import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from math import log N = int(readline()) B = int(readline()) *A, = map(float,read().split()) D = 0 I = 0 for a in A: D += a * (B ** (a-1)) if a != -1: I += B**(a+1) / (a+1) else: I += log(B) print(D,I,sep='\n')