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: class UnionFind:
      def __init__(self, n):
          self.__parent = [i for i in range(n)]
          self.size = [1 for _ in range(n)]
  
      def union(self, x, y):
          pX, pY = self.find(x), self.find(y)
          if pX != pY:
              if pX < pY:
                  self.__parent[pY] = pX
                  self.size[pX] += self.size[pY]
              else:
                  self.__parent[pX] = pY
                  self.size[pY] += self.size[pX]
  
      def find(self, x):
          if self.__parent[x] != x:
              self.__parent[x] = self.find(self.__parent[x])
          return self.__parent[x]
  
  
  N, M = map(int, input().split())
  bridge = [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(M)]
  uf = UnionFind(N)
  num_disconnect = int(N * (N - 1) / 2)
  ans = []
  for a, b in reversed(bridge):
      ans.append(num_disconnect)
      pA, pB = uf.find(a), uf.find(b)
      if pA != pB:
          num_disconnect -= uf.size[pA] * uf.size[pB]
      uf.union(a, b)
  
  for i in reversed(ans):
      print(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"}]