/**
 * This function takes a list of numbers and a value as arguments and returns a list of numbers 
 * that fall within the given range and have negative values, and also are greater than 50% of the given value.
 *
 * @param numbers A list of numbers (can contain positive and negative values)
 * @param value The reference value for comparison
 * @return A list of numbers within the range and with negative values, greater than 50% of the given value.
 *
 * Example:
 * getNegativeRangeIntersection(listOf(10, -20, 30, -40, -50, 60), -30) // [-20, -40, -50]
 */
fun getNegativeRangeIntersection(numbers: List<Int>, value: Int): List<Int> {

    val intersection = mutableListOf<Int>()

    for (number in numbers) {
        if (number < 0 && number >= value - (0.5 * Math.abs(value))) {
            intersection.add(number)
        }
    }

    return intersection
}
/**
 * This function takes a list of numbers and a value as arguments and returns a list of numbers 
 * that fall within the given range and have negative values, and also are greater than 50% of the given value.
 *
 * @param numbers A list of numbers (can contain positive and negative values)
 * @param value The reference value for comparison
 * @return A list of numbers within the range and with negative values, greater than 50% of the given value.
 *
 * Example:
 * getNegativeRangeIntersection(listOf(10, -20, 30, -40, -50, 60), -30) // [-20, -40, -50]
 */
fun getNegativeRangeIntersection(numbers: List<Int>, value: Int): List<Int> {
/**
 * This function takes a list of numbers and a value as arguments and returns a list of numbers 
 * that fall within the given range and have negative values, and also are greater than 50% of the given value.
 *
 * @param numbers A list of numbers (can contain positive and negative values)
 * @param value The reference value for comparison
 * @return A list of numbers within the range and with negative values, greater than 50% of the given value.
 *
 * Example:
 * getNegativeRangeIntersection(listOf(10, -20, 30, -40, -50, 60), -30) // [-20, -40, -50]
 */
fun getNegativeRangeIntersection(numbers: List<Int>, value: Int): List<Int> {

    val intersection = mutableListOf<Int>()

    for (number in numbers) {
        if (number < 0 && number >= value - (0.5 * Math.abs(value))) {
            intersection.add(number)
        }
    }

    return intersection
}