Bem, aqui como eu faria isso (sem entrar em muitos detalhes)
Gostaria de acompanhar o valor de todos os resultados que descartei. Eu provavelmente os colocaria em uma fila ordenada cujo tamanho é o número permitido de teste descartado. Ele seria classificado como o teste de queda, o mais próximo de zero é no início. Ao percorrer a lista com o algoritmo tradicional, faria o seguinte:
if I encounter a negative number
if the queue is not full
add it to the queue
else
if the new negative number is smaller (farther from zero) than the first number in the queue
remove the first number from the queue
add the new number to the queue
add the removed number to the current subsequence value
else
add the new negative number to the current subsequence value
Dessa forma, você sempre mantém a subsequência sem a pior marca da sequência, e se você encontrar uma marca ainda pior, você pode restaurar o valor de uma marca anteriormente descartada para o valor da sua subsequência.