/**
 * Given a specific range [start, end), iterate over the range using the given step
 * and return the tuples containing the index and the sliced element at that index.
 *
 * @param n The number of elements to generate within the given range
 * @param start The start index of the range (inclusive)
 * @param end The end index of the range (exclusive)
 * @param step The step size used for iterating over the range
 * @return A list of tuples containing the index and the sliced element at that index
 */
fun psychologistExercise(n: Int, start: Int, end: Int, step: Int): List<Pair<Int, List<Int>>> {

    // Generate the range of numbers using the given start, end, and step
    val numbers = (start until end step step).toList()

    // Iterate over the range and create tuples of index and corresponding sliced element
    val result = numbers.mapIndexed { index, _ -> index to numbers.subList(index, numbers.size) }

    return result
}

// Example usage
/**
 * Given a specific range [start, end), iterate over the range using the given step
 * and return the tuples containing the index and the sliced element at that index.
 *
 * @param n The number of elements to generate within the given range
 * @param start The start index of the range (inclusive)
 * @param end The end index of the range (exclusive)
 * @param step The step size used for iterating over the range
 * @return A list of tuples containing the index and the sliced element at that index
 */
fun psychologistExercise(n: Int, start: Int, end: Int, step: Int): List<Pair<Int, List<Int>>> {
/**
 * Given a specific range [start, end), iterate over the range using the given step
 * and return the tuples containing the index and the sliced element at that index.
 *
 * @param n The number of elements to generate within the given range
 * @param start The start index of the range (inclusive)
 * @param end The end index of the range (exclusive)
 * @param step The step size used for iterating over the range
 * @return A list of tuples containing the index and the sliced element at that index
 */
fun psychologistExercise(n: Int, start: Int, end: Int, step: Int): List<Pair<Int, List<Int>>> {

    // Generate the range of numbers using the given start, end, and step
    val numbers = (start until end step step).toList()

    // Iterate over the range and create tuples of index and corresponding sliced element
    val result = numbers.mapIndexed { index, _ -> index to numbers.subList(index, numbers.size) }

    return result
}

// Example usage