It shows two test cases wrong

Consider:

4 4 5 10
. . . . 
. # . . 
* * * * 
* # * * 

Expected Output:
No

Your Output:
Yes
10

There must be hint video on this. Refer that and verify your approach https://ide.codingblocks.com/s/292517