Solving a programming-contest using Python
<p>I found this problem, which I thought would be interesting to solve but couldn't really come up with a correct solution- </p>

<blockquote>
  <p>Inside a room, there is a monster with
  N heads, and a human (with 1 head).
  The human has two laser guns. The
  first gun, A destroys C1 heads when
  fired and the second gun,B destroys C2
  heads when fired [The guns may destroy
  both the monster's as well as human
  heads, but the guns prioritize monster
  heads over human ones].</p>
  
  <p>Also, if after the firing of the gun
  the monster has a positive non-zero
  number of heads left, the monster will
  grow additional heads. The monster
  grows G1 heads when gun A is used and
  it grows G2 heads when gun B is used.</p>
  
  <p>The problem is to input N, C1, C2, G1
  and G2, then find out what would be
  the shortest combination of
  gun-choice(A or B) the human must use
  to kill the monster(the monster dies
  when No. of heads=0).
  [Note- this problem is from a programming contest that has already ended]</p>
</blockquote>

<p>I tried approaching this problem using recursion but found myself clueless about how to actually come up with the solution. So, if you could give some hints how to approach the problem, that'd be great. </p>
