output_description: Print the area of the triangle ABC.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      |AB| |BC| |CA|
attempt: if __name__ == "__main__":
      import sys
  
      input = sys.stdin.readline
      import collections
  
      n, k = map(int, input().split())
      td = [list(map(int, input().split())) for _ in range(n)]
      td.sort(key=lambda x: x[1], reverse=True)
      ans_list = [0]
      reverse_td = list(zip(*td))
      c = collections.Counter(reverse_td[0][:k])
      kind = len(c)
      ans = sum(reverse_td[1][:k]) + kind**2
      check = k - 1
      flag = False
      for i in range(k, n):
          t = td[i][0]
          d = td[i][1]
          if t in c:
              pass
          else:
              c[t] = 1
              while True:
                  new_t = td[check][0]
                  if c[new_t] == 1:
                      check -= 1
                      if check == -1:
                          flag = True
                          break
                  else:
                      c[new_t] -= 1
                      ans_list.append(2 * kind + 1 + d - td[check][1])
                      kind += 1
              if flag:
                  break
      print(ans + max(ans_list))
  
problem_description: Statement
  
  There is a right triangle ABC with ∠ABC=90°.
  
  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the
  right triangle ABC.
  
  It is guaranteed that the area of the triangle ABC is an integer.
samples: [{"input": "3 4 5", "output": "6\n    \n\n![tri](https://img.atcoder.jp/ghi/44c1d4cbdf4677ce3b08ca70b5ce98ea.png)\n\nThis triangle has an area of 6.\n\n* * *"}, {"input": "5 12 13", "output": "30\n    \n\nThis triangle has an area of 30.\n\n* * *"}, {"input": "45 28 53", "output": "630\n    \n\nThis triangle has an area of 630."}]