Greedy Algorithm- Dividing Array doubt

sir my code gets compiled but does not passes any testcase. where i am making mistakes?

@udaycodingblocks,
send ur code saving on http://ide.codingblocks.com/
even server is down so try after some time if u feel code is correct

how to share code on coding block ide

@udaycodingblocks, signin, write ur code press ctrl + s and send the link after saving

sir my code gets compiled but does not passes any testcase. where i am making mistakes?

@udaycodingblocks,
max part is good for min part ive corrected the code commented https://ide.codingblocks.com/s/656855

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.