Implement a function that calculates the minimum distance to an affordable house based on the given parameters. The function's purpose is to determine how far one must travel to reach the closest house that is both affordable and located along a linear arrangement (represented by indices).
Functionality
The function find_min_distance_to_affordable_house should take four inputs:
n (int): The total number of houses.
m (int): The index of the current house.
k (int): The maximum price of an affordable house.
a (list of int): A list of house prices, where each element represents the price of the house at the corresponding index.
The function should return the minimum distance to the nearest house that is affordable (price between 1 and k, inclusive). The distance is calculated based on the absolute index difference between the current house and the affordable houses, multiplied by 10.
Input/Output Requirements
Input:
n: an integer representing the number of houses (1 <= n <= 1000).
m: an integer representing the index of the current house (1 <= m <= n).
k: an integer representing the maximum price of an affordable house (0 <= k <= 1000).
a: a list of integers of size n, where each integer is the price of the respective house (0 <= price <= 1000).
Output:
An integer representing the minimum distance to an affordable house multiplied by 10.
Implementation
Your solution must be implemented in a file named /app/solution.py.
Ensure your code handles edge cases, such as when no affordable houses exist within the range specified, and returns an appropriate result (consider raising an exception or returning a sentinel value).