Statistics

Problem Statement for "TroytownKeeper"

Problem Statement

People enjoy mazes, but they also get them dirty. Arrows, graffiti, and chewing gum are just a few of the souvenirs people leave on the walls. You, the maze keeper, are assigned to whiten the maze walls. Each face of the wall requires one liter of paint, but you are only required to paint visible faces. You are given a map of the maze, and you must determine the amount of paint needed for the job.

The maze is described by a String[] maze, where each character can be either '#' (a wall) or '.' (an empty space). All '.' characters on the perimeter of the map are considered entrances to the maze. Upon entering the maze, one can only move horizontally and vertically through empty spaces, and areas that are not reachable by these movements are not considered visible. Each '#' represents a square block with four wall faces (each side of the square is a face). A face is visible if it is not directly adjacent to another wall (and is in a reachable area of the maze). For example, two adjacent blocks can have at most six visible faces since two of their faces are directly adjacent to each other. All exterior faces on the perimeter are considered visible.

For example, the following picture represents a trivial maze with just one (wide) entrance and only four empty reachable spaces:

To whiten this maze you must paint the faces highlighted in yellow above: 16 for its perimeter, plus 8 interior faces. Note that there are faces that are not visible and thus need not be painted.

Definition

Class:
TroytownKeeper
Method:
limeLiters
Parameters:
String[]
Returns:
int
Method signature:
int limeLiters(String[] maze)
(be sure your method is public)

Constraints

  • maze will contain between 1 and 50 elements, inclusive.
  • Each element of maze will contain between 1 and 50 characters, inclusive.
  • All elements of maze will have the same number of characters.
  • All characters in maze will be either '.' or '#'.

Examples

  1. {"########" ,"#.#....." ,"#..#####" ,"#.#....#" ,"###.####"}

    Returns: 46

  2. {"##..#" ,"#.#.#" ,"#.#.#" ,"#####"}

    Returns: 24

    Example from the problem statement.

  3. {"#############################"}

    Returns: 60

  4. {"##", "##"}

    Returns: 8

    Only the perimeter of the maze (which has no interior!) has to be painted.

  5. {"######" ,"#....." ,"#.####" ,"#.#..#" ,"#.##.#" ,"#....#" ,"######"}

    Returns: 56

  6. {"#############################","#############################","#############################","#############################","#############################","#############################","#############################","#############################"}

    Returns: 74

  7. {"####..#...####..###...#..###.####.#","....##.#.#.####.#.#..#.###.##......","#...##.####...#....#..#..#.#..##..#","###.#..#.#.#.##.##.####.###.....###","...#.#.##.#.##.######.#.#.#...#..##","#####.#.#.#.#..#.#.#.#.#...##..#..#",".#.#####.###..##..#.....#...####..#","....###....#####.#...##.#..#....##.","....##...###....#..##.#.#.#######..","..####.....#.##.##.#######.#.##.#.#",".####.#.##..##.#.##...###......#.#.","##.#.#.####..#.#.#.#.#.##..####.#.#",".#.#..##.##.#####..#.##.###...####.","..###..#####.##..##..###.###..#####",".###.#.#.#..##..#..###...##.#.#.#.#","..##.##.#####.#.#....#.#######.#.#.",".....####..#..#..##.####.#..#####.#","#.###..##....#...##.#.#..#####.#...","#..######..#.##.###.#.#.####.#.#.#.",".###....####.#.#..#.###.#.#########",".#.###..###..#..##..#.#.#.###.##..#","##...##..###....#.#######.#...#####","#.#.#.#.###.####.###.###.##.##.####","##.#.######.#...##.#..#.#....##.##.",".....#....#.###.##.###....#...#.###","#.#.#..##.####.#..#...#...#.....##.","#.#.##.#####...###..#...#..##.####.",".###..##..##...###.#.....###.#.##.#"}

    Returns: 384

  8. {"###.#.###.###..##...#.##..",".#.#..#.##.##.####.##.####",".#####.#####...#.##.#.##..","#.#.####.#.############.##","##..###..####.#..#.#####.#","###..##..##.#...###.#.###.",".#.##.#####.##.#####.####.","###.##...###.##.##..##...#","##..#...#.#..#####...#.#..","###..#.#..##.#.#.######.#.","###.#..#....########..###.",".#...##..#.#.#.#.#..###..#",".#######....####..###.#.##","##..##..###.############.#","#..#####.#..##..#.#......#","##..########.##.#.##...#.#","##.#..#.##...##.#.#####.#.","##.#...#.###..#.######.###","###.##.###..###..###..##.#","#..####..###..###.#..#.#.#","...##.#..#..##.#.###.#####",".#...##...###.#.##.###.##.","##...#..#.###..####....#..","###..#########.##.##....#.","##..##...####.##########..","#.###...###....###..####..","##.##.#####..##.##.##.#.#.","###.....#########..####...","##....###..####.##..##...#"}

    Returns: 234

  9. {"####.################","########.###.###.#.##",".##########.#######.#","######.##############","#.######.#######.##..","#######.##.#..#####.#",".#.##.########..##..#","##.#######.#####.###.","#.######.##.##.#.###.",".###.#..###########.#","###.##.#.##..#..####.",".#..##.######.#######","#######.#############","##..#######.#.###.###",".##.#.#..#.###.###.##","#####.#.###.###.####.","###.#########.#######","##.###.###########.##","#.#...#####..####..##","##########.######.###",".#####.##.####.##.#.#","..###.##.##..###.####","####.################","#.#####.######.######","#..#..###.###########","#####.#####..########",".###..##.#######.####","##.###.#########.####","#############.##.####","#####.#########.###.#","###..#############.##","####..#.#.#######.###","###.##############..#","..#########.#######.#",".#..########.#####..#",".######.#####...#####","#..####.#.##.#.######","####.##.#########.#.#","###############.##...","##..#.#.##.###.####.#","###.#.####.######.###","##.##.###.#####.####.","##.###..########..##.","#######.#############",".######..###########."}

    Returns: 190

  10. {"...#.#####..####....###.#..#.###.#",".#####.####.........##.#.###.##.##","..#.#...#..###.#....##.#..####.###","#....###.#.###.#########..######..","#......#.###..#######.##.#.#.#.###","#.##..###.##...###....#####..#.#..","##.######....#..#.#....#.#..####.#","...##.#.###.#...###.#####.####...#"}

    Returns: 194

  11. {".#......","..#..#.#","##.#.#..","###.#...","..#.....","..#####.",".#.#.##.",".######.","##...#.#","#..#.#..","..##.##.","##..###.","###...##","#.###.##",".#...#..","..######","##..####","...####.","#.##...#","###.####",".###.#.#",".###.#..","##..#..#","##.##...","#.#...#.","..#....#","###....#","...##.#.",".##..###",".####..#",".#.....#","##...###","#####...",".###.##."}

    Returns: 200

  12. {"####.#######.############################.#####","#############.#################################","###############################################","###############################################","###############################################","#####.################.########################","##.############################################","###############################################","#.#############################################","#######################.#######################","########################################.######","##################.############################","###.###########################.##########.####","###############################################","###############################################","#####.#########################################","###############################################","############################################.##","######.########################################","###############################################","######.##########################.#############","#######################.###.###################","################.####.#########################","################################.#.############","############.##################################","##################################.############","################.##############################","###########################.###################","###################################.###########","##.#.#########################.################","###############.#####################.#########","###############################################","###############################.###############","################.#################.############",".########################################.#####","##############################.################","################.#######################.######","####.################.######.######.###########","################.################.#############","##########################.###########.########","#######..#.############.####################.##","############################.##################","###############################################","####.#########.########.#######################","#############..################################","#####################################.#########","########.#########################.############"}

    Returns: 200

  13. {"..#.#..#...####...#......#.....##...##...",".##.....#.###...#..#..##....#..##..#..#.#","#.#.#...#.#..#........#..#.....#...##.#..","##.##..######...##.##....##..#####...#...","...##.#.#.###.#..##..#..#...###.#..##..##","...###.##...#.###.#.......#..#....####...","...#.#.#.......#.....#....#######..##.#..","#.####...###.#.#.##.......###.##....#....","#...#...#..#...#.#.#.#.##.########..#.##.","#.#####...#...##..#..#...........#....#..",".#..##....#.........#...##..##..#..#####.","#.#..#..###.##....##.#..###..###...##.#..",".#..###......#.#.###...###..#.#...###.###","...##.#.#.#.....#..#.#....##.#..##.##..#.",".#.###..###.##...#.#.#..######...#..#.##.","###.####.####.###....#..#.#.#.....#.##..#","#....####....###.#.##....##.....##..#####",".#..##.##.#..#...####.#.###....#..##.....","##....##..##.......###.##.#.##.#....#.###","..####.##...#...#..####.#.##.#...###.#.##","....#......#.###..#...#...#.#.#.####.##.#","#####.#.#......#.#.##...######..#.##..#..",".......##..#..#...#....##..#.#....##...##",".##..........#####...#..#...#..######.##.","##.##.##.##.##.#...#.###.##.#####.#..####",".###.#.........#.###.#..#....#.#.#.....##","..#...#....###..##...#...#.#..#..##...#..","...#...##..#...#.#.#...#.#..#.#.#.##.###.","...#.#.#..####.##.#.#...#####.#.#...#....","#####.##.##.#.#########..########.##....#","#####....##..#.##.#.####.##..##..##...##.",".#.#..###.#.#.#...###.##.#.#...##........","#.###.......##..##.#.......#..#.#...#.###",".##....##....##.#..##.####...##.#..#..#..","#..####...##.###....#.#..#.........#####.",".####..##.#..#.....#.###.###..##.#..#....","...##..#..##.#.#...####.###...#####...#..","..##..#.#.####.#.#####.#.##.##.##..#..###","##.####.#..#.#...#..##.#.#.##.##.#...#..#","...#..#..#...#..#..........#....##.#..#..","##.##...#...###..#.#.###.#..###.##..##.#.","##..###.####.#.#.#...#.#..####....##.#...","##...#.#.....##..##.#..##..#..#.....#..##","#..#.#######.##........##...###....#..#.."}

    Returns: 1380

  14. {"##########.#######","##################","###############.##","##################","##################","##################","################.#","#########.########","#.################","##################","##################","##################","#####.############","##################","##################","###.############.#","##################","##################",".#################","##################","##################","#########.#####.##","##################","#############.####","##################","##################","##################","##################","##.###############"}

    Returns: 100

  15. {"########..######.#.##.###","###.####..######.########","####..#.######.####.#####","#....#########.#.########","######.####.##.###.######","#####.####...####.######.",".##..####.########..##.##","####.#.#.#######.##.####.",".#.#.###########...####..","###.##.######.#########..","#.####.##.#....##.#######","####.#######.#.###..####.","##..##.####.#.###.#####.#",".###.#.##...###########..",".###..#########.###.#..##","#########..######.##...##","..#######.#############.#","##########..###########.#",".#.#.#######..##.####..##","#..####.######.##.###.##.","######.##.####..#.###.###","##.##.######.##.#########","#########.######..##..###","###################.#.###","#######..#########.#.#.##","###########..##.##.######",".##.####..####.####.####.","##.###################...",".#####...#####.##..#####.","####.####.#######.#######",".###..###########..####.#","###########.####.####.###","######..########..##..###","..#######.#.########.##.#",".#.######.##.#.####.###.#","..###.######..##.########","#####.###.#######.#.#####","####.#########.##.#.#####",".##..##.###...##.#.#.##.#","##############.##.#.#####",".######.#####..######.#.#","##########.#####..###.###",".####..#.######.#.###..#.",".########.############.#.","####..#######.###########","##########.###.#.#.###.##"}

    Returns: 218

  16. {"#####","#...#","#...#","#...#","#.#.#","#...#","#.#.#","#...#","#####"}

    Returns: 28

    cannot enter

  17. {"##################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#...#...#...#...#...#...#..#...#...#...#...#...#.#","..#...#...#...#...#...#...#..#...#...#...#...#...#","##################################################"}

    Returns: 280

    longest snake

  18. {"##################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#...#...#...#...#...#...#..#...#...#...#...#...#.#","#.#...#...#...#...#...#...#..#...#...#...#...#...#","##################################################"}

    Returns: 200

    cannot enter

  19. {"##################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","#................................................#","#.################################################","#................................................#","################################################.#","...#...#...#...#...#...#...#...#...#...#...#...#.#",".#...#...#...#...#...#...#...#...#...#...#...#...#","##################################################"}

    Returns: 2600

    longest snake

  20. {"..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", ".................................................."}

    Returns: 0

    big, empty

  21. {"..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.", "..................................................", "..#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#."}

    Returns: 2400

    spread squares

  22. {"..#.#..#.....####.#..#.##..#..###.#","....#.##..#..#..##...#...#..###.#.#","...####.#.#.###..#.##.#.#..#.#.#.#.","...#..##..#.#...###.#..#.###.#.....","##..#.#...##...#.#..#####.####..#.#","#...#..##..#.#.#.#.####.#.#.#.##.##",".#.##.#...##..#.#...#.#...#####.#..","#.#..######...##.##..#...###..#.#.#","#.#.##....###.#.##.###.#..####.###.","#.#.##...#####..#.#...###.#...#..##",".#.#...####.#.####...#.##..###.#..#","###.#.#..#.#.#.#.##..#.....###.#...",".##..##..#.##.#..#######......#..#.","##..#..#......##..#.###.#.#.#.##.#.","#####.#.##.##.#..#..#..#...##..##.#",".#..#.#.#..##.##..#.#...#.##.#.#...","...##.##..#....#..#..##.########...","#.####...######.####.#.#..##.#...##","#..#.##..#...#...###.####..#.#####.","..##.###.#.########.####.....#....#",".##.##.###.#..#..##..#.###.#.#...#.","#..####..#.###.....#########.#..###","..##.###..#..########.######.......",".##.##....###.##...##.##..##.#...#.","#####.##.#..##.####.#...#.##.###.#.","###..####....#.#.##.##..##...##....","...#.##.#..##.#.#..#####...#.##.#.#","......###.#.#.#.########.##.####..#","##..###..##.##.##.#.....##.#.....##","#...##...##.##.##.##.##..#.##..#...","...###....#.##.##.###...###.######.","###..##..#..#..###..#.#.##...#....."}

    Returns: 500

  23. {"#..###....###","#..#.##.#.#.#","###.#.#.#.#.#","..#........#.",".##..####...#","##########.#.","#.....#..##..","...##.#..##..","..###...#...#","..##..##.##.#"}

    Returns: 128

  24. {"....#.###..#.#....#..##..##..#.#......##.#..#...","###.#.#.#.#..##...#.....#...###.#..##..#.#...##.","#....#....#.####..##.............#....#...#.##..","#.#.#..#.........##..#..#.......#.##......##...#","....##.#.###......##...#...###........#...##..##","...#...##..##.##..#.....#.#..#.####...#...##.###","##..#.#.#.#...##....#.##...#..##..#.#...#.#.....","......#.#.#..##.##....#...#...##...####.#......#","##..#.#...#..#..#..##.##....#.##.#..###...#..#.#","#.#...#.#.#..#...##......#.##.......##.#.#.#.#.#",".#......##.##.....#.#.#...#..#.....#.....##..###",".....##...#.......##.#..#........#.....###.#.#.#",".......##.#.#......#...#.......#.......##.....#.","..####..#.#.#.......#..#.#.#......#.#........###","....#........##..#..##..#.#...#.#.#.##.###.#.#.#",".#..#.....#.#...##..#.##.#...#..#.#.....##.#.#..",".##..#..#...#..#......#..#.#...#....#..#...#..#.","....##.#..#.###..#...#.##..##...#.#.#..#.###....","#....##.##...#.#...#.....#.#.#.....##..##.##....","..#...#...#.....#..#...####..#.#.....###.#......","#.....#.#..#...##..#...#...#.#.##...###...#.##..","....#..#.......#...#.##.#.#.#..#..##.#...##..#..",".####...##.#.#.#...#.....##...#..#.#.....##....#","......###..##.....#...##...#....#.#.#.....#.#.##","##......#........#####...#...#..........#..#####","##...#.######.##.....#....##.#.#.##.##..#......#","..##.#.#.....#...........#.#.##.####....#.#.#...",".#..#.#..#.#.........#.#.#...#...##...#.##.#.#..","#.....#...#........##...#.##.#..###...###.....#.",".##.#.....###...#.####..###.###.#####.####..###.",".#..#......##.#...##..#....###..#.#.###.#..#.#..","##........#.#..#..#.#..#..#.#..#...###...#...#..","........#..##.#..#.#.......##.......#.....###...","......###.#...##.#..#...##...#.#.##........####.","...##.#.#..#...##.##........###.#......#.##...#.",".##.###.#....##.#..###...#.##.##.............###","#.....#.#........#.##.###..#....#..#............","..##.###.#.##..#....#....##.###.#....###...##...",".#...#..#....####.#..##.##.##..###.#..##...#.#..",".######...#.##....#.##...###.#...#....#......##.",".#....#...##.#........#...#.#.....##..####......","..##..#..#..#.##..##.##.....##..#.###..##.##.##.","....#...#.#...#...#..#...#.........#........#.#.","..##.#...#.###....##..###..#..#.#.#.##..#..#.###"}

    Returns: 1798

  25. {"#.#....#......##","##.##.#.#...#...","##..#...#....#.#",".#.###.#...#...#","...#...####..#.#",".....#...#...#..","#....#.##...##..","#.####....##.##.","####.#..#..#...#",".###...#.#.####.","....##...#..#...","##.....###..#.#.","...#.#.#..####..",".###.##.#.#.....","#...#.#.....##..",".##.##.#..#.....",".#...##..#.#..#.",".###.##.#.##..##",".........###....","..#........###..","......##......#.","..##...#.####.##",".#....#..#.#.###","#....##...#.....","#.....#.#..##..#",".##..#.....##.##","#.##...#..####.#","....#..##.#....#","..###.####.####.","#.#####.#####..."}

    Returns: 428

  26. {"#################.######.##.############.########","#####.###########.###############################","####.#############.######################.#######","#####.#################################.#########","##########.##.#####.##########.########.#########","###########.##################.##.#############.#","#########.##################.###############.####","##############.#.##..######################..####","###############.#####.#.####.####################","########.########.###.######.#########.##########","#####.#######.##############..######.#.#####.####","#.###########################.#.#######.###.#####","############.#######.###.######.#######.#####.###","######################.########################.#","#################.###.#########.##.####.#########"}

    Returns: 148

  27. {"#.###..#..#","#...#.##.#.","#..#.#....#",".####..####","#....#.#.##",".....#..###","..#.#..#.#.","..##.#.#...","....#.#.#..","#..##...###","...####.##.",".##..#.##.#","##.##..#.##","##.#.##....","....#..#..#"}

    Returns: 144

  28. {"####################################","############.#########.#############","#########.##########################","####################################","####################################","####################################","####################################","################################.###","#################################.##","####################################","####################################","###############.####################","####################################","######################.#############","####################################","####################################","####################################","####################################","####################################","####################.###############","####################################","###################.################","######################.#############","####################################","####################.###############","####################################","####################################","####################################","####################################"}

    Returns: 130

  29. {".#####.##.####...#.###..#..######..","##.#..###..#####.#.#.##.########.##"}

    Returns: 94

  30. {"############################","###.#######.################","############################","############################","####.#######################","###.########################","############################","############################","######################.#####","########.###################","##############.#############","######################.#####","##############.#####.#######","##########.#######.#########","############################","############################","##.#########################","################.###########","############################","#############.###.##########","########################.###","#.##########################","############################","#########################.##","##.#########################","##################.#########","#######################.####","############################","###########.################","############################","############################"}

    Returns: 118

  31. {"#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################","#####################"}

    Returns: 140

  32. {"#.###...##",".#.##.####",".#.#..####","##.#...###","##.#####.#",".#..##.###","##..#..#.#",".####..##.","...####...","###.#.###.",".##..#.#.#",".#####.#.#","###.####..","########.#","...#..#..#","#..######.","...#..#.##","###..#.###",".#.####..#","##.#.#.###",".#.#.###..","####.#.#.#",".#.####.#.",".#.......#","#..#####..",".#####...#","#.#...#.#.","...###.#.#",".#.##..##.","#.#..####.","#######.##",".###....##","#####..#.."}

    Returns: 220

  33. {"#############..####.##..###...##.#.##","#.####..######.##.##..#.##.....#..###","..########..#....##.##.####.####..#..","####.###.#.###..##..####..##.#.#####."}

    Returns: 146

  34. {"##########.########.##########","##############################","##############################","#######.#.###.##.#############","##############################","##############################","########.###.####.##.#####.###","######.##########.##.#########","############.###.#############","###############.##############","##########################.###","#.##.###########.#############","########################.####.","##############..##############","#################.#.##########","#.##################.#########","####################.##.######","#######.######################","########################.#####","###.########.##########.#####.","##########################.###","##########.####..############.","####.###.########.############","#.############################","#.############..####.##.###.##","#.#.###########.##############","#######.#######.#.#.##.#######","#################.############",".########.####################","##############################","###.#########.#######.#..#####","#########.#########.##########","##.###.######################.","##########.######.############","###.######.###################","#####..#####.#################","######.#######################"}

    Returns: 154

  35. {"...##...##..#.##....#.",".#.#.##...#..##.##...#","###......#..#.....#...","..#........#.#.###.##.","##.###.#....##.##...#.",".###..#..#.##.###.####","..######.#..#.#...###.",".#..#####.#.#.#.#..#.#","#.....#.....##.#.#...#",".#....##..##..#...###.","...##.###.#..#..#.#.##",".##.#.##...#.###.##.##",".#.......####...#.....","...#..#.#...#.......##",".##...##.#.#.###.#.###","###.#.#..##....#.#.##.","..##...#..##.##...#..#","#.#....####.##.....#..","#.#..#...#..#....#.#.#",".##.##.#.#...###..#.##","..##.##....####..#.###","........###.#....####.","..####.##..####.....##","###..#..#......##....#","#..#.#.##.###.#.#...##","...#...#.#.####.#.....","..#...####.#####.#####","#.##....#..#.#.#..#.#.",".#........#.#...##..#.","###..#..##.#.......#..",".#.#.#...##.....##...#","###.#.##..#####..##...","#..#...#..#.##....###.","..###..#.#.###...#....",".##..#.....#......#...","#...##.##.....#..#...#","#.##..#...###..#..#...","..#.#.####...#.###...#","....#.##.###.#..#..#.#",".#.###.....#.###......","....##..#.#..#...####."}

    Returns: 710

  36. {".#.##.#.#######.#.#","#..#########.#.####",".#.#.#########.#.##","####..#.#####.#####","#######.###.#######","###.##.#.##.##.#.##","##..#.#.###.#.###.#","#.#.##.###..##.####","#######.....#..####",".##.#####.##.#.#.##",".##.##.##...#.#####",".##.##.###.##.###.#",".###..###.#####..#.","#.########.#..###..",".#.#....#...######.","##.####.#.#.######.","####.######..#.#..#","###.##.#########.##",".##.######.#####.##","#..###.#.####.#####","###.##.####.#####.#","..#..#..####.###..#","#.#.##..#.#####.#.#",".#..#.####...###.##","..#..##..####..####","##.########....##.#","#.##.##.####.######","##.#####.########.#","##..###.########.##","#.#.##.##.##.###.##","#####.###.#####.###","######...###..####.",".##.#########.#####","###.########.#####.","#####.##########..."}

    Returns: 152

  37. {"##",".#","#.","..","..","##","##","..","##","..","#.","##","..","#.","#.","##","#.",".#","#.","##","##",".#",".#","..","##","..","..","#.","..","#.","##","##",".."}

    Returns: 84

  38. {"######.##.","###..#####",".####.####","###.##.###","##########","##########","##########","##########","##########","####.#####","##########",".##.######","##########","##########","#########.",".#######.#","###.###..#","##########","########.#","####.#####","##.#######",".#########","#####.####","##########","####.##.##",".#########","#.#####.##","##.#######","#########.",".####.###.","####.#####","####..#.##","##########","#####.####","##########","##.#######","########.#","##########","###..#####","####..####","#.###.#.##","########.#","######.##.",".###.#####","########.#",".#########","########.."}

    Returns: 138

  39. {"......#.##...#.#...#....",".....#..#.....##.##.....","##.#.#..##...##.#..#.##.","..###......###..###..#..","..#........##.....#..#..","...##.....#..#..#..###..",".......#....#.#.....###.","#.....##.###.........#..","###.#....#....#......#..","#.##.....#...#....#.#.##","#.....#.........##.#.#..","##..##.....#.#.....##.#.","...#...#........###..#..","##..#..#.....#.....##...","###..#.###.....#.....#..",".#.#.#.##...##....#.....",".#..#..##.#........#####",".#......###....#......#.",".##..#.......#....#....#","..##.#.#...##......#...#","#..##.###....##....#.#..",".........#...#...##..###","#...##.#.#...#.....#...."}

    Returns: 452

  40. {"####....#...#....#....#..##.#..............##.###","#...####...#.#...#.....#......##..###..##....###.",".##....#.#...#.....#..##.##.........##.#.#.#..##.","..#..##..#....#...........###...#..######..#.#.#.","#...#####.##...##.#.#..#.............#.########..",".......#....#...#.#...#....##.##..###.##..#...##.","...#..#.....#..###....#...#..#..#...#.#..##.###..","....#.#...#.##.####.#.....#..#..#......#........#","..#...#.#....##.#..###...#.#....#.#....#...##.#..","....#...##.....#..#.....##..##..#......#.........","...#....##.#...#...##.....#...#.....#.##........#","##..#........#..###...#.##.....###.###..#..###..#",".....#....##.#...#..#.#..###....#..##....#.#.###.","##.##..#..#..#.........#.##..###..####..###.#..##","#...#.#..##.##.#..#....#.......#..##.##.#........",".......##.###.#.###.#....#..###..#..#....#..#....","..#.#.#.##..#....#...##....####..#.#...#...###.#.","##.#.#.#..#...#..#....##.#..##....#.##.#....#...."}

    Returns: 764

  41. {"###..#.###...###.##.##########","#.#####.###.##.#.##########.##","###.####.#.####.##############","###.##.######.#####.########.#","###.#########.######.#########","#################.##..####.##.","####.#######.###.####.#.##..##","################..###########.","##.##.##########.########.####","##############################","####.########..###..########..","##.###...###..#####.#####.####","#############.#############..#",".#####.####..#.########.######","##.###.###########.####.######","##.#####.###..###.#########.#.","###.#.#####.##.#######.####..#","#########.###...##.###########","######.########.#####.###.####","#########..###################","#####.#####.###############.##","#####.###############.########","######.#...#.########.##.##.##","##.#####.#.#####.########.####","####..###########..##.########","########################.#####",".################.############","######.#####.#.###.###.####.##","##############################","##.#.#######.###.###.#########","#####.#.##########.#####.#.#.#","###.#####.####.###############","######.########.########..#.##","#####.######.########.########","####.#######.##.####.#.#######",".######.######.##.#########..#","#.############..###.##########","###.#####.##.#.#######.#######",".#######.############.####.###","#####.########################",".###.###.#.#..############.###"}

    Returns: 184

  42. {"####..........##.#........#...#.#......#####.",".....##.####.#..###...#.##.#####.............","##...#.#.#.###..#.#..#....##.#.#..#.#..#####.","#.#..##..#.##.##.##...#.##.......#..#..#.#.##",".#.......###..##....#.#.#.#......#.#..##.##.#","..#..####..##.###..###.#..####...##.#..#.....","#######.#.....##..#..#.#..#.......##..##...#.","...#....#.#.#.#.##.#.####..#..#.#..#......#.#","###....##......###...##.###...##.....#.#.####","##..#..#..#..#.#.###.##..#..............#..#.","...........#..##.###.#...#..##..#.........###","#.#......#.#....#.#.##.##.#..#.##...#....#...","####..#...##..#..#.##.##.#.#...#....######.#.","#...#..#.##..#..##.#####.#.####..#..#..#..##.",".....#...##.#.....#.#.......#.#..#####.#.#...",".#.....##...#.#.#.#.##..#.#..##.###.#..#.#...","..#...........#..####....#....#####.#.#...##.",".#......#..#######.....#.#..#...#.#...#......",".......##.#.......##....##....#.#.#.###..#.##","#........###...####...###....###....#.##...##","#.##..#..#.#...###.#.####...##.......#.#.#.##","#....##.####.#.#.#.###........###.....#...##.","..#.#.......#.....##.....##.##..#.#.###.#.#..","##.####..#####..#..##.#..#.#..#.#.#...##.##.#","#.##....##.#.#.#.....#####..#..##..##.###.###",".#.#.#..#..##..#..#.#.###....###.#.#..#.#.##.",".#.#...#.###..#..##..#...#..###.#...#.###.#.#"}

    Returns: 872

  43. {".#.#####","##.#.##.","..##...#","..####..","......#.","####.###",".#####..",".##..##.",".###.#.#","#.######",".#.###.#","######.#",".###.###","..###..#",".##.##.#",".####.##","#..#####","..##.###","#.#....#","#..#####","#.####..",".#....##","....#..#","#..#.###","##.#...#",".#.##..."}

    Returns: 160

  44. {"..#.#..#.","#.#.#...#",".....##..",".#....###","....###.#"}

    Returns: 48

  45. {"..#.#...#....#..#.##.########...#","..###...##.#.##........#.#.#..##.",".##..#.##.##.##.#.#.##.#.#.##.###","...#.#..###...#.##.#.#.#..#....#.","#####...#..#..##.#.#.#######..##.","##...#.##.##..####...#.##.###.#..",".##.#..#....#.##.....#...#.###..#","##.##.....#.###..#.#######..##...",".....#...###.#####..#.#..#..###..","..###..####.#.#......##..#####.##","#.##...#.#..#.#.#.##..#####..##..","#...#.....##...##.###.#.#.#..##..","..###.#...#.#.#...#.######....#.#","...#..#....####..##....######.##.","##....###.#..##.####....##..###..","..#.##...#..####..#.##.####..#.#.","....##....#.#####.#####.###..#..#","###.##.##.#..##..#.#..#...#..#.#.",".#..#.#.#.....#...##...#..#.#.###","....#.##....####..#.#######......","#....#..#.#.##..#.##..##...#...#.",".#####.##.#.####.##....##.###.#.#","#......#......##..#..#..###.#....","#...#..###.#.####..##.#.##.###.#.","######...######..##.#...#..#...##","####.#.##.##..#......##....##..##","#.##..#..####..#........#.#...##.",".....#..###.###.#####....#.###..#",".####...###.#..#.......#.##.###.#",".##.##..#..#.#..####..##.##.#.###","##...##...#.......#...##.#.#.#..#",".##.#.#.##...###..#..#.#.....##..",".#..##...#..#......#.#..#..##....","#..#.##.##.#..#..#..#...#...####.",".#.#.#...##.....##.#.##.#...#####","########..#..........####.#......","#.#..####.#..#.##..#...#.##..#.#.","###.#..###....#.##.#.##....##..#.","#.....#.#.#..#.#.....#..####..#.#","....#.#.##...#...##.##...######..","#..#.#..#.####...#.#....#...##..#",".#.#.#.##.####........#.#......##","###.######.##.#########.#..##.###","..###...#.##..#...####.#.#.##..#.","....#..#####..#...#.##....##..#..","##.##..###.#...#.#.###..#.##...##","#.#..#...#..##....###.#.##.#..###"}

    Returns: 778

  46. {"############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################","############################"}

    Returns: 128

  47. {"####.#.#########.##########################.###","#####.##.#.#.#######.#..############.#####.####","####.################.#####.##############..###","###########################.######.###.##.#.###","###.###################.#####.######.#.########","##.##.####.##########.########.##############..","#############.#######.#################.#######","##############.#######.##.#######.######.######","####.#########.##################.############.","##############################.################","############################################.##","#####.#.#####.######.###.##.###########.#######",".########.#.######.#########.##################","#.###########..#########.#####################.","#######..###################.####..############","#########.##############.#####.#########.######",".##...##.#.################.##.####.###########","####.#########..#.#.######.##.#################"}

    Returns: 168

  48. {"#..#..##.##.....","...#..#....#....",".....#.......#..","....#.....##....","...##......###..",".........###..#.","..#.#.##.###..#.",".....####.###..#","##...#.#....#.##",".#.#.##..##....#","....#....##..#..",".#.##...##.#....","..#.#.#.......#.","..#...#####.#..#","..#....#...#....","..##..##..#.##..",".#...#.#....#...","##.##.#...#..#.#",".##......#...#..",".....###...#.#.#","#.#.##..#....#.#","#........##..##.","..#..#.###...##.",".##.............",".##.#.....#..#..",".......#...#..#.","...#....#....#..","##...#.#.##.###.","..#......#.#...#","..##...#...#....","##.#.#.#.#......",".#....##..#.....","...##..##.....#.","###.#...##...###","..###....#.#..##","..#..#..#.......",".##...##.##...##","....##.#......#.","....##.#...#..#.","..#..##...#.#.#.","...#.#...#..#.#.","......###.....#.",".#.#.#.#........","#.#.....#.#.###.","...####...#..#..","###..#..#.#....#","...##.#..###.#..","#.#..#..#..#....","..#..##.#.#..#.#","#..#............"}

    Returns: 702

  49. {"...#.#..#...#.#.###.##.#.#.#.##..#","###.#..###.###########.####.##...#","#.#.###...###..###..##.##.###.....","#..##..#..#.#####.########....#...","....#####.##...#..#.#...###.###.##",".###.###.##.#.###....##......#.###","...#.##.###...####...#.##..#.#....","#####.#.##..####.########...###...","####.##.##..#...#.#.#####.##.####.","####.##..###....#.########.##.##.#","#.#...#.#..##.##...#.##.#.##.####.",".###.###..#####.###..##.#.#.###..#",".###..####..###.####.##.#..#..#.##","#..#####.######...#.#.##.##.#.###.",".#.#.###.#.##.#...###.#..###.#.###",".#..#.####.###.#.#.....##..###.###","##.#.##..####.#.##.########.#.####","#####.##...#.#####.##..###.#..####","##...####.##..#####...##.##.#.##.#","..##.##.##....##.#.#.##.#.###.#.##",".#.#.###.####..##..###.##.#.....#.","#####..####.#...##....#....#..#...","##.##..##..###...#..####...#.#.###","#.##..####.#....#.....#.##..#....#"}

    Returns: 344

  50. {".##","##.","#.#",".##","##.","#.#","###","###","###",".##",".##","#..","###","###","##.","###","#.#","###",".#.","##.","##.","...",".##",".##","###"}

    Returns: 76

  51. {"###.####..#####.#####..#####","###....#####.#######.#.#.###","######.#########.######.####",".####.######.####..####.#.#.","##.#####.######..##..#####.#","..######..#.#########.##.###","##.######..####.######...###","###.##########.#.####.##..##","##.######.##.##.###.########","###############.####..####.#","##.###.#####################","###############.##########.#","######.#####.#############.#","###########.###.####.#######","#######..###################","#####.#######.#.#.####.#####","##..####.#.#########.####.#.","#.#..###.####.####.##.##.###","##########..#####.#.###..###",".#################.###.#####","######.##.#.#.#.######.####.","########.######.##########.#",".######.#######.############",".####################..#####"}

    Returns: 140

  52. {"######" ,"#....." ,"#..#.." ,"#....." ,"######"}

    Returns: 36

  53. {"#.#.#.#" ,".#.#.#." ,"#.#.#.#" ,".#.#.#."}

    Returns: 36

  54. {"######", "#.....", "#.####", "#.#..#", "#.##.#", "#....#", "######" }

    Returns: 56

  55. {"....................#...................." }

    Returns: 4

  56. {"#####", "#...#", "#.#.#", "#...#", "#####" }

    Returns: 20

  57. {"#.#.#.#", ".#.#.#.", "#.#.#.#", ".#.#.#." }

    Returns: 36


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: