Statistics

Problem Statement for "ClosestRabbit"

Problem Statement

Rabbits are going to play a game on a board with a rectangular grid. Each cell of the board is either empty or full. You are given a String[] board, where the j-th character of the i-th element (0-based indices) is '.' if the cell in the i-th row and the j-th column (we call this cell (i, j)) is empty, or '#' if cell (i, j) is full. The distance between two cells is the Euclidean distance between their centers. Formally, the distance between the cells (i1, j1) and (i2, j2) is the square root of (i1 - i2)^2 + (j1 - j2)^2. (Note that the full cells do not act as obstacles.)

There are r rabbits, numbered 1 through r. In the increasing order of their numbers, each rabbit chooses an empty cell uniformly at random and moves into that cell. Note that cells chosen by previous rabbits are no longer considered to be empty.

After all rabbits chose their cells, let's define the values f(1), f(2), ..., f(r) as follows: For each X = 1, 2, ..., r, the value f(X) is the number of the rabbit that is closest to rabbit X. In case there is a tie, we prefer the rabbit with the smallest row index, and if there is still a tie, we prefer the rabbit with the smallest column index.

Let's construct an undirected graph with r vertices, numbered 1 through r. The graph has exactly r edges: for each X = 1, 2, ..., r, we add an edge connecting vertex X and vertex f(X). Calculate and return the expected number of connected components of this graph.

Definition

Class:
ClosestRabbit
Method:
getExpected
Parameters:
String[], int
Returns:
double
Method signature:
double getExpected(String[] board, int r)
(be sure your method is public)

Notes

  • A connected component of a graph is a set of vertices where every pair of vertices has a path connecting them.
  • The returned value must have an absolute or relative error less than 1e-9.

Constraints

  • board will contain between 1 and 20 elements, inclusive.
  • Each element of board will contain between 1 and 20 characters, inclusive.
  • Each element of board will contain the same number of characters.
  • Each character in board will be either '.' or '#'.
  • r will be between 2 and the number of '.'s in board, inclusive.

Examples

  1. {".#.#."}

    2

    Returns: 1.0

    No matter how the two rabbits choose their cells, we will always have f(1) = 2 and f(2) = 1. The graph will always contain two edges, each connecting the vertices 1 and 2. Therefore, the number of connected components is always 1.

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

    4

    Returns: 1.6

    Here are two examples of rabbits' positions (represented by 1, 2, 3, and 4): (a) 13###2 (b) 34###. .###4# 2###1# In (a), f(1) = 3, f(2) = 4, f(3) = 1, and f(4) = 2 holds and the graph has two connected components. In (b), f(1) = 4, f(2) = 3, f(3) = 4, and f(4) = 3 holds and the graph has one connected component.

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

    5

    Returns: 2.0

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

    4

    Returns: 1.253968253968254

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

    19

    Returns: 5.77311527122319

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

    19

    Returns: 5.850306651594568

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

    19

    Returns: 5.8502529817179765

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

    19

    Returns: 5.850506005015867

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

    19

    Returns: 5.850476740211365

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

    2

    Returns: 1.0000000000000002

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

    13

    Returns: 3.7785714285714276

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

    2

    Returns: 0.9999999999999984

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

    15

    Returns: 3.116421568627451

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

    4

    Returns: 1.6

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

    7

    Returns: 2.375

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

    2

    Returns: 0.9999999999999997

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

    10

    Returns: 4.0

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

    2

    Returns: 1.0

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

    2

    Returns: 1.0

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

    4

    Returns: 1.3021920003771201

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

    21

    Returns: 5.091609721870399

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

    108

    Returns: 22.610172461860266

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

    3

    Returns: 1.0000000000000004

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

    7

    Returns: 2.175757575757575

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

    8

    Returns: 2.4969147504287115

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

    20

    Returns: 6.388347331997852

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

    35

    Returns: 10.562229369116636

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

    70

    Returns: 18.20650093013232

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

    7

    Returns: 2.2760169292677013

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

    83

    Returns: 18.96311821207985

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

    20

    Returns: 5.243296159259913

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

    50

    Returns: 12.26622413412488

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

    16

    Returns: 4.107166311500676

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

    5

    Returns: 2.0

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

    12

    Returns: 3.3723962917326737

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

    177

    Returns: 18.49677324541602

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

    8

    Returns: 2.6848484848484846

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

    48

    Returns: 12.530626017193992

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

    15

    Returns: 4.107546022574959

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

    38

    Returns: 11.745529458740963

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

    14

    Returns: 4.293135985547342

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

    156

    Returns: 31.47147039957384

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

    33

    Returns: 10.099643361794831

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

    138

    Returns: 29.682816847255612

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

    192

    Returns: 31.096656312527184

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

    10

    Returns: 3.393870835047306

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

    184

    Returns: 34.178315105090306

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

    31

    Returns: 9.424967860621402

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

    48

    Returns: 14.281243307387536

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

    33

    Returns: 9.128863772613254

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

    107

    Returns: 26.429011699136133

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

    41

    Returns: 12.51561968951967

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

    319

    Returns: 8.721800896913361

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

    10

    Returns: 3.14081530261366

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

    87

    Returns: 23.95228948437378

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

    129

    Returns: 30.06260248120947

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

    6

    Returns: 1.8867798867798875

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

    24

    Returns: 7.396058784515051

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

    53

    Returns: 15.729996369196652

  60. {"....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "...................."}

    2

    Returns: 0.9999999999996512

  61. {"....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "...................."}

    3

    Returns: 0.9999999999999525

  62. {"....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "...................."}

    159

    Returns: 31.304964026759265

  63. {"....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "...................."}

    399

    Returns: 1.044999999999999

  64. {"....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "...................."}

    400

    Returns: 1.0

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

    200

    Returns: 100.0

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

    19

    Returns: 5.77311527122319

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

    4

    Returns: 1.253968253968254

  68. {".#.#.#.#.#.#.#.#.#.#", "#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#", "#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#", "#.#.#.#.#.#.#.#.#.#.", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", ".#.#.#.#.#.#.#.#.#.#", "#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#", "#.#.#.#.#.#.#.#.#.#.", ".#.#.#.#.#.#.#.#.#.#", "#.#.#.#.#.#.#.#.#.#." }

    200

    Returns: 16.066350629374888

  69. {"....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "...................." }

    36

    Returns: 10.903532939701691

  70. {"....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "....................", "...................." }

    5

    Returns: 1.5664095664151276


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: