title: Algorithm to calculate number of intersecting discs
body: <p>Given an array <code>A</code> of <code>N</code> integers we draw <code>N</code> discs in a 2D plane, such that i-th disc has center in <code>(0,i)</code> and a radius <code>A[i]</code>. We say that k-th disc and j-th disc intersect, if k-th and j-th discs have at least one common point. </p>
  
  <p>Write a function </p>
  
  <pre><code>int number_of_disc_intersections(int[] A);
  </code></pre>
  
  <p>which given an array <code>A</code> describing <code>N</code> discs as explained above, returns the number of pairs of intersecting discs. For example, given <code>N=6</code> and </p>
  
  <pre><code>A[0] = 1
  A[1] = 5
  A[2] = 2
  A[3] = 1
  A[4] = 4
  A[5] = 0
  </code></pre>
  
  <p>there are 11 pairs of intersecting discs: </p>
  
  <pre><code>0th and 1st
  0th and 2nd
  0th and 4th
  1st and 2nd
  1st and 3rd
  1st and 4th
  1st and 5th
  2nd and 3rd
  2nd and 4th
  3rd and 4th
  4th and 5th
  </code></pre>
  
  <p>so the function should return 11. 
  The function should return -1 if the number of intersecting pairs exceeds 10,000,000. The function may assume that <code>N</code> does not exceed 10,000,000. </p>