Piyush and Magical park

Why I can’t able to clear all the test cases even I have put all the conditions and the same code as bhiya.
code :
#include
using namespace std;
void PiyushBacchaHaiHamara(char a[][100],int m,int n,int k,int s)
{
bool flag = true;
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
char ch = a[i][j];
if(s<k)
{
flag = false;
break;
}
if(ch==’*’)
{
s+=5;
}
else if(ch==’.’)
{
s-=2;
}
else {
break;
}
if(j!=n-1)
{
s–;
}
}
}
if(flag)
{
cout<<“Yes”<<endl;
cout<<s<<endl;
}
else
{
cout<<“No”<<endl;
}

}
int main() {
int n,m,k,s;
cin>>n>>m>>k>>s;
char path[100][100];
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
cin>>path[i][j];
}
PiyushBacchaHaiHamara(path,m,n,k,s);
return 0;
}

Done…