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(e) for e in input().split(" ")]
  d_node2setindex = {}
  ABs = []
  for _ in range(M):
      ABs.append([int(e) for e in input().split(" ")])
  maxValue = N * (N - 1) // 2
  ans = [maxValue]
  buf_sets = []
  flagSkip = False
  for i in range(M - 1):
      a, b = ABs[M - 1 - i]
      # print("a,b", a, b)
      if flagSkip is True:
          ans.append(0)
          continue
  
      idx_a = d_node2setindex.get(a, None)
      idx_b = d_node2setindex.get(b, None)
      # if len(buf_sets) > 0:
      #     for j, s in enumerate(buf_sets):
      #         if idx_a is None:
      #             if a in s:
      #                 idx_a = j
      #         if idx_b is None:
      #             if b in s:
      #                 idx_b = j
      #         if idx_a is not None and idx_b is not None:
      #             break
      delta = 0
      if idx_a is None and idx_b is None:
          s_new = set([a, b])
          idx_set = len(buf_sets)
          d_node2setindex[a] = idx_set
          d_node2setindex[b] = idx_set
          buf_sets.append(s_new)
          delta = 1
      elif idx_a is not None and idx_b is None:
          delta = len(buf_sets[idx_a])
          buf_sets[idx_a].add(b)
          d_node2setindex[b] = idx_a
      elif idx_a is None and idx_b is not None:
          delta = len(buf_sets[idx_b])
          buf_sets[idx_b].add(a)
          d_node2setindex[a] = idx_b
      else:
          if idx_a != idx_b:
              s_a = buf_sets[idx_a]
              s_b = buf_sets[idx_b]
              delta = len(s_a) * len(s_b)
              [d_node2setindex.__setitem__(e, idx_a) for e in s_b]
              # for e in s_b:
              #     d_node2setindex[e] = idx_a
              buf_sets[idx_a] = s_a | s_b
              buf_sets[idx_b] = None
              # buf_sets.pop(idx_b)
  
      d = ans[-1] - delta
      ans.append(d)
      if d == 0:
          flagSkip = True
  
  txt = "\n".join(map(str, reversed(ans)))
  print(txt)
  
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"}]