output_description: Print the number of pairs with integer product A_i \cdot A_j (and i < j).
  
  * * *
input_description: Input is given from Standard Input in the following format.
  
      
      
      N
      A_1
      A_2
      \vdots
      A_N
attempt: from fractions import Fraction
  
  N = int(input())
  A = [Fraction(input()) for i in range(N)]
  
  
  def vp(n, p):
      res = 0
      m = n
      while m > 0:
          if m % p == 0:
              res += 1
              m //= p
          else:
              return res
  
  
  def div25(f):
      return (
          vp(f.numerator, 2) - vp(f.denominator, 2),
          vp(f.numerator, 5) - vp(f.denominator, 5),
      )
  
  
  B = [div25(f) for f in A]
  B.sort()
  MAX_N = 100
  C = [[0 for j in range(MAX_N)] for i in range(MAX_N)]
  for seq in B:
      x, y = seq
      C[x + MAX_N // 2][y + MAX_N // 2] += 1
  D = [[0 for j in range(MAX_N)] for i in range(MAX_N + 1)]
  E = [[0 for j in range(MAX_N + 1)] for i in range(MAX_N + 1)]
  for i in range(MAX_N):
      for j in range(MAX_N):
          D[i + 1][j] = D[i][j] + C[i][j]
  for i in range(MAX_N + 1):
      for j in range(MAX_N):
          E[i][j + 1] = E[i][j] + D[i][j]
  ans = 0
  for seq in B:
      x, y = seq
      tmp = (
          E[MAX_N][MAX_N]
          + E[-x + MAX_N // 2][-y + MAX_N // 2]
          - E[MAX_N][-y + MAX_N // 2]
          - E[-x + MAX_N // 2][MAX_N]
      )
      if x >= 0 and y >= 0:
          ans += tmp - 1
      else:
          ans += tmp
  print(ans // 2)
  
problem_description: Statement
  
  You are given N real values A_1, A_2, \ldots, A_N. Compute the number of pairs
  of indices (i, j) such that i < j and the product A_i \cdot A_j is integer.
samples: [{"input": "5\n    7.5\n    2.4\n    17.000000001\n    17\n    16.000000000", "output": "3\n    \n\nThere are 3 pairs with integer product:\n\n  * 7.5 \\cdot 2.4 = 18\n  * 7.5 \\cdot 16 = 120\n  * 17 \\cdot 16 = 272\n\n* * *"}, {"input": "11\n    0.9\n    1\n    1\n    1.25\n    2.30000\n    5\n    70\n    0.000000001\n    9999.999999999\n    0.999999999\n    1.000000001", "output": "8"}]