WINNING CB SCHOLARSHIP

Can you please check my code , 3 test cases are not passsing.

@CODER_JATIN take everything as long long int it will pass

okay ji, thanks. . . . . .

and bhaiya, if we take input as (5 2 2 1), then the maximum no of students to which we can give 100% scholarship should be 3, but my code is showing 2 .???

@CODER_JATIN how 5 2 2 1 will give ans as 3?
it will be 2 only