Statistics

Problem Statement for "HittingPerfectTarget"

Problem Statement

A player is going to throw a dart. It is guaranteed that the dart will hit a lattice point (a point whose coordinates are both integers) within a square whose vertices are (-100, -100), (-100, 100), (100, 100), (100, -100). All such lattice points have the same probability of being hit.
In this problem, a point is considered to be within a convex polygon if it lies in the interior of the polygon or on its boundary.  In addition, a convex polygon A is considered to be within a convex polygon B if all the points in A are within polygon B.
You are given two convex polygons, both of which are within the square.  A shot is said to be lucky if the dart hits a point that is within both polygons.  Return the probability that the player's shot will be lucky.
The coordinates of the vertices of the first polygon will be given as two int[]s x1 and y1.  The coordinates of the i-th vertex of the polygon are (x1[i], y1[i]).  The vertices will not be given in any specific order (so they are not necessarily in clockwise or counter-clockwise order), but it will be possible to construct a convex polygon using each vertex exactly once.  The second polygon will be described in an analogous manner using int[]s x2 and y2.

Definition

Class:
HittingPerfectTarget
Method:
getProbability
Parameters:
int[], int[], int[], int[]
Returns:
double
Method signature:
double getProbability(int[] x1, int[] y1, int[] x2, int[] y2)
(be sure your method is public)

Constraints

  • x1, x2, y1, and y2 will each contain between 3 and 15 elements, inclusive.
  • x1 and y1 will contain the same number of elements.
  • x2 and y2 will contain the same number of elements.
  • Each element of x1, x2, y1, and y2 will be between -100 and 100, inclusive.
  • (x1[i], y1[i]) and (x1[j], y1[j]) will be distinct whenever i and j are distinct, i.e., no two vertices of the first polygon will coincide (have both their x and y coordinates equal).
  • (x2[i], y2[i]) and (x2[j], y2[j]) will be distinct whenever i and j are distinct, i.e., no two vertices of the second polygon will coincide (have both their x and y coordinates equal).
  • It will be possible to construct a convex polygon using each of the points (x1[i], y1[i]) exactly once as its vertices.
  • It will be possible to construct a convex polygon using each of the points (x2[i], y2[i]) exactly once as its vertices.
  • No three vertices of the first polygon will lie on a single line.
  • No three vertices of the second polygon will lie on a single line.

Examples

  1. {-100, -100, 100, 100}

    {-100, 100, -100, 100}

    {-100, -100, 100, 100}

    {-100, 100, -100, 100}

    Returns: 1.0

    Both polygons are just the big square.

  2. {-99, -98, 0}

    {-99, 99, 0}

    {99, 98, 0}

    {-99, 99, 0}

    Returns: 2.475186257765897E-5

    Hitting the origin is the only way to make a lucky shot.

  3. {0, 0, 1, 1}

    {0, 1, 0, 1}

    {-54, -99, -100, -100}

    {-54, 99, 100, -100}

    Returns: 0.0

    These polygons are disjoint so it is impossible for the dart to hit a point that is within both of them.

  4. {-1, 1, -30, 30, 0}

    {-1, -1, 30, 30, 50}

    {-2, 2, -60, 60, 0}

    {-2, -2, 60, 60, 100}

    Returns: 0.03895943169723522

    The first polygon lies within the second one.

  5. {-1, 1, -30, 30, 0}

    {-1, -1, 30, 30, 50}

    {-2, 2, -60, 60, 0}

    {-2, -2, 40, 40, 41}

    Returns: 0.03551892279894062

  6. {-64, -77, 83, 91}

    {51, -54, -94, -54}

    {4, 92, 17, -91}

    {-83, -43, 85, -35}

    Returns: 0.22479641593029875

  7. {-68, -81, 100}

    {-6, 63, 81}

    {-21, 33, 66}

    {94, -59, 43}

    Returns: 0.034454592708101285

  8. {-74, -94, 43, 92, 16, 51, -99, 97}

    {-76, 75, 91, -66, -97, -92, -67, 84}

    {96, 44, -86, -91, 81, 62, -72, -92}

    {8, 100, -32, 93, -27, -59, -88, 72}

    Returns: 0.6302566768149304

  9. {-69, -90, -18, -55, 72, 52, -56, -94, -73, 97, 90}

    {-94, -24, 80, 62, -79, -92, -99, 8, 43, 46, 75}

    {95, -77, 56, -95, 14, -32, -88, -98, 54, 18, 98}

    {-90, 64, 31, -14, -98, 72, -90, 21, -99, 67, -36}

    Returns: 0.5832776416425336

  10. {53, 98, -98, 98, -50, 93, -63, -91, 92, -3, 13, 35, -40, -73}

    {-84, -45, -66, -6, -99, 77, 72, 40, -77, 97, 100, 95, -99, 67}

    {53, 98, -98, 98, -50, 93, -63, -91, 92, -3, 13, 35, -40, -73}

    {-84, -45, -66, -6, -99, 77, 72, 40, -77, 97, 100, 95, -99, 67}

    Returns: 0.8052028415138239

  11. {-86, -34, 45, -41, -96, 91, 9, 76, 48, -99, 96}

    {81, -95, -95, -92, -62, 47, -100, 74, 89, 39, -84}

    {-86, 74, 98, -62, 51, -5, 96, 2, -93, -48, 100}

    {-50, 87, -23, 91, -55, 95, 79, -77, 56, -64, 25}

    Returns: 0.632014059057944

  12. {81, -14, -84, -24, 98, 86, 40, -62, -89, -92, 89}

    {-99, -100, 44, 85, -86, 83, 98, -94, -30, -84, 71}

    {90, 96, -41, -88, -58, 41, 52, 62, -28, -97, 93}

    {32, -83, 100, -1, -88, -99, 92, 83, -94, 97, 15}

    Returns: 0.7186950818049058

  13. {95, -84, 36}

    {61, -67, -67}

    {99, 56, -10}

    {67, 24, 10}

    Returns: 0.00598995074379347

  14. {0, 100, 0}

    {0, 0, 100}

    {0, -100, 0}

    {0, 0, 100}

    Returns: 0.002499938120343556

  15. {0, -96, 72, -26}

    {81, -96, 72, -69}

    {-21, 69, -44, -73}

    {-48, 77, 88, 14}

    Returns: 0.16430286379050024

  16. {-71, 100, -58, 70, 2}

    {-94, -39, 93, 82, -86}

    {45, -78, 45, -85, 96}

    {-91, -42, 58, 9, -38}

    Returns: 0.3607088933442242

  17. {91, 80, -34, 27, -99, 48, -95, -100, -29}

    {45, -58, 100, -83, 25, 97, -12, 82, -100}

    {91, -100, -79, -60, 59, 93, -41, 93, -83}

    {-46, 59, -1, -48, -98, 84, -92, 55, 100}

    Returns: 0.6809237395113983

  18. {-31, -92, -84, -91, 99, 64, -36, -66, -99, 90, 95, 98, 62}

    {-98, -79, -93, 72, -17, -97, 100, 97, -45, 42, -93, -61, 71}

    {57, 87, -21, -78, -100, -99, -73, -85, 63, 90, 29, -46, 90}

    {-94, -72, 93, 63, 19, -51, -94, -93, 90, 4, -95, 83, 80}

    Returns: 0.7613425410262122

  19. {-100, -100, -99}

    {-100, 0, 100}

    {100, 100, 99}

    {100, 0, -100}

    Returns: 0.0

  20. {-100, -100, -99, -1}

    {-100, 0, 100, 0}

    {100, 100, 99, 1}

    {100, 0, -100, 0}

    Returns: 0.0

  21. {-51, -55, 72, -78, -97, 85, -94, -23, 95, 96, 30, -99}

    {-94, 98, 47, 97, -40, 20, -66, -100, -71, -23, 75, 78}

    {-58, -97, -64, -72, 57, 78, -76, 90, 89, 11, 49, -12}

    {-62, 84, 98, -11, -95, 43, 95, -76, -50, 97, 89, -94}

    Returns: 0.6379297542140046

  22. {-87, 41, -75, 88, 96, -66}

    {42, -63, -44, -58, 82, -67}

    {77, 81, -10, -94, 85, -95}

    {-86, 55, 42, 17, -45, -62}

    Returns: 0.4194945669661642

  23. {-92, -31, -11, 97, 98, 60, -88}

    {-85, 25, 61, 48, 75, -81, -98}

    {-94, -70, 52, -96, -11, 85, 95}

    {-63, 98, -91, 53, -96, 98, -57}

    Returns: 0.47501299472785324

  24. {72, -21, -40, 26, 85, -97, 5, 98, 99, -90, 74, 100, -16, 47, -98}

    {82, -94, 99, 98, -70, 64, -98, -59, 28, 74, -79, 4, 100, -89, -36}

    {72, -21, -40, 26, 85, -97, 5, 98, 99, -90, 74, 100, -16, 47, -98}

    {82, -94, 99, 98, -70, 64, -98, -59, 28, 74, -79, 4, 100, -89, -36}

    Returns: 0.8032969480953441

  25. {-96, -99, -24, -34, 2, -11, 99, 75, -87, 96}

    {-96, -77, -90, 99, 100, 100, -77, -81, 42, 82}

    {85, 95, -92, 74, -27, 67, 3, -88, -66, -56}

    {98, -57, -46, -68, 94, -70, -83, 59, 84, -94}

    Returns: 0.7268631964555333

  26. {89, -91, 2, 96, -63, 84}

    {52, -71, 66, 2, 65, -96}

    {50, 54, -96, -27, 4, -83}

    {-61, -90, 58, -75, 53, 98}

    Returns: 0.3034825870646766

  27. {-96, -99, -24, -34, 2, -11, 99, 75, -87, 96, 73, -66}

    {-96, -77, -90, 99, 100, 100, -77, -81, 42, 82, 99, 89}

    {-69, -92, 35, 47, -25, -95}

    {-66, 57, -77, 88, -76, -24}

    Returns: 0.459790599242593

  28. {99, -25, -93, -16, -44, -92, 98, -88, 73, -91, 51, 91}

    {-93, 95, 29, 96, -98, -85, 75, -98, 93, 74, 98, -94}

    {-40, -79, 95, 82, -18, 95}

    {-49, -19, 87, -80, 74, -5}

    Returns: 0.5076607014677854

  29. {-98, 92, 91, 80, -34, 27, 48, -100, -29}

    {-84, 66, 45, -58, 100, -83, 97, 82, -100}

    {-71, 100, -58, 70, 2}

    {-94, -39, 93, 82, -86}

    Returns: 0.5934754090245291

  30. {96, -96, -74, 4, 97, 93, 21, -91, -34}

    {-38, -43, -71, -98, -3, 98, -98, 91, -90}

    {28, -72, 64, -93, -97, -74}

    {-33, -71, 82, -53, -4, 72}

    Returns: 0.4223162793000173

  31. {63, -78, -98, 80, 85, -30, -99, 28, -86, -19, 45}

    {63, -95, 77, -5, -92, -98, -82, -96, 81, 85, -95}

    {91, 9, -97, 76, -20, 48}

    {47, -100, 42, 74, -77, 89}

    Returns: 0.4243459320313854

  32. {-45, -84, 43, -28, -98, 20, 100, -100, 100, -55, 67}

    {96, -68, -83, -83, 15, -88, 95, -35, 89, -76, -40}

    {-89, 86, -33, 82, -77}

    {94, -93, 97, 62, -54}

    Returns: 0.5646394891215564

  33. {-94, -73, -92, 5, 91, 95, 7, 56, 51, -64}

    {47, -90, 32, 98, 74, -48, -93, -89, 89, 100}

    {25, 40, 100, -81, 54, -76}

    {74, -100, -73, -94, 68, 39}

    Returns: 0.5660008415633276

  34. {96, -93, 14, -100, -38, 69, -100, 97, -78, -88}

    {66, -89, -99, 80, 95, 91, 33, -83, 96, 93}

    {-84, 71, 26, -73, 43, 62, -28}

    {-21, 44, 82, -62, 93, -96, -75}

    Returns: 0.450137372837306

  35. {-70, 83, -86, 67, -98, -31, 84, 44, 100, -97}

    {-100, 73, 85, -79, -23, 93, -56, 93, 41, 77}

    {14, 80, -94, 93, 80}

    {98, -71, 17, 45, 76}

    Returns: 0.43434568451275957

  36. {12, -97, 88, 71, -68, 79, -28, 93, -88, 84, -77}

    {-100, 36, -80, 89, 77, -93, 100, 7, -28, -89, -81}

    {-52, -55, -36, 56, 73, 20, 68}

    {-63, -49, 52, 28, -43, -84, -48}

    Returns: 0.30818544095443184

  37. {-100, 95, -3, -76, -100, 62, 57, 100, 84, -79, 43, 92}

    {-29, -33, 91, -76, -17, 95, 96, 32, -45, 73, -88, 62}

    {-22, -80, -99, 92, 81, -94}

    {-78, -58, 52, -56, 62, 16}

    Returns: 0.5319917823816243

  38. {93, -97, 96, 15, 34, -86, -99, -100, 85, 7, 98}

    {15, 98, -87, -97, 92, -94, -27, 3, 53, 98, -22}

    {-87, 48, 31, -87, 7, -86}

    {-57, -58, -92, 57, 78, -82}

    Returns: 0.4541224227123091

  39. {97, -99, 65, -98, 80, 7, -87, 100, -21, -66}

    {-99, -24, 87, -71, 85, -96, 68, 81, 94, -79}

    {73, -15, -72, -76, -76, 61, -66, 75}

    {-70, -98, 11, -74, -38, -95, -94, 84}

    Returns: 0.5018935174871909

  40. {43, 92, 16, 51, -99, 97, -93, -78, -38}

    {91, -66, -97, -92, -67, 84, 95, -81, -99}

    {-80, 83, -70, -90, 55}

    {89, -76, -12, 65, 53}

    Returns: 0.40184648894829333

  41. {-98, 66, -95, -99, 97, 77, -25, -70}

    {-75, 96, 48, 6, 54, -51, -93, 98}

    {52, -71, 66, 16}

    {-91, 84, 96, -63}

    Returns: 0.3403628623053885

  42. {-96, 98, -57, -12, 10, 94, -83, 84, -94}

    {-82, 95, 91, -92, -87, -44, -88, -60, 85}

    {-90, -49, -75, 53, 10, 98}

    {4, -96, 4, -84, -4, -45}

    Returns: 0.27838419841093043

  43. {-41, -99, 96, 54, -77, 100, -99, 95, -93}

    {98, -4, 93, -91, 93, -16, 17, -75, -89}

    {-74, -39, 48, -64, 86, -41, 17}

    {44, -32, -48, 5, 28, 68, 93}

    Returns: 0.36306032028910173

  44. {26, -30, 76, 82, 95, -77, 92, -95, 14, -88, -98}

    {97, 98, 88, 43, -90, 64, -59, -14, -98, -90, 21}

    {54, 18, -75, 98, -57}

    {-99, 67, -54, -36, 7}

    Returns: 0.4037028786416178

  45. {91, -81, -85, -12, -97, 91, -90, 85, 80, -69}

    {-47, -96, -86, 93, 8, -25, 88, -91, 84, 91}

    {6, -4, 90, 16, -9, 42, -13}

    {94, -40, 7, 98, -32, -98, 52}

    Returns: 0.2877899061904408

  46. {13, -90, -55, -35, 58, 100, 93, -88, -100}

    {-100, 26, 75, 88, 96, -86, 81, -92, -23}

    {-85, 52, 90, -99}

    {95, 81, -65, -77}

    Returns: 0.5995643672186332

  47. {53, 91, -39, 92, -36, -96, -94, -68}

    {100, -77, -100, 79, 98, 64, -39, -90}

    {-67, 73, -99, 71, 54, 22, 43}

    {32, -56, -18, -94, 90, -73, 97}

    Returns: 0.4518204994925868

  48. {90, 91, -27, -54, 41, -85, 57, 87, -21, -78, -100}

    {75, -53, -94, 89, 96, -84, -94, -72, 93, 63, 19}

    {17, -39, -99, 26, -73, -85, -4, -19, 48}

    {-4, -7, -51, -58, -94, -93, -81, -90, -3}

    Returns: 0.21098487661196505

  49. {90, -36, -95, 89, 83, -58, -29, 53, 1, 59, -87, -56}

    {55, -89, 67, -40, -81, 90, 95, 91, 94, -95, -33, -80}

    {66, -77, -60, -77, -13, -69, -20}

    {-54, -69, -94, -70, 58, -11, -86}

    Returns: 0.2881364322665281

  50. {72, -14, -98, -70, 82, -51, 85, -73, -93}

    {83, -85, -51, -71, -91, -77, 12, 96, 14}

    {-66, 100, 79, 100, -74, 73}

    {44, -75, 86, -26, 74, -93}

    Returns: 0.3984554837751541

  51. {96, 2, -50, 57, -32, -99, -39, 99, 56, -100, -96}

    {6, -94, -79, -100, -85, -17, 98, -81, 98, -42, 48}

    {95, 98, -8, 73, 74, -80}

    {47, 69, -84, 67, -28, 14}

    Returns: 0.3457587683473181

  52. {97, -100, 85, 91, 76, 95, 13, 81, -94, 25}

    {-50, -94, 42, -69, 52, 10, 97, -92, 98, -96}

    {39, -74, -48, 98, -96, 86}

    {51, 54, 74, -63, -71, 25}

    Returns: 0.5308284448404742

  53. {77, -27, -95, -40, 47, -88, 10, -91, 97, 61, -95}

    {92, -85, -92, 94, -74, 61, 98, -94, 1, -69, -51}

    {-65, 58, -96, 19, 71, -79, 74}

    {96, -30, 8, 20, -75, -49, -57}

    Returns: 0.37073339768817604

  54. {-94, 72, -100, 66, 88, -65, -9, 100, -44}

    {-49, -88, -6, -94, -51, 75, 99, 100, -97}

    {61, 43, 12, -44, -86, -78}

    {-15, -73, 81, 94, -59, 45}

    Returns: 0.445781045023638

  55. {55, -98, 87, -79, -61, 69, 95, -96, -24, 50, 83, -39}

    {-30, -84, 76, -87, 88, 87, 30, 63, -82, 98, -11, 95}

    {-37, 95, -82, -96, -74, 92}

    {57, -72, -81, -71, -5, 95}

    Returns: 0.5015717432736814

  56. {-89, 86, 77, 72, 93, -77, 47, -100, 86, -57, -63}

    {-30, 56, 93, -91, -37, 86, 98, 77, -69, -78, 88}

    {89, 95, 49, 6, -77, 83}

    {-92, -63, 52, 81, -92, 9}

    Returns: 0.4250142323209822

  57. {27, 98, -46, 94, 75, 84, -94, -92}

    {93, 67, -96, -77, -96, 91, -75, 97}

    {39, 47, -34, -68, -89, -89, 64}

    {-93, 20, -75, -56, -23, -38, -82}

    Returns: 0.26788940867800304

  58. {54, 98, -100, 77, 36, -89, -95, -100, -94, 97, 83}

    {-83, 64, -59, -68, 91, -82, -72, -28, 61, 5, 80}

    {49, -93, -72, 1, -95, 85, 93}

    {-89, -49, -73, 96, -23, -54, 96}

    Returns: 0.6084255340214351

  59. {99, 92, -69, 96, 59, -91, -79, -85, -94, 76}

    {-38, -85, -91, 74, 98, -9, -74, 95, 8, 98}

    {41, -59, 68, -61, -13, -55, 100}

    {-65, -69, -19, 18, 88, 93, 51}

    Returns: 0.4789980446028564

  60. {-55, -92, -99, 97, -91, -81, 82, 99}

    {-96, 42, -62, 21, -75, 83, -99, 88}

    {79, -37, 44, -33, -67}

    {48, -72, -86, 68, -14}

    Returns: 0.3904358802999926

  61. {-99, 79, -87, -100, 98, 38}

    {100, -88, -97, 12, 95, -100}

    {90, -32, 4, 92, 53}

    {-90, -71, 38, -11, 88}

    Returns: 0.32830870523006855

  62. {61, -98, -79, -19, 77, -97, 100, -89, 97, -74, -7}

    {-74, 50, 72, -91, 99, -32, -21, -66, 80, -99, 98}

    {45, 6, -17, 99, -82, -15}

    {-26, -43, 80, 55, 62, -30}

    Returns: 0.3147446845375114

  63. {99, -94, 84, 98, 97, -28, 81, -78, -100, 66, 16}

    {2, -87, -92, 72, -56, -97, 85, -94, 95, 96, -99}

    {-61, -99, -65, 4, -27, 74, 79}

    {97, 36, -25, 87, -66, 34, -62}

    Returns: 0.5196901066805277

  64. {-80, 84, 98, -95, -85, 43, 46, -68, 97, 84, 95, -94}

    {-97, -64, -34, -33, 78, -76, 90, 89, -52, 87, 32, -67}

    {54, -71, 10, 35, -71, 89, -25}

    {47, 75, -98, 85, -79, -57, 83}

    Returns: 0.5545159773272939

  65. {-99, 4, -12, -52, 98, -99, 51, -85, 8, 98, 75}

    {0, 98, -96, 92, 11, -91, 72, 60, 97, 37, -100}

    {-78, -81, -83, 55, 76, 60, 71}

    {29, 0, -90, 52, -73, -100, 2}

    Returns: 0.5089477983218237

  66. {78, 60, 6, -86, 52, -45, 100, -94, -99, 91, -62}

    {-82, -97, 81, -57, 54, -82, -28, 61, -7, 2, 79}

    {41, -63, -41, 88, 42, -67, 17}

    {-91, 36, 97, -83, 8, 47, -93}

    Returns: 0.31231900200490087

  67. {100, -78, 78, -35, 57, 81, -93, 9, 61, 97}

    {-75, 58, 41, 78, 59, -93, -92, 84, -99, -43}

    {-77, 44, 4, -44, 23, 32}

    {82, -29, -79, -86, 85, 60}

    Returns: 0.36192173461052946

  68. {62, -98, -82, 89, 99, 98, 48, -64, 96}

    {-94, -89, 49, -58, 37, -16, 100, 87, 68}

    {-40, 61, -76, 58, 71, -70}

    {68, 84, -22, -54, 14, -52}

    Returns: 0.402960322764288

  69. {-81, -92, 4, 100, -97, -100, -94, 98, 87, -59, -98, -72, -53}

    {-64, 86, -96, 43, 18, 66, -12, -81, 85, -97, 79, 98, 99}

    {74, -79, 26, 1, -96, 76, 100, -89}

    {74, 56, -95, 100, 27, -96, 47, -4}

    Returns: 0.6279795054577857

  70. {-98, -32, -96, -43, -92, 100, 71, 90, 80}

    {-36, 99, 44, 92, -86, -51, -87, 58, 97}

    {79, 58, -43, 76, -95}

    {-82, 98, -6, 36, -74}

    Returns: 0.4274646667161704

  71. {-28, 93, -88, 76, 97, -57, 81, -87}

    {100, -10, -91, 94, 67, -100, -98, 28}

    {-51, -66, 0, -65, 2, -51}

    {-76, 45, -100, -38, 47, 83}

    Returns: 0.23927625553822926

  72. {97, -35, -70, -98, -91, 96, 56, 90, -100}

    {-79, 95, -87, -50, 70, 83, -96, 100, 52}

    {84, -73, -81, 8, 97, 52}

    {-71, -66, 4, -95, -38, 81}

    Returns: 0.5048142372713547

  73. {85, -99, -100, 99, -98, -78, 89, 39, 21, -13, 53, -71}

    {62, 44, 34, 26, -87, 92, -17, -74, 98, -92, 92, 96}

    {78, 74, -69, -16, -66, 71}

    {-32, 97, 12, 88, 67, -70}

    Returns: 0.3992227915150615

  74. {91, -42, 97, -97, 12, 69, -76, -98, 53, -76}

    {-75, 98, -36, -30, 99, -82, -96, 72, 90, 88}

    {65, -80, -23, 51, 74, -11, -100}

    {84, 37, -30, -62, 20, 100, 8}

    Returns: 0.42370238360436624

  75. {57, 85, -74, -92, -47, 3, -91, -90, -81, -72, 71}

    {-98, 95, -92, 45, -100, 99, 4, -35, 85, 99, -97}

    {-71, 35, -73, -83, 92, 56}

    {78, 59, 73, 39, -38, -100}

    Returns: 0.36825821143041015

  76. {-51, 99, 28, 100, -84, -85, 0, 84, -59, 96, 72}

    {-97, -81, -96, -47, -68, -12, -98, 88, 84, 83, 89}

    {38, 94, -97, -96, -88, 81, 26}

    {-58, 50, 15, -74, 83, -30, 68}

    Returns: 0.5188485433528873

  77. {100, 100, 99, -100, -100}

    {99, -100, 100, -100, 100}

    {-100, -100, -99, 100, 100}

    {-99, 100, -100, 100, -100}

    Returns: 0.9999504962748447

  78. {0,1,2,3,4,5,6,7,7,6,5,4,3,2,1}

    {0,3,5,6,6,5,3,0,-1,-4,-6,-7,-7,-6,-4}

    {0,1,2,3,4,5,6,7,7,6,5,4,3,2,1}

    {0,3,5,6,6,5,3,0,-1,-4,-6,-7,-7,-6,-4}

    Returns: 0.0017573822430137869

  79. {0, 0, 1, 1 }

    {0, 1, 0, 1 }

    {-54, -99, -100, -100 }

    {-54, 99, 100, -100 }

    Returns: 0.0

  80. {-99, -98, 0 }

    {-99, 99, 0 }

    {99, 98, 0 }

    {-99, 99, 0 }

    Returns: 2.475186257765897E-5

  81. {-100, -100, 100, 100 }

    {-100, 100, -100, 100 }

    {-100, -100, 100, 100 }

    {-100, 100, -100, 100 }

    Returns: 1.0

  82. {-100, 0, -100 }

    {100, 0, -100 }

    {100, 0, 100 }

    {100, 0, -100 }

    Returns: 2.475186257765897E-5


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: