Test Case 0,1 & 4 are failing

#include

using namespace std;

void magical_park(char a[][100], int m, int n, int k, int s)
{
bool success = true;

for (int i = 0; i < m; i++)
{
    for (int j = 0; j < n; j++)
    {
        char ch = a[i][j];

        if (s < k)
        {
            success = false;
            break;
        }
        if (ch == '*')
        {
            s += 5;
        }
        else if (ch == '.')
        {
            s -= 2;
        }
        else {
            break;
        }
        if (j != n - 1)
        {
            s--;
        }
    }
}
if (success){
    cout << "Yes" << endl << s << endl;
}

}

int main()
{
int m, n, k, s;
cin >> m >> n >> k >> s;

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

}

also added the cout << ‘No’ ;

hi @prachur12_a2595aa1d8b484a4,
refer this https://ide.codingblocks.com/s/642895