Test case running but showing error while submitting

#include
using namespace std;

void magical_park(char park[][100], int n, int m, int k, int s)
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{

  if (s < k)
  {
    cout << "no";
    exit(0);
  }
  if (park[i][j] == '.')
  {

    s = s - 2;
  }
  else if (park[i][j] == '*')
  {

    s = s + 5;
  }

  else
  {
    break;
  }
  if (j != m - 1)
  {
    s--;
  }
}

}
if (s >= k)
{
cout << “yes” << endl;
cout << s;
}
else
{
cout << “no”;
}
}
int main(int argc, char const *argv[])
{
int n, m;
int k, s;
cin >> m >> n >> k >> s;

char park[100][100];

if (s < k)
{
exit(0);
}

for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
cin >> park[i][j];
}
}

magical_park(park, n, m, k, s);

return 0;
}

Hi @haziqinfinity
Refer this–>

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.