Please look at my code it is showing error in last two and first test cases

#include
#include<stdio.h>
#include
using namespace std;

int magical(char arr[][110],int r,int c,int s,int k)
{
for(int i=0;i<c;i++)
{

    for(int j=0;j<r;j++)
    {

        

       if(s<k)
		  return INT_MIN;

        if(arr[i][j]=='.' )
        {
            s-=2;
        }
        else if(arr[i][j]=='*')
        {
            s+=5;
        }
        
		else{
            break;
        }
		if(j!=r-1)
		  --s;
		
      
    }
}
return s;

}

int main()
{

int r,c,s,k;
cin>>r>>c>>k>>s;
char arr[r][110];

for(int i=0;i<r;i++)
for(int j=0;j<c;j++)
cin>>arr[i][j];

int o=magical(arr,r,c,s,k) ;

printf("%s\n",o>=k?“Yes”:“NO”);
if(o>=k)
printf("%d",o);

return 0;
}

hi @manthan.joshi.jiit please share your code by saving it on cb ide

@manthan.joshi.jiit correct this part according to the output given in question
image