# Arup Guha
# 6/11/2022
# Example that uses a break statement.

# Program determines all pairs of positive integers a and b that sum to a
# particular value and whose product is less than or equal to given value.


def main():

    # Get the two given values from the user.
    total = int(input("What is the sum of the two positive integers?\n"))
    maxProduct = int(input("What is the maximum allowable product of the two integers?\n"))

    # Try all possible values of a.
    for a in range(1, total):

        # This is what b must be.
        b = total - a

        # Two ways we know the search is done - a and b have crossed over,
        # or the product is too big.
        if b < a or a*b > maxProduct:
            break

        # Print this possible pair.
        print("A possible value of the integers is",a,"and",b)

# Run it!
main()

        
        
