title: Find an optimal n square size (same for each) to fit most part of rectangle container
body: <p><strong>Input</strong></p>
  
  <p>Rectangle area width and height, so we could calculate rectangle aspect/proportions.</p>
  
  <p>N is the number of squares that we want to resize using <strong>the same size for each</strong>.</p>
  
  <p><strong>Output</strong></p>
  
  <p>Find the optimal squares size that would fit most part of our container. For example</p>
  
  <pre><code>containerWidth = 200;
  containerHeight = 100;
  n = 8;
  </code></pre>
  
  <p>In this case squaresSize should be 50 to fit most of rectangle area.</p>
  
  <p><strong>What i tried</strong></p>
  
  <p>I already tried to calculate container math area and then divide it to the number of squares to get each square area by taking a square root. But this is the ideal square size, so it douesn't respect each square place relative to container rectangle.</p>
  
  <p><strong>Real purpouse</strong></p>
  
  <p>I trying to make scallable user interface, that would draw as much square objects in rectangle container as it is possible.</p>