import sys from math import log def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): N = int(input()) B = int(input()) a = [float(i) for i in input().split()] dif = sum(a_i * B**(a_i - 1) for a_i in a) integral = 0 for a_i in a: if a_i != -1: integral += B**(a_i + 1) / (a_i + 1) else: integral += log(B) print(dif) print(integral) pass if __name__ == '__main__': solve()