var f,g:text; 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 assign(f,'int.in'); reset(f); assign(g,'int.out'); rewrite(g); readln(f,n,k); for i:=1 to n do begin read(f,x); writeln(g,big(x,k)); end; close(f); close(g); end.