"""
Recommended Python Style Guide:
https://peps.python.org/pep-0008/#introduction
"""

import time

def coprime(a, b):
    # Check each integer from 2 to the smaller of the two numbers
    for i in range(2, min(a, b) + 1):
        # If both numbers are divisible by i, they are not coprime
        if (a % i == 0) and (b % i == 0):
            return False
    # If no common divisor is found, the numbers are coprime
    return True

# Prompt the user to input two integers
a = int(input("Entrez un premier nombre : "))
b = int(input("Puis un deuxieme : "))

# Validate that both numbers are positive
if a <= 0 or b <= 0:
    print("Erreur : vos nombres doivent etre positifs.")
else:
    start = time.time()  # Start timing the coprime check
    are_coprime = coprime(a, b)
    end = time.time()  # End timing

    # Output whether the numbers are coprime
    if are_coprime:
        print("Vos nombres sont premiers entre eux.")
    else:
        print("Vos nombres ne sont pas premiers entre eux.")

    # Print the time taken for the calculation, formatted to 5 decimal places
    print(f"Calcule en {end - start:.5f} secondes.")
