Statistics

Problem Statement for "RotatingTriangles"

Problem Statement

NOTE: This problem statement contains images that may not display properly if viewed outside of the applet.

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. Each of these triangles can be rotated left or right by any multiple of 90 degrees. They can also be unfolded to become squares. However, black squares cannot be folded to become triangles.

Your task is to generate proper black triangles 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 grid will be given as a String[], where the j-th character of the i-th element represents the cell at row i, column j. '.' represents an empty cell, '#' represents a cell containing a black square, and '/' represents a cell containing a black triangle. Return the total number of distinct proper black triangles that can be formed in this grid. Two triangles are considered distinct if they differ in at least one vertex.

For example, consider the following input grid:



It is possible to generate 5 distinct proper black triangles:

 
 

Definition

Class:
RotatingTriangles
Method:
count
Parameters:
String[]
Returns:
int
Method signature:
int count(String[] grid)
(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 '/'.

Examples

  1. {"//"}

    Returns: 10

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

    Returns: 5

    This is the example from the statement.

  3. {".#.", "#/#", ".#."}

    Returns: 0

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

    Returns: 46

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

    Returns: 540

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

    Returns: 57

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

    Returns: 295

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

    Returns: 811

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

    Returns: 602

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

    Returns: 223

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

    Returns: 823

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

    Returns: 167

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

    Returns: 381

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

    Returns: 227

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

    Returns: 328

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

    Returns: 1428

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

    Returns: 458

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

    Returns: 128

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

    Returns: 1292

  20. {"#.##.////#/#.#./.#//#/./#","/#....#.#././/.##./###./.","//#/.////##.#/#/#./.#../.","#.//.//#.####.#/..//..//.",".##.#.....///.#...#.#//#/","//#/.#/.///.#//./.#/###.#","#...//##/###.//.#/.#/.##.","#/#./#####/##/#.#/##..//#","#//##.#////#....//#####/#","....##..#..###/..#//#//./","/.#.#.//#.#.../...#.#.##.","#...#...##.####//#.//#../","..//#..#/./.././//#/..///",".##.##/#.//.#/.##../.#../","#/.../.#/#/.#.###.##.#/./","///#...######.//#/##./##.","#//#//##//../.#.###/##///",".///#/####.##..#...../#./","../../.#...##/#.#.#/./#..","//####/#/../#//./###///#/",".#....#.#////#//#/#/.#.#.","#//.#....#/././/./#/#..##","/.#/##/////#..#/..#..///.","#..#.//#../../##.###.#/#/",".#/.#////#/#./#/./####../","/.#.##.#//./.#/./.././.#/","/#/..../././#/#//###./##.","/.#.#/#./////.#.#/#/#.#..","#.#//./.#///.../#.//.././","/###...#....#./#.#/////.#",".#..#...////.#//###/#.#/.","/#//.#///./##//##/#././/."}

    Returns: 713

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

    Returns: 268

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

    Returns: 864

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

    Returns: 754

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

    Returns: 659

  25. {"//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////","//////////////////////////////////////////////////"}

    Returns: 277100

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

    Returns: 263834

  27. {"#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/","/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#","#/#/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#/#/#/#/", "/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#", "#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/", "/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#"}

    Returns: 192

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

    Returns: 3837

  30. {"."}

    Returns: 0

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

    Returns: 1

  32. {"/.................................................", "//................................................", "///...............................................", "////..............................................", "/////.............................................", "//////............................................", "///////...........................................", "////////..........................................", "/////////.........................................", "//////////........................................", "///////////.......................................", "////////////......................................", "/////////////.....................................", "//////////////....................................", "///////////////...................................", "////////////////..................................", "/////////////////.................................", "//////////////////................................", "///////////////////...............................", "////////////////////..............................", "/////////////////////.............................", "//////////////////////............................", "///////////////////////...........................", "////////////////////////..........................", "/////////////////////////.........................", "//////////////////////////........................", "///////////////////////////.......................", "////////////////////////////......................", "/////////////////////////////.....................", "//////////////////////////////....................", "///////////////////////////////...................", "////////////////////////////////..................", "/////////////////////////////////.................", "//////////////////////////////////................", "///////////////////////////////////...............", "////////////////////////////////////..............", "/////////////////////////////////////.............", "//////////////////////////////////////............", "///////////////////////////////////////...........", "////////////////////////////////////////..........", "/////////////////////////////////////////.........", "//////////////////////////////////////////........", "///////////////////////////////////////////.......", "////////////////////////////////////////////......", "/////////////////////////////////////////////.....", "//////////////////////////////////////////////....", "///////////////////////////////////////////////...", "////////////////////////////////////////////////..", "/////////////////////////////////////////////////.", "//////////////////////////////////////////////////"}

    Returns: 92397

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

    Returns: 61483

  34. {"#"}

    Returns: 0

  35. {"/"}

    Returns: 4

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

    Returns: 1

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

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

    Returns: 1

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

    Returns: 0

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

    Returns: 0

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

    Returns: 1

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

    Returns: 1

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

    Returns: 1

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

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

    Returns: 0

  55. {".....#", "....#/", "...#/#", "..#/##", ".#/###", "#/####", "......"}

    Returns: 1

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

    Returns: 1

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

    Returns: 1

  58. {".....#", "....#/", "...#/#", "..#/##", ".#/###", "#/####", "...#.."}

    Returns: 0

  59. {"#/####.", ".#/###.", "..#/###", "...#/#.", "....#/.", ".....#."}

    Returns: 0

  60. {"..#...", "####/#", "###/#.", "##/#..", "#/#...", "/#....", "#....."}

    Returns: 0

  61. {".....#", "....#/", "...#/#", "..#/##", ".#/###", "#/###.", "......"}

    Returns: 0

  62. {"#/###..", ".#/###.", "..#/##.", "...#/#.", "....#/.", ".....#."}

    Returns: 0

  63. {"......", ".###/#", "###/#.", "##/#..", "#/#...", "/#....", "#....."}

    Returns: 0

  64. {"//////////////////////////////////////////////////"}

    Returns: 298

  65. {".../...", "..///./", ".//#/./", ".......", ".//#/./", "..///./", ".../...", ".......", "///////", "///////", "///////" }

    Returns: 328

  66. {".#.", "#/#", ".#." }

    Returns: 0

  67. {".../...", "..///./", ".//#/./" }

    Returns: 46


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: