Statistics

Problem Statement for "PackingSquares"

Problem Statement

Manao is given a sequence of squares numbered from 0 to N-1. The i-th square has side length equal to 2^a[i].

In the beginning, there is only an empty plane. Manao will process the squares one after another, in the order in which they are given. He will pick a parent object for each of the squares and then move the square onto its parent object. The parent object can be either the plane or one of the already processed squares. Each square must lie entirely within (or exactly cover) its parent object. Also, two children of the same object must never have an intersection with a positive area. (I.e., siblings may share a common boundary but they must not overlap.)

Given an int[] a, return the minimum possible covered area of the plane at the end of the process described above.

Definition

Class:
PackingSquares
Method:
leastArea
Parameters:
int[]
Returns:
long
Method signature:
long leastArea(int[] a)
(be sure your method is public)

Notes

  • The answer will always fit in a signed 64-bit integer.

Constraints

  • a will contain between 1 and 50 elements, inclusive.
  • Each element of a will be between 0 and 30, inclusive.

Examples

  1. {0, 1, 2}

    Returns: 21

    Manao has three squares with side lengths 1, 2 and 4. The parent for the first square can only be the plane. Since the second square does not fit into the first one, its parent should also be the plane. The same happens to the third square. Thus, the area used on the plane is equal to 1 + 4 + 16 = 21.

  2. {1, 0, 0, 0, 0, 0, 0, 0}

    Returns: 4

    The square 0 is put on the plane. For each i > 0, square i-1 can be the parent of square i.

  3. {2, 1, 0, 2, 1}

    Returns: 20

    Manao can use 20 units of the plane if he assigns parents as follows: Square 0: plane. Square 1: plane. Square 2: square 1. Square 3: square 0. Square 4: square 3.

  4. {30, 0, 1}

    Returns: 1152921504606846976

    The square of side 2^30 is placed on the plane. The square of side 1 can then be placed in the square of side 2^30. Finally the square of side 2 can not be placed in the square of side 1, but can be placed in the square of side 2^30 without intersecting its sibling square of side 1.

  5. {6, 5, 12, 15, 14, 5, 6, 5, 13, 15, 11, 11}

    Returns: 1358958592

  6. {2,1,4,2}

    Returns: 272

  7. {4,1,5,6,5,9,3,10,0,0,5,2,4,9,8,1,5,3,6,2,1,5,1,10,8,6,1,0,6,8,9,9,9,8,8,2,5,6,1,5,4,5,1,1,8,2,6,6,0}

    Returns: 1316096

  8. {5,10,8,4,8,3,3,2,10,10,1,0,3,5,1,5,9,7,5,7,6,2,0,5}

    Returns: 1115136

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

    Returns: 1332224

  10. {2,5,6,0,7,2,1,5,2,8,10,10,10,6,10,6}

    Returns: 1135632

  11. {8,8,3,5,4,7,7,1,9,9,1,6,5,3,8,4,4,0,9,8,6,7,9,1,2,1,0,8,10,5,2,1,4,9,7,7,7,9,4,1,9,2,5,2,4,10}

    Returns: 1398080

  12. {3,6,7,2,4,6,6,1,5,8,6,9,1,1,4,2,3,5,1,4,6,5,4,0,9,6,8,3,4,4,2,10,1,0,6,4,2,9,9,7,10,10,3,9}

    Returns: 1396800

  13. {10,4,9,7,6,4,7,3,6,7,10,1,8,0,2,4,9,3,10,4,10,2,8,6,2,10,5,9}

    Returns: 1396992

  14. {9,3,8,4,5,2,6,9,4,3,1,6,1,1,7,5,6,5,1,10,9,1,8,2,6,9,2,7,7,9,4,4,7,3,9,5,4,4,7,10,6,1}

    Returns: 1398080

  15. {1,9,3,3,5,1,2,0,10,1,8,4,0,2,6,9,2,9,8,1,8,8,3,10,8,3,9,1,1,8,1,0,9,9,1,1}

    Returns: 1377348

  16. {5,6,6,10,7,5,8,0,0,5,1,5,4,2,0,2,8,1,0}

    Returns: 1053696

  17. {4,7,5,1,10,4,4,4,6,10,8,4,9,0,1,2,3,6,7,5,1,3,9,10,2,7,5,5,8,3,4,2,2,3,3,4,1,9,9,10,7,8,5}

    Returns: 1398016

  18. {7,1,10,4,5,9,1,8,10,1,1,1,4,9,5,3,9,6,4,6,8,10,7}

    Returns: 1392640

  19. {7,3,7,6,5,10,6,2,4,10,9}

    Returns: 1065024

  20. {1,8,0,10,6,10,6,10,0,4,3}

    Returns: 1114116

  21. {3,2,3,2,0,1,0,6,8,3,10,3,1,4,2,3,3,5,3,4,3,10,0,3,0,5,8,1,4,1,4,5,4,10,8}

    Returns: 1118288

  22. {1,8,5,6,8,0,10,2,2,4,4,10,6,7,10}

    Returns: 1119236

  23. {1,6,1,8,9,8,6,7,9,9,6,2,8,3,10,7,10,8,1,10,0,9,4,6,8,10,9,6,3,10,0,6,9,3,6,10,4,5,5,4,5,4,9,8,7}

    Returns: 1396740

  24. {7,10,8,10,9,9,0,4,7,5,2,9,10,10,2,3,4,10,6,6,6,0,7,10,8}

    Returns: 1392640

  25. {4,9,8,9,9,0,0,8,8,10,7,4,9,5,2,2,0,9,1,1,5,0,6,9,7,7,3,10,9,7,7,7,6,1,4,2}

    Returns: 1376512

  26. {3,2,8,8,7,7,7,2,0,10,7,2,7,10,6,10,2,1,4,7,5,10,6,0,4,0,3}

    Returns: 1114176

  27. {23,6,16,16,29,1,28,9,28,25,6,25,18,2,25,27,21,8,21,26,6,7,11,25,24,26,23,9,21,25,16,30,20,27,13,20,26}

    Returns: 1441222249502736384

  28. {25,30,30,26,26,11,7,3,27,2,24,20,20,27,6,20,26,8,11,10,22,8,10,9,22,4,23,4,16,11,29,3,25,5,2,2,25,6,26,11,12,12,11,6,12}

    Returns: 1154047404513689600

  29. {24,23,6,21,9,21,27,16,15,16,3,6,6,10,1,1,26,11,3,14,6,20,26,25,26,10,23,8,12,12,18,11,24,26,18,14,11,22,12,16,11,5,26,6,11,30}

    Returns: 1171217378093039616

  30. {9,16,5,1,7,8,24,30,6,14,15,24,8,24,12,28,24,29,28,28,20,18,25,23,20,2,3,12,21,18,13,8,1,23,23,25,12,10}

    Returns: 1153202983878787072

  31. {27,15,3,13,22,25,1,13,25,7,25,12,9,19,15,4,23,19,21,29,2,2,23,6,22,16,11,16,7,18,6,19,15,3,12,4,11,28,4,16,5}

    Returns: 306244774661193728

  32. {20,8,12,16,29,9,17,1,20,3,25,4,16,3,24,26,27,21,29,10,9,21,19,26,25,15,18,14,21,13,18,2,27,16,5,14,28,29,8}

    Returns: 383932989236641792

  33. {12,29,9,20,8,29,4,20,18,11,25,24,24,15,6,14,3,3,30,15,9,30,14,19,12,22,29,16,0,30,10,22,3,3,7,18,30}

    Returns: 1442278880193806336

  34. {28,27,19,22,12,11,21,24,8,8,24,13,23,28,7,9,26,8,18,25,18,9,13,20,20,20,30,11,27,7,19,20,6,0,11,18}

    Returns: 1242993497154256896

  35. {30,22,0,26,6,22,28,27,8,7,23,3,16,8,8,1,17,6,6,20,10,12,9,28,21,18,20,7,18,4,30,21,7,26,17,11,1,9,22,23,29,25,22,4,7,1,17,4,5,21}

    Returns: 1247514688967671808

  36. {20,20,22,25,14,23,16,23,10,20,4,10,20,2,21,5,30,24,15,13,18,17,13,28,17,29,22,17,12,10,5,9,21,9,30,5,11,23,7,1}

    Returns: 1514354066401001472

  37. {27,18,18,30,16,14,16,21,18,14,2,16,17,9,24,15,14,8,20,16,29,26,5,3,30,3,1,27,28,0,8,20,18,3,23,9,27,27,5,28,13,7,17,24}

    Returns: 1459166279268040704

  38. {7,9,7,14,22,21,22,13,3,12,1,4,6,4,8,27,4,8,9,5,15,16,2,27,26,19,8,19,20,0,1}

    Returns: 18036389010751488

  39. {23,24,13,24,17,8,16,17,25,13,19,23,7,17,3,11,22,16,30,27,18,15,27,11,14,26,18,4,22,27,8,28}

    Returns: 1154399248234577920

  40. {7,12,15,7,20,21,20,6,2,22,14,23,6,11,7,18,27,10,16,11,5,2,1,15,25,6,9,27,19,12,16,20,22,22,16,29,9,21,4}

    Returns: 307464134146932736

  41. {23,23,27,4,10,4,24,18,23,19,26,15,18,21,18,25,15,14,29,1,10,25,25,12,3,2,14,20,6,27,0,2,28,29,6,29,20,11,4,4,16,30,25,28}

    Returns: 1536079316654227456

  42. {15,30,10,26,16,13,7,3,18,14,14,1,12,17,15,6,15,3,4,30,20,2,12,12,29,4,29,27,11,9}

    Returns: 1157425105307959296

  43. {28,12,2,0,12,13,4,2,27,6,12,23,3,1,1,6,14,17,29,4,6,4,23,9,22,28,7,2,27,10,29,15,8,2,8,7,23,8,13,6,16,16,11,0,9}

    Returns: 378302368783007760

  44. {18,28,17,3,13,29,1,8,7,7,15,7,24,4,29,11,14,15,29,25,26,10,18,24,8,28,2,29,0,18,25,19,6,8,13,22,14,1,19,25,3,25,4}

    Returns: 366199013420040192

  45. {17,26,5,9,28,17,16,22,0,13,21,5,23,8,12,25,23,24,25,20,6,21,25,10,23,6,16,27,9,8,25,18,17,24,30,2,12,25}

    Returns: 1229482715452014592

  46. {28,21,15,14,1,11,5,27,7,9,30,26,19,14,28,25,0,8,1,27,14,3,13,27,29,28,12,26,18,0,1,16,12,3,23,15,23}

    Returns: 1224979098644774912

  47. {2,14,26,8,15,7,18,2,24,26,15,15,29,14,11,19,20,17,4,4,9,16,2,30,28,22,20,4,5,14,27,3,14,2,0,1,9,20,9,0,7,19,15,2,11,12,12}

    Returns: 1445937025424293904

  48. {11,26,6,24,22,9,14,1,23,19,1,11,10,9,3,13,1,3,14,28,11,9,15,5,23,20,13,0,8,24,25,4,18,21,18,29,9,14}

    Returns: 364791569821204480

  49. {4,15,5,29,25,12,19,3,0,25,7,21,13,24,29,5,24,23,25,18,17,24,27,27,26,21,13,14,18,2,11}

    Returns: 289356552010203392

  50. {10,25,18,15,22,20,9,27,18,19,10,2,3,18,15,4,24,13,3,7,26,3,5,23,9,22,14,6,15,26,12,23,30,13,0,13,15,27,11,12,16,29,2,2,7}

    Returns: 1172061803024220160

  51. {17,30,23,26,28,4,17,25,2,22,15,16,7,10,28,16,6,20,1,30,6,8,9,9,9,5,28,25,5,16,0,24,18,0,25,4,11,9,25,8,18,19,16,17}

    Returns: 1229553084196192256

  52. {14,12,2,16,21,28,25,14,18,8,16,5,13,5,29,10,13,29,30,29,20,0,3,25,2,11,9,11,13,23,18,21,23,18,10}

    Returns: 1513213877406400512

  53. {27,6,6,29,22,20,2,15,11,20,14,11,26,14,7,14,2,25,3,25,7,4,3,30,5,3,27,0,8,20,14,8,7,29,21,4,16,20,24,0,19,24,11,9,4,27}

    Returns: 1459166279268040704

  54. {1,1,29,26,7,17,23,20,13,1,20,16,25,29,23,9,16,8,30,27,19,21,28,20,29,3,0,23,5,11,10,15,20,28,8,30,16,18,19,25}

    Returns: 1535727472933339140

  55. {28,16,2,2,18,24,7,26,16,19,7,30,26,27,0,9,2,18,26,17,27,13,15,19,0,10,13,15,20,3,12,28,29,28,12,20,7,8,6,4,24,20,11,1,16,27,24,14,7}

    Returns: 1224979098644774912

  56. {19,26,14,17,21,30,11,20,6,1,1,27,25,10,12,17,21,25,18,26,27,0,6,11,8,17,20,28,0,9,14,15}

    Returns: 1157425379112124416

  57. {15,9,4,3,7,8,20,19,7,15,23,15,4,27,4,30,6,30,18,8,3,19,1,8,21,0,7,25,2,16,7,2,15,18,11,26,10,20,18}

    Returns: 1171007372445876224

  58. {26,0,13,7,2,25,11,19,4,9,25,12,19,15,18,19,3,11,21,9,30,2,29,30,6,1,28,15,24,6,0,4,27,27,27,26,20}

    Returns: 1445655480385929216

  59. {28,8,27,14,4,13,10,24,13,0,8,7,20,1,22,27,0,20,15,2,11,16,6,5,3,16,9,25,23,7,16,5,25,24,11,25,18,26,13,3,22,19,27,21,6,17,15,16,15}

    Returns: 72057594037927936

  60. {27,21,5,16,1,29,17,29,13,16,29,16,28,3,2,25,6,29,8,29,0,8,24,2,17,16,3,6,1,30,16,28,8,4,24,1,12,12,19,29,1,13}

    Returns: 1531223873305968640

  61. {15,13,0,14,8,22,27,3,20,18,29,18,9,30,16,23,4,1,23,18,30,19,15,29,3,14,2,12,23,5,21,17,11,1,21,22,5,15,8,20,17,0,23}

    Returns: 1459183872527826944

  62. {17,27,8,23,23,25,7,14,19,2,20,15,26,22,26,9,4,24,12,8,18,13,11,24,28,1,1,19,2,12,9,12,2,27,25,1,7,7,30,29,30,3,15,2,14,25,23,28,9}

    Returns: 1531223890485837824

  63. {5,28,7,11,24,14,10,18,3,7,3,20,22,25,14,27,29,9,11,25,25,10,13,10,7,11,4,15,0,0,12,28}

    Returns: 360287970189640704

  64. {8,10,21,21,10,19,14,14,27,19,29,15,29,28,8,15,11,18,3,16,20,25,4,8,12,21,24,14,27,26,29,9,23,18,4,12,19,0,10,18,13,25,15,6,12,4}

    Returns: 378306766746746880

  65. {30,4,10,11,13,18,0,21,30,7,1,14,2,21,9,4,4,0,10,20,23,27,27,1,25,4,10,23,29,24,28,17}

    Returns: 1152925971445186816

  66. {20,20,14,23,9,17,11,30,26,4,21,28,17,17,12,22,17,21,2,8,8,6,11,11,12,23,21,21,2,22,21,17,13,28,30,11,22,21}

    Returns: 1229554166527950848

  67. {17,10,26,2,28,27,29,16,20,28,3,17,23,5,9,6,29,2,2,19,12,22,11,1,13,15,3,29,28,2,1,12,23,4,8,26}

    Returns: 382805985506361344

  68. {0,19,14,27,17,5,23,13,18,25,15,16,1,15,1,15,5,7,19,20,28,12,11,2,4,15,5,21,9,7,29,10,15,0,0,6,11,29,24,2}

    Returns: 378302643577028609

  69. {0,0,0,14,4,2,6,8,5,24,5,9,5,0,27,24,19,28,8,17,11,0,27,16,14,17,24,7,23,10,18,12,25,21,25,27,26,24,24,27,0,11,19,24,1,6,6}

    Returns: 90353467792556033

  70. {10,2,20,14,16,30,11,21,22,30,23,11,24,18,11,1,4,24,9,29,1,22,28,5,18,11,6,15,9,19,10,0,9,21,12,29,21}

    Returns: 1152944594352078848

  71. {0,0,0,0,0,10,15,8,11,0,2,21,12,25,20,16,2,17,8,0,3,17,28,23,0,27,1,6,8,5,7,27,29,30,5,13,8,11,14,29,8,22,15,9,8,12}

    Returns: 1514339773824630785

  72. {0,3,4,23,0,2,22,15,6,15,1,9,10,7,13,17,17,5,17,13,19,16,14,6,2,5,1,27,19,8,14,7,20,19,28,21}

    Returns: 90142361291587905

  73. {29,15,7,26,25,19,1,24,15,23,10,7,17,4,14,22,16,24,16,1,0,12,16,14,12,15,4,26,9,25,19,26,8,3,3,17,7,11,30,26,1}

    Returns: 1441151880758558720

  74. {0,0,25,5,3,20,6,9,19,6,17,25,16,7,24,13,2,11,2,14,13,8,21,10,7,9,1,6,13,17,14,23,13,24,14,19,16,22,15,12,29,21,4,24,30}

    Returns: 1442278880177030145

  75. {0,14,6,27,26,21,11,17,22,11,20,11,12,1,10,30,19,6,6,11,9,27,19,2,6,2,0,7,24,8,28,12,1,24,22,17,13,29,26,27,3,8,26}

    Returns: 1170935903384764417

  76. {14,19,7,4,18,25,13,18,10,13,16,7,9,10,11,28,8,1,23,3,22,16,23,11,24,2,11,22,25,13,0,16,29}

    Returns: 361414145242824704

  77. {2,3,24,15,3,4,10,8,4,1,20,1,1,17,7,14,4,1,11,16,13,16,20,26,15,8,1,18,25,6,26,29,11,30,3,4,8,28}

    Returns: 1447062855269482576

  78. {13,3,11,9,13,24,6,18,27,10,6,19,27,12,12,0,9,7,25,8,15,17,10,28,22,25,15,29,26,11,12,15,6,3,22,25,21,16,23,0,25,27}

    Returns: 378583843747135552

  79. {10,2,3,23,28,4,13,13,8,26,18,5,17,2,14,11,7,0,22,12,27,1,11,7,3,22,15,2,6,1,1,3}

    Returns: 72127962783154176

  80. {0,0,27,21,14,22,12,1,18,5,21,17,18,10,6,8,8,11,14,4,7,11,5,12,22,9,0,13,12,10,19,4,26,8,22,0,25,7,28,28,28,3,6,25,23,3,20,3}

    Returns: 90071992547409921

  81. {0,0,12,10,10,8,12,6,1,13,0,7,1,3,9,3,12,7,16,8,16,9,5,11,11,6,6,9,8,6,6,25,19,8,18,19,14,3,13,16,21,26,19,11}

    Returns: 5629503914115073

  82. {1,2,2,8,3,11,4,9,28,3,6,19,11,0,21,7,6,19,13,7,9,25,27,7,7,15,21,19,22,18,11,13}

    Returns: 72057594042187796

  83. {26,5,2,14,10,8,17,21,0,7,16,24,19,19,19,16,5,23,16,1,26,23,23,6,23,4,14,20,13,22,20,10,0,20,6,25,15}

    Returns: 4789490098897920

  84. {0,10,4,2,0,3,4,5,3,9,8,1,0,2,7,2,24,1,13,19,22,3,22,22,28,4,22,25,6,15,23,21,13,1,28,19,1,14}

    Returns: 73464968922529793

  85. {0,25,11,20,1,13,27,0,15,30,30,10,12,23,22,4,30,14,17,8,16,19,28,18,24,15,26,18,19,6,2,16,7,16,22}

    Returns: 1172061803023171585

  86. {14,20,26,26,12,25,11,28,17,5,4,12,2,23,7,18,9,4,19,10,5,1,0,3,23,14,24,1,19,24,23,22}

    Returns: 76562293445361664

  87. {5,2,3,4,1,2,15,15,5,17,23,30,30,1,6,16,12,2,9,11,27,29,30,21,8,9,26,5,28,10,25,27,27}

    Returns: 1459236666265830400

  88. {0,9,4,3,9,15,22,7,2,12,5,29,8,8,4,7,23,10,3,17,16,12,1,21,6,17,13,6,20,14,0,26,22,28,24}

    Returns: 288247969411760385

  89. {0,8,16,29,18,7,28,1,20,13,19,26,19,17,17,4,6,25,14,9,29,11,1,10,1,23,26,3,20,12,15,14,21,26,5}

    Returns: 360288043204149249

  90. {3,3,23,9,7,2,14,4,2,11,17,17,4,0,26,15,16,26,2,10,16,0,9,28,19,7,1,20,3,13,23,0,13,9,29,27,13}

    Returns: 364861938561187904

  91. {7,17,9,13,1,26,5,16,4,25,21,23,10,16,24,28,4,24,10,15,15,5,5,10,4,5,13,0,13,29,18,4}

    Returns: 364791586996895744

  92. {0,30,21,18,30,21,4,6,8,30,17,19,16,8,11,24,14,12,2,7,11,12,19,10,22,17,12,13,17,9,1,9}

    Returns: 1152925971372834817

  93. {16,13,26,13,19,12,8,8,8,14,2,25,13,24,3,5,17,23,1,16,16,26,14,1,21,25,4,13,16,8,24,8,25,2,8,6,28,22,24,6,10,19,17}

    Returns: 77687372745015296

  94. {11,28,13,25,21,23,13,29,20,0,7,19,27,4,16,11,27,6,2,6,12,14,14,4,9,5,3,21,12,21,21}

    Returns: 360287970193833984

  95. {0,0,0,13,13,24,8,19,12,9,3,12,14,10,29,26,13,5,4,5,27,11,28,6,12,19,25,14,22,23,30,12,16,9,0,16,15,16,22,25,23,29,19,15,10,3,11,5,12,23}

    Returns: 1441433355802378241

  96. {14,4,7,10,25,7,12,18,17,5,2,13,3,7,3,5,14,7,17,21,3,19,4,6,10,16,11,22,1,12,3,22,14,23,11,10,11,0,18,12,22,2,4,17,13,20,19}

    Returns: 1125900175278080

  97. {0,0,0,0,0,2,30,20,29,9,7,26,12,24,1,17,2,0,16,26,26,5,8,16,18,7,13,17,8,9,30,9,4,13,23}

    Returns: 1441152980270186513

  98. {0,10,5,4,2,0,20,24,9,17,12,14,22,13,19,7,4,19,2,3,29,6,1,19,20,15,17,23,27,30,25,22,28,0,12}

    Returns: 1441434455247945729

  99. {0,0,13,6,16,8,13,8,7,9,24,14,21,4,1,10,11,18,22,5,3,24,3,9,4,29,20,30,6,25,2,15,11,27,7,9}

    Returns: 1441455350329901057

  100. {3,0,2,2,24,7,4,11,15,17,17,21,15,19,5,19,24,1,9,10,30,14,16,22,26,29,8,11,28,22,15}

    Returns: 1153207395887890496

  101. {9,21,2,5,15,2,28,18,3,24,15,13,16,21,19,4,12,0,14,11,8,16,26,7,5,11,24,25,1,8,9,23,2}

    Returns: 72061992084701184

  102. {0,0,0,0,0,0,0,0,0,0,4,6,3,5,4,4,30,3,10,24,0,6,12,12,11,18,25,18,8,17,18,0,1,20,14,16,28,2,11,19,19,9,12}

    Returns: 1152921504606851329

  103. {0,19,16,1,9,16,10,26,6,4,7,25,13,17,20,0,16,8,12,2,6,5,24,18,25,23,18,16,2,15,17}

    Returns: 4503874505277441

  104. {13,21,30,20,12,19,22,30,3,11,4,11,5,2,11,19,29,16,1,10,12,11,17,25,25,1,26,21,6,7,8}

    Returns: 1152943494906511360

  105. {16,3,0,1,2,1,6,27,27,9,10,16,24,11,8,15,0,2,20,8,7,20,21,7,28,19,15,13,5,14,21,20,26}

    Returns: 90071996842377216

  106. {0,6,4,1,12,1,10,9,8,0,10,29,16,10,11,24,3,2,17,29,5,14,5,14,23,19,27,22,13,1,23,14,9,20,26,25,15,24,18,14}

    Returns: 288511855440171009

  107. {0,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}

    Returns: 1537228672809129301

  108. {3, 23, 19, 21, 11, 25, 12, 7, 1, 3, 9, 28, 25, 13, 9, 5, 19, 14, 13, 18, 11, 28, 18, 2, 4, 5, 2, 8, 27, 14, 6, 6, 28, 21, 1, 29, 6, 29, 12, 20, 18, 13, 12, 8, 19, 24, 29, 5, 20, 18 }

    Returns: 379498637350142016


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: