3 tets cases are failing

cant find the error in my code

#include<bits/stdc++.h>
using namespace std;
#define ll long long
bool isPossible(ll arr[],int k,int n,ll cur_min){

int i=0;
int painters_used=1;
while(i<n){
	ll time=0;
	
	while(1){
		time+=arr[i];
		if(time>cur_min){
			painters_used++;
		break;
		}
		
		i++;
	}
	if(painters_used>k)
	break;
}
if(i==n)
return true;
else 
return false;

}
int main() {
int k,n;
cin>>k>>n;
ll arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
ll s=arr[n-1];

ll e=0;
for(int i=0;i<n;i++){
	e+=arr[i];
}

ll ans=INT_MAX;
while(s<=e){
	ll mid=(s+e)/2;
	if(isPossible(arr,k,n,mid)){
		ans=min(ans,mid);
		e=mid-1;
	}
	else{
		s=mid+1;
	}
}
cout<<ans;
return 0;

}

hello @techashish2000

a) dont sort the array because painter can only paint contigous blocks
b) search space s=max element of array * Time , which can be anywhere in array (so u should find maximum)
e=summation of array * time
c) u need to take mod of ur answer (check output format)

in output format it is written just print the min time

and i did the a) and b) part still tets cases are failing

image

make the change and submit again,
if still it shows any issue then share ur updated code using cb ide

i have sent the ide link on chat with ta platform

ok wait i m checking

did u find the error

i have replied to ur chat ,pls check

in the question given in divide and conquer it is not that

input and output format is different to what u sent me

see the question in divide nad conquer section

input and output format is same as what I have done in the code

can u pls send the screenshot of the question,
it is showing me this problem->

here I can’t find the option to send a photo through my gallery

can u give me ur number i will then whatsapp u the SS of the question

open this link -> 3 tets cases are failing
and then uu can share the screenshot from there easily

link is not opening in fact it is not even Clickable