Help me in solving DSSA13 problem

My issue

My code

def can_friend_win_race(N, K, L, speeds):
    friend_speed = speeds[N-1]
    max_speed = max(speeds)

    for units in range(L + 1):
        new_speed = friend_speed + (units * K)
        if new_speed > max_speed:
            return True

    return False

def main():
    T = int(input())

    for _ in range(T):
        N, K, L = map(int, input().split())
        speeds = list(map(int, input().split()))

        result = can_friend_win_race(N, K, L, speeds)
        print("Yes" if result else "No")

if __name__ == "__main__":
    main()

Learning course: Kalasalingam Academy of Research and Education
Problem Link: CodeChef: Practical coding for everyone