Statistics

Problem Statement for "FencingGarden"

Problem Statement

There is an empty grass field with an infinitely long straight wall. You are going to create a rectangular garden against the wall. Three sides of the garden will be enclosed with a fence. The fourth side of the garden is formed by part of the wall.

You currently have some fence segments. Each side of your fence can be created by connecting some of these segments. The length of a side of the fence is equal to the sum of the lengths of the fence segments that form it. The length of each side of the fence must be exactly equal to the length of the corresponding side of the rectangular garden. As in real life, each fence segment may only be used at most once.

Fortunately, you have a saw that can cut at most one of these segments into two shorter segments. The saw will break after being used one time. You may cut the one segment into two shorter segments at any point between its endpoints (non-integer length is allowed). Note that the total length of the two shorter segments created must be equal to the length of the original segment.

You are given int[] segment. The i-th element of segment represents the length of the i-th fence segment. Using these segments construct the garden fence (as described above) enclosing the maximum area possible and return the length of the garden's side parallel to the wall. If the maximum area can be formed in more than one way then return the largest parallel-to-the-wall length that gives the maximum area.

Definition

Class:
FencingGarden
Method:
computeWidth
Parameters:
int[]
Returns:
long
Method signature:
long computeWidth(int[] segment)
(be sure your method is public)

Constraints

  • segment will contain between 2 and 40 elements, inclusive.
  • Each element of segment will be between 1 and 100,000,000, inclusive.

Examples

  1. {1,1,1,1,10}

    Returns: 8

    Cut the segment with length 10 into segments with lengths 2 and 8. Make two sides with length 3 and one side with length 8 using these segments. This gives a 3x8 rectangular garden. Note that a 4x6 rectangular garden can also be constructed. It has the same maximum area of 24. But the correct answer is 8 since you should return the largest parallel-to-the-wall length that gives the maximum area and 8 is larger than 6.

  2. {50,25,25}

    Returns: 50

    Sometimes it is not necessary to cut any segment.

  3. {5,7,9,13,21,581,1848,1058,57172,58281,612,528}

    Returns: 60078

  4. {1,1}

    Returns: 1

  5. {100000000,100000000}

    Returns: 100000000

  6. {100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000,100000000}

    Returns: 2000000000

  7. {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

    Returns: 20

  8. {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864}

    Returns: 67108864

  9. {262144,2097152,524288,4194304,99999991,67108864,4,8,32768,256,99999995,99999999,99999990,99999994,16,64,131072,2048,8192,99999995,1,99999992,16777216,1048576,99999993,512,1024,32,16384,2,4096,99999994,65536,100000000,99999997,99999998,33554432,128,99999995,8388608}

    Returns: 717108830

  10. {100000000,34,37,3,46,36,48,27,24,7,8,6,33,19,25,40,26,22,47,47,22,10,23,33,38,39,2,39,12,21,2,16,6,35,50,31,13,43,25,8}

    Returns: 99998997

  11. {67967623,90115693,35789827,12629039,45506039,74022023,31321319,94462943,47952923,21016577,93164129,44648519,18437929,24476687,39408893,31060817,72719411,3239077,74139529,77388763,80151397,13829843,23341061,50115661,38601733,51149569,46268231,78741863,9857461,85307771,82492727,96365879,65304859,55522001,52308703,26542363,55150379,81950333,97187173,89401591}

    Returns: 1089529179

  12. {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

    Returns: 16

  13. {2,3}

    Returns: 3

  14. {1,1,3,2,3,2,2,2,3,3,1,1,2,1,3,1,1,1,2,3,2,3,2,3,1,3,2,1,1,2,3,1}

    Returns: 31

  15. {17,11}

    Returns: 17

  16. {7,20,18,10,6,19,8,2}

    Returns: 45

  17. {17,4,18,12,6,8,16,14,15,13,3,13,14,4,2,1,5,1,3,13,14,15,4,16,12,5,6,12,4,10,1,19}

    Returns: 150

  18. {23,20,37,52,29,20,8,7,49,16,26,8,60,2,11,46,36,36,57,18,11,17,46,1,2,24,4,13,15,19,28,27}

    Returns: 384

  19. {300,248,39,96,172,197,102,180}

    Returns: 669

  20. {1278,791,963,702,1485,6,929,1070}

    Returns: 3664

  21. {709,831,940,1414,5,913,153,136,174,220,1139,721,197,85,437,948,1375,821,633,1204,225,430,1146,286,1398,745,1427,1277,415,957,1434,1004}

    Returns: 11900

  22. {8162,7156,7949,627,1295,1919,3494,8518}

    Returns: 19605

  23. {1293,3791,3075,5286,6533,6822,4997,6876,6530,5929,6266,568,5181,6513,8613,3365,1035,1947,4619,7490,7882,848,3239,595,3528,2134,6815,4126,4733,4877,5788,4351}

    Returns: 72823

  24. {944,13654}

    Returns: 12710

  25. {17476,6026,19417,20984,24515,12766,6548,14494,11024,923,17489,10163,25485,33327,18501,10808,35599,11964,30886,17969,22817,16937,15969,9223,17743,26913,13845,32215,26091,6883,25926,17089}

    Returns: 289008

  26. {36716,2100}

    Returns: 34616

  27. {59126,53612,51422,88184,104147,72666,83786,9132,67812,43040,55318,86596,98726,91172,12552,69697,68602,88913,12812,75030,94021,21923,107442,71533,49887,13934,43195,55056,105383,50712,9200,89729}

    Returns: 1002180

  28. {192025,135144}

    Returns: 192025

  29. {48052,24738,284445,135703,101069,24452,100011,388102,131434,176476,222190,354836,301246,55907,2185,204057,243693,109700,247334,33412,43733,284575,38433,160837,173778,67175,61179,230083,108871,28323,110616,268935}

    Returns: 2382790

  30. {2028530,1428854}

    Returns: 2028530

  31. {480408,671369,1992874,1561344,1048504,1291588,1227293,1364594}

    Returns: 4824600

  32. {2087777,846562,2007762,519783,1164709,1441382,1384375,1101178,161177,2132631,1141163,1372414,451975,1999361,752562,526008,1366831,2154546,1234197,1185055,1291649,192558,185839,1992643,1293189,2141580,54848,1504499,261268,1038198,1261790,812134}

    Returns: 18530822

  33. {990842,4073501,5939010,6552292,3103842,3967431,4787509,1708135,3158457,7964207,2117096,285108,130666,4402237,5730313,151156,5015669,49405,7822105,2610662,2639966,4204736,7770334,7633070,3248156,1766923,3812082,6633009,4399819,4110343,6168514,6114347}

    Returns: 64530471

  34. {22838924,2398057}

    Returns: 20440867

  35. {4306181,32221636,29412151,25545256,7004728,8639809,29830829,11463723,9107113,13532572,14261223,15420537,5474376,16354284,15555054,11581989,19049705,30727455,10552975,18482949,27556161,30095956,2108076,50546,10024269,12943631,3788169,29617259,19387932,14401240,5229184,29713858}

    Returns: 256720413

  36. {23766875,16791884}

    Returns: 23766875

  37. {62189196,63661735}

    Returns: 63661735

  38. {1280948,2838184,2705822}

    Returns: 3986770

  39. {50627805,5414924,8620890}

    Returns: 36591991

  40. {220547,306221,1386796,7058825}

    Returns: 5145261

  41. {13120519,14205739,64289567,739867,10687539}

    Returns: 51776941

  42. {13860106,125093,38530163,6226472,5022568,6599547,9727547,17034064}

    Returns: 48742757

  43. {4184792,23941125,30648320,3085591,3736487,1767359,3938473,31714654,6987342,74481,240461}

    Returns: 54963861

  44. {8901346,10000471,21007887,16270413,7090105,10383968,34201211,10829811,475081,44260186,5342882,8152473,25642514,676567}

    Returns: 101621001

  45. {13898492,5728158,12384380,24870569,16127310,1334871,4637,39220561,7562229,6123300,429652,3924497,8193141,1023704,426385,15897216,2894526}

    Returns: 80021980

  46. {4832229,40694415,2485960,2906354,110104,43390908,10773881,393777,6621501,7277863,2238165,413295,1750173,39697020,6596801,3336456,6453926,5014976,26610894,618924}

    Returns: 106108830

  47. {38545372,1585155,24280152,9315142,13103358,23818675,14868695,3057922,1018591,1494908,6550402,509995,405325,3566540,4152737,1318753,8683018,1763593,6895181,6819952,5121800,1832802,24800466}

    Returns: 101754266

  48. {8137097,51938978,1091239,7634164,21554355,46787259,16380511,24770313,18410140,28438717,18516996,1630473,905529,11240737,32627532,9706593,34177262,77813,16862535,1521337,4079991,12049791,7181732,29578254,2493264,828984}

    Returns: 204310799

  49. {30125292,10418352,163728,322378,7682,3398798,2433828,4070710,62648,16052039,179864,21288167,4535901,468536,9203589,20882063,4752558,7257154,9081030,9776021,3134968,12017391,736647,38506682,3050919,3143726,368505,35956773,10427770}

    Returns: 130911860

  50. {6935695,2762604,8659693,3732773,1592122,9827390,44515578,1153340,8302394,1643601,57948585,6645158,13420464,3354053,1517973,520910,9432109,1523277,1113809,8436878,1441966,10868149,4114534,10941577,6020156,3609310,6002538,59851422,5225460,15091881,2458296,8140621}

    Returns: 163402158

  51. {1543583,441445,40385,30087863,9752766,14833747,10768039,11863305,4772525,35986877,38757259,2405024,3252108,4374063,30450930,69962665,1393845,2281574,23392217,36025407,5111818,4890072,19830190,36369239,725549,12845936,194230,28685659,20474464,22101686,36592202,15289612,1797299,9863695,38904429}

    Returns: 293030854

  52. {12345538,13508528,5303318,23069648,5492026,10895173,697392,3112137,2165863,44758832,5895250,20826191,6695963,2000053,3112849,16954021,66369460,2887857,2410669,8959856,7473372,3699347,2734740,34875194,25716346,29483727,637159,2637384,20615349,2508977,9964599,66347704,13016364,21497574,5226327,5586422,895417,19013009}

    Returns: 264694818

  53. {8131771,2064923,9409142,5845447,9564538,86855,4237825,5711596,9008708,3256483,2306702,1027953,1505247,5414002,7890676,6387870,4373015,5555886,345491,3897917,99948597,99747423,99891355,99602271,99902437,99611726,99584654,99973449,99963397,99788936,99531034,99867225,99682238,99531818,99791950,99552627,99754588,99583665,99638487,99908275}

    Returns: 1045439100

  54. {9999972,9999970,9999979,9999967,9999955,9999960,9999983,9999977,9999968,9999990,9999965,9999951,9999961,9999981,9999969,9999985,9999975,9999980,9999964,9999959,9999974,9999987,9999954,9999978,9999956,9999984,9999953,9999971,99999952,9999976,9999958,9999973,9999989,9999966,99982,9999957,9999963,9999962,9999988,9999986}

    Returns: 240098958

  55. {80000000,78000000,76000000,74000000,72000000,70000000,68000000,66000000,64000000,62000000,60000000,58000000,56000000,54000000,52000000,50000000,48000000,46000000,44000000,42000000,40000000,38000000,36000000,34000000,32000000,30000000,28000000,26000000,24000000,22000000,20000000,18000000,16000000,14000000,12000000,10000000,8000000,6000000,4000000,2000000}

    Returns: 820000000

  56. {1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986}

    Returns: 82790070

  57. {1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,20686496}

    Returns: 93133318

  58. {2,9227465,14930352,55,987,5702887,1597,514229,13,5,1,21,2584,8,28657,89,6765,832040,2178309,10946,196418,24157817,75025,4181,610,17711,34,63245986,377,317811,121393,39088169,233,3524578,3,46368,144,1346269}

    Returns: 82790070

  59. {2178309,144,63245986,46368,196418,5702887,8,514229,24157817,2584,377,4181,1,317811,233,3,17711,81861314,9227465,832040,2,28657,75025,10946,1346269,610,39088169,34,5,21,89,1597,14930352,3524578,987,121393,13,85681818,55,6765}

    Returns: 166561636

  60. {1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400,441,484,529,576,625,676,729,784,841,900,961,1024,1089,1156,1225,1296,1369,1444,1521,1600}

    Returns: 11070

  61. {1,8,27,64,125,216,343,512,729,1000,1331,1728,2197,2744,3375,4096,4913,5832,6859,8000,9261,10648,12167,13824,15625,17576,19683,21952,24389,27000,29791,32768,35937,39304,42875,46656,50653,54872,59319,64000}

    Returns: 336200

  62. {1,16,81,256,625,1296,2401,4096,6561,10000,14641,20736,28561,38416,50625,65536,83521,104976,130321,160000,194481,234256,279841,331776,390625,456976,531441,614656,707281,810000,923521,1048576,1185921,1336336,1500625,1679616,1874161,2085136,2313441,2560000}

    Returns: 10890666

  63. {1,32,243,1024,3125,7776,16807,32768,59049,100000,161051,248832,371293,537824,759375,1048576,1419857,1889568,2476099,3200000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176,69343957,79235168,90224199,99999967}

    Returns: 366266584

  64. {1,64,729,4096,15625,46656,117649,262144,531441,1000000,1771561,2985984,4826809,7529536,11390625,16777216,24137569,34012224,47045881,64000000,85766121,99999965,99999964,99999980,99999988,99999986,99999954,99999976,99999971,99999985,99999977,99999959,99999950,99999962,99999976,99999972,99999993,99999997,99999956,99999989}

    Returns: 1101110716

  65. {73540560,9091429,60692538,30401665,35981282,75005544,12498995,37971391,61000690,18006095,73849494,2241099,17062840,62055460,41993639,23009945,8818863,78206642,7739611,59262494,85265097,64837852,7922318,47050775,70449545,86372022,83883084,74201891,81772664,50107433,45630456,44066564,57353089,7580964,10149784,29836018,87767236,77177974,60280518,16196568}

    Returns: 938166064

  66. {69467259,9648721,82632412,35627187,86766758,83301040,3680879,66576496,46037453,22104495,24611335,29919125,42147543,78368235,79894515,99272683,70808156,38072599,77729591,67574781,45341067,43487626,35447209,95935852,70103042,18735884,73913462,68186460,87483449,36397485,15857723,86941701,61853400,58465567,42827133,89190546}

    Returns: 1022204435

  67. {623633,1043556,4655823,4977845,11236448,13241295,14272622,18315088,20556729,24738695,25172076,25987965,28318750,34561681,34910404,36338871,38578812,45033264,48336430,48830187,52381025,52479134,52764748,52851801,54071080,55476529,56495600,57660619,59607877,67375920,69534742,82747036,86780044,90765523,93520628}

    Returns: 732121240

  68. {9744883,16384934,20532173,30869645,49408482,50546485,57666768,58698966,60628533,64906186,66072754,73495629,75238125,79028288,81237406,83130722,83540412,92481631}

    Returns: 526806230

  69. {9328464,11308244,22862157,28234983,36728733,57628497,58380518,61954953,75155132,75269889,79730378,81930265,97023241}

    Returns: 347778278

  70. {97723339,97113339,7330,96737790,98881056,93797495,99085857,99449441,92576805,98749642,2503,98706195,94775589,99925331,4033,1866,99484733,96066959,6167,2730,95095555,94616667,96992631,96710826,95870588,1051,96768441,98018825,92281116,94909093,94011736,99618427,99323642,94472926,95905216,2656,7640,1196,93011239,94868421}

    Returns: 1447793046

  71. {98514345,239,95637222,214,213,96065375,496,59,92847773,150,514,96129557,351,95324755,295,93353061,95883544,401,95245612,457,98085149,366,97227525,96735779,96976462,96172333,111,646,97510103,281,98719002,5,325,73,97858529,93066628,97738740,99573118,589,430}

    Returns: 964335414

  72. {97442893,3520,1291,5780,2949,4531,394,2987,1151,4319,2784,4467,2898,3818,98043824,201,3875,4973,99445470,2533,2151,3050,1410,99567181,98089415,3225,5856,1573,96927456,99052243,2348,5508,1253,99446657,1245,2455,98586068,5626,98886746,1053}

    Returns: 492788589

  73. {1,3,9,27,81,243,729,2187,6561,19683,59049,177147,531441,1594323,4782969,14348907,43046721,2,1,92,52,17,95,10,57,54,88,16,81,25,10,23,7,61,51,52,8,81,5,69}

    Returns: 32285520

  74. {1,4,16,64,256,1024,4096,16384,65536,262144,1048576,4194304,16777216,67108864}

    Returns: 44739243

  75. {1,5,25,125,625,3125,15625,78125,390625,1953125,9765625,48828125,91,73,82,33,22,7,17,36,95,83,63,33,51,76,67,6,10,92,55,60,70,83,25,75,36,97,30,94}

    Returns: 36619532

  76. {1,6,36,216,1296,7776,46656,279936,1679616,10077696,60466176}

    Returns: 48372941

  77. {1,7,49,343,2401,16807,117649,823543,5764801,40353607,50,8,98,94,3,31,1,74,61,41,36,86,70,83,19,1,36,78,21,81,21,30,63,94,92,21,32,11,61,4}

    Returns: 33626605

  78. {1,9,81,729,6561,59049,531441,4782969,43046721,42,56,33,1,8,10,76,48,90,3,81,83,73,3,34,50,92,28,66,83,72,71,77,66,48,92,19,75,93,46,13}

    Returns: 37664249

  79. {1,10,100,1000,10000,100000,1000000,10000000,100000000}

    Returns: 88888889

  80. {193,37249,7189057,13,169,2197,28561,371293,4826809,62748517,8,64,512,4096,32768,262144,2097152,16777216,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304}

    Returns: 51383312

  81. {173,29929,5177717,193,37249,7189057,3,9,27,81,243,729,2187,6561,19683,59049,177147,531441,1594323,4782969,14348907,43046721,29,841,24389,707281,20511149,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192}

    Returns: 49132235

  82. {35,1225,42875,1500625,52521875,31,961,29791,923521,28629151,43,1849,79507,3418801,113,12769,1442897,15,225,3375,50625,759375,11390625,9,81,729,6561,59049,531441,4782969,43046721,31,961,29791,923521,28629151,137,18769,2571353,113}

    Returns: 90705848

  83. {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

    Returns: 20

  84. {262144,2097152,524288,4194304,99999991,67108864,4,8,32768,256,99999995,99999999,99999990,99999994,16,64,131072,2048,8192,99999995,1,99999992,16777216,1048576,99999993,512,1024,32,16384,2,4096,99999994,65536,100000000,99999997,99999998,33554432,128,8388608}

    Returns: 667108833

  85. {1,1,1}

    Returns: 2

  86. {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

    Returns: 19

  87. {378,108,1,144,348,10,355,44,7}

    Returns: 697

  88. {12,23,1,11,1,8,11,13,23}

    Returns: 51

  89. {1,5,1}

    Returns: 3

  90. {3,12,1,24}

    Returns: 24

  91. {47,31}

    Returns: 47

  92. {15,1,9,16}

    Returns: 21

  93. {12,14,19}

    Returns: 21

  94. {1,1,1,1,1,1,1,1}

    Returns: 4

  95. {36,10,14,15,82,32,78}

    Returns: 134

  96. {7,6,23,8,16}

    Returns: 30

  97. {44,24,62,20,37}

    Returns: 99

  98. {37,33,35,28,37,2,25,33}

    Returns: 114

  99. {7,9,10,3,5,10}

    Returns: 22

  100. {54,52,14,79,71,53,44}

    Returns: 184

  101. {2,4,4,2,2,2,3,1,3,1}

    Returns: 12

  102. {63,29,35,64,59,7,12,26,35,65}

    Returns: 198

  103. {14,1,40,3,53,24,15,47}

    Returns: 100

  104. {7,9,7,12}

    Returns: 17

  105. {18,12}

    Returns: 18

  106. {21,12,4,2}

    Returns: 21

  107. {36,59,55,47,46}

    Returns: 125

  108. {35,37,33,15,16,19}

    Returns: 81

  109. {72,5,59}

    Returns: 72

  110. {16,31,16,35,12,15,24}

    Returns: 75

  111. {4,5,3}

    Returns: 6

  112. {2,2}

    Returns: 2

  113. {5,2,2}

    Returns: 5

  114. {1,1,2,2,1}

    Returns: 4

  115. {1,5}

    Returns: 4

  116. {1,1,3}

    Returns: 3

  117. {5,4,7,7,2}

    Returns: 13

  118. {2,4,5,5}

    Returns: 8

  119. {3,3}

    Returns: 3

  120. {2,6}

    Returns: 4

  121. {5, 7, 9, 1239, 13, 21, 581, 1848, 1058, 57172, 58281, 612, 528, 2312, 381 }

    Returns: 62035

  122. {100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000, 100000000 }

    Returns: 2000000000

  123. {29432324, 13793424, 78286021, 603872, 60139801, 95082629, 5778764, 2280629, 75903501, 41943009, 67701022, 87345697, 85419026, 78652620, 14286716, 66159348, 18706368, 73289022, 47617520, 30005731, 61125473, 26685674, 15551553, 41428469, 87508466, 6946227, 17459259, 55304370, 40866373, 35562997, 33294113, 44154398, 54689939, 98810299, 66541362, 1295589, 25586257, 21018094, 36713423, 24169936 }

    Returns: 883569658

  124. {4, 6, 10 }

    Returns: 10

  125. {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }

    Returns: 20

  126. {1, 3, 12 }

    Returns: 8

  127. {5, 7, 9, 13, 21, 581, 1848, 1058, 57172, 58281, 612, 528, 3636363, 36363636, 36363636, 363636, 24242, 345346, 242424, 334646, 2536, 4747, 474747, 34534536, 47474, 34636747, 3536467, 3674747, 3674747, 374747, 47373, 3737, 7373, 373748, 9, 68567, 4634, 3634, 345636, 2343242 }

    Returns: 80976756

  128. {10, 4, 1, 1 }

    Returns: 8


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: