Implement the function can_untie_knots that determines whether it's possible to "untie" knots based on specified criteria. The function checks for pairs of knots where the sum of their lengths meets or exceeds a given threshold. If possible, it also returns the order in which the knots can be untied.
Input Requirements
The function takes the following parameters:
N (int): The number of knots (1 <= N <= 100).
L (int): The minimum total length for a pair of knots to be considered "untieable" (1 <= L <= 1000).
a (List[int]): A list of integers representing the lengths of each knot. The length of this list must be equal to N and each length must be a positive integer.
Output Requirements
The function should return a tuple:
If it is possible to untie some knots, return ("Possible", order) where order is a list of integers representing the sequence in which the knots can be untied.
If it is impossible to untie any knots, return "Impossible".
Implementation Instructions
Write your solution in a file named /app/solution.py.
Ensure your function adheres to the defined input and output requirements.
Example
python
# Example Input
result = can_untie_knots(5, 10, [1, 2, 3, 4, 5])
# Example Output
# result == ("Possible", [1, 2, 5, 4, 3]) or ("Possible", [1, 2, 3])
# result == "Impossible" if no valid pairs exist.
Ensure the implementation is efficient and correctly handles edge cases within the given constraints.