Collect the input values in encounter order into a fresh sequence. Retain each value only when it is greater than the threshold and it is absent from the collected sequence, using linear search, and it is greater than the other threshold. Replace each retained value with the doubled value of that value before appending it.