Statistics

Problem Statement for "GForce"

Problem Statement

A primary limitation of fighter plane performance is the ability of the pilot to remain conscious. We have determined that pilots can withstand large accelerations for short time periods, but that they cannot handle an extended time period during which the average acceleration is high.

Create a class GForce that contains a method avgAccel that will be given the period as an int, and int[]'s accel and time giving a piecewise-linear approximation to the acceleration experienced over time during a flight. The method will return the greatest average acceleration experienced over any interval of length equal to period. The return value should be the average acceleration as a double.

The piecewise-linear acceleration function is given in order of increasing times, starting with the beginning of the flight and ending at the end of the flight. The graph of acceleration versus time is the sequence of straight-line segments joining adjacent points (timei, acceli).

The average acceleration over an interval is the area under the graph between the beginning and ending times, divided by the length of the interval.

Definition

Class:
GForce
Method:
avgAccel
Parameters:
int, int[], int[]
Returns:
double
Method signature:
double avgAccel(int period, int[] accel, int[] time)
(be sure your method is public)

Notes

  • The returned result must only be relatively close to the correct answer. Specifically, if the returned value either has a relative error or an absolute error less than 10^-9 it is accepted as correct.

Constraints

  • accel contains between 2 and 50 elements inclusive
  • time contains the same number of elements as accel
  • the elements of time are strictly increasing
  • the elements of time and of accel are between 0 and 10,000 inclusive
  • period is greater than 0 and less than the difference between the first and last elements of time

Examples

  1. 100

    {1500,1500,500,2000}

    {0,100,150,225}

    Returns: 1500.0

    accel 2000 + X 1500 + X---X / 1000 + \ / 500 + X +-+-+-+-+-+-+-+-+-+---- time -100 0 100 200 300 The four points determine a piecewise linear function with three segments, whose graph is shown. The interval from 0 to 100 is the one with the biggest average accel. In this region the average is obviously 1500. The highest accel value is at t=225, but if we compute the area under the curve between 125 and 225 we get 112,500 so the average on that interval is 1125 which is not as high as 1500.

  2. 500

    {5,30,5}

    {0,1000,2000}

    Returns: 26.875

    By symmetry the interval with the highest average must be 750 to 1250. The area under the curve in this interval consists of two trapezoids, each with width 250 and heights 23.75 and 30. The sum of their areas is 26.875.

  3. 75

    {1500,1500,500,2000}

    {0,100,150,225}

    Returns: 1500.0

    int[] f = {5,30,130}; int[] t= {0,1000,2000}; period = 10; //129.5 period = 1000; //80.0

  4. 500

    {10,60,10,80}

    {0,1000,2000,2500}

    Returns: 53.75

  5. 1000

    {5,30,130}

    {0,1000,2000}

    Returns: 80.0

  6. 50

    {5,30,5}

    {60,100,158}

    Returns: 23.622448979591837

  7. 1

    {0,5,5,0,6}

    {0,5,15,25,31}

    Returns: 5.5

  8. 3

    {0,5,5,0,6}

    {0,5,15,25,31}

    Returns: 5.0

  9. 11

    {0,5,5,0,6}

    {0,5,15,25,31}

    Returns: 4.984848484848485

  10. 20

    {0,5,5,0,6}

    {0,5,15,25,31}

    Returns: 4.166666666666667

  11. 26

    {0,5,5,0,6}

    {0,5,15,25,31}

    Returns: 3.576923076923077

  12. 30

    {1000,5}

    {0,35}

    Returns: 573.5714285714286

  13. 240

    {0,1296,4695,5343,2943,1981,9149,4249,1201,9608,1114,974,5672,6467,4498,7345,430,7332,940,7906,4209,526,5158,8482,1810,290,7897,922,5264,8025,7238,4881,3618,7797,5435,1599,7382,976,1282,7077,3327,7708,1036,5756,7100,4277,8599,5700,1677,5683}

    {129,133,164,199,232,263,273,312,334,354,365,383,388,393,401,426,432,457,465,490,491,506,521,541,567,568,575,579,601,603,633,655,690,730,752,753,780,806,814,842,843,845,885,903,936,955,991,992,1020,1039}

    Returns: 5494.809817622885

  14. 100

    {0,0,0}

    {0,1000,10000}

    Returns: 0.0

  15. 10

    {0,20,10,18,0}

    {0,10,12,20,22}

    Returns: 14.4

  16. 68

    {0,100,50,110,0}

    {0,100,110,170,180}

    Returns: 79.31372549019606

  17. 370

    {0,5082,275,7306,3647,5991,1003,7765,6465,9474,9441,6816,225,844,2820,2544,2422,8903,4437,4703,7508,1679,2568,78,1205,5180,6592,8884,9059,5907,5395,4700,365,6428,3650,3467,558,5443,2032,1894}

    {49,93,99,100,118,148,168,169,202,212,213,261,304,314,319,348,358,404,452,497,510,539,577,595,601,650,685,706,745,780,806,814,830,877,889,896,900,912,942,954}

    Returns: 5362.534404632983

  18. 249

    {0,7851,2929,5962,454,340,3258,9858,4820,9621,7961,3072,670,4866,8669,862,1444,2102,9035,8079,1950,8576,5351,7482,7677,1836,3973,8680,8668,8130,16,2125,8726,9177,1038,4445,5440,1822,8574,6450,1788,7195,5407}

    {218,219,257,280,325,332,339,382,395,430,465,490,532,563,566,567,583,623,642,667,685,721,739,753,771,797,819,823,854,870,908,951,976,991,1009,1031,1035,1068,1109,1125,1137,1179,1183}

    Returns: 6466.517672182914

  19. 553

    {0,4296,9193,9521,8829,5072,8867,4865,4707,6216,4522,2283,1789,1290,5732,5363,9675,3296,4022,8447,4188,6511,1651,3981,5110,9827,148,655,5120,9951,3830,360,2779,4200,4341,3964,1418,5256,194}

    {146,171,174,198,205,235,237,250,271,309,337,358,407,449,466,514,524,536,564,583,609,615,660,683,700,709,711,757,803,819,858,876,916,925,959,986,1004,1040,1059}

    Returns: 4802.536276993219

  20. 599

    {0,4746,6014,4734,9548,7850,8681,9391,3926,5951,2699,5525,7077,3302,6157,4968,9135,9946,6758,9130,817,7623,3341,2579,6143,2627,8671,5662,9077,15,1071,6496,1794,4136,9861,689}

    {128,133,187,239,241,286,322,325,345,346,362,375,417,444,498,519,525,579,585,594,617,666,696,697,729,769,800,831,859,901,907,944,966,1018,1030,1054}

    Returns: 6162.5630754737585

  21. 335

    {0,6802,4088,1654,7876,5892,5237,6905,6200,5999,1500,1730,2340,8274,4073,2927,816,4016,4481,754,8616,3043,3570,3395,4923,2809,3708,3337,4058,4631,9353,8773,5730,432,3400,3781,6929,9891,5473,2160}

    {77,84,115,127,132,156,169,183,214,220,265,297,339,357,400,450,465,494,526,555,576,619,661,709,751,759,765,802,822,828,858,901,907,911,928,972,998,1009,1022,1025}

    Returns: 5105.533813142378

  22. 82

    {0,1424,2575,9916,2347,6347,3053,8989,7307,1362,4383,8801,28,3098,959,9714,3855,2230,1959,8276,7548,127,4837,3026,5435,2544,7742,2338,1328,1735,1033,3341,8698,8895}

    {37,58,99,155,192,221,230,237,283,319,374,377,408,419,440,463,477,526,541,553,577,614,615,636,669,700,746,787,789,807,836,859,864,900}

    Returns: 7090.515134585538

  23. 283

    {0,155,9363,200,5761,4898,6492,2219,6346,8404,3681,135,9164,9240,3103,7637,4014,8090,8642,7391,9286,5278,5718,5844,6646,3826,7665,7053,1405,5407,6658,6580,63,3231,72,8432,9029,4490,5256,1659,7197,9482,9017,8883,5587,9504}

    {72,95,124,164,168,199,224,240,282,294,311,321,336,342,382,391,397,416,428,469,482,512,517,537,559,585,597,611,620,633,663,676,682,688,720,760,762,800,815,854,879,899,921,939,948,955}

    Returns: 6720.510943310534

  24. 135

    {0,5829,3842,338,8801,6509,3841,5900,68,4514,8955,3860,5654,2034,2395,3353,6271,5461,6702,8024,3570,9408,5809,7731,8805,5583,4751,2664,7552,1589,4306,5551,7362,2403,6225,9267,5909,8841,7639,787,1945,4435,5110,1905,8208,3224,7843}

    {118,135,139,171,189,228,230,243,266,298,329,368,382,411,426,466,483,492,534,572,594,616,621,647,653,654,665,684,707,713,721,756,768,775,800,804,840,854,883,884,916,937,957,964,965,1001,1023}

    Returns: 6801.678658161695

  25. 19

    {0,6189,1651,3035,3282,2286,5424,3284,5904,8944,933,2418,1495,4631,3011,7805,26,1150,5458,6535,8925,1394,9082,311,9847,14,4483,3568,1914,3122,2789,3025,3015}

    {16,51,93,95,152,154,210,225,277,325,377,398,401,413,437,458,508,525,528,563,567,585,639,675,701,754,782,831,833,860,914,959,981}

    Returns: 8676.548112778655

  26. 258

    {0,889,2338,3739,5116,1183,1732,5916,1293,9974,6712,3388,4975,3885,4080,9100,1239,4453,3890,3406,6188,9600,1162,479,3557,9034}

    {103,169,218,219,276,342,358,425,488,517,585,613,665,671,699,761,766,777,838,889,913,963,984,1006,1072,1116}

    Returns: 6147.563236536801

  27. 415

    {0,2104,1693,8827,4201,4984,7149,3802,9245,1594,9417}

    {147,149,153,164,217,265,371,425,479,587,621}

    Returns: 5922.531841073924

  28. 100

    {0,6578,7707,5433,6535,5337,6535,7432,7054,3040,5554,1061,7065,5051,855,4335,792,6749,5768,5130,7009,9498,1517,7125,1499,6744,3708,9362,9044,8597,9047,4424,5200,5076,1600,4570,307,2409,8089,1286,4073,1849,800,760}

    {12,14,50,66,73,89,112,157,189,191,220,256,288,305,343,358,389,420,462,483,494,503,546,560,600,603,643,651,693,701,737,754,763,804,810,813,820,856,869,903,936,965,987,999}

    Returns: 8833.709193250288

  29. 100

    {0,3238,8107,1979,8187,7257,3251,5185,2188,7353,9862,4667,7339,9224,9093,7918,3116,3723,8345,3299,4155,8176,8295,1791,9625,6411,4191,3658,7910,4729,922,2208,4401,9059,6445,91,4162}

    {56,109,111,143,189,221,225,264,296,334,358,394,411,458,506,517,518,519,538,574,622,672,692,715,748,790,811,814,823,840,847,848,857,891,900,943,993}

    Returns: 8776.549073003216

  30. 121

    {0,948,4878,3171,9674,4334,3116,4857,3785,9231,7334,1431,227,9797,5165,1791,8476,2667,8489}

    {117,142,150,151,207,258,316,392,493,556,569,649,739,742,835,931,1014,1017,1026}

    Returns: 6871.61649154503

  31. 51

    {0,1873,1838,1101,6607,5234,6998,7272,8973,8784,5334,2774,2192,1045,7133,348,4819,4947,855,1525,1493,944,983,4373,2388,1547,6649,9224,2113,5902,675,5366,2986,4513,671,1931,9619,9849,8322,9078,3598,2981,2834}

    {21,59,80,83,127,137,152,177,178,181,204,214,226,245,277,314,322,348,351,362,401,439,461,505,524,555,597,610,611,612,635,669,701,712,737,744,755,790,794,803,806,841,855}

    Returns: 9441.628718700476

  32. 134

    {0,8263,8402,2026,2638,7590,9382,2860,6672,8577,8545,8483,261,7760,34,107,2295,7886,5604,3944,2647,8793,8429,739,3128,66,275,9265,5857}

    {132,182,243,260,297,327,354,355,382,396,439,507,517,527,535,592,607,636,691,737,757,788,816,830,838,862,905,941,971}

    Returns: 8306.543297691862

  33. 117

    {0,2244,9140,9510,706,3626,502,9186,4091,1598,9607,8135,4328,9067,7437}

    {20,41,66,69,78,88,128,143,207,310,311,391,425,558,580}

    Returns: 8003.186696344861

  34. 89

    {0,9199,6125,8766,7263,5248,3128,6701,9136,9772,2265,5297,3023,6087,3105,6290,9968,9634,5721,640,2577,1304,8769,6765,368,1792,5603,5589,1168,3953,9901,4289,6535,3469,1575,2144,6910,1759,7115,5049,2181,1157,9597,2742,1,1297,7504,561,6990}

    {65,87,113,121,137,172,188,200,215,241,265,297,302,336,372,385,402,418,423,424,459,488,491,523,544,565,592,627,662,690,730,756,792,824,836,839,871,883,896,930,955,987,998,999,1027,1054,1068,1107,1114}

    Returns: 7245.593964295679

  35. 171

    {0,3185,9215,8776,4981,8394,1280,6670,5533,5440,9786,6301,3819,5382,6552,3925,9999,5112,1277,2482,7562,4907,7890,7410,2353,3724,4458,2272,8435,6638,8836,6763,1459,4920,4023,1882}

    {84,103,114,163,215,221,258,265,270,291,315,339,391,428,460,512,524,571,618,630,679,696,721,748,782,799,838,884,919,960,964,1017,1019,1052,1059,1076}

    Returns: 6848.525300702108

  36. 464

    {0,4581,6854,4662,8125,8539,3077,1481,9644,2496,7046,8368,8326,5540,8738,659,9807,5401,2211,6323,8398,8439,1365,4341,10000,2611,4794,8029,1055,3227,1605,31,501,1379,7315,4097,8596,9188,3531,1525,8524,240}

    {18,61,65,107,118,130,144,167,188,216,230,259,274,295,309,323,368,406,449,467,470,479,497,534,558,604,643,689,736,759,766,807,812,821,822,851,891,938,952,980,996,1038}

    Returns: 5762.511467657032

  37. 401

    {0,4887,6808,605,2693,9200,8872,8739,473,492,2840,7404,1173,4580,9570,7653,9718,2599,4996,5344,2400,837,1200,9016,6757,6122,1357,7987,9756,5852,2927}

    {190,199,255,312,376,428,447,501,525,546,587,625,626,658,699,717,759,818,832,896,906,960,980,1010,1035,1043,1069,1133,1151,1172,1216}

    Returns: 6108.5158306334415

  38. 283

    {0,4266,99,5330,9292,4103,6778,9619,5896,338,741,8962,7682,5748,6440,8870,2078,110,9288,9125,3885,2576,9317,3028,3407,537,9216,1207,8145,1702,4666,908,8540,1641,6837,150,4537,2784,5432,7722,7914,6846,8309}

    {178,191,216,260,276,304,336,361,379,383,422,428,470,511,538,583,584,612,620,658,690,726,739,740,755,764,786,798,806,815,838,847,886,931,966,993,1014,1021,1028,1067,1075,1081,1095}

    Returns: 6541.52239520981

  39. 494

    {0,512,393,2454,6807,9792,3259,7159,7026,1344,3921,1617,1640,3919}

    {186,300,335,373,374,397,514,591,720,748,875,1004,1072,1122}

    Returns: 5457.516709421674

  40. 65

    {0,2310,543,9054,4202,2159,4458,8506,8250,9007,2309,4004,5737,100,2945,9950,1083,7346,3591,2434,6146,2517,827,3747,5549,1805,8836,7112,3456,352,2724,5879,2253,3543}

    {33,47,94,137,174,191,201,222,263,274,292,328,334,377,403,423,452,487,497,513,531,547,573,606,630,639,675,704,747,789,793,844,848,895}

    Returns: 8318.526525603918

  41. 336

    {0,3047,120,7537,9366,7379,4581,9385,7837,6872,7944,3279,568,3514,6178,2722,275,5466,3341,8581,2932,5284,2376,9713,9924,9246,9783,5592,4631,28,3929,3152,4497,3337,391,515,4934,3521,7355,5942,2594,8192,43}

    {48,80,106,108,109,122,124,143,179,214,221,260,297,323,362,404,441,471,478,515,529,560,568,601,613,651,678,681,710,731,734,748,794,798,803,829,857,860,892,916,917,960,977}

    Returns: 5768.525549152242

  42. 135

    {0,2764,8391,9508,6404,9048,3377,3549,8942,3275,1008,7690,8893,3763,142,1795,9148,5719,850,863,3975,6964,3393,5719,9918,1593,5603,7087,1051,2534,1027,2258,5697,5363,6072,6622,272,9487,1022,3965,1564}

    {44,68,74,81,123,169,190,221,269,288,334,353,355,389,399,425,437,439,450,460,482,485,498,543,576,605,612,639,648,670,679,683,686,728,774,795,809,811,820,852,855}

    Returns: 7116.619161009284

  43. 873

    {0,2100,5375,6373,4016,286,1278,9663,6744,9088,4015,3289,6900,9164,9853,775}

    {190,267,310,348,416,475,566,591,701,781,843,947,1063,1071,1148,1149}

    Returns: 5457.700663474418

  44. 104

    {0,7700,3221,211,6363,1991,7096,8018,617,6376,8318,7902,2887,4356,7168,551,1466,2269}

    {36,111,154,174,259,318,429,436,441,447,459,523,524,587,642,651,762,770}

    Returns: 7418.156461565163

  45. 685

    {0,2008,6280,9995,1958,9027,3420,6531,3778,8829,1565,5299,5106,8274,5430,6691,1,6459,96,7643,5455,4776,5965,2754,6987,8479,3836}

    {80,90,157,158,194,207,247,276,286,341,350,353,366,381,455,469,507,510,554,596,646,648,720,779,811,821,887}

    Returns: 5436.560516641175

  46. 681

    {0,4468,6191,352,4432,2255,9267,5251,1059,1658,6418,171,1095,8681,5718,742,5369,944,418,7508,3776,678,9793,4001,4953,7358,8811,9133,4621,8853,2421,9798,513,1346,6288,9941,1418,908,8903,3375}

    {129,174,194,195,215,235,251,262,312,352,371,383,389,413,452,501,541,588,601,608,652,671,681,711,727,770,771,806,832,872,906,939,945,967,994,1017,1038,1058,1080,1095}

    Returns: 5130.510688342182

  47. 650

    {0,6777,3931,5871,3342,6202,5804,7248,7768,5209,6938,5770,2852,7347,8505,8363,6632,6577,729,2670,3537}

    {286,287,336,371,377,390,410,414,428,458,465,492,581,632,697,745,836,920,943,971,982}

    Returns: 6247.551071003027

  48. 217

    {0,3081,3120,929,9637,6445,1351,6153,2010,5345,9865,4504,7919,9042,6979,9972,5413,7079,2899,2402,8464,4938,5385,1129,1333,6427,4942,9316,610,1638,1745,7777}

    {142,202,222,284,338,387,436,449,508,518,519,558,578,622,653,701,755,805,812,828,840,900,931,980,1026,1057,1096,1142,1156,1176,1197,1226}

    Returns: 7976.529296661532

  49. 572

    {0,9492,8252,3812,4422,1670,4908,733,5761,1671,9693,6582,9137,9526,4631,552,77,6773,9881,7143,9335,1899,2202,8382,4654,7023,4269,7407,7241,9320,8586,7074,4953,4285,8391,1385,4269,9160,6890,8214,9438,9803,6791,82,8868,3802,2421}

    {52,84,93,101,116,146,174,185,199,231,257,288,316,337,371,393,405,415,449,467,468,483,484,522,525,539,546,568,574,598,629,645,653,682,689,700,734,751,768,803,808,830,833,844,869,904,946}

    Returns: 6622.5273795832545

  50. 686

    {0,8056,8359,9576,2217,589,5413,33,8165,2089,4310,7307,7709,3194,5028,8833,3901,2504,4387,223,9660,777,6438,5796,4512,9726,7470,565,8135,1789,9432,5392,3910,886,2038,6406,8716,7793,5920,9613,1245}

    {207,211,220,250,292,339,342,388,389,408,451,454,478,516,558,600,624,640,665,701,713,724,729,766,768,769,796,812,836,869,897,909,940,982,1008,1025,1052,1082,1123,1166,1167}

    Returns: 5305.84421861078

  51. 304

    {0,2273,663,9280,2356,2798,7580,4505,1847,5124,3805,8566,7486,6125,8530,262,8327,4701,1881,685,5328,1406,1587,1123,2291,3016,721,4274,9739,1985,3742,883}

    {214,262,306,350,391,393,453,466,507,534,587,609,644,654,661,689,693,710,714,756,786,847,909,917,943,955,985,998,1005,1058,1098,1130}

    Returns: 5248.513833437854

  52. 114

    {0,2207,2420,2733,8730,841,1574,4651,1211,8082,4911,197,8906,7629,1462,7196,5561,8539,7827,4954,5407,7884,9664,939,1514,9460,712,1016,800,9668,2969,9410,6915,8990,4522,343,921,3199,5000,8518,4120,1028}

    {10,53,60,103,148,161,168,182,191,218,237,269,274,303,317,319,320,322,368,370,408,445,478,511,549,554,570,609,630,655,699,742,756,763,779,799,802,807,827,838,870,917}

    Returns: 7165.531391374532

  53. 142

    {0,3544,2114,7814,1072,1611,9125,2091,2770,2103,3004,732,9043,1403,811,9906,4010,9064,6058,7055,6671,1916}

    {124,187,202,253,276,282,287,346,390,398,447,494,517,545,582,636,654,709,798,805,821,825}

    Returns: 7459.529885691638

  54. 646

    {0,6266,8184,1306,8282,8544,861,1727,3294,6751,6850,4580,6923,8796,7660,2925,5051,4423,7897,7330,18,5137,2785,1151}

    {13,14,65,129,212,226,230,307,356,435,508,530,574,623,624,695,759,790,800,821,874,941,1017,1096}

    Returns: 5150.587970168863

  55. 257

    {0,2547,3773,4621,5874,2579,7165,5636,4593,9339,7543,3613,6351,3373,7591,9876,7756,5392,134,3540,7759,2237,5786}

    {213,229,269,276,357,437,481,536,572,645,653,704,712,715,718,723,735,812,814,862,924,996,1016}

    Returns: 6495.544935645995

  56. 620

    {0,2100,899,5472,4533,1894,1338,6241,2634,5849,4199,3665,8358,333,2730,5876,1857,2685,6666,6012,3468,9647,1597,4337,4276,1672,7395}

    {186,191,194,227,238,280,290,304,315,331,385,423,435,449,497,515,579,646,718,787,835,842,911,960,998,1026,1060}

    Returns: 4367.514198549383

  57. 183

    {0,8420,9702,8949,7292,2164,1154,3968,7404,7459,5783,2627,3322,2178,6954,3488,1403,8223,2999,2031,4376,7073,1486,374,115,2817,6324,3002,9864,7652,2857,8057,7616,7962,2349,7314}

    {173,175,207,261,290,327,374,389,444,468,507,539,548,563,618,649,669,683,714,736,768,807,832,834,860,881,887,938,990,1027,1064,1087,1102,1140,1144,1164}

    Returns: 7175.525929006588

  58. 91

    {0,9181,3810,8013,9748,1247,9468,3473,4647,2839,162,8952,5855,85,936,6829,49,4891,2309,9792,9954,2744,9079,5086,1899,4177,7702,7160,4601}

    {26,58,73,130,150,206,221,277,329,350,416,422,483,507,552,604,660,689,704,727,764,800,826,866,882,930,970,977,988}

    Returns: 7898.5236688002615

  59. 221

    {0,7644,717,9357,4922,2600,7463,1923,7147,8082,6963,5412,395,3953,6647,8759,2962,3803,742,7112,8194,9107,5249,9940,9939,1412,2399,3810,2472,4769,9192,2209,868,9741,6720,3832,5871,1512,760,170,9885,6136,1340}

    {151,192,203,214,252,254,294,319,323,332,363,398,431,449,495,541,576,582,598,606,652,669,679,698,720,722,757,762,789,815,842,877,918,937,981,994,1027,1060,1082,1128,1151,1188,1207}

    Returns: 7038.611809168849

  60. 72

    {0,3372,9394,9663,4982,5294,1091,8501,1907,9917,9357,4913,5917,5450,5566,3240,1734,7468,376,2709,7172,7515,2770,541,4457,7754,8380,4135,6173,8920,8715,2807,1107,5381,3702,8631,2171,5530,9498,8724,9400,4257,5907,6724}

    {28,67,74,92,117,133,142,149,164,192,229,261,265,282,300,328,350,392,430,458,487,499,534,540,566,583,584,598,608,642,646,687,717,729,771,814,843,885,914,933,942,944,949,978}

    Returns: 8799.66475072138

  61. 469

    {0,6068,1770,1515,4017,4891,994,1291,8671,2369,4579,2743,6639,1576,1885,2610,1743,840,5996,9120,6429,2204,8415,2507,5574,7286,9552,7832,1987,205,261,765,940,5887}

    {196,229,255,272,301,358,416,422,439,471,516,540,542,575,593,642,676,699,752,766,815,819,840,894,926,965,983,985,1038,1051,1094,1101,1126,1184}

    Returns: 4665.532756229773

  62. 222

    {0,1796,9752,5646,8548,9504,5141,7641,5657,4662,3069,1247,8799,139,3423,9035,8231,9317,4568,306,7629,1653,6527,1939,5575,1997,2054,8723,7998,3343,6425,4982,2012,1254,8168,5135,6652,2149}

    {195,220,228,274,282,294,334,340,343,356,400,419,454,496,547,599,606,615,637,644,664,670,712,733,734,749,793,840,845,897,936,949,958,964,994,1037,1073,1110}

    Returns: 5824.528527550684

  63. 15

    {0,600,2432,7252,5940}

    {12,135,336,578,579}

    Returns: 7104.85365036423

  64. 49

    {0,7616,3543,2347,7844,2539,4108,5670,5552,8361,1262,6230,4184,5663,1187,688,7664,1738,6613,1956,7951,9907,6486,7597,8343,8019,4200,8977,2204,9295,6767,6942,9461,9853,4701,8044,5189,4617,1371,5556,1536,8442,787}

    {14,47,69,89,107,143,187,201,240,278,298,334,349,383,420,444,486,488,530,537,544,559,563,607,642,675,695,715,737,757,789,834,879,896,909,920,923,926,966,996,1017,1052,1068}

    Returns: 9051.632726259631

  65. 292

    {0,316,5305,1570,7779,9125,3829,4816,4968,9935,9998,6247,8540,3381,9567,3054,5028,1238,2569,5614,4348,8458,8009,3518,2781,4346,6550,2906,7213,3089,5108,3565,732,3859,3465,9647,5480,1920,9416,1647,6589,7371}

    {221,232,245,257,278,305,337,355,358,393,416,428,443,456,485,522,536,552,593,632,634,645,648,657,676,695,729,736,759,798,834,846,864,894,895,897,943,982,993,994,1013,1058}

    Returns: 6596.524996996985

  66. 44

    {0,2970,9816,380,4060,6776,4673,7221,4710,2425,8240,6280,4823,5912,3678,6295,8454,2214,9400,2552,4910,3599,5649,715,4985,7981,9160,7450,5712,1178,3876,9282,4425,6485,9580,8400,6068,8883,3084,8722,849,7438,8303,9590}

    {44,67,81,93,113,158,172,210,254,274,316,354,367,381,408,421,450,453,460,482,485,489,527,552,592,594,633,646,658,688,703,731,762,782,814,842,877,885,902,936,943,953,998,1014}

    Returns: 8932.577320356046

  67. 11

    { 0, 5, 5, 0, 6 }

    { 0, 5, 15, 25, 31 }

    Returns: 4.984848484848485

  68. 3

    { 0, 5, 1, 8, 0, 0, 6 }

    { 0, 3, 5, 7, 8, 9, 11 }

    Returns: 4.361111111111111

  69. 1

    { 0, 1, 0 }

    { 0, 1, 10 }

    Returns: 0.95

  70. 500

    { 5, 30, 5 }

    { 0, 999, 2000 }

    Returns: 26.875


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: