/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package folded;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author cteam028
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main
(String[] args
) { try {
Main fm = new Main();
fm.init();
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
while((line = br.readLine()) != null) {
int pole[][][][] = new int[Ar][Ac][(Ar/Tr) + 2][(Ac/Tc) + 2];
for(int x=0; x < Ar; x++) {
line = br.readLine();
char[] text = line.toCharArray();
for(int y=0; y < Ac; y++) {
boolean inMap = (text[y] == 'X');
if(inMap){
for (int dx = 0; dx < Tr; dx++) {
for (int dy = 0; dy < Tc; dy++) {
pole[dx][dy][(x + dx)/Tr][(y + dy)/Tc] = 1;
}
}
}
}
}
for (int dx = 0; dx < Tr; dx++) {
for (int dy = 0; dy < Tc; dy++) {
int pocet = 0;
for (int idxx = 0; idxx < (Ar/Tr) + 2; idxx++) {
for (int idxy = 0; idxy < (Ac/Tc) + 2; idxy++) {
if(pole[dx][dy][idxx][idxy] == 1) pocet++;
}
}
min
= Math.
min(min, pocet
); }
}
}
}
}