First, of all description of this question is too bad. But, i managed to solve it.
But, i have a doubt in this problem when the previous count or sum is less than the current input of the user then i break the loop and print No as a answer. But, what about the rest of the input how they can be handled. They can become the input for the next test case.
I solve it both ways by breaking the loop immediately, and by reading the whole input stream. Both, works fine on online judge.
1st one is faster takes 0.20sec and 2nd one takes 0.36sec