output_description: Print an integer representing the minimum total travel expense.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N A B
attempt: import math
  
  n, d = input().split()
  n = int(n)
  d = int(d)
  
  
  def combinations(n, r):
      return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))
  
  
  x = []
  if d == 1:
      count = combinations(n, 2)
      count = int(count)
  else:
      for i in range(n):
          xa = [int(s) for s in input().split()]
          x.append(xa)
      a = []
      for i in range(n - 1):
          for j in range(i + 1, n):
              t = []
              for k in range(d):
                  c = (x[i][k] - x[j][k]) * (x[i][k] - x[j][k])
                  t.append(c)
                  if k == d - 1:
                      a.append(sum(t))
      answer = list(map(lambda x: pow(x, 1 / 2), a))
      count = 0
      for l in range(n):
          if answer[l].is_integer() == True:
              count = count + 1
  print(count)
  
problem_description: Statement
  
  N of us are going on a trip, by train or taxi.
  
  The train will cost each of us A yen (the currency of Japan).
  
  The taxi will cost us a total of B yen.
  
  How much is our minimum total travel expense?
samples: [{"input": "4 2 9", "output": "8\n    \n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so\nthe minimum total travel expense is 8 yen.\n\n* * *"}, {"input": "4 2 7", "output": "7\n    \n\n* * *"}, {"input": "4 2 8", "output": "8"}]