output_description: Print the number of times Takahashi will hear his favorite sound.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C
attempt: N, M = [int(elm) for elm in input().split(" ")]
  bridges = [[int(elm) for elm in input().split(" ")] for _ in range(M)]
  
  
  class Graph:
      pass
  
  
  graph = {}
  for node in range(1, N + 1):
      graph[node] = [node]
      # graph_mem[node] = []
  
  graph_n_mem = [0] + [1 for i in range(N)]
  n_all_pairs = N * (N - 1) // 2
  
  # def delete_graph(B):
  #    pass
  
  
  def calc_out(n_list):
      out = n_all_pairs
      for elm in n_list:
          if elm <= 1:
              continue
          tmp = elm * (elm - 1) // 2
          out -= tmp
      return out
  
  
  outs = []
  for A, B in reversed(bridges):
      # print(graph_n_mem)
      # print("before AB", A, B)
      A = graph[A][0]
      B = graph[B][0]
      # print(graph_n_mem, "AB", A, B)
      if graph[A] != graph[B]:
          # graph_n_mem[A] += len(graph[B])
          graph_n_mem[A] += graph_n_mem[B]
          graph_n_mem[B] = 0
  
          graph[A] += graph[B]
          for node in graph[A]:
              graph[node] = graph[A]
  
          # graph_mem[A] += graph_mem[B]
  
      out = calc_out(graph_n_mem)
      outs.append(out)
  
  outs = outs[::-1]
  outs = outs[1:] + [n_all_pairs]
  for out in outs:
      print(out)
  
problem_description: Statement
  
  Takahashi likes the sound when he buys a drink from a vending machine.
  
  That sound can be heard by spending A yen (the currency of Japan) each time.
  
  Takahashi has B yen. He will hear the sound as many times as he can with that
  money, but at most C times, as he would be satisfied at that time.
  
  How many times will he hear the sound?
samples: [{"input": "2 11 4", "output": "4\n    \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n    \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]