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 = map(int, input().split())
  isl1 = [0] * m
  isl2 = [0] * m
  for i in range(m):
      (isl1[i], isl2[i]) = map(int, input().split())
      isl1[i] -= 1
      isl2[i] -= 1
  boss = [-1] * n
  mem = [1] * n
  dpt = [0] * n
  ans = [0] * m
  s = (n * (n - 1)) // 2
  ans[m - 1] = s
  
  
  def sea(i, boss):
      m = 0
      while boss[i] >= 0:
          i = boss[i]
          m += 1
      return i, m
  
  
  for j in range(m - 1):
      i = m - j - 1
      i1, i2 = isl1[i], isl2[i]
      p1, m1 = sea(i1, boss)
      p2, m2 = sea(i2, boss)
      if p1 != p2:
          if dpt[m1] < dpt[m2]:
              (p1, p2) = (p2, p1)
          boss[p2] = p1
          s -= mem[p1] * mem[p2]
          mem[p1] += mem[p2]
          mem[p2] = 0
          dpt[p1] = max(dpt[p1], dpt[p2] + 1)
      ans[i - 1] = s
  
  for i in range(m):
      print(ans[i])
  
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"}]