var n,k,x:longint; i:integer; 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 begin read(x); writeln(g,big(x,k)); end; end.