Book allocation getting wrong answer


My solution is working perfectly for given test case
But getting Wrong Answer while submitting

@dsingh200021 hey darshpreet you’re forgot to put endline.

I am still getting wrong answer

@dsingh200021 hey darshpreet you have do s=max(s,a[i]); in the loop
for(i=0;i<n;i++){
sum+=a[i];
}