



def   _lowerCAmelCase   (						A__	):
      lowercase__     =  set()
      # To detect a back edge, keep track of vertices currently in the recursion stack
      lowercase__     =  set()
      return any(
          node not in visited and depth_first_search(A__						,  A__						,  A__						,  A__	)
          for node in graph	)

def   _lowerCAmelCase   (						A__						,  A__						,  A__						,  A__	):
      visited.add(A__	)
      rec_stk.add(A__	)

      for node in graph[vertex]:
            if node not in visited:
                  if depth_first_search(A__						,  A__						,  A__						,  A__	):
                        return True
            elif node in rec_stk:
                  return True

    # The node needs to be removed from recursion stack before function ends
      rec_stk.remove(A__	)
      return False


if __name__ == "__main__":
      from doctest import testmod

      testmod()





def   _lowerCAmelCase   (						A__						,  A__						,  A__	):
      if principal <= 0:
            raise Exception('Principal borrowed must be > 0'	)
      if rate_per_annum < 0:
            raise Exception('Rate of interest must be >= 0'	)
      if years_to_repay <= 0 or not isinstance(A__						,  A__	):
            raise Exception('Years to repay must be an integer > 0'	)

      # Yearly rate is divided by 12 to get monthly rate
      lowercase__     =  rate_per_annum / 12

      # Years to repay is multiplied by 12 to get number of payments as payment is monthly
      lowercase__     =  years_to_repay * 12

      return (
          principal
          * rate_per_month
          * (1 + rate_per_month) ** number_of_payments
          / ((1 + rate_per_month) ** number_of_payments - 1)
      )


if __name__ == "__main__":
       import doctest

       doctest.testmod()
