Problem Statement
You are given a white rectangular grid made up of square cells. Some cells contain black squares, and some contain black squares that have been folded in half to form right triangles, such that one of their sides matches the grid line to the right of the cell and another side of the triangle matches the grid line to the bottom of the cell. At most unfoldLimit of these triangles can be unfolded to become black squares. However, black squares cannot be folded to become triangles.
We are interested in forming the largest possible proper black triangle in the grid using the aforementioned operations. A black triangle is considered proper within a grid configuration if no other black shape shares a line segment with it. However, black shapes may still share one or more points with the triangle. The size of a triangle is defined as the number of grid cells that are currently occupied by the triangle.
The grid will be given as a
For example, consider the following input grid:

If unfoldLimit is greater than or equal to 3, the largest possible proper triangle size is 10:
If unfoldLimit is 2, the largest possible proper triangle size is 3:
Larger black triangles are possible, but they would not be proper triangles.
Definition
- Class:
- UnfoldingTriangles
- Method:
- solve
- Parameters:
- String[], int
- Returns:
- int
- Method signature:
- int solve(String[] grid, int unfoldLimit)
- (be sure your method is public)
Constraints
- grid will contain between 1 and 50 elements, inclusive.
- Each element of grid will contain between 1 and 50 characters, inclusive.
- Each element of grid will contain the same number of characters.
- Each character in grid will be '.', '#' or '/'.
- unfoldLimit will be between 1 and 2500, inclusive.
Examples
{".../", "../#", "./#/", "/#//"}
4
Returns: 10
{".../", "../#", "./#/", "/#//"}
2
Returns: 3
Examples 1 and 0 were explained in the problem statement.
{"////", "////", "////", "////"}
5
Returns: 6
{".....#...", "....###.."}
10
Returns: -1
{"./#....", "...../.", ".....#."}
2
Returns: -1
{"...../", "..../#", ".../#/", "../#/#", "./#/#/", "/#/#/#"}
6
Returns: 21
{"...../", "..../#", ".../#/", "../#/#", "./#/#/", "/#/#/#"}
2
Returns: 10
{"...../", "..../#", ".../#/", "../#/#", "./#/#/", "/#/#/#"}
1
Returns: 3
{"...../", "..../#", ".../#/", "../#/#", "./#/#/", "/#/#/#"}
5
Returns: 10
{"#//#", "#//#", "####", "///#"}
4
Returns: 1
{"/#./.#/..#/#..","/...#./#.#/.//","##/#.////.//./","//#/#.##.#.../","/#/..##.//##.#"}
1
Returns: 1
{"#..#...#.../#","///.#/#/##.##","#####..#...#/",".###/.//..../","../##./..#/#.","###/#/..//./#",".##.#/##./#//","###//###.##/#","/..###//#.###","./#//./######","...#/..././#/","/#./..##./#/.","./##.#.#/....",".//..#...///#","#/#./#/./#../","/#/..#/###.#.","/#.#.###/##.#","#/##/#/###./.","/./#/##.///.#","./#.###/..../","///./.#.#..#/","/#.//##.###/#","#/..#.#././..","..#.##../../#","././/#./##/#/","/#.#.##/###/.",".#../#..#/../","/.#/####.#...","/.././#/.#//#",".//##.//#.#..","#/.#..#.//#/.","/#/.#./#/#./.","#.####.#/././","//.#./.....##","#/#.///.#..#/","#..//...//#/#","..#.#/.#/##//","####.#./..##.","##./#/#..#..#","/..##.##//.#.","./#.///#/##.#",".///..#/.#/.#","/#./###//./#/"}
59
Returns: 3
{"///.//.#..//...//.#/#/.#.//.#//././.##./",".////..#.###/##/./..#..../#.//#.#///.##/",".//#.##/#/.//./#/.#//#/..#..##.//##.//#/","##./.###/##/....#//./#.##/.##//##..###/.","#/#/.#.#/#//././##.//.#../#//./#..///#/#","/.#/#/#../.####/#.#././././#.##...##/./#","/#//##//#/..#../#./././././.../.#/./##/#","./.#...//#/##//.//#/##../.##.##////#./#/","#/.#./#.//#./#/#/./..##./##//...#.//.#/#","#.#.#//#.#/##.#/#./#/##./#.##/##/.#/.../","#./#....#//..##.####.//.#./#..##/##///..","#..#.#../#//.#/#/..//#//#//./../.#..#//.","##/.###./.#...##./#../#/////.###//#.#.#.","##...#.##.##/...#/##//#/...###.//.#.//./","#./###.....#/###..#////#.#//.////##/.##.","#./#./#.#/.##//.//###.//.//.///#./#/////",".#//...././/...#../.#//./#//.#/#//##/#..",".#./#/#./.../..#.///.#/#../##/###/##./..","#../.#.###.../.#.//#.#####///##/##/./###","/#.....///../#//./#.#..##.././....#.#//#","//....//......//#../###//.../.#.//###.#/",".##///#/#./#//.//#.####./.#/..../..///##","..../#.#.#//#//..#.//#./####../.##/#/#/#","/.#./...././.###/.#./../.../////.###//.#",".##////#./#.##/..../..//.#//./.#././//.#","#.#/./#.#//##//##/..//.#./##///#./././##","./#.#.#/#//#./#..//#./...//#.////.#../.#","#/#..#/...#/#////./.#.##//././//..##/.##","#/##/../##.##././##.##.#//.#.#./../////#","##/.#//.../#./#///###/#########/#.##.#.#"}
127
Returns: 6
{".##..#//#.#/.///./#/#./#.#.#.##/#/.//.#//.#","/.#.##/.#./../#/.....//../.#/.###.#/.//#../","/.##/..//#../#/#//.#/####/###.#.//./.#####/","/#/./###////.././//###/////#/#.//#/##///##/","#/#/#..##/./..#.#//#/#../###/....//././/###","#.//./#//#../.###./###/##..#.////.#./#./#//","####.//./#...//#/.#/..///#.#.../././#/././.",".#./...//.##/./#.#////./.#.#.#/./.#...###//","#/#/##.#//.#//.##//..#/.#.##.//#/###//##.#.","/.././#./##.///..##.#.###//#./.#.###..###/.","./#.#///#./#../#/...././##././#////.#//./##","/.##/.##.####.###//#../.#.#/#../#././////#/","/.//##..//#./...#/.##/##//#./###/.//.././/#",".##/../###//.#.///#./#.././...#/#.##/..#//.","...##.#/./#..#//.//##.#/#/.#//#.#///##///#/","###////#...././#/.//.###.///#../#/#..##/#//","/../#...#/#/#.#/.##///#..#.######/...#.####","/#.#./..//##/...//.#.///##./##.#/#/../#/../",".#/.//.#//./###.#.//#/#///.##.#/#./...../#.",".///##//##.#./.#..##..///.##///./..##...///","///////.//.#.../.#/##//////#....#..#.#/#...","#.##//././#..###/#/#//./..###//.//##/#../##","###./#././/#....#.###..##..#.//###./..##...",".#/#.//#/.##./#//././//.#../.././..#//.#/#/","#..#..#/#//..##/../#..#//.#...##../#./.#//.","../#/.##..##//../#..#/#.##..//#...#/###//#.","##/###.//#//./####...#/#/#././##.#.##/#//./","//##.//#//../....#.#.###.../#/..././/.##.//","#.#./#.#.#.././//././..#//.#/#///.#/#..///#",".####.///#./.#.#/##./#./.#/.#/.#/../.#.##//","##/#.///###//#..##.....//#.#///.///#///#./#","///./#//./.#/..#.././##..#/#./#.#/.#.#/.#//","#..###.#.#./##/.//.#././/.#/./#......#.#.#/","/###.#.##.#/.///.#.#./.#./#.###..////##/.#/","/#..#/.#./.#..#/##../..../#.#/#..#/././##./","....#./#.#////#.#//..././##/.#.#.#####././/","##/.#/###.#//#.#../..#./#./#./.#././#/...#.","#####.###/#.#/#..##/#/##..//....###/#.#.//."}
2
Returns: 6
{"/#./#////#.////..##./.###.#/##./#...#..///#//.","###////.././.####/####.///##..##////#//##/.#//","//##..//././/#/.####../.####..#.//.#.//./.#/#.","#/.../.#/#/./#/#./.#./####/#/#../././//////#/#","#.##.###//../..#/###./#///...#.#//..//..../#/.","/.#.#/./##./#./.##./#/.#/.##/##.////./.#/../#/","./.#/##././.##../.#./..//././#/#////#../#/.###",".////..//#./#.###..#.//.//..####.#////.//.#.#/","#/.#//.#/./##///./#.#...././/#/..#.#.#/###//#.","/##..##..###/##./......##//.#/#/.././//...../#","././...///#/.//..###../////#.../.#..##/#/./#./","#/#.#.///#///#.###../////.#...//#//./#./#./#./","//#./..#/.#/...//./.#././.##...#/./.#.###././#","#..../..#/#//./.#//./#././###/.#//#./##/.##/#/","#//..#.#./###/.####////.///.#.#/////...././//#","/#/./../././#/#/#//////#//...#../#//###.#/.###","###/#././.#...#./#/#.##..##../.#../#.#///.#/##","##.//.//./..#///.#/../.#/#.//#.//##/####//.#//",".#/#/.#/#/.#/./#/..#/.//.#.#####/#/##./.#./#/#","/.#/.##/./.#..//##//.//./#/.#..//./##//.//..//","##/.../..##./#####...##./..#.##..##/.#/////#/.","#./..#./#.#//#/#.../....###.#.##.##..#/./#/./.","#/##..###.#######//..//#.#./../#./..#/.//.#.#/",".###/..///.//.#..###./.#//###//#.//#/#./#...#.","###/./.#./.#...#//#/../.###.././//#.../#./#//#","././.#///./#///.///./.#.....#.##.#///#.##..#/.","//.....#/##/#/..../####..#/.##///..#/#/...###/","###/..//#..#..##..#.#/.##//./#.#/#/..///.#/#/#"}
165
Returns: 3
{"///.##/#/##.//.//..//","/..//#/##./#//../../#","##////#.//#../#/.///.","#/...#/###.////.//.#.","/.#././/#.//###..../#",".//#.../#.#.//##//..#","#.#..#/#//./#.#./###.","./.#/##.##/.././##.##","#..//#...///#.//.#/##","/.###.#././/#.../..#/","/###.///.#/#/#///./#.","..##/../#../##/..##.#","##/.##.##..///#/.....","###//./.#/../.#/#.//#","#..//#//#..../....#/#","##..#/.//.#/#./###///","//##.////###..#/#.#/#","//.#///#/#///.##..#.#","//../#./...##././..##","/#//././#./.#...//.#/","//#/#/#..///#...#.#//","//###///##//###/./#.#","##//.../../##.#/.///#","/##/##./#/#.#/../..//","/#/.//...//////.#//#/",".//..//#/...../../#/#","..//..../#.//.//#..#/","///##.##.#..###./#/#/",".#.././#/././/.#...//","#//...././/.#////#.#/","#.././/##.#.#/./..##/","/#/#/.##.##.#//./#.//","/#./#/#.#//#.#.###/##",".#///#././....//###//","////.#./#/..././.#/#.","##./##/#####.##/###//","/..#.#/####/#.##//#/.","...#.#/.#..#.#..#.#..","#/..#/#/#//#......./#"}
2
Returns: 3
{"#./..#../...////#/.#//../#/#.#/##..#//",".####/#//#.#//.#/#/.#/#.#/..#..#..#../","....///#////.#/##/.#/.###/.##//..#/.#.","//#////./.##.###.//###..#/./##//##./#.","/##/##.#../#/./###///.##././.#//##.#..","#/#/.##../##.///.///./#./.#../##.#./..","///#/#.#./#//.#//#.//##/.../#...#../..","..##/./////#//#../..//..///////##/../#","#.#../..#///...#./.#//#./#.../#/#./.#.","..#../##../#./#.#///.////##.#.///##/#/","###.././///#/.//..#././//####./.###./#",".###/./.##//##/#..#/./....//./.#...#/.",".#..#.../.#///#/#/./#/.//##/../#../#/#","/.##/##/...#/./###...#/.../////#///../","#/###.#/../.#....#//.////./#.#.##/../.","..././../#/##.//#.//..#/##//./.##/##/."}
3
Returns: 3
{"/##/#/.#/.//#/./#.##","#.##./#.##../.#./#./","/.#//#//#/.#.//#/.#/","#//.////#/./#/#.//.#","///#././/.//#/./#/#.","##.../.#/../.#.##.#/","/#/./#/./../####//#.","///#...#/./#/././../","..##/##../###.//..//","##//##/#/.#//####/#.","//./.#.###...#../##/","//.#/.#//...//#/.../","///.#/.#/####.##...#","#.././.##///##.#.///",".//.#.#/..#.##.#/.##","./#/../..#.#/////../","#./.#.#././/#/././##","//#..//.#.#//.#/#../","/./#.///##.###./.#.#"}
8
Returns: 6
{"./#/#////..//#/.#//#..###.//..///./.#...//.","#.//.#/.//#/.#..#//#///##./#/##//.##/###/.#",".../.#...##//##./././../../#.//#.###../#/#/","#/.#.###/#...///##/.###...#/.#.#.#/.#//../#","##..////..../.##/.#////./..../#//#.#/#/#.##","##.#/.#././#..#//#///#/.###.#.././/#./.#./#","/#.###/##///...##/#...#/#/.##/.##.##...//.#","#.##/#####//##//.////.#/./..##../#..//#.##/",".##/.#/##/.////#.#/#####././.##././////#.#.","##.././.###//#/.##././/#/#././.../##///.//.","/#..#.///...##./#/.//.#../#../##/#/#/..../#",".#/./.#.#/#./###/#.#/.//./#.#.../.#..///#.#",".#./##//.#//##/##.../././###/#.../..##/./#.","../#.#/.#..#.//#/.#../###..////.#./#.#.##..",".#/./###.#/./##/#/..#.////#../#...#/###.//.",".///#//###//#/##//#.#..#.###/..//##.#./#//#","#.///##.#//#///#.#...///#./../...####.///#.","//#//.#/#//#/.#......#../../.#/####////.//.","#.##.#/#/##//./....//##//#/.##/.###../../.#","###/.#./#..//.#//#/./.#///.//##/./#./.###..","/.##.#//##/###/#././///./##/##../##///../##","//././/.#//..#../.#//././#/...###/#.#..##/.","#./.#..//#.#./#.../#//..##..//#...##/#./#..","/.#../#///////.//./##/.##.../#.////#/##.///","#####..//..###///././##.#./.##.//#..//..##/","..////.#/.//..##/#./#./.#......#.#/.#.#.#./","//#./././##.##/#.#/.#/./#/.##./#/#/.###..#/",".//#.#//.#..#./##/#/#//#./#/#.##.##.../##.#"}
1
Returns: 3
{"/.###...#..//#//./##/./##.###.///.###.//.#",".//#/.///#/...../#.#/../##////./...//#./..","##./#.//#..#/.#/##./#/#.##.../....##./#..#",".#/#//.......#/#.../#../.#/.....//#/.#./##","..//.//#./#/.//#/..#.///./#..##.##.##./#./","/#/.#/#.#/./...##/#//.../..#/./#././.##///","./#./##.#/#/.///#.###/...#..../#./#//.#./.",".#..///.##..../../##/#...//.#.#///#//#../#","..//##//././././../.../...//....#//.#..#..","/#....##/###./##/./#./#/#.##.#....//#//#/.","/.////#..##///.#/..##//.##/.#.././/...#../","##/##/.##........##../../###/#/##.##./#/./",".##.##//../..//#/../#././//././/./####.//.",".///#./.....////./#//#//#/....##//#./.#/##","#.///.../#.#/#/..#.##/#/###.//..#..../..#.","...#.//..../#../#//.//.#####/./#..#./###..",".#.//.//.#///#.#/.//#.##/./.#.//#./#//.//#","././/#/#./..#./#/#....##..##.###..///.#/..","//..////#//###/#..//.#./..././#/#//#..../#","/.###/..#.###/#...#//...#/./...../#...../.","/.../#.###./#.###///#..##/.#/##././.#/..#.","/#..#/##.#./....###..##...///###/..//.//#.","/////#/../#/#//.///###//.##/../.##/..../..",".#/.#//#/.#////#/####//#....#/#/.#//#/#./.","#/..//###.///#..#..../##./.#...///#/..#.#/","//##./#//./.##.../###/#.#./#.#.#./#.##/#/.","/#././#...//##/##..#.#./..##.#.##../#../..","#/#./....##/..#/#./#/#.//.#/#./#/.....#///",".#././..#/##.##./...//.#/.#/././#/////../#","####./////..##//../..###/..#/#////#/.//##.","////##.#.#/#.//..//.#./.#.//..#/#/..#/.//.","#//#.##/#.##././/..//#//././#.....././//#."}
90
Returns: 6
{"/##.#.##.#","#//.###///","..#...///.","#//#////#.","/#..#.//#/",".//##//#//","/#/##.#..#",".#/#/###/#","#..##..###","/.#./#/...","./.#/..#//","/./##.////",".#////#/##","#//..#.#/#","#.##/##/#.","././/../.#","./#./#/./.","##////.##/","./##.../..","/....#..#.","##/././#/#","///##/###/","#.#.#/#/..","#./#/.#...","/#.#./...#","#/#...//##","#/#/.#.#/#","././../.##","#/######.#","//./##/...","#.#./#.//#","/##/#.#../","/././#/.##",".#/.##....","#/...#//##","..#/.###/#","/.#//##//.","/#././..#.","../..##./#","..#/#.#/..","/#//.//#./","##.##//..#","#./#/##/..","/#.#///###","./##./##/#"}
97
Returns: 3
{"./.###.///./#//.....//....##././..//./.#/./","##/.../.#/##/#../..#/.///.//////..####.///.",".###./##/##.//../#.##/#//#.//....#////////#","../#/.#//.../#..///#//#.#./.#/.#/./../#.#//","#/#////#.//../#../#...///.#.#..////./#.#./#","//.#..#///#....#//.//.#.//.#./##.//./###.#.","#/.//#/##//#/#/####//#./.../.#///###/##.//#","###/#//..##../###/..#//#.#.##./../#.#/././.","/#././#.....#/..//...#/.#..##./#.##/.#/#/##","..///.#./##/..###.///.../...##///...##/.#/#","/#../.#....##.##.#...#....##.//.##/...//##.","../././##/###/.#//##..//#././//.#/.#///../.","#.#..//../.../...#./.#////././//.///..#/./.","/#..#.###.###/#/#.##/#..#.#..//###/.##.#///",".##////./#.//#../.#.#///##//#//#//.#/./##//","..//#.#/#./.#.#.##.#/..#//./#/#.##/./.####.","//#.....////./.##../..#/###////....##/#/.#.","##///..///##/##...#.//.///./#//..#/#/#.#../","###//#/#.#./##..#/#/###..//./##/..//#./#./#","..###/#//##//.##/#...#.##//#/#./....//.//#.","/#//./#//.#/##..#.#//.../..###.//#..//.//##","#./#.#//./...#/./##..#####..#..#/.//#/.#/./","/##/.#/../##/#/###.///...#..../.#...#.#..#/","..###/##/././##/#../#//#./..//#.#//./../#/#","...###/#..#./#...#/...#//.//#/###/.##/#####","####.#././/#/.###/#/####.#..#/##/#///#/##/#","//#.#/#.........##././#.###...##..#/../.../","#./#/.##.#/./#/...#.//#.#...//.##/./#/////."}
1
Returns: 6
{"/#..#.#///...#/....#.#///..././/...#/##./..#//##",".//.#..///#././/#.##/###.#.//////.#...//.#//#/##",".//.#.//##.##..#/.//#./#..#//./.#.##.#.##.#///#.","//###/./#//###.//......#//..../#././...//./..///",".###.././#.#/.##///#/.....#//.##.././.#...##/##.","#//......#//./#/.#/./#./##/.#.#/.##../.#//.#.//.","..////#/..#/.#.///.#.#/....#/#/.##/..#.////..#./","//#####./././###.##/#./#/..#/##/.//../..#..#/#./","##./#/.#.##/../.#/.//#.#/.#/.//.###.//./../.....",".#/#/##.##./.#/././#/###/##/./##/./##././/./.###","#/./.##/..../#/.#/#./#./###./././#..##./#..#/#.#","#/#/.///##.#/.#/#/.././/.#/#/.##..#/.#/.#/#.../.","##//#...##/#/#/./.../##.#.//#/.../#/#/.#/./..#/#","#./.#//./#.#//.###///#./#..####/././#/#.#/..#./#","..../..##.#/../##///..//./##.#/###//.###/#.#//#/","//.../#/..//./#.//.#.#/..#..///.##/#.///#../.#/#","##.#../##/////./#../#///#///#/#....#./###.//../#","#.#....#/...##/#.#/#./#../##.##/#.##./#.///.##.#","#/../..//#//#..#.////.#...#..././.#./#./..#././.","/##/..##///#/#/./.#.##.#.#//.//./#.#/.//..#.//.#","###/#..#...///##..///#//#.././/..#/..///.#/...//","/#///../##..#////##/./..##/...###//.#/#/.///##//","#/.#/////..##/####.#.../#.#/..##///#/..#/....##.",".#..#//#/..#.#.//##/...###/./#/.##.#/////.#../##","..###/#####..##/../#//###//#.##/##/#.//.##.#/#/.","/#./#/...//##///#.#//####/#...##//./.##...##../#","//#.#.#//./....##.##//..#/...//##...//#.#.#/.##/",".#..##.#/#/##/#/#.#////.##.#/./#..///#/##.#.//##","../..##//..#//##/#././..#././/.#////#.//.##/#...","..///..#/#..##.///#//./##.#..####/##//#/###.#/#/",".#/#.#///#./.#//.///#..####/.########//.//./#//#",".//#..#.##...#.#.###/#//.##/#.../####././.#/##/#"}
175
Returns: 6
{"##/#/.//","../#/./.",".//.////",".#//#/..","/###.##.","/./..##.",".##.....","/#/./.#.","./##/.#.","#/.///..",".#./#//#","///####.","..#.#./.","/#..###.",".////#/#","./#.#//."}
2
Returns: 3
{"/##../.####/////#//#/.","###.###//#.#/.###///..","#./..#.#/...###.#.##/#","./.#/../#...//#./#./##","#///#/#....##////#/../",".##.###.##//###.///./#","/.//#.#/./#//..##.../#","/.......//##//#././#..","#...#//##././/.#.#././","../..//...#/#//#/#/..#","#/#/.#.##//##//./////#","/##./#//#.#///./####./","//#/##.....#.#..##.#.#","./.#./#/##/.###.##//#."}
34
Returns: 3
{"//#.#//#..#/#..#.#/..//./#./##########//#","##.#/#/#.#..##./#/./.#/..//.####//#.###./","./##//##.//.#.###/#.//./#./.../..#.##//##","#../..#/#/#/../.#.///##./##..#///#.#/.#./",".###./../../###//#/#.//#.##..//##.//.#/##"}
1
Returns: 3
{"/#//#//#/###../##.../.##//.","#.//#./#./#././#.#.../#..#/","#..//##..../#//./...##//../",".#....//../../###.#.#.#../#","#///##/#/...#./#/.##//.###/",".#.#/#/#...././/#.////#./.#"}
11
Returns: 3
{"#././.##////#.///...#####",".#/.#//..##/./.#/./##.##.",".#/././#..#/.///./#./###/","..//..#/.#/#/#/####/.#/#.","./#//#..#.####.#####.//./","./#..#.///#/./..#/////../","/.#.#.#.#./#/#./#///##...","/..###/##./#.#/#/./../.##",".##/../##/.#///...##/./.#","/##..##/##//.//#.#//...#/","..#/####./#//#/.//#/...#.","//#.//#.//#/#/.....#/##/.","#..#././##..../##.../.#./","..#..#.#//#/./##../.#/###","/#####.//#.####//.##.//#/","#.#/..#/./.##/##.//#/#/..",".##.##/...##../..#//.#../","#.#.//.//#//.#/././#/..##","/##.##..././###.///.##.#.","##//###.#..#///#/..#####/","./#/#/#...//..#/#.##//##.","/...#//.////.#////#./#//.","#/#/#../#///./....//...//","./.##//#....#/.//./##...#","/./.././//..##././#./##.#","##./#//.###..//#.///..//#","/.#/..##./.#/##/.../.##//",".#.////.#.//#///#/##/...#"}
1
Returns: 6
{"../#####//..####/..#//###/.##.##/##//#...../","././...#.#.../..##.#/../#/#/#....///..#//##/",".//../.#/./##//.#/./..//#..///.##......./#./","../.#/./../#.//...#..##.//.#/#..//##/###/../","../##../#//.##....#####./////#.##./#.#.#/.//",".#///./.../#//##...#.///...###/././//##///##","/#..//././.#../../#.#.###.//#//.#/.#../#.###",".././//./##/##.##.##..##//.../#.../..../#/.#","###./#//#../...##/.#./#.#.///#..///####/../#","//###..#.//#..#//#./..//#///#.//###.#/#.///#","/.#//#.#/#.#/.#/././//#/##////..#/./#/../..#",".##./.#.//##//./#../.#./..##.#/##../#/#./#/#","#.../#.#..##...#.#.#//.#//#.##/#//./../#./#/","/..#/##..#.#./....#//###/...#//.//##/###..#.","/./..#.#../././/#/##...//###//####.#/#///../","#.###//.#.##//##./##/#/.//#.###.#/.##././/#/","../.###///#.##/./##.##///.#.//####.#./#./#//","/../#/##././///#/#..#.#../##//.#/#//#.#..../","/##.#../.#//../##/#.//#//###.######.//.##/#.",".#./..#.#./.#/..#/.#/././/.#/.#.#.//./.#/##.",".#/#.///.##//./.#/#.#/.#.##./#/////..#.//#.#","#//..#....#/.#/##.#././#/../#./#/#...##/##/#","....//#/#///#./.#//././///##.##./../####./##",".##//###.##/#..##//#//.#/././#./#//.#././##/",".////.//##.///#/#.##././#/.//..###.././###/.","/#.///#./.#..###..#.#...#/.#/###.../####.//.","/#..#/.#...#/..#####////#///###..#.##/#..//.",".#/..###...///#...#.#/#/#///####///#...##/##",".####/.#.///#/##.//.../#.##./..#./#/##//.#.#","##/./#/.#.###./.####.##..#//#.#/.##.#./////#"}
190
Returns: 3
{"..#/.....#.//#.#.#./##//#.#/./","#/#///.#/.#../###//.#/.##.####","..##..##.#.../#./.././#.//.##/","/###/.//.#..#///.//##/////##/#","/#/./..#./#/##.../././//..//##","#./..///.##//#/#.##/../##./#.#","#..#//./././.#.//.#./..#/##.##","/.#./#../#/#.##//.//#...../#.#",".//##/...//./////#/.////#..##.","#/.//.#/..#..#/.#/././.#/./../",".#.//..//###//./.#.//#/...#.#.",".##///.#/#/#.#.#/##/#/.//###.#","/.#/#//###.#////###./#.####/#/","/./#..#/.////.##.#/#.##//.##./","./#/..#/#.##/#../##/#/./.#.///"}
34
Returns: 3
{"//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////"}
1000
Returns: 1035
{"//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////"}
2500
Returns: 1275
{"......../........./........./........./........./.", "......./#......../#......../#......../#......../#.", "....../##......./##......./##......./##......./##.", "...../###....../##......./#.#....../###....../###.", "..../####...../####...../####...../.###...../####.", ".../#####..../#####..../#####..../#####..../######", "../######.../######.../######.../######.../######.", "./#######../#######../#######../#######../#######.", "/##.#####./########./########./########./########.", "..................................................", "......../#......../........./........./........./.", "......./#......../#......../#......../#......../#.", "....../##......./##......./##......./##......./##.", "...../###....../###....../###....../###....../###.", "..../####...../####...../####...../####...../####.", ".../#####..../#####..../#####..../#####..../#####.", "../######.../######.../######.../######.../######.", "./#######../#######../#######../#######../#######.", "/########./########./########./########./#########", "..............#.....#.................#...........", "........#........./........./.....................", "......./#......../#......../#.....................", "....../##......./##......./##................../..", "...../###....../###....../###.........../...../#..", "..../####.....#####...../####...../..../#..../##..", ".../#####..../#####..../#####..../#.../##.../###..", "../######.../######.../######.../##../###../####..", "./#######../#######../#######../###./####./#####..", "/########./########.#########.....................", "..................................................", "......../............................/............", "......./#.........................../.............", "....../##.........................................", "...../###.........................................", "..../####.........................................", ".../##.##.........................................", "../######.........................................", "./#######........./................/..............", "/########......../................................", "...............././...............#...............", "..............././...............##...............", "............../././.............###...............", "............./././.............####...............", "...........././././...........#####...............", "..........././././...........######...............", "............................#######...............", "...........................########...............", "..................................................", "..................................................", ".................................................."}
1
Returns: 21
{"......../..", "......./#/.", "....../##..", "...../###..", "..../####..", ".../#####.#", "../######..", "./#######..", "/########..", "..../..../.", "..#........"}
3
Returns: 45
{"//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////"}
1225
Returns: 1275
{"//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////"}
1225
Returns: 1275
{".../.../", "../#..//", "./.#.///", "/###...."}
3
Returns: 6
{".../", "../#", "./#/", "/#//" }
5
Returns: 10
{"." }
12
Returns: -1
{"./#" }
1
Returns: -1
{"..../", "...//" }
2
Returns: 3
{"////.", "////.", "////#", "////.", "..#.." }
10
Returns: 6
{"/", "#" }
10
Returns: -1
{"/#" }
1
Returns: -1
{"....####..#..///", "###.....////.///", "##..#..#..#..../", "../////#..#..///", "....////../.././", "..#########..///", ".#..#..#..#../..", "....####..#..///", ".////////.#..///" }
10
Returns: 3
{"../", "./#", "/##", ".#." }
122
Returns: -1
{".....#", "..../#", ".../##", "../###", "./####", "######" }
10
Returns: -1
{"../#", "...." }
1
Returns: -1
{"......", "......", "......", "..../.", ".../#.", "../###" }
10
Returns: -1
{".#", "/." }
1
Returns: 1
{"..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "............................/.....................", ".........................../......................", "........................../.......................", ".........................//.......................", "........................///.......................", ".......................////.......................", "....................../////.......................", ".....................//////.......................", "....................///////.......................", ".................../..............................", "................../...............................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", "..................................................", ".................................................." }
2500
Returns: 28
{"/#", "##" }
2500
Returns: -1
{".", ".", ".", "." }
10
Returns: -1
{".....", ".../.", "../#.", "./##.", "...#.", "....." }
5
Returns: -1
{".../.", "../#.", "./...", "/...#" }
1
Returns: 3
{"../.", ".//#" }
1
Returns: 1
{"..../", ".../.", "../#/", "./##.", "/././" }
1
Returns: 6