var n,k:longint; i:integer; v:array[1..1000] of byte; function big (x,k:longint):longint; var i,suma,kk:longint; begin suma:=0; kk:=k; for i:=1 to x do begin suma:=suma+trunc(exp(k*ln(2))); k:=k+kk+1; end; big:=suma; end; begin readln(n,k); for i:=1 to n do read(v[i]); writeln; for i:=1 to n do writeln(big(v[i],k)); end.