What is the possible fault in this program?
Scanner obj = new Scanner(System.in);
int n = obj.nextInt();
int m = obj.nextInt();
int k = obj.nextInt();
int s = obj.nextInt();
if(n>=0 && m>=0 && k>=0 && s>=0){
if(n<=100 && m<=100 && k<=100 && s<=100){
char[][] arr = new char[n][m];
for(int i=0; i<arr.length; i++){
for(int j=0; j<arr[i].length; j++){
arr[i][j] = obj.next().charAt(0);
while(arr[i][j]!='.' && arr[i][j]!='*' && arr[i][j]!='#'){
arr[i][j] = obj.next().charAt(0);
}
}
}
int i;
for(i=0; i<arr.length; i++){
for(int j=0; j<arr[i].length; j++){
if(s>=k){
if(arr[i][j]=='.'){
s-=2;
s-=1;
}else if(arr[i][j]=='*'){
s+=5;
s-=1;
}else if(arr[i][j]=='#'){
break;
}
}else{
break;
}
if(j==arr[i].length-1){
s+=1;
}
}
}
if(i==arr.length){
System.out.println("Yes");
System.out.println(s);
}else{
System.out.println("No");
}
}
}