/VERSUSGAME - Trò chơi đối kháng

<Problem>

http://ntucoder.net/Problem/Details/5564
              Uses Crt,math;
      Var a,b,c,d:array[0..2000000] of longint;
          i,j,n,max,k:longint;
      Begin
          readln(n);
          for i:=1 to n do
          begin
              readln(c[i]);
              if c[i]>max then max:=c[i]; //Quy hoach dong chi xet den max
          end;
          a[1]:=1; a[2]:=3; a[3]:=5; a[4]:=10; a[5]:=15; a[6]:=19;
          b[1]:=1; b[2]:=1; b[3]:=2; b[4]:=1; b[5]:=2; b[6]:=3;
          for i:=1 to max do
          begin
              d[i]:=maxlongint; //khoi tao
              for j:=1 to 6 do
              begin
                  k:=a[j];
                  if (i-k>=0) then
                  begin
                      d[i]:=min(d[i],d[i-k]+b[j]);
                      //Vd d[30]=d[20]+19 (a[6]) toi uu hon la d[30]=d[21]+19 
                  end;
              end;
          end;
          for i:=1 to n do writeln(d[c[i]]);
          readln;
      End.