Statistics

Problem Statement for "Alarmed"

Problem Statement

Our alarm system is intended to keep intruders from entering at the front door of a square room, crossing the room, and then exiting through the back door. It consists of noise sensors located at various points on the floor of the room. Each sensor has its own threshold sound level -- it will warn us if the sound level at the sensor exceeeds its threshold.

The sound generated by an intruder attenuates according to an inverse square law. Specifically, at a distance r from an intruder, the sound level will be A/r2, where A is the noisiness of the intruder.

The room is square, with each side of length 100.0. The coordinates of the southwest corner are (x=0,y=0) and the coordinates of the northeast corner are (x=100,y=100). The intruder will enter at (50,0) and exit at (50,100).

Given int[]s x, y, and threshold return the largest value of A that will allow an intruder to walk through the room without setting off an alarm. The i-th sensor is described by the ith elements of x, y, and threshold. Note that we cannot expect an intruder to limit his path to integer coordinates!

Definition

Class:
Alarmed
Method:
noise
Parameters:
int[], int[], int[]
Returns:
double
Method signature:
double noise(int[] x, int[] y, int[] threshold)
(be sure your method is public)

Notes

  • A return value with either an absolute or relative error of less than 1.0E-9 is considered correct.

Constraints

  • x will contain between 1 and 50 elements, inclusive.
  • x, y and threshold will contain the same number of elements.
  • All sensor locations will be distinct.
  • Each element of x and y will be between 1 and 99, inclusive.
  • Each element of threshold will be between 1 and 10,000, inclusive.

Examples

  1. {50}

    {2}

    {87}

    Returns: 347.99999999999994

    Here there is one sensor, very close to the front door. The intruder can move along the wall where he enters and continue to follow the walls until he gets to the exit door. The closest he will get to the one sensor is at the point where he enters the room which is a distance of 2 away. If A is 348 the alarm will not sound, since 348/(2*2), the largest sound level at the sensor, does not exceed the threshold of the sensor, but any bigger value of A will sound the alarm.

  2. {1,99}

    {50,50}

    {1,1}

    Returns: 2400.9999999999995

    There are two very sensitive sensors located near the east wall and the west wall. The best path for an intruder is straight through the room. Then the closest he will get to a sensor is a distance of 49, and the crucial value of A will be 49*49 = 2401.0.

  3. {3,11,2,62,91}

    {90,10,75,25,50}

    {5,4,3,2,1}

    Returns: 1537.9999999999998

  4. { 1,99}

    { 50,50}

    { 1, 2}

    Returns: 3295.5717878751793

  5. { 1,99}

    { 50,50}

    { 10, 20}

    Returns: 32955.71787875179

  6. { 50, 51, 50, 50 }

    { 50, 50, 51, 52 }

    { 20, 10, 40, 30 }

    Returns: 25010.0

  7. { 11, 32, 50, 69, 30, 49, 72, 91, 9, 31, 52, 70 }

    { 24, 26, 25, 23, 51, 52, 50, 49, 77, 75, 74, 76 }

    { 105, 97, 100, 106, 96, 103, 99, 102, 95, 101, 104, 98 }

    Returns: 13454.291820507602

  8. { 89, 68, 69, 51, 80, 48, 7, 73, 90, 99, 87, 14, 26, 89, 21, 20, 98, 56, 77, 24, 98, 28, 74, 64, 85, 74, 96, 86, 94, 96, 47, 89, 22, 33, 27, 11, 23, 79, 35, 9, 23, 85, 38, 91, 42, 62, 36, 37, 61, 87 }

    { 35, 14, 56, 10, 66, 8, 1, 19, 42, 45, 73, 77, 6, 54, 89, 71, 86, 25, 86, 92, 97, 49, 28, 83, 22, 32, 25, 4, 36, 63, 72, 41, 30, 93, 61, 43, 32, 95, 33, 98, 99, 34, 98, 99, 58, 81, 37, 87, 98, 4 }

    { 810, 3873, 9246, 4576, 2721, 2029, 3563, 7068, 3489, 9499, 6012, 223, 2590, 674, 2573, 1493, 2712, 3949, 8666, 8197, 4605, 8209, 5071, 8590, 2352, 8987, 156, 2461, 2275, 7181, 1578, 5644, 55, 1237, 5633, 5615, 3255, 6496, 5172, 2192, 5994, 9371, 1545, 6979, 119, 5825, 3969, 2641, 2652, 2362 }

    Returns: 92619.99999999999

  9. { 5, 6, 7,10,15,20,25,30,35,40,10,15,20,25,30,35,40,45,46,47}

    {25,25,25,25,25,25,25,25,25,25,75,75,75,75,75,75,75,75,75,75}

    {5,5,5,5,5,5,5,5,5,4,5,5,5,5,5,5,5,5,5,5}

    Returns: 2899.999999999999

  10. { 5, 6, 7,10,15,20,25,30,35,40,10,15,20,25,30,35,40,45,46,47}

    {25,25,25,25,25,25,25,25,25,25,75,75,75,75,75,75,75,75,75,75}

    {5,5,5,5,5,5,5,5,4,5,5,5,5,5,5,5,5,5,5,5}

    Returns: 3169.9999999999995

  11. {50,50}

    {99,1}

    {12,17}

    Returns: 11.999999999999828

  12. {70,70,50,30,30}

    {1,21,21,21,1}

    {3,3,3,3,3}

    Returns: 299.9999999999999

  13. {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49}

    {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49}

    {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}

    Returns: 6249.999999999999

  14. {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98}

    {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98}

    {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,5}

    Returns: 19.999999999999996

  15. {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98}

    {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98}

    {7,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,7,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6}

    Returns: 27.999999999999996

  16. {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98}

    {2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98}

    {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,7,16,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,5}

    Returns: 20.287093855419933

  17. {43, 57, 8, 12, 43}

    {22, 71, 80, 84, 92}

    {6561, 9654, 9741, 8449, 4888}

    Returns: 552343.9999999999

  18. {46, 51, 50, 40, 62, 63, 49, 32, 36, 2, 19, 26, 60, 26, 51, 37, 63, 47, 8, 29, 79, 61, 73, 67, 81, 32, 86, 18, 44, 67, 26, 72, 82, 24, 4, 28, 44, 58, 85}

    {35, 78, 23, 12, 10, 2, 92, 42, 84, 6, 30, 50, 16, 68, 87, 61, 23, 4, 76, 41, 95, 90, 25, 79, 20, 18, 88, 87, 35, 24, 73, 73, 2, 26, 91, 16, 19, 86, 81}

    {7490, 9819, 3810, 8480, 6994, 7292, 5884, 5097, 753, 2970, 9488, 8763, 6604, 52, 4486, 6486, 3572, 4530, 9554, 743, 3696, 7301, 2218, 310, 8927, 3273, 4830, 6368, 6681, 8104, 3416, 5343, 8240, 1880, 2465, 8116, 3912, 8548, 3468}

    Returns: 83199.99999999997

  19. {99, 86, 31, 75, 93, 9, 84, 38, 31}

    {89, 16, 36, 38, 32, 15, 86, 52, 61}

    {4961, 1049, 5803, 7393, 6016, 3064, 6291, 8438, 366}

    Returns: 603670.8566537682

  20. {36, 57, 47, 71}

    {33, 35, 6, 23}

    {437, 4231, 4851, 5266}

    Returns: 218294.99999999997

  21. {59, 27, 52, 51, 12, 72, 97, 85, 75, 78, 21, 50, 77, 43, 26, 90, 9, 56, 39, 2, 77, 87, 12, 26, 7, 10, 36, 41, 40, 97, 54, 76, 45, 51, 74, 71, 60, 39, 22, 64, 96, 2}

    {56, 14, 14, 71, 66, 28, 82, 24, 87, 54, 81, 37, 87, 16, 56, 1, 86, 32, 49, 78, 91, 40, 2, 78, 63, 47, 37, 12, 7, 28, 11, 14, 77, 87, 78, 78, 97, 89, 88, 76, 39, 57}

    {8668, 6128, 8868, 4741, 6009, 5487, 953, 4102, 1556, 6929, 7344, 1394, 4585, 5064, 212, 9593, 3262, 3531, 1755, 8866, 7781, 5678, 5163, 2078, 1259, 4297, 3056, 6954, 6014, 2231, 870, 5361, 7356, 190, 9633, 3835, 7078, 7429, 2588, 6087, 8051, 6503}

    Returns: 32299.999999999996

  22. {92, 27, 86, 99, 8, 59, 51, 50, 55, 9, 13, 43, 65, 84}

    {29, 61, 48, 77, 28, 14, 92, 61, 68, 6, 12, 90, 14, 2}

    {7139, 9781, 2287, 8519, 5489, 5839, 3771, 7120, 901, 4513, 7342, 4128, 495, 2971}

    Returns: 208394.99999999997

  23. {1, 95, 65, 15, 68, 51, 35, 63, 42, 69, 31, 92}

    {62, 99, 50, 51, 19, 3, 54, 63, 40, 1, 88, 33}

    {5488, 1568, 4146, 1314, 9437, 9948, 2093, 9109, 2553, 9951, 4923, 2476}

    Returns: 99479.99999999999

  24. {53, 35, 37, 96, 87, 12, 34, 71, 6, 96, 41, 33, 75, 45, 27, 40, 11, 66, 19, 20, 82, 93, 8}

    {80, 32, 15, 53, 75, 14, 75, 51, 10, 73, 95, 88, 53, 32, 9, 49, 73, 24, 69, 46, 58, 35, 13}

    {1565, 2506, 2088, 4233, 4934, 7317, 4261, 6265, 1892, 2879, 3770, 8211, 6395, 4941, 980, 7338, 7046, 8323, 5430, 1951, 960, 1150, 2790}

    Returns: 399619.99999999994

  25. {15, 37, 33, 7, 64, 81, 24, 79, 51, 18, 26, 63, 55, 29, 95, 70, 47}

    {86, 28, 12, 90, 29, 57, 51, 81, 39, 66, 6, 73, 21, 90, 67, 34, 73}

    {9129, 1313, 6207, 6232, 7422, 9555, 2101, 9203, 1619, 3970, 5372, 297, 2589, 267, 34, 7602, 3157}

    Returns: 90215.4235571697

  26. {20, 41, 90, 74, 83, 68, 87, 17, 58, 15, 37, 98, 9, 69, 20, 95, 76, 60, 23, 92, 46, 98, 41, 58, 76, 67, 71, 53, 71, 76, 67, 93, 26, 20, 92, 22, 11, 21, 30, 51, 46, 25, 39, 1, 49, 45, 95, 97, 30, 31}

    {12, 75, 19, 20, 51, 89, 79, 96, 34, 27, 85, 35, 26, 5, 62, 2, 53, 90, 46, 42, 36, 49, 23, 12, 25, 86, 71, 10, 83, 62, 58, 92, 82, 25, 24, 75, 47, 51, 74, 6, 50, 33, 56, 33, 15, 72, 41, 12, 10, 71}

    {4404, 5724, 3864, 9424, 8304, 3072, 8540, 9338, 6807, 7968, 675, 1201, 1059, 7747, 667, 9814, 9503, 8168, 6309, 5249, 798, 7579, 8665, 1617, 565, 3702, 2756, 3811, 3702, 2820, 31, 4945, 2490, 8769, 9085, 5921, 122, 2845, 7969, 3007, 2937, 5471, 6041, 5397, 9969, 3462, 651, 3894, 1513, 187}

    Returns: 22935.873529612545

  27. {71, 19, 74, 32, 22, 66, 47, 97, 95, 83, 12, 27, 72, 97, 2, 21, 76, 79, 34, 43, 30, 54, 99, 87, 3, 29, 91, 12, 92, 84, 83, 61, 35, 95, 58, 91, 35, 32, 38, 71, 30, 82, 85, 51}

    {37, 44, 83, 73, 79, 61, 33, 77, 88, 34, 57, 96, 66, 54, 53, 31, 58, 14, 87, 14, 68, 58, 34, 9, 43, 53, 8, 83, 19, 5, 64, 44, 81, 73, 39, 67, 65, 68, 52, 19, 67, 91, 13, 11}

    {87, 6914, 1558, 600, 438, 6316, 1198, 9470, 7412, 8283, 7653, 2948, 83, 1322, 3132, 1146, 7829, 7246, 5710, 2813, 1382, 4581, 943, 2485, 9251, 7050, 6400, 9319, 9160, 8775, 8254, 151, 7367, 7511, 8396, 2542, 8373, 1286, 5493, 6148, 4750, 3048, 355, 1499}

    Returns: 72716.6132255494

  28. {23, 68, 14, 15, 96, 2, 51, 54, 50, 18, 32, 52, 85, 36, 2, 40, 40, 31, 62, 14, 82, 75, 68, 16, 54, 53, 75, 23, 7, 24, 44}

    {45, 36, 55, 92, 36, 71, 53, 89, 76, 30, 76, 51, 71, 51, 73, 10, 1, 53, 13, 9, 71, 69, 61, 89, 60, 94, 16, 53, 47, 80, 9}

    {2307, 580, 4203, 4708, 4913, 5525, 9992, 9104, 5800, 352, 3466, 3552, 954, 2101, 9798, 3795, 4192, 1908, 939, 1023, 2955, 8112, 8204, 7394, 8866, 2259, 3307, 2196, 6477, 843, 1715}

    Returns: 101654.99999999999

  29. {80, 81, 96, 42, 95, 21, 10, 32, 8, 56, 94, 22, 93, 13, 32, 61, 10, 19, 43, 4, 69, 94, 27, 10, 89, 93, 1, 72, 9, 81, 83, 30, 51, 14, 33, 48, 22, 94, 71, 64, 11, 96, 79, 48, 59, 67, 19, 74}

    {48, 79, 99, 94, 27, 93, 22, 30, 69, 49, 94, 13, 83, 82, 97, 5, 90, 89, 4, 43, 51, 81, 36, 70, 35, 75, 27, 76, 10, 3, 95, 22, 74, 14, 43, 3, 99, 90, 97, 73, 69, 29, 2, 77, 24, 19, 79, 26}

    {9295, 2172, 9905, 4930, 3134, 9098, 551, 2497, 4035, 6503, 8978, 5442, 7077, 4054, 2409, 5369, 6672, 2268, 6625, 3743, 9177, 5391, 608, 5847, 2635, 7468, 9292, 9867, 7667, 1367, 7461, 4627, 788, 7997, 3708, 7943, 2104, 5014, 1679, 8573, 9861, 6871, 4114, 620, 5607, 4163, 9275, 3377}

    Returns: 103259.0

  30. {19, 49, 8, 50, 9, 19, 73, 58, 7, 30, 24, 17, 26, 14, 66, 46, 55, 51, 3, 83, 50, 46, 68, 20, 68, 81, 75, 73, 48, 2, 58, 47, 31, 35, 95, 75, 68, 75, 3, 8, 95, 34, 10, 7, 90}

    {9, 96, 27, 13, 67, 82, 87, 37, 93, 46, 66, 99, 42, 7, 31, 73, 77, 21, 53, 60, 79, 17, 67, 42, 1, 83, 30, 6, 25, 12, 82, 50, 73, 65, 25, 17, 54, 39, 21, 73, 79, 64, 40, 12, 25}

    {1957, 7271, 6332, 9863, 616, 8846, 6144, 3129, 9440, 8909, 8161, 1694, 4627, 2499, 7601, 3600, 4722, 9007, 4520, 9474, 6775, 1002, 8069, 2697, 8718, 6865, 3845, 2343, 2385, 9870, 9970, 7380, 1035, 8546, 3554, 2267, 7118, 289, 9937, 2398, 5471, 6906, 217, 8103, 3183}

    Returns: 123606.99999999999

  31. {6, 24, 82, 7, 50}

    {56, 2, 3, 17, 4}

    {7960, 848, 6469, 2735, 1403}

    Returns: 22447.999999999996

  32. {8, 47, 54, 79, 91, 10, 38, 50, 40, 78, 67, 62, 65, 82, 11}

    {49, 73, 64, 30, 54, 16, 33, 70, 7, 2, 79, 75, 71, 9, 86}

    {3262, 814, 3142, 7446, 3993, 250, 7636, 5955, 8325, 6611, 2157, 1424, 1404, 6835, 8001}

    Returns: 464000.0

  33. {13, 41}

    {18, 25}

    {805, 9375}

    Returns: 1362864.9999999995

  34. {59, 72, 17, 43, 14, 54, 55, 38, 44, 79, 70, 65, 68, 53, 88, 94}

    {86, 15, 96, 56, 18, 27, 82, 46, 26, 49, 74, 9, 22, 10, 32, 67}

    {4649, 6356, 5023, 585, 5208, 3157, 5329, 9049, 1913, 6141, 7302, 4585, 2665, 6475, 2692, 1894}

    Returns: 705774.9999999999

  35. {31, 44, 5, 55, 6, 49, 52, 46, 11, 27, 45, 80, 60, 5, 54, 44, 11, 87, 58, 99, 68, 85, 17, 61, 56, 94, 51, 59, 12, 59, 3, 6, 97, 55, 46, 88, 50}

    {39, 43, 85, 37, 81, 58, 57, 83, 73, 47, 26, 45, 1, 19, 20, 16, 66, 73, 79, 19, 69, 45, 16, 86, 1, 46, 78, 51, 8, 70, 97, 15, 80, 82, 12, 84, 30}

    {8929, 6700, 5865, 6407, 7492, 8254, 3192, 3306, 8336, 6800, 495, 8092, 3238, 3106, 5736, 3452, 8281, 454, 589, 3741, 8742, 2241, 3391, 4086, 6574, 6305, 6947, 2153, 2356, 5867, 9526, 2526, 8690, 6688, 322, 91, 7190}

    Returns: 47708.081541402746

  36. {90, 13, 46, 43, 66, 75, 65, 12, 17, 70, 14, 99, 62, 55, 21, 97, 15, 3, 14, 76, 58, 43, 30, 26, 73, 27, 1, 74, 8, 72, 7, 48, 93}

    {53, 47, 22, 10, 74, 21, 16, 2, 23, 67, 9, 9, 42, 8, 29, 28, 60, 20, 56, 82, 32, 15, 56, 2, 68, 12, 52, 80, 9, 16, 11, 66, 46}

    {4819, 677, 7089, 2159, 9305, 1798, 6743, 3611, 3422, 2069, 6841, 4586, 4548, 4061, 5089, 9393, 8382, 7635, 3823, 2705, 9314, 9076, 9517, 6832, 1837, 9575, 4158, 6437, 6849, 2991, 2815, 4640, 4858}

    Returns: 259903.99999999997

  37. {20, 2, 53, 49, 78, 45, 48, 71, 65, 6, 71, 39, 46, 80, 14, 39, 75, 68, 88, 13, 70, 3, 98, 71, 67, 70, 19, 34, 89, 95, 19, 49, 61, 39, 85, 39, 16, 32, 61, 47}

    {76, 39, 61, 8, 31, 81, 75, 99, 92, 21, 21, 93, 64, 57, 11, 63, 80, 60, 72, 89, 80, 88, 69, 57, 56, 31, 39, 11, 71, 32, 82, 93, 34, 51, 11, 99, 11, 23, 85, 17}

    {1810, 4773, 1940, 6478, 1559, 7922, 3389, 3670, 6385, 2777, 2617, 9721, 2106, 3322, 8374, 7763, 8234, 9510, 4320, 3851, 393, 9439, 3709, 7808, 5490, 4284, 6178, 4897, 4916, 9958, 3353, 745, 2642, 8001, 7562, 1094, 9786, 106, 2726, 101}

    Returns: 30097.99999999999

  38. {51, 44, 41, 23, 72, 76, 23, 56, 84, 94, 57, 53, 7, 95, 32, 98, 7, 53, 71, 14, 88, 1, 86, 36, 25, 80, 50, 86, 30, 58, 19, 76, 86, 52, 89, 69, 53, 51, 86, 90, 40, 76, 6, 1, 22, 22, 90}

    {49, 84, 56, 88, 17, 66, 93, 68, 57, 62, 13, 45, 6, 38, 1, 98, 38, 69, 46, 43, 91, 75, 81, 78, 5, 77, 38, 56, 41, 9, 21, 27, 82, 65, 6, 37, 98, 11, 52, 49, 78, 95, 93, 78, 96, 14, 66}

    {3525, 146, 6722, 2573, 9685, 9020, 6449, 5990, 1827, 5619, 1285, 4060, 2906, 8867, 7810, 6248, 4269, 3468, 8708, 6326, 6689, 2015, 9017, 1648, 2417, 2085, 9513, 3958, 7074, 4991, 803, 9818, 3621, 2616, 9557, 9736, 1394, 7879, 1479, 8067, 4982, 5249, 3381, 3515, 5292, 5163, 5207}

    Returns: 18122.0

  39. {54, 1, 79, 2, 98, 73, 23, 17, 19, 19, 59, 43, 52, 23, 39, 82, 11, 2}

    {38, 46, 22, 80, 8, 9, 15, 18, 47, 95, 30, 59, 90, 16, 23, 11, 1, 4}

    {5512, 2653, 6036, 4953, 7084, 2539, 8277, 9404, 6958, 4665, 7814, 271, 9833, 3941, 2993, 7217, 2961, 4792}

    Returns: 468829.99999999994

  40. {24, 68, 56, 39, 40, 39, 77, 46, 33, 45, 30, 77, 11, 56, 98, 63, 61, 91, 99, 33}

    {15, 10, 93, 8, 92, 50, 90, 60, 32, 23, 21, 29, 19, 13, 15, 80, 47, 54, 33, 84}

    {6192, 2477, 2310, 2115, 9822, 8698, 7730, 586, 4852, 6780, 2360, 6886, 2583, 2745, 3341, 1658, 3932, 5351, 9806, 1830}

    Returns: 196349.99999999994

  41. {29, 51, 62, 38, 33, 18, 50, 5, 96, 25, 29, 16, 42, 52, 63, 72, 22, 1, 42, 18, 73}

    {63, 53, 89, 13, 63, 8, 53, 70, 78, 35, 70, 29, 35, 99, 75, 49, 77, 74, 62, 29, 1}

    {9223, 7882, 6950, 9425, 7245, 6891, 615, 7565, 8172, 9683, 6464, 7454, 9422, 5831, 8979, 3147, 828, 2799, 157, 1139, 518}

    Returns: 29154.999999999996

  42. {1 }

    {1 }

    {10000 }

    Returns: 2.402E7

  43. {1 }

    {50 }

    {10000 }

    Returns: 4.900999999999999E7

  44. {95, 14, 99, 75, 62, 5, 43, 35, 36, 6, 79, 23, 92, 64, 2, 81, 67, 13, 24, 7, 84, 28, 88, 63, 93, 30, 82, 60, 13, 46, 51, 5, 42, 61, 82, 60, 47, 96, 48, 19, 1, 50, 53, 89, 57, 61, 7, 6, 75, 6 }

    {68, 55, 71, 32, 27, 43, 1, 72, 7, 78, 67, 25, 30, 39, 61, 1, 52, 19, 81, 28, 2, 73, 75, 92, 22, 20, 48, 15, 45, 96, 53, 26, 79, 76, 1, 73, 77, 75, 16, 18, 44, 68, 42, 99, 65, 55, 78, 50, 38, 4 }

    {76, 932, 17, 655, 133, 985, 285, 885, 44, 206, 775, 730, 301, 295, 77, 496, 733, 959, 66, 232, 33, 242, 753, 134, 311, 693, 714, 384, 672, 580, 605, 266, 971, 222, 771, 751, 158, 701, 206, 344, 564, 689, 644, 46, 253, 258, 243, 933, 113, 443 }

    Returns: 10436.678683656739

  45. {30, 70 }

    {20, 20 }

    {500, 500 }

    Returns: 199999.99999999994

  46. {30, 70, 50 }

    {20, 20, 50 }

    {500, 500, 300 }

    Returns: 199999.99999999994

  47. {20, 30, 40, 50, 60, 70, 80 }

    {10, 23, 36, 50, 64, 77, 90 }

    {5, 5, 5, 5, 5, 5, 5 }

    Returns: 499.9999999999999

  48. {1, 50, 99, 50, 49, 48, 99, 3, 4 }

    {99, 50, 1, 1, 51, 52, 99, 3, 4 }

    {1, 1, 1, 8, 2, 1, 1, 3, 4 }

    Returns: 7.999999999999999

  49. {10, 10, 10, 20, 30, 40, 50, 60, 40, 50, 60, 70, 80, 80, 80, 90, 90, 90 }

    {40, 50, 60, 60, 60, 60, 60, 70, 30, 30, 30, 30, 40, 30, 20, 50, 40, 10 }

    {90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90 }

    Returns: 20249.999999999996

  50. {3, 11, 2, 62, 91 }

    {90, 10, 75, 25, 50 }

    {5, 4, 3, 2, 1 }

    Returns: 1537.9999999999998

  51. {1, 12, 3, 43, 5, 16, 8, 9, 99, 98, 59, 52, 33, 34, 25, 17, 29, 14, 19, 33, 15, 44, 52, 28, 28, 28 }

    {10, 3, 11, 6, 10, 9, 4, 3, 12, 80, 67, 65, 12, 10, 11, 12, 13, 99, 99, 14, 15, 24, 81, 1, 50, 99 }

    {1, 2, 3, 12, 12, 12, 1, 1, 99, 99, 99, 50, 10, 10, 99, 99, 10, 1, 1, 1, 1, 1, 1, 2, 2, 2 }

    Returns: 360.99999999999966

  52. {10, 10, 10, 10, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 70, 70, 70, 70 }

    {5, 10, 15, 20, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20, 15, 10, 5 }

    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }

    Returns: 24.999999999999993

  53. {25, 25, 25, 25, 25, 78, 79, 80, 81, 82, 35, 65 }

    {1, 10, 20, 30, 40, 1, 10, 20, 30, 40, 40, 40 }

    {10000, 10000, 10000, 10000, 10000, 9000, 8000, 7000, 6000, 5000, 1234, 4321 }

    Returns: 471716.6308116517

  54. {50 }

    {50 }

    {10000 }

    Returns: 2.4999999999999985E7

  55. {1 }

    {99 }

    {10000 }

    Returns: 2.402E7

  56. {8, 16, 90, 1, 98, 2, 43, 86, 92, 38, 28, 9, 26, 40, 53, 70, 70, 42, 33, 53, 3, 55, 20, 57, 92, 48, 55, 5, 5, 7, 30, 49, 89, 25, 92, 12, 74, 77, 5, 57, 14, 42, 62, 82, 40, 95, 10, 85, 46, 72 }

    {49, 4, 40, 5, 57, 85, 22, 26, 51, 98, 15, 66, 84, 21, 7, 20, 15, 19, 6, 2, 40, 81, 99, 89, 44, 77, 22, 68, 32, 40, 88, 40, 9, 19, 16, 76, 84, 31, 13, 22, 42, 23, 25, 45, 74, 85, 17, 60, 12, 51 }

    {9323, 5038, 2719, 8895, 7493, 4272, 4349, 914, 218, 5204, 8559, 4622, 6434, 369, 2010, 1047, 4481, 7697, 7014, 2641, 9491, 80, 8970, 2658, 9605, 6022, 852, 9191, 2151, 8355, 9959, 4149, 9584, 4202, 7529, 3267, 8657, 673, 8379, 806, 3694, 4104, 4315, 3981, 185, 6264, 6584, 1213, 5759, 6237 }

    Returns: 30880.0

  57. {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 }

    {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 }

    {1111, 1112, 13, 14, 15, 16, 17, 18, 1119, 20, 21, 22, 23, 2114, 25, 26, 27, 2118, 29, 3110, 31, 32, 33, 3114, 35, 36, 37, 3118, 39, 40, 4111, 42, 43, 44, 45, 4116, 47, 48, 49, 50, 5111, 5112, 53, 54, 55, 56, 57, 1158, 59, 6011 }

    Returns: 19993.999999999996

  58. {1, 99 }

    {50, 50 }

    {1, 2 }

    Returns: 3295.5717878751793

  59. {20, 50, 70 }

    {50, 70, 80 }

    {42, 42, 42 }

    Returns: 16799.999999999996

  60. {1, 99 }

    {50, 50 }

    {10000, 10000 }

    Returns: 2.4009999999999996E7

  61. {99 }

    {50 }

    {10000 }

    Returns: 4.900999999999999E7


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: