<h1> How much do I need to hurry to build SP on next turn? </h1> <form action="" method="get"> <p> Turns left: <input name="turns" value="<%=params[:turns]%>" /> Full cost: <input name="cost" value="<%=params[:cost]%>" /> <input type="submit" value="calculate" /></p> </form> <% if params[:turns] %> <p> Invest at least <%=(params[:cost].to_f / params[:turns].to_f * (params[:turns].to_f - 1)).ceil %> EC </p> <% end %>