title: Math question regarding a Fantasy Sports (snake) draft
body: <p>If you're familiar with any fantasy sports draft, the draft-order grid looks something like this:</p>
  
  <pre><code>EXAMPLE 1 (3-teams):
  Round   Team 1   Team 2   Team 3
    1     1 (1.1)  2 (1.2)  3 (1.3)
    2     6 (2.3)  5 (2.2)  4 (2.1)
    3     7 (3.1)  8 (3.2)  9 (3.3)
  </code></pre>
  
  <p>The numbers 1-9 represent the <code>overall pick number</code> of the draft.</p>
  
  <p>The items in parentheses represent the <code>round_number</code> and <code>pick_number_of_that_round</code>.</p>
  
  <p>I cannot figure out a formula which converts my <code>overall_pick_number</code> into it's proper <code>pick_number_of_that_round</code>.</p>
  
  <p>In the above example, the number 8 equals 2 (the 2nd pick of the 3rd round). But in a 4-team league, the number 8 equals 4 (the 4th pick of the 2nd round).</p>
  
  <pre><code>EXAMPLE 2 (4-teams):
  Round   Team 1   Team 2   Team 3   Team 4
    1     1 (1.1)  2 (1.2)  3 (1.3)  4 (1.4)
    2     8 (2.4)  7 (2.3)  6 (2.2)  5 (2.1)
    3     9 (3.1)  10 (3.2) 11 (3.3) 12 (3.4)
  </code></pre>
  
  <p>I thought about trying to dynamically build an associative array based on the number of teams in the league containing every pick and which pick it belonged to, but it's just beyond me.</p>