Pair of roses: right output but getting test case error what is the problem with code

Here is the code

@shraddhamishra812003_b58bd74465a696b0
hey check the case :
1
5
10 20 30 40 50
80
your program output is
Deepak should buy roses whose prices are 40 and 40. (which is not possible) since ive only 1 rose for 40
rather it should be 30 & 50

@shraddhamishra812003_b58bd74465a696b0 hope the doubt is clear

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.