title: Fully cover a rectangle with minimum amount of fixed radius circles
body: <p>I've had this problem for a few years. It was on an informatics contest in my town a while back. I failed to solve it, and my teacher failed to solve it. I haven't met anyone who was able to solve it. Nobody I know knows the right way to give the answer, so I decided to post it here:</p>
  
  <p><strong>Ze problem</strong></p>
  
  <p>Given a rectangle, X by Y, find the minimum amount of circles N with a fixed given radius R, necessary to fully cover every part of the rectangle.</p>
  
  <hr>
  
  <p>I have thought of ways to solve it, but I have nothing definite. If each circle defines an inner rectangle, then <code>R^2 = Wi^2 + Hi^2</code>, where <code>Wi</code> and <code>Hi</code> are the width and height of the practical area covered by each circle <code>i</code>. At first I thought I should make <code>Wi</code> equal to <code>Wj</code> for any <code>i</code>=<code>j</code>, the same for <code>H</code>. That way, I could simplify the problem by making the width/height ratios equal with the main rectangle (<code>Wi/Hi</code> = <code>X/Y</code>). That way, <code>N=X/Wi</code>. But that solution is surely wrong in case <code>X</code> greatly exceeds <code>Y</code> or vice versa.<br>
  The second idea was that <code>Wi</code>=<code>Hi</code> for any given <code>i</code>. That way, squares fill space most efficiently. However if a very narrow strip remains, it's much more optimal to use rectangles to fill it, or better yet - use rectangles for the last row before that too.<br>
  Then I realized that none of the ideas are the optimal, since I can always find better ways of doing it. It will always be close to final, but not final.</p>
  
  <p><strong>Edit</strong><br>
  In some cases (large rectangle) joining hexagons seem to be a better solution than joining squares.</p>
  
  <p><strong>Further Edit</strong><br>
  Here's a comparison of 2 methods: clover vs hexagonal. Hexagonal is, obviously, better, for large surfaces. I do think however that when the rectangle is small enough, rectangular method may be more efficient. It's a hunch. Now, in the picture you see 14 circles on the left, and 13 circles on the right. Though the surface differs much greater (double) than one circle. It's because on the left they overlap less, thus waste less surface.
  <img src="https://i.stack.imgur.com/XI4um.png" alt="Hexagonal vs clover"></p>
  
  <p>The questions still remain:</p>
  
  <ol>
  <li>Is the regular hexagon pattern itself optimal? Or certain adjustments should be made in parts of the main rectangle.</li>
  <li>Are there reasons not to use regular shapes as "ultimate solution"?</li>
  <li>Does this question even have an answer? :)</li>
  </ol>