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 bisect import bisect_left
  from decimal import Decimal
  
  N, *A = map(Decimal, open(0).read().split())
  N = int(N)
  A.sort()
  
  c = {}
  intc = 0
  ints = []
  decs = []
  for d in A:
      if d in c:
          c[d] += 1
          if d == int(d):
              intc += 1
      else:
          c[d] = 1
          if d == int(d):
              intc += 1
              ints.append(d)
          else:
              decs.append(d)
  
  result = intc * (intc - 1) // 2
  for i in range(len(decs)):
      a = decs[i]
      t = bisect_left(decs, 1 / a)
      for j in range(t, len(decs)):
          b = decs[j]
          t = a * b
          if t == int(t):
              # print(a, b)
              result += c[a] * c[b]
  
      f = a - int(a)
      t = bisect_left(ints, 1 / f)
      for j in range(t, len(ints)):
          b = ints[j]
          t = a * b
          if t == int(t):
              # print(a, b)
              result += c[a] * c[b]
  
  print(result)
  
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"}]