DatasetRepo commited on
Commit
9f3adc3
·
verified ·
1 Parent(s): f6ac8cb

aa9f16787efe708ad3a07abcb7b77b12da828574e5773d4600a267c509cc6641

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +3 -0
  2. apply_operations_to_maximize_frequency_score/ocaml_tests/main.ml +0 -0
  3. apply_operations_to_maximize_frequency_score/scala_tests/MySuite.scala +0 -0
  4. apply_operations_to_maximize_score/haskell_tests/Main.hs +0 -0
  5. apply_operations_to_maximize_score/java_tests/Main.java +21 -0
  6. apply_operations_to_maximize_score/meta.json +3 -0
  7. apply_operations_to_maximize_score/ocaml_tests/main.ml +0 -0
  8. apply_operations_to_maximize_score/scala_tests/MySuite.scala +0 -0
  9. assign_elements_to_groups_with_constraints/haskell_tests/Main.hs +3 -0
  10. assign_elements_to_groups_with_constraints/java_tests/Main.java +25 -0
  11. assign_elements_to_groups_with_constraints/meta.json +3 -0
  12. assign_elements_to_groups_with_constraints/ocaml_tests/main.ml +0 -0
  13. assign_elements_to_groups_with_constraints/scala_tests/MySuite.scala +0 -0
  14. average_value_of_even_numbers_that_are_divisible_by_three/.DS_Store +0 -0
  15. average_value_of_even_numbers_that_are_divisible_by_three/haskell_tests/Main.hs +24 -0
  16. average_value_of_even_numbers_that_are_divisible_by_three/java_tests/Main.java +21 -0
  17. average_value_of_even_numbers_that_are_divisible_by_three/meta.json +0 -0
  18. average_value_of_even_numbers_that_are_divisible_by_three/ocaml_tests/main.ml +26 -0
  19. average_value_of_even_numbers_that_are_divisible_by_three/scala_tests/MySuite.scala +12 -0
  20. beautiful_towers_i/haskell_tests/Main.hs +44 -0
  21. beautiful_towers_i/java_tests/Main.java +24 -0
  22. beautiful_towers_i/meta.json +3283 -0
  23. beautiful_towers_i/ocaml_tests/main.ml +45 -0
  24. beautiful_towers_i/scala_tests/MySuite.scala +36 -0
  25. beautiful_towers_ii/haskell_tests/Main.hs +0 -0
  26. beautiful_towers_ii/java_tests/Main.java +24 -0
  27. beautiful_towers_ii/meta.json +0 -0
  28. beautiful_towers_ii/ocaml_tests/main.ml +0 -0
  29. beautiful_towers_ii/scala_tests/MySuite.scala +0 -0
  30. best_poker_hand/.DS_Store +0 -0
  31. best_poker_hand/haskell_tests/Main.hs +27 -0
  32. best_poker_hand/java_tests/Main.java +25 -0
  33. best_poker_hand/meta.json +222 -0
  34. best_poker_hand/ocaml_tests/main.ml +29 -0
  35. best_poker_hand/scala_tests/MySuite.scala +16 -0
  36. bitwise_xor_of_all_pairings/.DS_Store +0 -0
  37. bitwise_xor_of_all_pairings/haskell_tests/Main.hs +24 -0
  38. bitwise_xor_of_all_pairings/java_tests/Main.java +21 -0
  39. bitwise_xor_of_all_pairings/meta.json +26 -0
  40. bitwise_xor_of_all_pairings/ocaml_tests/main.ml +26 -0
  41. bitwise_xor_of_all_pairings/scala_tests/MySuite.scala +12 -0
  42. build_a_matrix_with_conditions/.DS_Store +0 -0
  43. build_a_matrix_with_conditions/haskell_tests/Main.hs +24 -0
  44. build_a_matrix_with_conditions/java_tests/Main.java +21 -0
  45. build_a_matrix_with_conditions/meta.json +0 -0
  46. build_a_matrix_with_conditions/ocaml_tests/main.ml +26 -0
  47. build_a_matrix_with_conditions/scala_tests/MySuite.scala +12 -0
  48. buy_two_chocolates/haskell_tests/Main.hs +45 -0
  49. buy_two_chocolates/java_tests/Main.java +21 -0
  50. buy_two_chocolates/meta.json +245 -0
.gitattributes CHANGED
@@ -64,3 +64,6 @@ alternating_groups_iii/meta.json filter=lfs diff=lfs merge=lfs -text
64
  append_k_integers_with_minimal_sum/meta.json filter=lfs diff=lfs merge=lfs -text
65
  apply_operations_on_array_to_maximize_sum_of_squares/meta.json filter=lfs diff=lfs merge=lfs -text
66
  apply_operations_to_maximize_frequency_score/meta.json filter=lfs diff=lfs merge=lfs -text
 
 
 
 
64
  append_k_integers_with_minimal_sum/meta.json filter=lfs diff=lfs merge=lfs -text
65
  apply_operations_on_array_to_maximize_sum_of_squares/meta.json filter=lfs diff=lfs merge=lfs -text
66
  apply_operations_to_maximize_frequency_score/meta.json filter=lfs diff=lfs merge=lfs -text
67
+ apply_operations_to_maximize_score/meta.json filter=lfs diff=lfs merge=lfs -text
68
+ assign_elements_to_groups_with_constraints/haskell_tests/Main.hs filter=lfs diff=lfs merge=lfs -text
69
+ assign_elements_to_groups_with_constraints/meta.json filter=lfs diff=lfs merge=lfs -text
apply_operations_to_maximize_frequency_score/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
apply_operations_to_maximize_frequency_score/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
apply_operations_to_maximize_score/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
apply_operations_to_maximize_score/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(81, maximumScore(new ArrayList<>(Arrays.asList(8,3,9,3,8)), 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(4788, maximumScore(new ArrayList<>(Arrays.asList(19,12,14,6,10,18)), 3));
19
+ }
20
+
21
+ }
apply_operations_to_maximize_score/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08fd5e2d0b140eec91c74a8a2ab39e16d697dd6956105e49e87126ba2fab6c62
3
+ size 11485068
apply_operations_to_maximize_score/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
apply_operations_to_maximize_score/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
assign_elements_to_groups_with_constraints/haskell_tests/Main.hs ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ac46aab4b4394979db68195c2ccb1127f936008da4dd3b5db4699583a513013
3
+ size 11359941
assign_elements_to_groups_with_constraints/java_tests/Main.java ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(new ArrayList<>(Arrays.asList(0,0,-1,1,0)), assignElements(new ArrayList<>(Arrays.asList(8,4,3,2,4)), new ArrayList<>(Arrays.asList(4,2))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(-1,1,0,-1)), assignElements(new ArrayList<>(Arrays.asList(2,3,5,7)), new ArrayList<>(Arrays.asList(5,3,3))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(new ArrayList<>(Arrays.asList(0,1,0,1)), assignElements(new ArrayList<>(Arrays.asList(10,21,30,41)), new ArrayList<>(Arrays.asList(2,1))));
23
+ }
24
+
25
+ }
assign_elements_to_groups_with_constraints/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09b7f93f422d5f8f602f70f0da5d0425f16bfd4676bab8c127e61f16cc4882d0
3
+ size 38777260
assign_elements_to_groups_with_constraints/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
assign_elements_to_groups_with_constraints/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
average_value_of_even_numbers_that_are_divisible_by_three/.DS_Store ADDED
Binary file (6.15 kB). View file
 
average_value_of_even_numbers_that_are_divisible_by_three/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (averageValue [1,3,6,10,12,15])," 9 (averageValue [1,3,6,10,12,15]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (averageValue [1,2,4,7,10])," 0 (averageValue [1,2,4,7,10]))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
average_value_of_even_numbers_that_are_divisible_by_three/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(9, averageValue(new ArrayList<>(Arrays.asList(1,3,6,10,12,15))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(0, averageValue(new ArrayList<>(Arrays.asList(1,2,4,7,10))));
19
+ }
20
+
21
+ }
average_value_of_even_numbers_that_are_divisible_by_three/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
average_value_of_even_numbers_that_are_divisible_by_three/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 9 (averageValue [1;3;6;10;12;15])
12
+
13
+ let test2 _ = assert_equal 0 (averageValue [1;2;4;7;10])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for averageValue" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
average_value_of_even_numbers_that_are_divisible_by_three/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.averageValue(List(1,3,6,10,12,15)), 9)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.averageValue(List(1,2,4,7,10)), 0)
10
+ }
11
+
12
+ }
beautiful_towers_i/haskell_tests/Main.hs ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+ maximumSumOfHeights :: [Int] -> Int
7
+ maximumSumOfHeights heights = undefined
8
+
9
+ --Program end
10
+
11
+ -- Test cases
12
+
13
+ test1 :: Test
14
+ test1 = TestCase (assertEqual "for (maximumSumOfHeights [5,3,4,1,1])," 13 (maximumSumOfHeights [5,3,4,1,1]))
15
+
16
+ test2 :: Test
17
+ test2 = TestCase (assertEqual "for (maximumSumOfHeights [6,5,3,9,2,7])," 22 (maximumSumOfHeights [6,5,3,9,2,7]))
18
+
19
+ test3 :: Test
20
+ test3 = TestCase (assertEqual "for (maximumSumOfHeights [3,2,5,5,2,3])," 18 (maximumSumOfHeights [3,2,5,5,2,3]))
21
+
22
+ test4 :: Test
23
+ test4 = TestCase (assertEqual "for (maximumSumOfHeights [461095276, 386639795, 873859621, 892139800, 82516304, 785970576, 553100365, 677118346, 850406943, 598758632, 637390625, 974451679, 319236936, 312383614, 59877712, 773224528, 753820008, 319787930, 264076871, 348733454, 654886345, 225449408, 895039995, 907127873, 62848268, 348609545, 810191280, 598381971, 566981259, 831172922, 629628391, 702582341, 733614337, 416039432, 398836464, 404940226, 3470894, 580849934, 776304548, 542638485, 196250913, 876391110, 241686483, 400996037, 578773496, 150667439, 811461760, 350606183, 882289231, 255297066, 39806978, 358764343, 810199897, 64759314, 140000321, 625450396, 686288032, 686161871, 83161870, 94858363, 233833592, 499323855, 992994771, 597734416, 206271624, 368103649, 24046666, 120733110, 388984908, 445911553, 459177933, 791680055, 83734582, 688837531, 908021794, 411312939, 877927717, 544862368, 707377197, 834962716, 149821711, 945898435, 777370970, 954712241, 634655483, 787323351, 714271241, 981833176, 679967775, 400126079, 254451367, 196517991, 348792002, 531858352, 719062368, 431990640, 519637454, 491165006, 9058816, 642190752, 108698992, 696881776, 611943276, 735912326, 513669965, 560225773, 81698284, 671564736, 888253775, 240304203, 342300216, 84108757, 451038736, 21950892, 538584903, 709795658, 579033963, 807181554, 831429179, 949250084, 303874746, 827312083, 809040931, 93472747, 480647222, 982274636, 704863957, 545039611, 466842571, 451567304, 442498795, 902079568, 322400185, 139877080, 396515305, 643537107, 256936739, 716331581, 452575423, 354361018, 747197160, 254214553, 199994355, 264500185, 448310322, 112146618, 47811962, 415761742, 982241461, 373161582, 376761708, 169282385, 805438683, 698746189, 475374735, 7737254, 610476409, 750043086, 205149594, 824138373, 106479320, 855761208, 347130241, 614201013, 860686165, 581305605, 901324873, 833425680, 243687643, 111303573, 15280706, 480805256, 362315486, 476190492, 918418275, 780343460, 583579962, 105733612, 291524091, 570946298, 175973598, 942892574, 637444119, 101344912, 523257121, 484292781, 705948330, 504269027, 965369659, 12776539, 572047448, 778031372, 931748065, 143517938, 440680755, 697015205, 567393516, 310088668, 576855888, 885400659, 35431032, 423463286, 376743742, 120990657, 386460453, 541143942, 116415718, 723467338, 276814686, 876195228, 196860368, 939018117, 426354321, 639129227, 280872679, 495394011, 272069484, 391877682, 387758536, 97430330, 120011202, 392541888, 479436521, 700890141, 92394400, 661692013, 482125907, 420226798, 346736899, 913845156, 974720679, 476675766, 222080816, 529570088, 630971646, 138650185, 214818888, 374188846, 277131287, 821091731, 414340231, 785181908, 667620487, 427405473, 503939995, 534799677, 905116716, 988838919, 772171744, 721250159, 12313847, 426426130, 134742987, 444004691, 524280082, 839125586, 980378778, 652785683, 72763682, 319046202, 891261574, 62344712, 6449656, 830222229, 712440255, 965318053, 917757700, 15049006, 440359516, 906649023, 493578105, 306794447, 818492015, 65408026, 294810842, 454338704, 936078134, 393347901, 807894063, 926360057, 858900653, 456587484, 737367357, 444795246, 551855388, 193044400, 192139016, 493705408, 716745734, 943709274, 945258189, 206568536, 786500696, 865972597, 627977415, 226173117, 743619674, 297311139, 743914914, 719001765, 378329821, 896922515, 372439157, 991804379, 993912045, 538147267, 843222218, 165814768, 367995916, 632223098, 225447699, 110531119, 273223118, 853526600, 453220994, 944451714, 835460216, 388709121, 653513401, 608948501, 789372890, 637479025, 847533840, 550365224, 31460159, 121309553, 726082875, 398853963, 919501890, 929583234, 86186536, 222825606, 572316333, 762412144, 373828084, 377715356, 357920551, 107734292, 722401541, 648765037, 843011089, 871690143, 833184665, 618447338, 950453002, 618394744, 273096456, 528536506, 368596818, 672389838, 427850541, 197929941, 596041987, 917796372, 202672856, 553232360, 456687629, 173166875, 430719354, 345527883, 856019642, 103768759, 500914629, 813073321, 45959012, 981168755, 966719300, 685841525, 976479663, 496717948, 434198947, 852580769, 259014796, 585434867, 670196688, 363028211, 444430262, 475356575, 154896759, 185410352, 507727918, 846049566, 26924850, 830925567, 857098717, 545592455, 292925684, 391938446, 534704878, 839820354, 702897464, 976376547, 101996688, 464274791, 773577807, 698460121, 806800162, 932674647, 590402864, 837572015, 667380110, 674554973, 269085208, 845961128, 268011421, 935918127, 131095551, 606497761, 947821559, 635142377, 78432792, 105933739, 436184938, 993006363, 660772685, 190424187, 593506323, 135528488, 247006536, 598258484, 14407842, 798725043, 177496387, 952834982])," 17158105543 (maximumSumOfHeights [461095276, 386639795, 873859621, 892139800, 82516304, 785970576, 553100365, 677118346, 850406943, 598758632, 637390625, 974451679, 319236936, 312383614, 59877712, 773224528, 753820008, 319787930, 264076871, 348733454, 654886345, 225449408, 895039995, 907127873, 62848268, 348609545, 810191280, 598381971, 566981259, 831172922, 629628391, 702582341, 733614337, 416039432, 398836464, 404940226, 3470894, 580849934, 776304548, 542638485, 196250913, 876391110, 241686483, 400996037, 578773496, 150667439, 811461760, 350606183, 882289231, 255297066, 39806978, 358764343, 810199897, 64759314, 140000321, 625450396, 686288032, 686161871, 83161870, 94858363, 233833592, 499323855, 992994771, 597734416, 206271624, 368103649, 24046666, 120733110, 388984908, 445911553, 459177933, 791680055, 83734582, 688837531, 908021794, 411312939, 877927717, 544862368, 707377197, 834962716, 149821711, 945898435, 777370970, 954712241, 634655483, 787323351, 714271241, 981833176, 679967775, 400126079, 254451367, 196517991, 348792002, 531858352, 719062368, 431990640, 519637454, 491165006, 9058816, 642190752, 108698992, 696881776, 611943276, 735912326, 513669965, 560225773, 81698284, 671564736, 888253775, 240304203, 342300216, 84108757, 451038736, 21950892, 538584903, 709795658, 579033963, 807181554, 831429179, 949250084, 303874746, 827312083, 809040931, 93472747, 480647222, 982274636, 704863957, 545039611, 466842571, 451567304, 442498795, 902079568, 322400185, 139877080, 396515305, 643537107, 256936739, 716331581, 452575423, 354361018, 747197160, 254214553, 199994355, 264500185, 448310322, 112146618, 47811962, 415761742, 982241461, 373161582, 376761708, 169282385, 805438683, 698746189, 475374735, 7737254, 610476409, 750043086, 205149594, 824138373, 106479320, 855761208, 347130241, 614201013, 860686165, 581305605, 901324873, 833425680, 243687643, 111303573, 15280706, 480805256, 362315486, 476190492, 918418275, 780343460, 583579962, 105733612, 291524091, 570946298, 175973598, 942892574, 637444119, 101344912, 523257121, 484292781, 705948330, 504269027, 965369659, 12776539, 572047448, 778031372, 931748065, 143517938, 440680755, 697015205, 567393516, 310088668, 576855888, 885400659, 35431032, 423463286, 376743742, 120990657, 386460453, 541143942, 116415718, 723467338, 276814686, 876195228, 196860368, 939018117, 426354321, 639129227, 280872679, 495394011, 272069484, 391877682, 387758536, 97430330, 120011202, 392541888, 479436521, 700890141, 92394400, 661692013, 482125907, 420226798, 346736899, 913845156, 974720679, 476675766, 222080816, 529570088, 630971646, 138650185, 214818888, 374188846, 277131287, 821091731, 414340231, 785181908, 667620487, 427405473, 503939995, 534799677, 905116716, 988838919, 772171744, 721250159, 12313847, 426426130, 134742987, 444004691, 524280082, 839125586, 980378778, 652785683, 72763682, 319046202, 891261574, 62344712, 6449656, 830222229, 712440255, 965318053, 917757700, 15049006, 440359516, 906649023, 493578105, 306794447, 818492015, 65408026, 294810842, 454338704, 936078134, 393347901, 807894063, 926360057, 858900653, 456587484, 737367357, 444795246, 551855388, 193044400, 192139016, 493705408, 716745734, 943709274, 945258189, 206568536, 786500696, 865972597, 627977415, 226173117, 743619674, 297311139, 743914914, 719001765, 378329821, 896922515, 372439157, 991804379, 993912045, 538147267, 843222218, 165814768, 367995916, 632223098, 225447699, 110531119, 273223118, 853526600, 453220994, 944451714, 835460216, 388709121, 653513401, 608948501, 789372890, 637479025, 847533840, 550365224, 31460159, 121309553, 726082875, 398853963, 919501890, 929583234, 86186536, 222825606, 572316333, 762412144, 373828084, 377715356, 357920551, 107734292, 722401541, 648765037, 843011089, 871690143, 833184665, 618447338, 950453002, 618394744, 273096456, 528536506, 368596818, 672389838, 427850541, 197929941, 596041987, 917796372, 202672856, 553232360, 456687629, 173166875, 430719354, 345527883, 856019642, 103768759, 500914629, 813073321, 45959012, 981168755, 966719300, 685841525, 976479663, 496717948, 434198947, 852580769, 259014796, 585434867, 670196688, 363028211, 444430262, 475356575, 154896759, 185410352, 507727918, 846049566, 26924850, 830925567, 857098717, 545592455, 292925684, 391938446, 534704878, 839820354, 702897464, 976376547, 101996688, 464274791, 773577807, 698460121, 806800162, 932674647, 590402864, 837572015, 667380110, 674554973, 269085208, 845961128, 268011421, 935918127, 131095551, 606497761, 947821559, 635142377, 78432792, 105933739, 436184938, 993006363, 660772685, 190424187, 593506323, 135528488, 247006536, 598258484, 14407842, 798725043, 177496387, 952834982]))
24
+
25
+ test5 :: Test
26
+ test5 = TestCase (assertEqual "for (maximumSumOfHeights [907280058, 869376860, 854663685, 724511174, 357575887, 554601152, 937815738, 592437413, 992324857, 878495940, 17450552, 956432545, 804037092, 677837122, 694998479, 156762276, 955878302, 665780760, 112590518, 206803239, 553709274, 977333507, 42914022, 727817882, 949565522, 929356052, 821163730, 718397171, 153319605, 461193802, 789116137, 925605936, 802825886, 4737558, 11647712, 31189628, 942544256, 770042957, 395278757, 985733882, 123533901, 352242508, 40259458, 53501312, 539100225, 313069975, 405177308, 659044744, 284605989, 816626669, 918521271, 18239953, 276592645, 700050801, 38981362, 225961863, 46257112, 165334748, 236853795, 330921988, 768046016, 468836367, 768867591, 241190251, 154176258, 22335657, 949023192, 860545730, 805252393, 87221731, 776545542, 463480071, 402535206, 600906414, 389636841, 897829208, 140770278, 653323553, 921504312, 821487086, 873563035, 963692200, 461479036, 22708227, 529098620, 324691179, 938766376, 285418428, 897924225, 964545685, 549528092, 107339534, 565997299, 347026474, 192397458, 703149593, 39965638, 512937318, 997398536, 876923456, 115670903, 47064731, 90047526, 157492826, 807443800, 570877161, 358127496, 633705563, 164596493, 249397364, 356949161, 195958184, 769414933, 318511504, 262607666, 786449636, 615136310, 598195355, 836171069, 650874042, 603829588, 749642104, 321098959, 711418221, 527606075, 828808943, 678037729, 140290247, 113081094, 723084737, 185748697, 774770559, 869803837, 111914410, 722673287, 776295962, 315220696, 191649107, 815581512, 989959866, 440552460, 954917947, 51832643, 905359234, 773143062, 656936019, 694396762, 230381678, 210807153, 350381952, 808610035, 6255600, 34540935, 209273851, 850049691, 858488382, 518231702, 352113465, 62780225, 282807698, 831007791, 650980005, 574846098, 61553545, 274523676, 711602218, 385129492, 847405724, 926456940, 748171699, 449810302, 977518246, 985455433, 407941158, 944376098, 961465481, 397544002, 303218493, 232461671, 825676404, 73156937, 793859512, 229878239, 588044040, 885332225, 512768388, 861633285, 389606930, 694205634, 194738823, 879852754, 815534297, 976940265, 483320339, 549677209, 850304406, 537645732, 763800735, 285775368, 256937213, 626323579, 129602042, 164697882, 858050839, 508655093, 92498001, 413904133, 572605135, 938286180, 845867960, 331523486, 870971097, 742327289, 166738298, 852205239, 878706851, 518111783, 493899427, 625687318, 508889267, 975932896, 366338365, 586089838, 400821155, 519465376, 148599366, 233385079, 813214982, 213016271, 92651775, 915860250, 347210612, 138592882, 954499279, 193516954, 418315160, 334344868, 745343952, 661884753, 928697299, 896202641, 774306109, 433312680, 61535626, 551137703, 291277716, 569084857, 560850824, 207761645, 344411585, 541493117, 385881591, 527167296, 972233327, 435058595, 460703083, 808370051, 852361167, 842857436, 811548314, 71840691, 850230266, 444048795, 719568642, 841077643, 37374268, 910911036, 380889602, 591441142, 322484405, 686543010, 312730410, 296791668, 485513569, 762038181, 223210260, 208949131, 427736469, 854695282, 760863108, 644991768, 347597952, 617800021, 19052932, 893751395, 890515798, 740708512, 38270286, 79536163, 508038945, 950953359, 890422385, 608498474, 814271884, 134656944, 145958542, 919211570, 65580922, 831269158, 920725364, 758904322, 837289035, 909873432, 751347744, 571322117, 412310164, 554173921, 103197044, 321531552, 244143119, 606838431, 194182488, 595422111, 520145167, 779150926, 290754911, 514905902, 396823286, 638387592, 821376592, 250422322, 641508719, 443196302, 434432513, 580876960, 939807718, 679698500, 11928162, 617383215, 908103245, 955672507, 767518600, 506326023, 689470888, 555604927, 522942640, 653657429, 235305617, 297446847, 779782477, 208904077, 424325305, 956283053, 770105711, 441349935, 815608638, 18405552, 658812718, 972528815, 369404560, 183684391, 124265017, 267910927, 356894296, 111621739, 529345682, 104542192, 413221077, 320826511, 22878970, 936015591, 521358984, 707820868, 395512066, 77004612, 679404096, 522336398, 793321689, 559568738, 508685973, 578049973, 444891489, 503407698, 318836053, 348514436, 731735990, 144125725, 286678449, 527619095, 757313658, 594982669, 941157496, 232274069, 347985723, 773072315, 465547591, 461633227, 117732755, 810251922, 973570259, 690079220, 862125590, 405390982, 929531742, 919050452, 148479573, 469923670, 882510483, 938455480, 323804525, 807154980, 299129215, 512698337, 983783156, 751763213, 749312006, 815493791, 967738640, 225493197, 63704527, 296466004, 378971759, 296064821, 293022007, 138037379, 406318776, 92301376, 891215287, 713880959, 210068289, 74761488, 404205329, 887848476, 377336575, 598591425, 740241469, 579039655, 707424303, 743508880, 508044416, 933801198, 417336607, 6641719, 632493878, 829949634, 934986008, 117558839, 793324833, 691881415, 158669788, 673145144, 820731009, 32414445, 611205310, 581553561, 299672197, 50087294, 763828341, 54649639, 34603442, 136776772, 734063953, 191306524, 411957664, 306220597, 641010972, 732062230, 294024691, 676209669, 855152945, 110310116, 441955786, 764396778, 960076821, 986605635, 240924926, 89200253, 883564498, 213610179, 794284614, 180504879, 311532380, 103685117, 29318893, 859497914, 123022643, 642491134, 506975174, 539188342, 653062362, 370329281, 899862913, 865854570, 833716225, 201342523, 732034769, 858640413, 383934495, 105403121, 922169592, 714395656, 262004557, 995525106, 271470066, 898640808, 223086637, 300555377, 251021366, 973949389, 106904706, 905028403, 124542256, 18729468, 927960082, 130713489, 42978748, 375630436, 784068231, 105581268, 745310754, 982387885, 208110234, 998472740, 950242139, 361480170, 605835061, 378791938, 385426704, 173490007, 840989527, 750889691, 558296961, 592578382, 543430494, 863101818, 452224004, 806813385, 262208764, 451457428, 668767606, 992312960, 53772933, 932568167, 515094846, 218715670, 117192714, 160127821, 347549713, 358842285, 42881586, 157404256, 162188817, 987671544, 34352859, 285529186, 187037073, 185282309, 613176701, 583805804, 415389541, 982504602, 582655326, 692944767, 791060529, 653901743, 758139384, 412842816, 591346325, 284856664, 604258399, 57101119, 417373117, 552335265, 306923153, 658164059, 693325423, 712496532, 243341024, 954079355, 954171997, 332665840, 100123831, 516429516, 224486773, 736914487, 103798490, 748436667, 460116016, 154132405, 133096029, 327951209, 693862799, 743760820, 368227215, 83833428, 706476338, 597799039, 887903365, 808868241, 819069341, 798366030, 409741371, 331989592, 974380265, 355152189, 502669015, 299669502, 658698592, 260721334, 756907437, 106131102, 554228613, 675166664, 316108544, 41960962, 258077325, 369512709, 418350618, 874766574, 376087919, 480195102, 610217443, 481367251, 17850657, 923139615, 773487855, 907166850, 818613197, 707741058, 538447172, 654448469, 301727530, 854575979, 617288980, 495740226, 384519077, 96426684, 36766398, 271761898, 80220413, 889315125, 460099516, 108304710, 648352858, 7314411, 220769737, 69095862, 850716074, 934288426, 603365099, 27452685, 423573676, 171631012, 219605931, 190726232, 619001091, 691641432, 404661929, 912200580, 60191502, 114705589, 563699388, 502459100, 582493068, 84088001, 496103606, 621610493, 907612877, 432882558, 881745477, 663664476, 45545571, 375574995, 364910810, 36413928, 158330550, 5056208, 170778091, 716452055, 974143473, 737038596, 67187161, 163282278, 239947775, 441358930, 938040191, 485374724, 760133531, 121152843, 192270637, 395353794, 628034439, 918570527, 421180159, 957821999, 872665061, 416003792, 541658539, 235698501, 206801418, 958944011, 772092674, 635997681, 756922613, 778723951, 595778086, 452249410, 278650048, 154538094, 593808447, 247046746, 645506659, 713209009, 362796769, 287679252, 211356787, 675393910, 648795529, 678918204, 181634500, 671169987, 243628940, 898107096, 606668651, 685422894, 948167874, 888202254, 602499367, 478380012, 660152465, 381546363, 573378116, 290546006, 519278660, 447312924, 226571410, 345078210, 21942937, 906487017, 748462085, 966453564, 660629529, 572178985, 30369095, 820953554, 521458401, 733228100, 706817886, 717736765, 859096943, 271561561, 961962384, 686499326, 789113257, 728015311, 234569562, 176116950, 537062437, 131187094, 838359764, 928432705, 277392721, 487093702, 415133899, 508578527, 614543521, 299349724, 17067654, 468477789, 266431305, 155320037, 122788656, 995651255, 245222103, 68691493, 851818713, 781600183, 979428001, 229131401, 313782109, 206489574, 472639045, 131994347, 33955895, 75839517, 701548425, 348529295, 234858359, 768882164, 7942677, 582139035, 621573387, 963435878, 967466898, 438075339, 911237022, 95282977, 296359508, 185726524, 21904235, 361730657, 759702368, 647093522, 415383055, 683639222, 691390411, 610235602, 199808090, 807009282, 38139895, 781786745, 310673206, 644914484, 213440225, 996327208, 646706306, 333518248, 630897579, 343255060, 131569387, 119573855, 112859612, 970824241, 183344288, 228657096, 629723452, 539791789, 967840886, 91137026, 127476119, 635470909, 826763616, 332750951, 474745742, 899517271, 232176115, 566884335, 963257190, 150004864, 286052863, 528233164, 390683191, 356865821, 638086204, 134714372, 683006182, 861120330, 760500517, 801720335, 142770209, 885664, 422751155, 906172245, 355580779, 444008582, 641496412, 569363180, 740393282, 626331121, 556107009, 738523784, 10521847, 820942454, 273092212, 805962000, 391860327, 726362960, 36305476, 997980139, 800133966, 214166604, 290174977, 553193710, 642912500, 130930501, 322147194, 188402765, 341690028, 499941060, 215811874, 565343097, 549268802, 912853119, 745677765, 835028225, 192007950, 590689710, 706754977, 346650674, 830600308, 116085278, 712200936, 705464333, 195831126, 486717000, 280041715, 888717645, 35969889, 881742578, 812953177, 622106874, 927489678, 576980430, 434571625, 906453207, 369384424, 308262272, 181218708, 427131182, 495473454, 39550886, 174247909, 437188682, 404995219, 249872322, 883607067, 753744310, 746127688, 266864206, 734661814, 71224714, 626051565, 922111874, 392695472, 989975594, 562080577, 755901281, 806968548, 658118435, 110920694])," 21086879764 (maximumSumOfHeights [907280058, 869376860, 854663685, 724511174, 357575887, 554601152, 937815738, 592437413, 992324857, 878495940, 17450552, 956432545, 804037092, 677837122, 694998479, 156762276, 955878302, 665780760, 112590518, 206803239, 553709274, 977333507, 42914022, 727817882, 949565522, 929356052, 821163730, 718397171, 153319605, 461193802, 789116137, 925605936, 802825886, 4737558, 11647712, 31189628, 942544256, 770042957, 395278757, 985733882, 123533901, 352242508, 40259458, 53501312, 539100225, 313069975, 405177308, 659044744, 284605989, 816626669, 918521271, 18239953, 276592645, 700050801, 38981362, 225961863, 46257112, 165334748, 236853795, 330921988, 768046016, 468836367, 768867591, 241190251, 154176258, 22335657, 949023192, 860545730, 805252393, 87221731, 776545542, 463480071, 402535206, 600906414, 389636841, 897829208, 140770278, 653323553, 921504312, 821487086, 873563035, 963692200, 461479036, 22708227, 529098620, 324691179, 938766376, 285418428, 897924225, 964545685, 549528092, 107339534, 565997299, 347026474, 192397458, 703149593, 39965638, 512937318, 997398536, 876923456, 115670903, 47064731, 90047526, 157492826, 807443800, 570877161, 358127496, 633705563, 164596493, 249397364, 356949161, 195958184, 769414933, 318511504, 262607666, 786449636, 615136310, 598195355, 836171069, 650874042, 603829588, 749642104, 321098959, 711418221, 527606075, 828808943, 678037729, 140290247, 113081094, 723084737, 185748697, 774770559, 869803837, 111914410, 722673287, 776295962, 315220696, 191649107, 815581512, 989959866, 440552460, 954917947, 51832643, 905359234, 773143062, 656936019, 694396762, 230381678, 210807153, 350381952, 808610035, 6255600, 34540935, 209273851, 850049691, 858488382, 518231702, 352113465, 62780225, 282807698, 831007791, 650980005, 574846098, 61553545, 274523676, 711602218, 385129492, 847405724, 926456940, 748171699, 449810302, 977518246, 985455433, 407941158, 944376098, 961465481, 397544002, 303218493, 232461671, 825676404, 73156937, 793859512, 229878239, 588044040, 885332225, 512768388, 861633285, 389606930, 694205634, 194738823, 879852754, 815534297, 976940265, 483320339, 549677209, 850304406, 537645732, 763800735, 285775368, 256937213, 626323579, 129602042, 164697882, 858050839, 508655093, 92498001, 413904133, 572605135, 938286180, 845867960, 331523486, 870971097, 742327289, 166738298, 852205239, 878706851, 518111783, 493899427, 625687318, 508889267, 975932896, 366338365, 586089838, 400821155, 519465376, 148599366, 233385079, 813214982, 213016271, 92651775, 915860250, 347210612, 138592882, 954499279, 193516954, 418315160, 334344868, 745343952, 661884753, 928697299, 896202641, 774306109, 433312680, 61535626, 551137703, 291277716, 569084857, 560850824, 207761645, 344411585, 541493117, 385881591, 527167296, 972233327, 435058595, 460703083, 808370051, 852361167, 842857436, 811548314, 71840691, 850230266, 444048795, 719568642, 841077643, 37374268, 910911036, 380889602, 591441142, 322484405, 686543010, 312730410, 296791668, 485513569, 762038181, 223210260, 208949131, 427736469, 854695282, 760863108, 644991768, 347597952, 617800021, 19052932, 893751395, 890515798, 740708512, 38270286, 79536163, 508038945, 950953359, 890422385, 608498474, 814271884, 134656944, 145958542, 919211570, 65580922, 831269158, 920725364, 758904322, 837289035, 909873432, 751347744, 571322117, 412310164, 554173921, 103197044, 321531552, 244143119, 606838431, 194182488, 595422111, 520145167, 779150926, 290754911, 514905902, 396823286, 638387592, 821376592, 250422322, 641508719, 443196302, 434432513, 580876960, 939807718, 679698500, 11928162, 617383215, 908103245, 955672507, 767518600, 506326023, 689470888, 555604927, 522942640, 653657429, 235305617, 297446847, 779782477, 208904077, 424325305, 956283053, 770105711, 441349935, 815608638, 18405552, 658812718, 972528815, 369404560, 183684391, 124265017, 267910927, 356894296, 111621739, 529345682, 104542192, 413221077, 320826511, 22878970, 936015591, 521358984, 707820868, 395512066, 77004612, 679404096, 522336398, 793321689, 559568738, 508685973, 578049973, 444891489, 503407698, 318836053, 348514436, 731735990, 144125725, 286678449, 527619095, 757313658, 594982669, 941157496, 232274069, 347985723, 773072315, 465547591, 461633227, 117732755, 810251922, 973570259, 690079220, 862125590, 405390982, 929531742, 919050452, 148479573, 469923670, 882510483, 938455480, 323804525, 807154980, 299129215, 512698337, 983783156, 751763213, 749312006, 815493791, 967738640, 225493197, 63704527, 296466004, 378971759, 296064821, 293022007, 138037379, 406318776, 92301376, 891215287, 713880959, 210068289, 74761488, 404205329, 887848476, 377336575, 598591425, 740241469, 579039655, 707424303, 743508880, 508044416, 933801198, 417336607, 6641719, 632493878, 829949634, 934986008, 117558839, 793324833, 691881415, 158669788, 673145144, 820731009, 32414445, 611205310, 581553561, 299672197, 50087294, 763828341, 54649639, 34603442, 136776772, 734063953, 191306524, 411957664, 306220597, 641010972, 732062230, 294024691, 676209669, 855152945, 110310116, 441955786, 764396778, 960076821, 986605635, 240924926, 89200253, 883564498, 213610179, 794284614, 180504879, 311532380, 103685117, 29318893, 859497914, 123022643, 642491134, 506975174, 539188342, 653062362, 370329281, 899862913, 865854570, 833716225, 201342523, 732034769, 858640413, 383934495, 105403121, 922169592, 714395656, 262004557, 995525106, 271470066, 898640808, 223086637, 300555377, 251021366, 973949389, 106904706, 905028403, 124542256, 18729468, 927960082, 130713489, 42978748, 375630436, 784068231, 105581268, 745310754, 982387885, 208110234, 998472740, 950242139, 361480170, 605835061, 378791938, 385426704, 173490007, 840989527, 750889691, 558296961, 592578382, 543430494, 863101818, 452224004, 806813385, 262208764, 451457428, 668767606, 992312960, 53772933, 932568167, 515094846, 218715670, 117192714, 160127821, 347549713, 358842285, 42881586, 157404256, 162188817, 987671544, 34352859, 285529186, 187037073, 185282309, 613176701, 583805804, 415389541, 982504602, 582655326, 692944767, 791060529, 653901743, 758139384, 412842816, 591346325, 284856664, 604258399, 57101119, 417373117, 552335265, 306923153, 658164059, 693325423, 712496532, 243341024, 954079355, 954171997, 332665840, 100123831, 516429516, 224486773, 736914487, 103798490, 748436667, 460116016, 154132405, 133096029, 327951209, 693862799, 743760820, 368227215, 83833428, 706476338, 597799039, 887903365, 808868241, 819069341, 798366030, 409741371, 331989592, 974380265, 355152189, 502669015, 299669502, 658698592, 260721334, 756907437, 106131102, 554228613, 675166664, 316108544, 41960962, 258077325, 369512709, 418350618, 874766574, 376087919, 480195102, 610217443, 481367251, 17850657, 923139615, 773487855, 907166850, 818613197, 707741058, 538447172, 654448469, 301727530, 854575979, 617288980, 495740226, 384519077, 96426684, 36766398, 271761898, 80220413, 889315125, 460099516, 108304710, 648352858, 7314411, 220769737, 69095862, 850716074, 934288426, 603365099, 27452685, 423573676, 171631012, 219605931, 190726232, 619001091, 691641432, 404661929, 912200580, 60191502, 114705589, 563699388, 502459100, 582493068, 84088001, 496103606, 621610493, 907612877, 432882558, 881745477, 663664476, 45545571, 375574995, 364910810, 36413928, 158330550, 5056208, 170778091, 716452055, 974143473, 737038596, 67187161, 163282278, 239947775, 441358930, 938040191, 485374724, 760133531, 121152843, 192270637, 395353794, 628034439, 918570527, 421180159, 957821999, 872665061, 416003792, 541658539, 235698501, 206801418, 958944011, 772092674, 635997681, 756922613, 778723951, 595778086, 452249410, 278650048, 154538094, 593808447, 247046746, 645506659, 713209009, 362796769, 287679252, 211356787, 675393910, 648795529, 678918204, 181634500, 671169987, 243628940, 898107096, 606668651, 685422894, 948167874, 888202254, 602499367, 478380012, 660152465, 381546363, 573378116, 290546006, 519278660, 447312924, 226571410, 345078210, 21942937, 906487017, 748462085, 966453564, 660629529, 572178985, 30369095, 820953554, 521458401, 733228100, 706817886, 717736765, 859096943, 271561561, 961962384, 686499326, 789113257, 728015311, 234569562, 176116950, 537062437, 131187094, 838359764, 928432705, 277392721, 487093702, 415133899, 508578527, 614543521, 299349724, 17067654, 468477789, 266431305, 155320037, 122788656, 995651255, 245222103, 68691493, 851818713, 781600183, 979428001, 229131401, 313782109, 206489574, 472639045, 131994347, 33955895, 75839517, 701548425, 348529295, 234858359, 768882164, 7942677, 582139035, 621573387, 963435878, 967466898, 438075339, 911237022, 95282977, 296359508, 185726524, 21904235, 361730657, 759702368, 647093522, 415383055, 683639222, 691390411, 610235602, 199808090, 807009282, 38139895, 781786745, 310673206, 644914484, 213440225, 996327208, 646706306, 333518248, 630897579, 343255060, 131569387, 119573855, 112859612, 970824241, 183344288, 228657096, 629723452, 539791789, 967840886, 91137026, 127476119, 635470909, 826763616, 332750951, 474745742, 899517271, 232176115, 566884335, 963257190, 150004864, 286052863, 528233164, 390683191, 356865821, 638086204, 134714372, 683006182, 861120330, 760500517, 801720335, 142770209, 885664, 422751155, 906172245, 355580779, 444008582, 641496412, 569363180, 740393282, 626331121, 556107009, 738523784, 10521847, 820942454, 273092212, 805962000, 391860327, 726362960, 36305476, 997980139, 800133966, 214166604, 290174977, 553193710, 642912500, 130930501, 322147194, 188402765, 341690028, 499941060, 215811874, 565343097, 549268802, 912853119, 745677765, 835028225, 192007950, 590689710, 706754977, 346650674, 830600308, 116085278, 712200936, 705464333, 195831126, 486717000, 280041715, 888717645, 35969889, 881742578, 812953177, 622106874, 927489678, 576980430, 434571625, 906453207, 369384424, 308262272, 181218708, 427131182, 495473454, 39550886, 174247909, 437188682, 404995219, 249872322, 883607067, 753744310, 746127688, 266864206, 734661814, 71224714, 626051565, 922111874, 392695472, 989975594, 562080577, 755901281, 806968548, 658118435, 110920694]))
27
+
28
+ test6 :: Test
29
+ test6 = TestCase (assertEqual "for (maximumSumOfHeights [424606157, 868454057, 655926406, 762331124, 781007349, 25855609, 570337160, 81881830, 737899152, 312953431, 884938070, 235997467, 86058582, 815302859, 827527803, 544397461, 946318394, 356108153, 504015276, 427220221, 441271269, 31069231, 107818372, 52872058, 19848961, 330553928, 372003325, 737995396, 525942199, 401049977, 26726601, 979515788, 686337488, 770132231, 375088663, 991406714, 346788757, 289503141, 455306773, 178956050, 913809654, 275241557, 533300593, 461111987, 543237880, 608368438, 335171062, 675189964, 155074983, 758418989, 744258102, 974125618, 77927545, 713767968, 281155999, 21136709, 273804857, 950268204, 406663351, 702375623, 488537248, 915974358, 164891558, 190002552, 116587122, 370130084, 323681679, 696729073, 834934402, 628314849, 869524077, 231452623, 757609035, 23736135, 860659235, 181166350, 375604662, 304353680, 966671049, 735531524, 635797963, 305188124, 314552267, 298391059, 78545067, 263046541, 474262081, 922779117, 345985130, 642600391, 854275521, 306914969, 907582100, 798306637, 556785913, 187973090, 522310602, 711312015, 218472727, 88732618, 554238248, 227989467, 45365896, 774444438, 108846514, 326515214, 325065303, 251031880, 644311889, 167287703, 85204377, 868230181, 218266343, 744160377, 263854367, 244331712, 58844021, 903118259, 556287612, 190019233, 771859125, 342169397, 784733603, 238933499, 266178099, 516144760, 368890028, 667729610, 434066251, 202714480, 818461815, 854965399, 560715322, 454355059, 76432474, 656735994, 679447073, 704379861, 387127546, 983223219, 697044450, 561346869, 673964174, 114245755, 449714614, 785320588, 362896289, 57924709, 80015761, 537433189, 891746640, 144215527, 583050470, 281281821, 749663957, 125280947, 577503881, 507127357, 108628346, 142177361, 784462143, 721687750, 931718105, 29754667, 29208398, 977520400, 573193813, 866767172, 827175662, 589614103, 20615978, 711472113, 140858912, 413191106, 666654690, 56880625, 582281368, 303562665, 179724814, 227016583, 946491552, 866413166, 500024195, 920595438, 400748985, 288687709, 694700493, 920269270, 59632072, 546445586, 278555116, 450371127, 296763710, 155824082, 492019330, 300409610, 785064338, 379344940, 370932636, 853900020, 611290894, 581565453, 524955087, 751838654, 69164078, 771871184, 134568093, 862937525, 973435729, 654991468, 903994029, 202017348, 211821339, 918758225, 750466248, 707940663, 988570936, 353248311, 169809386, 12466109, 926429933, 68721569, 320245734, 140973873, 478987459, 184153875, 245644797, 560249473, 227631268, 340854964, 193767502, 919178674, 591530493, 900311978, 665261784, 669196522, 90400609, 274035862, 576961321, 355974973, 53101315, 511565237, 649854805, 382442072, 964893056, 602076069, 240342719, 658379798, 68178147, 669535029, 706663739, 416602389, 952407754, 646136040, 923991660, 624760968, 610630550, 394385581, 67744313, 194398744, 123954825, 859969001, 723743900, 217516228, 445858283, 878103916, 144473239, 342386250, 510919517, 377195171, 178433441, 767718879, 497965694, 686730537, 778768843, 242051661, 552753137, 785759839, 559299151, 909142441, 19319268, 419516906, 654019870, 605614378, 255491975, 527298072, 64779396, 478021401, 659045830, 766873821, 827969129, 673691819, 30365618, 960896766, 335097708, 489798109, 921830007, 870164787, 397261062, 622360329, 265427231, 706961899, 489120306, 565219862, 517274109, 178179911, 392584532, 398168359, 584999271, 599349068, 956247333, 669268372, 740633549, 367044198, 131208311, 136764698, 159858313, 548563514, 539813495, 482583735, 231032496, 56339918, 832002582, 437851358, 399382523, 808324321, 637459653, 391082127, 748156649, 126745564, 134272722, 765127694, 495404820, 297024658, 528430277, 462294099, 963565773, 469139409, 164191045, 828315666, 94436003, 656962525, 320207813, 81381744, 430428845, 118840139, 221836425, 852061224, 663646746, 432640065, 340408363, 916462826, 740636639, 965314087, 249134027, 357437555, 783662677, 959003618, 117779909, 495285889, 831385384, 511631262, 492121037, 779873555, 518203636, 586177914, 421687143, 369860335, 38658346, 670051264, 867121706, 912438125, 234494851, 971672226, 510298928, 226678346, 877815693, 812353194, 706620702, 564809286, 72154289, 116284180, 798849358, 193967092, 176614494, 229190066, 262282194, 48232542, 199835280, 920156238, 279010252, 246398634, 820992055, 338237260, 164567059, 431568261, 927216919, 323557761, 869886071, 888202210, 772949535, 569048048, 437134924, 914786836, 28876991, 467955658, 890127756, 943805096, 678478238, 835946260, 573773321, 25684875, 385829009, 135464298, 635338091, 824321911, 533758288, 692877528, 518653213, 427198719, 221885017, 382051126, 22094263, 520432351, 636963297, 381797747, 694307457, 523576875, 476510365, 485176822, 245411365, 445749010, 508290479, 971662211, 977383047, 255154004, 614121625, 393910624, 85020022, 22085371, 894921648, 256200279, 487534889, 167467436, 992429680, 558073444, 964630476, 806752623, 792760887, 595219021, 545989710, 13419880, 845956600, 385278405, 567069241, 148751919, 980548777, 309077876, 929669901, 244356340, 652410431, 776395412, 279847656, 121852842, 371053605, 819943711, 172876020, 169566739, 863698781, 69904254, 203432029, 164262275, 33145069, 746452383, 501107506, 518837227, 41103147, 800132215, 428771377, 477581888, 665130503, 939578870, 228709542, 138196179, 404632052, 466187409, 40936142, 293802515, 998329989, 130148363, 706213219, 918100558, 617385012, 943006814, 108772603, 838778853, 582382918, 940155581, 703646063])," 17966263596 (maximumSumOfHeights [424606157, 868454057, 655926406, 762331124, 781007349, 25855609, 570337160, 81881830, 737899152, 312953431, 884938070, 235997467, 86058582, 815302859, 827527803, 544397461, 946318394, 356108153, 504015276, 427220221, 441271269, 31069231, 107818372, 52872058, 19848961, 330553928, 372003325, 737995396, 525942199, 401049977, 26726601, 979515788, 686337488, 770132231, 375088663, 991406714, 346788757, 289503141, 455306773, 178956050, 913809654, 275241557, 533300593, 461111987, 543237880, 608368438, 335171062, 675189964, 155074983, 758418989, 744258102, 974125618, 77927545, 713767968, 281155999, 21136709, 273804857, 950268204, 406663351, 702375623, 488537248, 915974358, 164891558, 190002552, 116587122, 370130084, 323681679, 696729073, 834934402, 628314849, 869524077, 231452623, 757609035, 23736135, 860659235, 181166350, 375604662, 304353680, 966671049, 735531524, 635797963, 305188124, 314552267, 298391059, 78545067, 263046541, 474262081, 922779117, 345985130, 642600391, 854275521, 306914969, 907582100, 798306637, 556785913, 187973090, 522310602, 711312015, 218472727, 88732618, 554238248, 227989467, 45365896, 774444438, 108846514, 326515214, 325065303, 251031880, 644311889, 167287703, 85204377, 868230181, 218266343, 744160377, 263854367, 244331712, 58844021, 903118259, 556287612, 190019233, 771859125, 342169397, 784733603, 238933499, 266178099, 516144760, 368890028, 667729610, 434066251, 202714480, 818461815, 854965399, 560715322, 454355059, 76432474, 656735994, 679447073, 704379861, 387127546, 983223219, 697044450, 561346869, 673964174, 114245755, 449714614, 785320588, 362896289, 57924709, 80015761, 537433189, 891746640, 144215527, 583050470, 281281821, 749663957, 125280947, 577503881, 507127357, 108628346, 142177361, 784462143, 721687750, 931718105, 29754667, 29208398, 977520400, 573193813, 866767172, 827175662, 589614103, 20615978, 711472113, 140858912, 413191106, 666654690, 56880625, 582281368, 303562665, 179724814, 227016583, 946491552, 866413166, 500024195, 920595438, 400748985, 288687709, 694700493, 920269270, 59632072, 546445586, 278555116, 450371127, 296763710, 155824082, 492019330, 300409610, 785064338, 379344940, 370932636, 853900020, 611290894, 581565453, 524955087, 751838654, 69164078, 771871184, 134568093, 862937525, 973435729, 654991468, 903994029, 202017348, 211821339, 918758225, 750466248, 707940663, 988570936, 353248311, 169809386, 12466109, 926429933, 68721569, 320245734, 140973873, 478987459, 184153875, 245644797, 560249473, 227631268, 340854964, 193767502, 919178674, 591530493, 900311978, 665261784, 669196522, 90400609, 274035862, 576961321, 355974973, 53101315, 511565237, 649854805, 382442072, 964893056, 602076069, 240342719, 658379798, 68178147, 669535029, 706663739, 416602389, 952407754, 646136040, 923991660, 624760968, 610630550, 394385581, 67744313, 194398744, 123954825, 859969001, 723743900, 217516228, 445858283, 878103916, 144473239, 342386250, 510919517, 377195171, 178433441, 767718879, 497965694, 686730537, 778768843, 242051661, 552753137, 785759839, 559299151, 909142441, 19319268, 419516906, 654019870, 605614378, 255491975, 527298072, 64779396, 478021401, 659045830, 766873821, 827969129, 673691819, 30365618, 960896766, 335097708, 489798109, 921830007, 870164787, 397261062, 622360329, 265427231, 706961899, 489120306, 565219862, 517274109, 178179911, 392584532, 398168359, 584999271, 599349068, 956247333, 669268372, 740633549, 367044198, 131208311, 136764698, 159858313, 548563514, 539813495, 482583735, 231032496, 56339918, 832002582, 437851358, 399382523, 808324321, 637459653, 391082127, 748156649, 126745564, 134272722, 765127694, 495404820, 297024658, 528430277, 462294099, 963565773, 469139409, 164191045, 828315666, 94436003, 656962525, 320207813, 81381744, 430428845, 118840139, 221836425, 852061224, 663646746, 432640065, 340408363, 916462826, 740636639, 965314087, 249134027, 357437555, 783662677, 959003618, 117779909, 495285889, 831385384, 511631262, 492121037, 779873555, 518203636, 586177914, 421687143, 369860335, 38658346, 670051264, 867121706, 912438125, 234494851, 971672226, 510298928, 226678346, 877815693, 812353194, 706620702, 564809286, 72154289, 116284180, 798849358, 193967092, 176614494, 229190066, 262282194, 48232542, 199835280, 920156238, 279010252, 246398634, 820992055, 338237260, 164567059, 431568261, 927216919, 323557761, 869886071, 888202210, 772949535, 569048048, 437134924, 914786836, 28876991, 467955658, 890127756, 943805096, 678478238, 835946260, 573773321, 25684875, 385829009, 135464298, 635338091, 824321911, 533758288, 692877528, 518653213, 427198719, 221885017, 382051126, 22094263, 520432351, 636963297, 381797747, 694307457, 523576875, 476510365, 485176822, 245411365, 445749010, 508290479, 971662211, 977383047, 255154004, 614121625, 393910624, 85020022, 22085371, 894921648, 256200279, 487534889, 167467436, 992429680, 558073444, 964630476, 806752623, 792760887, 595219021, 545989710, 13419880, 845956600, 385278405, 567069241, 148751919, 980548777, 309077876, 929669901, 244356340, 652410431, 776395412, 279847656, 121852842, 371053605, 819943711, 172876020, 169566739, 863698781, 69904254, 203432029, 164262275, 33145069, 746452383, 501107506, 518837227, 41103147, 800132215, 428771377, 477581888, 665130503, 939578870, 228709542, 138196179, 404632052, 466187409, 40936142, 293802515, 998329989, 130148363, 706213219, 918100558, 617385012, 943006814, 108772603, 838778853, 582382918, 940155581, 703646063]))
30
+
31
+ test7 :: Test
32
+ test7 = TestCase (assertEqual "for (maximumSumOfHeights [457307243, 538765441, 936585121, 891255631, 981400086, 785030154, 205823245, 366369370, 381995020, 620390059, 244571896, 946759161, 507788745, 871210585, 544518543, 783169450, 37124404, 946527946, 73127486, 607145768, 168991090, 134768122, 906205049, 364598861, 496385945, 186741170, 85470072, 984144055, 447287418, 382810184, 164359867, 626105760, 588155263, 367531644, 215006135, 930719828, 181463609, 721811508, 888191089, 700778940, 49229013, 305415785, 438730597, 215595615, 320778097, 553044877, 208579795, 650833235, 35788171, 199045946, 27204750, 96501563, 844752838, 351617059, 630805611, 511304463, 871828719, 299099113, 155592543, 828945189, 500207310, 964793055, 290570076, 520680881, 886441506, 964497646, 278497567, 721068849, 135725790, 902622141, 466434512, 17270282, 372613499, 209678454, 720325631, 696850901, 986931122, 892694579, 249379749, 115455210, 471418511, 170715949, 254608366, 385192501, 694035208, 369621614, 400753583, 799239314, 828994264, 999611810, 840022889, 460305770, 951120976, 170682134, 789538773, 172391908, 735854857, 483600955, 992172790, 799365599, 906797917, 705574376, 120953222, 491642449, 420558991, 812011453, 644593631, 972209414, 290494802, 740109977, 414164553, 553400073, 618722479, 782813288, 849053837, 554516352, 945517963, 443711395, 32675328, 652381001, 994255236, 846570317, 804694823, 945040848, 922473618, 671714748, 252981772, 583647023, 749518114, 953974681, 862900406, 253942102, 431788867, 815269881, 326969664, 902424068, 395939359, 899557123, 52751257, 702167344, 815551528, 534412689, 725722770, 84602638, 178963593, 677039164, 290622067, 533610726, 653549312, 309600592, 145614778, 833200618, 614029752, 253466773, 647625317, 848757408, 205925215, 2876869, 23530172, 332791049, 374010574, 262642293, 486224879, 38904308, 824146420, 832394838, 187700433, 167065764, 105549499, 793839801, 20114974, 566182026, 27713350, 51936313, 306272549, 412355222, 890558330, 363687500, 193037505, 355435245, 440293550, 270760354, 73284363, 326501935, 772556061, 837668668, 483897098, 133822042, 120951633, 106075138, 423223711, 619154519, 498849009, 903137903, 43411058, 913752568, 333563611, 617370463, 260224287, 332899347, 767911646, 405448163, 384440576, 43697943, 843637238, 219381769, 450409142, 848063703, 138831156, 335804379, 434239894, 309109060, 303386490, 662519062, 96550844, 335920951, 841873641, 797517841, 153090474, 946681167, 561913697, 519200726, 980514595, 453889782, 982715368, 649453828, 145539060, 28111331, 812543050, 73751290, 383915414, 730203629, 877136211, 11119242, 615256826, 778285564, 965386269, 287430642, 691052194, 973234437, 266954667, 109662819, 879457882, 220908892, 438829989, 695753536, 201052318, 545802781, 904881930, 967748446, 930138075, 312736777, 240172050, 187045751, 738761633, 929201592, 977670053, 328851403, 406551173, 445035869, 219643504, 90552121, 657060697, 577081112, 140668094, 907783637, 807013581, 490603966, 732800412, 734235959, 194766436, 320802990, 214150444, 209131452, 503701919, 133164428, 706130447, 404910401, 926559410, 120897612, 75490150, 526060275, 170067772, 382194198, 549940529, 284962367, 906928233, 793477356, 630340341, 406311890, 22757933, 755892043, 822405144, 293815665, 571632645, 31050454, 475685467, 953661075, 354774080, 113862075, 248454723, 652613382, 321059735, 805920014, 914167103, 883311914, 750335561, 85039012, 470272493, 573650489, 995008847, 591646702, 186196085, 129730843, 998557454, 312581705, 302755472, 56446966, 554891096, 810924335, 21682992, 950622889, 590313303, 916282879, 295238493, 568646916, 265195273, 546161348, 923142387, 625727303, 342578467, 57724596, 859826260, 591865883, 702589498, 82170410, 871056450, 469535669, 915940343, 301257348, 70176453, 554926646, 359633040, 931712390, 124546581, 869412811, 261926729, 971890272, 232559115, 533497879, 716205661, 274956060, 873877329, 293653555, 924275982, 805143133, 173078879, 461777516, 781869422, 455658862, 849049323, 339708903, 143910844, 551990625, 622263268, 293895814, 588402269, 492088189, 366049649, 807353761, 543011092, 903124866, 103647341, 180649478, 427217574, 418201939, 683506956, 249879624, 757134657, 671126995, 755503215, 765680711, 29704136, 237710711, 879018703, 554854569, 657916695, 524887262, 128359873, 89407448, 776936092, 992613157, 792521854, 150343568, 944030068, 687079014, 109230805, 930276197, 207558513, 262862664, 964158183, 500409240, 30167063, 22671953, 879012910, 884715414, 673955941, 187769527, 794159878, 97456296, 303996146, 488874729, 997249315, 135098215, 526943305, 443178379, 518456009, 783488317, 43949384, 909528144, 208833992, 942677336, 283302074, 744524642, 680184941, 859577404, 785100194, 433023662, 296074023, 336133862, 585826003, 351829228, 607324186, 557367648, 218719913, 29470005, 199409536, 864473342, 262405528, 766958349, 478825619, 34076570, 909608443, 900497866, 265618971, 201155937, 919890053, 314914658, 525911097, 208128285, 204988551, 384522452, 787590910, 524760376, 17671503, 86525451, 968344334, 470034628, 828250632, 818852926, 784738203, 922183528, 71247188, 198595481, 82140883, 969466856, 287406127, 346704548, 339102153, 360205909, 158195687, 464336282, 964871318, 585763946, 147226395, 765880325, 16773121, 958119523, 109487202, 322174005, 1895316, 856297377, 883744670, 585919364, 118300602, 402028209, 841437383, 813449282, 645555339, 395446594, 253061955, 36291401, 111268202, 332607952, 105963637, 217615637, 202732007, 188565158, 751144555, 976687785, 558182491, 602597125, 770279982, 486570410, 649658829, 544281812, 773295159, 925032664, 910570040, 728748874, 318551341, 707899470, 230399707, 596171570, 177619447, 876602832, 347506180, 732364349, 58383818, 805993915, 399011457, 240964851, 879905118, 885912112, 689985432, 554957148, 461679325, 246045619, 700249210, 556701758, 352008673, 558751975, 500834768, 617929893, 884189752, 875156266, 496105224, 912167843, 422742831, 871677984, 197232848, 613179711, 943044553, 352507515, 926360076, 646871293, 301195452, 532679668, 769348529, 841977871, 920822239, 399080785, 398129308, 674348896, 801444675, 501646583, 842744054, 808443215, 132085716, 145954246, 343941104, 704369464, 472292740, 534098278])," 15701756896 (maximumSumOfHeights [457307243, 538765441, 936585121, 891255631, 981400086, 785030154, 205823245, 366369370, 381995020, 620390059, 244571896, 946759161, 507788745, 871210585, 544518543, 783169450, 37124404, 946527946, 73127486, 607145768, 168991090, 134768122, 906205049, 364598861, 496385945, 186741170, 85470072, 984144055, 447287418, 382810184, 164359867, 626105760, 588155263, 367531644, 215006135, 930719828, 181463609, 721811508, 888191089, 700778940, 49229013, 305415785, 438730597, 215595615, 320778097, 553044877, 208579795, 650833235, 35788171, 199045946, 27204750, 96501563, 844752838, 351617059, 630805611, 511304463, 871828719, 299099113, 155592543, 828945189, 500207310, 964793055, 290570076, 520680881, 886441506, 964497646, 278497567, 721068849, 135725790, 902622141, 466434512, 17270282, 372613499, 209678454, 720325631, 696850901, 986931122, 892694579, 249379749, 115455210, 471418511, 170715949, 254608366, 385192501, 694035208, 369621614, 400753583, 799239314, 828994264, 999611810, 840022889, 460305770, 951120976, 170682134, 789538773, 172391908, 735854857, 483600955, 992172790, 799365599, 906797917, 705574376, 120953222, 491642449, 420558991, 812011453, 644593631, 972209414, 290494802, 740109977, 414164553, 553400073, 618722479, 782813288, 849053837, 554516352, 945517963, 443711395, 32675328, 652381001, 994255236, 846570317, 804694823, 945040848, 922473618, 671714748, 252981772, 583647023, 749518114, 953974681, 862900406, 253942102, 431788867, 815269881, 326969664, 902424068, 395939359, 899557123, 52751257, 702167344, 815551528, 534412689, 725722770, 84602638, 178963593, 677039164, 290622067, 533610726, 653549312, 309600592, 145614778, 833200618, 614029752, 253466773, 647625317, 848757408, 205925215, 2876869, 23530172, 332791049, 374010574, 262642293, 486224879, 38904308, 824146420, 832394838, 187700433, 167065764, 105549499, 793839801, 20114974, 566182026, 27713350, 51936313, 306272549, 412355222, 890558330, 363687500, 193037505, 355435245, 440293550, 270760354, 73284363, 326501935, 772556061, 837668668, 483897098, 133822042, 120951633, 106075138, 423223711, 619154519, 498849009, 903137903, 43411058, 913752568, 333563611, 617370463, 260224287, 332899347, 767911646, 405448163, 384440576, 43697943, 843637238, 219381769, 450409142, 848063703, 138831156, 335804379, 434239894, 309109060, 303386490, 662519062, 96550844, 335920951, 841873641, 797517841, 153090474, 946681167, 561913697, 519200726, 980514595, 453889782, 982715368, 649453828, 145539060, 28111331, 812543050, 73751290, 383915414, 730203629, 877136211, 11119242, 615256826, 778285564, 965386269, 287430642, 691052194, 973234437, 266954667, 109662819, 879457882, 220908892, 438829989, 695753536, 201052318, 545802781, 904881930, 967748446, 930138075, 312736777, 240172050, 187045751, 738761633, 929201592, 977670053, 328851403, 406551173, 445035869, 219643504, 90552121, 657060697, 577081112, 140668094, 907783637, 807013581, 490603966, 732800412, 734235959, 194766436, 320802990, 214150444, 209131452, 503701919, 133164428, 706130447, 404910401, 926559410, 120897612, 75490150, 526060275, 170067772, 382194198, 549940529, 284962367, 906928233, 793477356, 630340341, 406311890, 22757933, 755892043, 822405144, 293815665, 571632645, 31050454, 475685467, 953661075, 354774080, 113862075, 248454723, 652613382, 321059735, 805920014, 914167103, 883311914, 750335561, 85039012, 470272493, 573650489, 995008847, 591646702, 186196085, 129730843, 998557454, 312581705, 302755472, 56446966, 554891096, 810924335, 21682992, 950622889, 590313303, 916282879, 295238493, 568646916, 265195273, 546161348, 923142387, 625727303, 342578467, 57724596, 859826260, 591865883, 702589498, 82170410, 871056450, 469535669, 915940343, 301257348, 70176453, 554926646, 359633040, 931712390, 124546581, 869412811, 261926729, 971890272, 232559115, 533497879, 716205661, 274956060, 873877329, 293653555, 924275982, 805143133, 173078879, 461777516, 781869422, 455658862, 849049323, 339708903, 143910844, 551990625, 622263268, 293895814, 588402269, 492088189, 366049649, 807353761, 543011092, 903124866, 103647341, 180649478, 427217574, 418201939, 683506956, 249879624, 757134657, 671126995, 755503215, 765680711, 29704136, 237710711, 879018703, 554854569, 657916695, 524887262, 128359873, 89407448, 776936092, 992613157, 792521854, 150343568, 944030068, 687079014, 109230805, 930276197, 207558513, 262862664, 964158183, 500409240, 30167063, 22671953, 879012910, 884715414, 673955941, 187769527, 794159878, 97456296, 303996146, 488874729, 997249315, 135098215, 526943305, 443178379, 518456009, 783488317, 43949384, 909528144, 208833992, 942677336, 283302074, 744524642, 680184941, 859577404, 785100194, 433023662, 296074023, 336133862, 585826003, 351829228, 607324186, 557367648, 218719913, 29470005, 199409536, 864473342, 262405528, 766958349, 478825619, 34076570, 909608443, 900497866, 265618971, 201155937, 919890053, 314914658, 525911097, 208128285, 204988551, 384522452, 787590910, 524760376, 17671503, 86525451, 968344334, 470034628, 828250632, 818852926, 784738203, 922183528, 71247188, 198595481, 82140883, 969466856, 287406127, 346704548, 339102153, 360205909, 158195687, 464336282, 964871318, 585763946, 147226395, 765880325, 16773121, 958119523, 109487202, 322174005, 1895316, 856297377, 883744670, 585919364, 118300602, 402028209, 841437383, 813449282, 645555339, 395446594, 253061955, 36291401, 111268202, 332607952, 105963637, 217615637, 202732007, 188565158, 751144555, 976687785, 558182491, 602597125, 770279982, 486570410, 649658829, 544281812, 773295159, 925032664, 910570040, 728748874, 318551341, 707899470, 230399707, 596171570, 177619447, 876602832, 347506180, 732364349, 58383818, 805993915, 399011457, 240964851, 879905118, 885912112, 689985432, 554957148, 461679325, 246045619, 700249210, 556701758, 352008673, 558751975, 500834768, 617929893, 884189752, 875156266, 496105224, 912167843, 422742831, 871677984, 197232848, 613179711, 943044553, 352507515, 926360076, 646871293, 301195452, 532679668, 769348529, 841977871, 920822239, 399080785, 398129308, 674348896, 801444675, 501646583, 842744054, 808443215, 132085716, 145954246, 343941104, 704369464, 472292740, 534098278]))
33
+
34
+ test8 :: Test
35
+ test8 = TestCase (assertEqual "for (maximumSumOfHeights [336269634, 615505167, 902431139, 555442545, 462432320, 258326761, 49337782, 773274355, 678267702, 176399416, 316750347, 874026939, 149525606, 566144709, 17973605, 38060485, 190461140, 450132778, 95031841, 305978476, 645159534, 149090764, 444756193, 197818506, 127994969, 2405793, 360067266, 125489771, 241546507, 231019465, 871007133, 858346202, 184562288, 994857149, 954838489, 452089034, 305984495, 991739914, 16327074, 293466424, 919774810, 107737380, 697642494, 493604863, 822555742, 233332405, 453298155, 897326467, 871829445, 821635804, 641657766, 352992584, 200743420, 25478150, 760549387, 163389447, 197326657, 412356199, 364796452, 711322102, 218970744, 556339823, 423567914, 554002506, 249399490, 828362786, 347185754, 749059544, 926946284, 375830175, 352076755, 816691544, 127405945, 635616407, 419397136, 856462237, 939578049, 276243682, 297569943, 513054305, 80940267, 280109253, 834215245, 204661486, 301461695, 511370227, 734546790, 684909516, 757111653, 833205273, 999555822, 957808002, 852468625, 988137758, 411609999, 178341238, 131388328, 779082663, 744923897, 424292464, 60078425, 746737918, 274785348, 724769117, 537466817, 316919613, 67930109, 85089854, 119579800, 26761392, 422494003, 777524186, 1251509, 440380032, 100057860, 742534672, 816941787, 651531930, 25602548, 188109120, 23688057, 534566663, 401322007, 696871812, 330786631, 577597450, 214173588, 191810851, 996335985, 885130939, 712523714, 520694020, 608485376, 939113846, 433485780, 366955098, 606515489, 924949214, 652967346, 242737019, 293217079, 18558812, 868252938, 26783710, 265292904, 425033895, 760629714, 277721449, 544373174, 224428805, 291920070, 588236058, 372961707, 350786851, 461727292, 571003111, 397616785, 156841544, 744572529, 25047878, 588521301, 845735474, 193865200, 5855851, 637381868, 204494972, 387130730, 397641104, 437940646, 258113979, 699358189, 869067438, 141123665, 385811018, 16267907, 555174184, 668315211, 883755519, 46776324, 571890230, 977613966, 512360038, 781618204, 515341409, 57219224, 236780117, 572231421, 434264077, 583134340, 361805551, 298392285, 640141708, 998235369, 701768226, 861473960, 60763580, 705103088, 828008426, 420954126, 454640629, 114735057, 704268509, 616873636, 248519382, 106777611, 857698238, 766505574, 541890057, 131109584, 211014338, 34283759, 960813335, 320693430, 859971819, 763195961, 395346475, 695565206, 620453607, 779084763, 118375946, 123352242, 833740889, 264878999, 117295158, 877894966, 922971313, 103775456, 270485722, 439276681, 472560593, 963958614, 483426451, 8432699, 572959970, 396644976, 859825862, 309406332, 358134705, 634987567, 237044674, 652430766, 792200160, 46463459, 950556329, 660343964, 888732845, 756458417, 592750994, 499745364, 775319399, 722767119, 226204090, 913525978, 574224341, 911074795, 696529014, 196671271, 398858037, 643032749, 943073064, 859107314, 144414824, 361355566, 414817669, 413759190, 935748214, 752169656, 324235011, 949351201, 633160046, 256334985, 631235848, 817517121, 506493507, 198407760, 105075702, 977879444, 344776100, 513613590, 784884626, 319890704, 839775147, 760354336, 814403165, 338365233, 852665444, 353139719, 971686603, 42834773, 572591037, 173727000, 62304635, 155960978, 189197608, 732317742, 543788359, 552818370, 442470022, 950574533, 480874935, 969115983, 962400357, 693831115, 168896175, 501477434, 804606561, 987780309, 249584587, 139961252, 760976620, 961031845, 231044492, 729473172, 250646397, 80339964, 394253364, 176421111, 860773517, 985217749, 521427159, 835274633, 28599854, 420590331, 995520411, 961114780, 802343037, 817696324, 545342425, 297385450, 595256959, 999177910, 704730381, 730668876, 50134110, 839735329, 244549084, 303207114, 421763366, 294184622, 738663007, 824471573, 927626750, 560191373, 447441201, 957956902, 617069759, 129806423, 42788132, 308018457, 656704818, 46493913, 927942905, 39973430, 363163150, 485476138, 424501106, 122606242, 183554035, 924339800, 607331352, 624429732, 412036939, 169301948, 763073494, 95786736, 500294871, 415336390, 815949915, 630514933, 869491397, 190141524, 474241247, 298114637, 708966917, 921876167, 117306872, 664474094, 566087810, 437510104, 853550006, 317627022, 976535, 24234740, 621626330, 36570543, 401598222, 230217616, 689801133, 850507242, 485397068, 77384645, 887279023, 966449467, 458819583, 664580064, 63441509, 110962337, 128479917, 89397465, 91108189, 727312978, 830715228, 105565685, 995836833, 196583486, 706931293, 379707198, 775032636, 477589074, 406133084, 530218797, 748506159, 308188487, 764770484, 745297702, 350855665, 79751260, 58876477, 959834389, 663872221, 800158434, 976501229, 202632556, 78353430, 898755075, 219358136, 11106417, 871911861, 879298791, 424954842, 787637553, 504576037, 455524409, 480701297, 674391134, 450496504, 78685083, 621160543, 895771336, 630831622, 694809120, 182766955, 665837240, 982276097, 563012299, 339267806, 347909596, 401524297, 68664135, 84643939, 636167638, 108501305, 108983362, 191033958, 330368031, 496339366, 289921272, 135568120, 243667811, 11548094, 531422834, 454351560, 677110953, 187645581, 118592875, 819489607, 888553621, 474667595, 10312656, 578339086, 394613188, 43936745, 209549364, 159830925, 840198195, 745891578, 839131951, 574656960, 493803375, 376827162, 527862674, 933817764, 527751141, 154563984, 350059267, 468019032, 463220336, 222709591, 631213537, 867360611, 108554884, 680095206, 62339864, 361537171, 614210231, 757343222, 244915625, 449620749, 246404419, 867535090, 942523462, 794121594, 748554151, 692051140, 158808253, 672900232, 264824689, 591753118, 79990439, 828195165, 785430915, 866501050, 287349079, 393182895, 613761101, 807143026, 841561099, 882370543, 778226081, 337802020, 7125575, 193073248, 385596475, 898577466, 554363146, 49121468, 551757476, 208256816, 805731453, 330939041, 991764232, 284239276, 93316684, 643951578, 719981056, 719741740, 217569373, 200284224, 836519755, 374121500, 902007879, 703250717, 99934766, 980197405, 529088244, 65254296, 18326138, 310999816, 21884612, 410136737, 925087247, 437880793, 19699309, 664108912, 895933152, 49289076, 837930028, 13600353, 632546590, 924822774, 835812220, 559614661, 593298967, 869713682, 400139785, 69685513, 396975929, 550839926, 153487144, 196429194, 7879784, 457329112, 79210282, 876697912, 237499181, 566209162, 994544512, 845970885, 161800342, 685503894, 104805611, 247569491, 141739938, 150443134, 564138754, 303971982, 173031105, 54438358, 437442299, 74635908, 859382108, 47131374, 392820252, 525576960, 935990189, 68603155, 815408319, 619617060, 368797433, 181193713, 206799061, 724127994, 603724526, 309893907, 994049338, 21167196, 597871519, 482729332, 865967015, 852969719, 335942499, 128311350, 860585352, 219018164, 94718713, 575277619, 251723149, 752677395, 358323171, 529743287, 499818112, 319500847, 859781422, 762664619, 156194316, 478973228, 112094121, 733041278, 231852723, 435540007, 324443516, 833392012, 18990229, 914323368, 705180449, 147193534, 207406473, 1647053, 831939439, 278121613, 800480906, 311995307, 443640429, 967090620, 394970413, 382183330, 376145100, 522616772, 78178047, 75760323, 801330397, 67872831, 114500908, 28867052, 64210070, 577217953, 984196373, 429011170, 661835373, 715436826, 730560799, 534645511, 518679182, 134142686, 874268372, 493306289, 86518971, 233861997, 833381678, 65939279, 197311160, 330453714, 989237900, 901885389, 563420147, 267751669, 832520716, 824005233, 159109339, 768910200, 608691341, 300594434, 423535407, 456969971, 215716246, 604272579, 746279334, 111636467, 426136813, 372987610, 353962928, 546761709, 169794309, 630832965, 335570142, 129817511, 801818671, 722557692, 818231139, 975909512, 358331882, 860226545, 629524270, 4253131, 749982883, 554512857, 326556627, 786163156, 877898334, 275537899, 291838869, 445508992, 659743424, 815265689, 407011674, 750328268, 345953618, 245154084, 815338933, 919812631, 648079508, 521283073, 571180128, 457449963, 946409452, 723922109, 570411508, 606564844, 247098369, 394279720, 658848517, 731779039, 205677401, 159900436, 824927192, 939543657, 334228473, 425874328, 250603861, 202121043, 882697709, 825980269, 530500062, 174513126, 275957057, 85228406, 870577277, 187717318, 555598428, 700040955, 265003879, 862402368, 961267821, 885692556, 972886580, 492420429, 35323436, 111291048, 795718071, 745328393, 610758603, 166522395, 70895355, 26751790, 221683103, 922955080, 533635083, 362965595, 354718659, 70705851, 320018668, 491587775, 290195832, 258717844, 240889758, 593654042, 615356708, 683535185, 18483723, 316587273, 449283725, 279959021, 578908626, 826423708, 190484254, 395758053, 177793809, 937162185, 753342164, 964839798, 579838121, 817832647, 274586376, 872699587, 312440182, 780060763, 727166198, 360247523, 595480520, 39190344, 882481909, 740376586, 764208127, 972181715, 586343828, 397952034, 65105476, 769044077, 970589007, 986690063, 472951755, 730576828, 479256695, 695777716, 133526638, 62732226, 282105829, 696328130, 582736315])," 15677354913 (maximumSumOfHeights [336269634, 615505167, 902431139, 555442545, 462432320, 258326761, 49337782, 773274355, 678267702, 176399416, 316750347, 874026939, 149525606, 566144709, 17973605, 38060485, 190461140, 450132778, 95031841, 305978476, 645159534, 149090764, 444756193, 197818506, 127994969, 2405793, 360067266, 125489771, 241546507, 231019465, 871007133, 858346202, 184562288, 994857149, 954838489, 452089034, 305984495, 991739914, 16327074, 293466424, 919774810, 107737380, 697642494, 493604863, 822555742, 233332405, 453298155, 897326467, 871829445, 821635804, 641657766, 352992584, 200743420, 25478150, 760549387, 163389447, 197326657, 412356199, 364796452, 711322102, 218970744, 556339823, 423567914, 554002506, 249399490, 828362786, 347185754, 749059544, 926946284, 375830175, 352076755, 816691544, 127405945, 635616407, 419397136, 856462237, 939578049, 276243682, 297569943, 513054305, 80940267, 280109253, 834215245, 204661486, 301461695, 511370227, 734546790, 684909516, 757111653, 833205273, 999555822, 957808002, 852468625, 988137758, 411609999, 178341238, 131388328, 779082663, 744923897, 424292464, 60078425, 746737918, 274785348, 724769117, 537466817, 316919613, 67930109, 85089854, 119579800, 26761392, 422494003, 777524186, 1251509, 440380032, 100057860, 742534672, 816941787, 651531930, 25602548, 188109120, 23688057, 534566663, 401322007, 696871812, 330786631, 577597450, 214173588, 191810851, 996335985, 885130939, 712523714, 520694020, 608485376, 939113846, 433485780, 366955098, 606515489, 924949214, 652967346, 242737019, 293217079, 18558812, 868252938, 26783710, 265292904, 425033895, 760629714, 277721449, 544373174, 224428805, 291920070, 588236058, 372961707, 350786851, 461727292, 571003111, 397616785, 156841544, 744572529, 25047878, 588521301, 845735474, 193865200, 5855851, 637381868, 204494972, 387130730, 397641104, 437940646, 258113979, 699358189, 869067438, 141123665, 385811018, 16267907, 555174184, 668315211, 883755519, 46776324, 571890230, 977613966, 512360038, 781618204, 515341409, 57219224, 236780117, 572231421, 434264077, 583134340, 361805551, 298392285, 640141708, 998235369, 701768226, 861473960, 60763580, 705103088, 828008426, 420954126, 454640629, 114735057, 704268509, 616873636, 248519382, 106777611, 857698238, 766505574, 541890057, 131109584, 211014338, 34283759, 960813335, 320693430, 859971819, 763195961, 395346475, 695565206, 620453607, 779084763, 118375946, 123352242, 833740889, 264878999, 117295158, 877894966, 922971313, 103775456, 270485722, 439276681, 472560593, 963958614, 483426451, 8432699, 572959970, 396644976, 859825862, 309406332, 358134705, 634987567, 237044674, 652430766, 792200160, 46463459, 950556329, 660343964, 888732845, 756458417, 592750994, 499745364, 775319399, 722767119, 226204090, 913525978, 574224341, 911074795, 696529014, 196671271, 398858037, 643032749, 943073064, 859107314, 144414824, 361355566, 414817669, 413759190, 935748214, 752169656, 324235011, 949351201, 633160046, 256334985, 631235848, 817517121, 506493507, 198407760, 105075702, 977879444, 344776100, 513613590, 784884626, 319890704, 839775147, 760354336, 814403165, 338365233, 852665444, 353139719, 971686603, 42834773, 572591037, 173727000, 62304635, 155960978, 189197608, 732317742, 543788359, 552818370, 442470022, 950574533, 480874935, 969115983, 962400357, 693831115, 168896175, 501477434, 804606561, 987780309, 249584587, 139961252, 760976620, 961031845, 231044492, 729473172, 250646397, 80339964, 394253364, 176421111, 860773517, 985217749, 521427159, 835274633, 28599854, 420590331, 995520411, 961114780, 802343037, 817696324, 545342425, 297385450, 595256959, 999177910, 704730381, 730668876, 50134110, 839735329, 244549084, 303207114, 421763366, 294184622, 738663007, 824471573, 927626750, 560191373, 447441201, 957956902, 617069759, 129806423, 42788132, 308018457, 656704818, 46493913, 927942905, 39973430, 363163150, 485476138, 424501106, 122606242, 183554035, 924339800, 607331352, 624429732, 412036939, 169301948, 763073494, 95786736, 500294871, 415336390, 815949915, 630514933, 869491397, 190141524, 474241247, 298114637, 708966917, 921876167, 117306872, 664474094, 566087810, 437510104, 853550006, 317627022, 976535, 24234740, 621626330, 36570543, 401598222, 230217616, 689801133, 850507242, 485397068, 77384645, 887279023, 966449467, 458819583, 664580064, 63441509, 110962337, 128479917, 89397465, 91108189, 727312978, 830715228, 105565685, 995836833, 196583486, 706931293, 379707198, 775032636, 477589074, 406133084, 530218797, 748506159, 308188487, 764770484, 745297702, 350855665, 79751260, 58876477, 959834389, 663872221, 800158434, 976501229, 202632556, 78353430, 898755075, 219358136, 11106417, 871911861, 879298791, 424954842, 787637553, 504576037, 455524409, 480701297, 674391134, 450496504, 78685083, 621160543, 895771336, 630831622, 694809120, 182766955, 665837240, 982276097, 563012299, 339267806, 347909596, 401524297, 68664135, 84643939, 636167638, 108501305, 108983362, 191033958, 330368031, 496339366, 289921272, 135568120, 243667811, 11548094, 531422834, 454351560, 677110953, 187645581, 118592875, 819489607, 888553621, 474667595, 10312656, 578339086, 394613188, 43936745, 209549364, 159830925, 840198195, 745891578, 839131951, 574656960, 493803375, 376827162, 527862674, 933817764, 527751141, 154563984, 350059267, 468019032, 463220336, 222709591, 631213537, 867360611, 108554884, 680095206, 62339864, 361537171, 614210231, 757343222, 244915625, 449620749, 246404419, 867535090, 942523462, 794121594, 748554151, 692051140, 158808253, 672900232, 264824689, 591753118, 79990439, 828195165, 785430915, 866501050, 287349079, 393182895, 613761101, 807143026, 841561099, 882370543, 778226081, 337802020, 7125575, 193073248, 385596475, 898577466, 554363146, 49121468, 551757476, 208256816, 805731453, 330939041, 991764232, 284239276, 93316684, 643951578, 719981056, 719741740, 217569373, 200284224, 836519755, 374121500, 902007879, 703250717, 99934766, 980197405, 529088244, 65254296, 18326138, 310999816, 21884612, 410136737, 925087247, 437880793, 19699309, 664108912, 895933152, 49289076, 837930028, 13600353, 632546590, 924822774, 835812220, 559614661, 593298967, 869713682, 400139785, 69685513, 396975929, 550839926, 153487144, 196429194, 7879784, 457329112, 79210282, 876697912, 237499181, 566209162, 994544512, 845970885, 161800342, 685503894, 104805611, 247569491, 141739938, 150443134, 564138754, 303971982, 173031105, 54438358, 437442299, 74635908, 859382108, 47131374, 392820252, 525576960, 935990189, 68603155, 815408319, 619617060, 368797433, 181193713, 206799061, 724127994, 603724526, 309893907, 994049338, 21167196, 597871519, 482729332, 865967015, 852969719, 335942499, 128311350, 860585352, 219018164, 94718713, 575277619, 251723149, 752677395, 358323171, 529743287, 499818112, 319500847, 859781422, 762664619, 156194316, 478973228, 112094121, 733041278, 231852723, 435540007, 324443516, 833392012, 18990229, 914323368, 705180449, 147193534, 207406473, 1647053, 831939439, 278121613, 800480906, 311995307, 443640429, 967090620, 394970413, 382183330, 376145100, 522616772, 78178047, 75760323, 801330397, 67872831, 114500908, 28867052, 64210070, 577217953, 984196373, 429011170, 661835373, 715436826, 730560799, 534645511, 518679182, 134142686, 874268372, 493306289, 86518971, 233861997, 833381678, 65939279, 197311160, 330453714, 989237900, 901885389, 563420147, 267751669, 832520716, 824005233, 159109339, 768910200, 608691341, 300594434, 423535407, 456969971, 215716246, 604272579, 746279334, 111636467, 426136813, 372987610, 353962928, 546761709, 169794309, 630832965, 335570142, 129817511, 801818671, 722557692, 818231139, 975909512, 358331882, 860226545, 629524270, 4253131, 749982883, 554512857, 326556627, 786163156, 877898334, 275537899, 291838869, 445508992, 659743424, 815265689, 407011674, 750328268, 345953618, 245154084, 815338933, 919812631, 648079508, 521283073, 571180128, 457449963, 946409452, 723922109, 570411508, 606564844, 247098369, 394279720, 658848517, 731779039, 205677401, 159900436, 824927192, 939543657, 334228473, 425874328, 250603861, 202121043, 882697709, 825980269, 530500062, 174513126, 275957057, 85228406, 870577277, 187717318, 555598428, 700040955, 265003879, 862402368, 961267821, 885692556, 972886580, 492420429, 35323436, 111291048, 795718071, 745328393, 610758603, 166522395, 70895355, 26751790, 221683103, 922955080, 533635083, 362965595, 354718659, 70705851, 320018668, 491587775, 290195832, 258717844, 240889758, 593654042, 615356708, 683535185, 18483723, 316587273, 449283725, 279959021, 578908626, 826423708, 190484254, 395758053, 177793809, 937162185, 753342164, 964839798, 579838121, 817832647, 274586376, 872699587, 312440182, 780060763, 727166198, 360247523, 595480520, 39190344, 882481909, 740376586, 764208127, 972181715, 586343828, 397952034, 65105476, 769044077, 970589007, 986690063, 472951755, 730576828, 479256695, 695777716, 133526638, 62732226, 282105829, 696328130, 582736315]))
36
+
37
+
38
+ -- Grouping test cases
39
+ tests :: Test
40
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6, TestLabel "Test7" test7]
41
+
42
+ -- Running the tests
43
+ main :: IO Counts
44
+ main = runTestTT tests
beautiful_towers_i/java_tests/Main.java ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ public class Main {
7
+ //Program start
8
+
9
+ //Program end
10
+
11
+ @Test
12
+ public void test1() {
13
+ assertEquals(13, maximumSumOfHeights(Arrays.asList(5,3,4,1,1)));
14
+ }
15
+ @Test
16
+ public void test2() {
17
+ assertEquals(22, maximumSumOfHeights(Arrays.asList(6,5,3,9,2,7)));
18
+ }
19
+ @Test
20
+ public void test3() {
21
+ assertEquals(18, maximumSumOfHeights(Arrays.asList(3,2,5,5,2,3)));
22
+ }
23
+
24
+ }
beautiful_towers_i/meta.json ADDED
@@ -0,0 +1,3283 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3114,
3
+ "name": "beautiful_towers_i",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/beautiful-towers-i/",
6
+ "date": "2023-09-17 00:00:00",
7
+ "task_description": "You are given an array `heights` of `n` integers representing the number of bricks in `n` consecutive towers. Your task is to remove some bricks to form a **mountain-shaped** tower arrangement. In this arrangement, the tower heights are non-decreasing, reaching a maximum peak value with one or multiple consecutive towers and then non-increasing. Return the **maximum possible sum** of heights of a mountain-shaped tower arrangement. **Example 1:** **Input:** heights = [5,3,4,1,1] **Output:** 13 **Explanation:** We remove some bricks to make `heights = [5,3,3,1,1]`, the peak is at index 0. **Example 2:** **Input:** heights = [6,5,3,9,2,7] **Output:** 22 **Explanation:** We remove some bricks to make `heights = [3,3,3,9,2,2]`, the peak is at index 3. **Example 3:** **Input:** heights = [3,2,5,5,2,3] **Output:** 18 **Explanation:** We remove some bricks to make `heights = [2,2,5,5,2,2]`, the peak is at index 2 or 3. **Constraints:** `1 <= n == heights.length <= 103` `1 <= heights[i] <= 109`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "heights = [5,3,4,1,1]",
12
+ "output": "13 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "heights = [6,5,3,9,2,7]",
17
+ "output": "22 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "heights = [3,2,5,5,2,3]",
22
+ "output": "18 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ 461095276,
29
+ 386639795,
30
+ 873859621,
31
+ 892139800,
32
+ 82516304,
33
+ 785970576,
34
+ 553100365,
35
+ 677118346,
36
+ 850406943,
37
+ 598758632,
38
+ 637390625,
39
+ 974451679,
40
+ 319236936,
41
+ 312383614,
42
+ 59877712,
43
+ 773224528,
44
+ 753820008,
45
+ 319787930,
46
+ 264076871,
47
+ 348733454,
48
+ 654886345,
49
+ 225449408,
50
+ 895039995,
51
+ 907127873,
52
+ 62848268,
53
+ 348609545,
54
+ 810191280,
55
+ 598381971,
56
+ 566981259,
57
+ 831172922,
58
+ 629628391,
59
+ 702582341,
60
+ 733614337,
61
+ 416039432,
62
+ 398836464,
63
+ 404940226,
64
+ 3470894,
65
+ 580849934,
66
+ 776304548,
67
+ 542638485,
68
+ 196250913,
69
+ 876391110,
70
+ 241686483,
71
+ 400996037,
72
+ 578773496,
73
+ 150667439,
74
+ 811461760,
75
+ 350606183,
76
+ 882289231,
77
+ 255297066,
78
+ 39806978,
79
+ 358764343,
80
+ 810199897,
81
+ 64759314,
82
+ 140000321,
83
+ 625450396,
84
+ 686288032,
85
+ 686161871,
86
+ 83161870,
87
+ 94858363,
88
+ 233833592,
89
+ 499323855,
90
+ 992994771,
91
+ 597734416,
92
+ 206271624,
93
+ 368103649,
94
+ 24046666,
95
+ 120733110,
96
+ 388984908,
97
+ 445911553,
98
+ 459177933,
99
+ 791680055,
100
+ 83734582,
101
+ 688837531,
102
+ 908021794,
103
+ 411312939,
104
+ 877927717,
105
+ 544862368,
106
+ 707377197,
107
+ 834962716,
108
+ 149821711,
109
+ 945898435,
110
+ 777370970,
111
+ 954712241,
112
+ 634655483,
113
+ 787323351,
114
+ 714271241,
115
+ 981833176,
116
+ 679967775,
117
+ 400126079,
118
+ 254451367,
119
+ 196517991,
120
+ 348792002,
121
+ 531858352,
122
+ 719062368,
123
+ 431990640,
124
+ 519637454,
125
+ 491165006,
126
+ 9058816,
127
+ 642190752,
128
+ 108698992,
129
+ 696881776,
130
+ 611943276,
131
+ 735912326,
132
+ 513669965,
133
+ 560225773,
134
+ 81698284,
135
+ 671564736,
136
+ 888253775,
137
+ 240304203,
138
+ 342300216,
139
+ 84108757,
140
+ 451038736,
141
+ 21950892,
142
+ 538584903,
143
+ 709795658,
144
+ 579033963,
145
+ 807181554,
146
+ 831429179,
147
+ 949250084,
148
+ 303874746,
149
+ 827312083,
150
+ 809040931,
151
+ 93472747,
152
+ 480647222,
153
+ 982274636,
154
+ 704863957,
155
+ 545039611,
156
+ 466842571,
157
+ 451567304,
158
+ 442498795,
159
+ 902079568,
160
+ 322400185,
161
+ 139877080,
162
+ 396515305,
163
+ 643537107,
164
+ 256936739,
165
+ 716331581,
166
+ 452575423,
167
+ 354361018,
168
+ 747197160,
169
+ 254214553,
170
+ 199994355,
171
+ 264500185,
172
+ 448310322,
173
+ 112146618,
174
+ 47811962,
175
+ 415761742,
176
+ 982241461,
177
+ 373161582,
178
+ 376761708,
179
+ 169282385,
180
+ 805438683,
181
+ 698746189,
182
+ 475374735,
183
+ 7737254,
184
+ 610476409,
185
+ 750043086,
186
+ 205149594,
187
+ 824138373,
188
+ 106479320,
189
+ 855761208,
190
+ 347130241,
191
+ 614201013,
192
+ 860686165,
193
+ 581305605,
194
+ 901324873,
195
+ 833425680,
196
+ 243687643,
197
+ 111303573,
198
+ 15280706,
199
+ 480805256,
200
+ 362315486,
201
+ 476190492,
202
+ 918418275,
203
+ 780343460,
204
+ 583579962,
205
+ 105733612,
206
+ 291524091,
207
+ 570946298,
208
+ 175973598,
209
+ 942892574,
210
+ 637444119,
211
+ 101344912,
212
+ 523257121,
213
+ 484292781,
214
+ 705948330,
215
+ 504269027,
216
+ 965369659,
217
+ 12776539,
218
+ 572047448,
219
+ 778031372,
220
+ 931748065,
221
+ 143517938,
222
+ 440680755,
223
+ 697015205,
224
+ 567393516,
225
+ 310088668,
226
+ 576855888,
227
+ 885400659,
228
+ 35431032,
229
+ 423463286,
230
+ 376743742,
231
+ 120990657,
232
+ 386460453,
233
+ 541143942,
234
+ 116415718,
235
+ 723467338,
236
+ 276814686,
237
+ 876195228,
238
+ 196860368,
239
+ 939018117,
240
+ 426354321,
241
+ 639129227,
242
+ 280872679,
243
+ 495394011,
244
+ 272069484,
245
+ 391877682,
246
+ 387758536,
247
+ 97430330,
248
+ 120011202,
249
+ 392541888,
250
+ 479436521,
251
+ 700890141,
252
+ 92394400,
253
+ 661692013,
254
+ 482125907,
255
+ 420226798,
256
+ 346736899,
257
+ 913845156,
258
+ 974720679,
259
+ 476675766,
260
+ 222080816,
261
+ 529570088,
262
+ 630971646,
263
+ 138650185,
264
+ 214818888,
265
+ 374188846,
266
+ 277131287,
267
+ 821091731,
268
+ 414340231,
269
+ 785181908,
270
+ 667620487,
271
+ 427405473,
272
+ 503939995,
273
+ 534799677,
274
+ 905116716,
275
+ 988838919,
276
+ 772171744,
277
+ 721250159,
278
+ 12313847,
279
+ 426426130,
280
+ 134742987,
281
+ 444004691,
282
+ 524280082,
283
+ 839125586,
284
+ 980378778,
285
+ 652785683,
286
+ 72763682,
287
+ 319046202,
288
+ 891261574,
289
+ 62344712,
290
+ 6449656,
291
+ 830222229,
292
+ 712440255,
293
+ 965318053,
294
+ 917757700,
295
+ 15049006,
296
+ 440359516,
297
+ 906649023,
298
+ 493578105,
299
+ 306794447,
300
+ 818492015,
301
+ 65408026,
302
+ 294810842,
303
+ 454338704,
304
+ 936078134,
305
+ 393347901,
306
+ 807894063,
307
+ 926360057,
308
+ 858900653,
309
+ 456587484,
310
+ 737367357,
311
+ 444795246,
312
+ 551855388,
313
+ 193044400,
314
+ 192139016,
315
+ 493705408,
316
+ 716745734,
317
+ 943709274,
318
+ 945258189,
319
+ 206568536,
320
+ 786500696,
321
+ 865972597,
322
+ 627977415,
323
+ 226173117,
324
+ 743619674,
325
+ 297311139,
326
+ 743914914,
327
+ 719001765,
328
+ 378329821,
329
+ 896922515,
330
+ 372439157,
331
+ 991804379,
332
+ 993912045,
333
+ 538147267,
334
+ 843222218,
335
+ 165814768,
336
+ 367995916,
337
+ 632223098,
338
+ 225447699,
339
+ 110531119,
340
+ 273223118,
341
+ 853526600,
342
+ 453220994,
343
+ 944451714,
344
+ 835460216,
345
+ 388709121,
346
+ 653513401,
347
+ 608948501,
348
+ 789372890,
349
+ 637479025,
350
+ 847533840,
351
+ 550365224,
352
+ 31460159,
353
+ 121309553,
354
+ 726082875,
355
+ 398853963,
356
+ 919501890,
357
+ 929583234,
358
+ 86186536,
359
+ 222825606,
360
+ 572316333,
361
+ 762412144,
362
+ 373828084,
363
+ 377715356,
364
+ 357920551,
365
+ 107734292,
366
+ 722401541,
367
+ 648765037,
368
+ 843011089,
369
+ 871690143,
370
+ 833184665,
371
+ 618447338,
372
+ 950453002,
373
+ 618394744,
374
+ 273096456,
375
+ 528536506,
376
+ 368596818,
377
+ 672389838,
378
+ 427850541,
379
+ 197929941,
380
+ 596041987,
381
+ 917796372,
382
+ 202672856,
383
+ 553232360,
384
+ 456687629,
385
+ 173166875,
386
+ 430719354,
387
+ 345527883,
388
+ 856019642,
389
+ 103768759,
390
+ 500914629,
391
+ 813073321,
392
+ 45959012,
393
+ 981168755,
394
+ 966719300,
395
+ 685841525,
396
+ 976479663,
397
+ 496717948,
398
+ 434198947,
399
+ 852580769,
400
+ 259014796,
401
+ 585434867,
402
+ 670196688,
403
+ 363028211,
404
+ 444430262,
405
+ 475356575,
406
+ 154896759,
407
+ 185410352,
408
+ 507727918,
409
+ 846049566,
410
+ 26924850,
411
+ 830925567,
412
+ 857098717,
413
+ 545592455,
414
+ 292925684,
415
+ 391938446,
416
+ 534704878,
417
+ 839820354,
418
+ 702897464,
419
+ 976376547,
420
+ 101996688,
421
+ 464274791,
422
+ 773577807,
423
+ 698460121,
424
+ 806800162,
425
+ 932674647,
426
+ 590402864,
427
+ 837572015,
428
+ 667380110,
429
+ 674554973,
430
+ 269085208,
431
+ 845961128,
432
+ 268011421,
433
+ 935918127,
434
+ 131095551,
435
+ 606497761,
436
+ 947821559,
437
+ 635142377,
438
+ 78432792,
439
+ 105933739,
440
+ 436184938,
441
+ 993006363,
442
+ 660772685,
443
+ 190424187,
444
+ 593506323,
445
+ 135528488,
446
+ 247006536,
447
+ 598258484,
448
+ 14407842,
449
+ 798725043,
450
+ 177496387,
451
+ 952834982
452
+ ],
453
+ "output": 17158105543
454
+ },
455
+ {
456
+ "input": [
457
+ 907280058,
458
+ 869376860,
459
+ 854663685,
460
+ 724511174,
461
+ 357575887,
462
+ 554601152,
463
+ 937815738,
464
+ 592437413,
465
+ 992324857,
466
+ 878495940,
467
+ 17450552,
468
+ 956432545,
469
+ 804037092,
470
+ 677837122,
471
+ 694998479,
472
+ 156762276,
473
+ 955878302,
474
+ 665780760,
475
+ 112590518,
476
+ 206803239,
477
+ 553709274,
478
+ 977333507,
479
+ 42914022,
480
+ 727817882,
481
+ 949565522,
482
+ 929356052,
483
+ 821163730,
484
+ 718397171,
485
+ 153319605,
486
+ 461193802,
487
+ 789116137,
488
+ 925605936,
489
+ 802825886,
490
+ 4737558,
491
+ 11647712,
492
+ 31189628,
493
+ 942544256,
494
+ 770042957,
495
+ 395278757,
496
+ 985733882,
497
+ 123533901,
498
+ 352242508,
499
+ 40259458,
500
+ 53501312,
501
+ 539100225,
502
+ 313069975,
503
+ 405177308,
504
+ 659044744,
505
+ 284605989,
506
+ 816626669,
507
+ 918521271,
508
+ 18239953,
509
+ 276592645,
510
+ 700050801,
511
+ 38981362,
512
+ 225961863,
513
+ 46257112,
514
+ 165334748,
515
+ 236853795,
516
+ 330921988,
517
+ 768046016,
518
+ 468836367,
519
+ 768867591,
520
+ 241190251,
521
+ 154176258,
522
+ 22335657,
523
+ 949023192,
524
+ 860545730,
525
+ 805252393,
526
+ 87221731,
527
+ 776545542,
528
+ 463480071,
529
+ 402535206,
530
+ 600906414,
531
+ 389636841,
532
+ 897829208,
533
+ 140770278,
534
+ 653323553,
535
+ 921504312,
536
+ 821487086,
537
+ 873563035,
538
+ 963692200,
539
+ 461479036,
540
+ 22708227,
541
+ 529098620,
542
+ 324691179,
543
+ 938766376,
544
+ 285418428,
545
+ 897924225,
546
+ 964545685,
547
+ 549528092,
548
+ 107339534,
549
+ 565997299,
550
+ 347026474,
551
+ 192397458,
552
+ 703149593,
553
+ 39965638,
554
+ 512937318,
555
+ 997398536,
556
+ 876923456,
557
+ 115670903,
558
+ 47064731,
559
+ 90047526,
560
+ 157492826,
561
+ 807443800,
562
+ 570877161,
563
+ 358127496,
564
+ 633705563,
565
+ 164596493,
566
+ 249397364,
567
+ 356949161,
568
+ 195958184,
569
+ 769414933,
570
+ 318511504,
571
+ 262607666,
572
+ 786449636,
573
+ 615136310,
574
+ 598195355,
575
+ 836171069,
576
+ 650874042,
577
+ 603829588,
578
+ 749642104,
579
+ 321098959,
580
+ 711418221,
581
+ 527606075,
582
+ 828808943,
583
+ 678037729,
584
+ 140290247,
585
+ 113081094,
586
+ 723084737,
587
+ 185748697,
588
+ 774770559,
589
+ 869803837,
590
+ 111914410,
591
+ 722673287,
592
+ 776295962,
593
+ 315220696,
594
+ 191649107,
595
+ 815581512,
596
+ 989959866,
597
+ 440552460,
598
+ 954917947,
599
+ 51832643,
600
+ 905359234,
601
+ 773143062,
602
+ 656936019,
603
+ 694396762,
604
+ 230381678,
605
+ 210807153,
606
+ 350381952,
607
+ 808610035,
608
+ 6255600,
609
+ 34540935,
610
+ 209273851,
611
+ 850049691,
612
+ 858488382,
613
+ 518231702,
614
+ 352113465,
615
+ 62780225,
616
+ 282807698,
617
+ 831007791,
618
+ 650980005,
619
+ 574846098,
620
+ 61553545,
621
+ 274523676,
622
+ 711602218,
623
+ 385129492,
624
+ 847405724,
625
+ 926456940,
626
+ 748171699,
627
+ 449810302,
628
+ 977518246,
629
+ 985455433,
630
+ 407941158,
631
+ 944376098,
632
+ 961465481,
633
+ 397544002,
634
+ 303218493,
635
+ 232461671,
636
+ 825676404,
637
+ 73156937,
638
+ 793859512,
639
+ 229878239,
640
+ 588044040,
641
+ 885332225,
642
+ 512768388,
643
+ 861633285,
644
+ 389606930,
645
+ 694205634,
646
+ 194738823,
647
+ 879852754,
648
+ 815534297,
649
+ 976940265,
650
+ 483320339,
651
+ 549677209,
652
+ 850304406,
653
+ 537645732,
654
+ 763800735,
655
+ 285775368,
656
+ 256937213,
657
+ 626323579,
658
+ 129602042,
659
+ 164697882,
660
+ 858050839,
661
+ 508655093,
662
+ 92498001,
663
+ 413904133,
664
+ 572605135,
665
+ 938286180,
666
+ 845867960,
667
+ 331523486,
668
+ 870971097,
669
+ 742327289,
670
+ 166738298,
671
+ 852205239,
672
+ 878706851,
673
+ 518111783,
674
+ 493899427,
675
+ 625687318,
676
+ 508889267,
677
+ 975932896,
678
+ 366338365,
679
+ 586089838,
680
+ 400821155,
681
+ 519465376,
682
+ 148599366,
683
+ 233385079,
684
+ 813214982,
685
+ 213016271,
686
+ 92651775,
687
+ 915860250,
688
+ 347210612,
689
+ 138592882,
690
+ 954499279,
691
+ 193516954,
692
+ 418315160,
693
+ 334344868,
694
+ 745343952,
695
+ 661884753,
696
+ 928697299,
697
+ 896202641,
698
+ 774306109,
699
+ 433312680,
700
+ 61535626,
701
+ 551137703,
702
+ 291277716,
703
+ 569084857,
704
+ 560850824,
705
+ 207761645,
706
+ 344411585,
707
+ 541493117,
708
+ 385881591,
709
+ 527167296,
710
+ 972233327,
711
+ 435058595,
712
+ 460703083,
713
+ 808370051,
714
+ 852361167,
715
+ 842857436,
716
+ 811548314,
717
+ 71840691,
718
+ 850230266,
719
+ 444048795,
720
+ 719568642,
721
+ 841077643,
722
+ 37374268,
723
+ 910911036,
724
+ 380889602,
725
+ 591441142,
726
+ 322484405,
727
+ 686543010,
728
+ 312730410,
729
+ 296791668,
730
+ 485513569,
731
+ 762038181,
732
+ 223210260,
733
+ 208949131,
734
+ 427736469,
735
+ 854695282,
736
+ 760863108,
737
+ 644991768,
738
+ 347597952,
739
+ 617800021,
740
+ 19052932,
741
+ 893751395,
742
+ 890515798,
743
+ 740708512,
744
+ 38270286,
745
+ 79536163,
746
+ 508038945,
747
+ 950953359,
748
+ 890422385,
749
+ 608498474,
750
+ 814271884,
751
+ 134656944,
752
+ 145958542,
753
+ 919211570,
754
+ 65580922,
755
+ 831269158,
756
+ 920725364,
757
+ 758904322,
758
+ 837289035,
759
+ 909873432,
760
+ 751347744,
761
+ 571322117,
762
+ 412310164,
763
+ 554173921,
764
+ 103197044,
765
+ 321531552,
766
+ 244143119,
767
+ 606838431,
768
+ 194182488,
769
+ 595422111,
770
+ 520145167,
771
+ 779150926,
772
+ 290754911,
773
+ 514905902,
774
+ 396823286,
775
+ 638387592,
776
+ 821376592,
777
+ 250422322,
778
+ 641508719,
779
+ 443196302,
780
+ 434432513,
781
+ 580876960,
782
+ 939807718,
783
+ 679698500,
784
+ 11928162,
785
+ 617383215,
786
+ 908103245,
787
+ 955672507,
788
+ 767518600,
789
+ 506326023,
790
+ 689470888,
791
+ 555604927,
792
+ 522942640,
793
+ 653657429,
794
+ 235305617,
795
+ 297446847,
796
+ 779782477,
797
+ 208904077,
798
+ 424325305,
799
+ 956283053,
800
+ 770105711,
801
+ 441349935,
802
+ 815608638,
803
+ 18405552,
804
+ 658812718,
805
+ 972528815,
806
+ 369404560,
807
+ 183684391,
808
+ 124265017,
809
+ 267910927,
810
+ 356894296,
811
+ 111621739,
812
+ 529345682,
813
+ 104542192,
814
+ 413221077,
815
+ 320826511,
816
+ 22878970,
817
+ 936015591,
818
+ 521358984,
819
+ 707820868,
820
+ 395512066,
821
+ 77004612,
822
+ 679404096,
823
+ 522336398,
824
+ 793321689,
825
+ 559568738,
826
+ 508685973,
827
+ 578049973,
828
+ 444891489,
829
+ 503407698,
830
+ 318836053,
831
+ 348514436,
832
+ 731735990,
833
+ 144125725,
834
+ 286678449,
835
+ 527619095,
836
+ 757313658,
837
+ 594982669,
838
+ 941157496,
839
+ 232274069,
840
+ 347985723,
841
+ 773072315,
842
+ 465547591,
843
+ 461633227,
844
+ 117732755,
845
+ 810251922,
846
+ 973570259,
847
+ 690079220,
848
+ 862125590,
849
+ 405390982,
850
+ 929531742,
851
+ 919050452,
852
+ 148479573,
853
+ 469923670,
854
+ 882510483,
855
+ 938455480,
856
+ 323804525,
857
+ 807154980,
858
+ 299129215,
859
+ 512698337,
860
+ 983783156,
861
+ 751763213,
862
+ 749312006,
863
+ 815493791,
864
+ 967738640,
865
+ 225493197,
866
+ 63704527,
867
+ 296466004,
868
+ 378971759,
869
+ 296064821,
870
+ 293022007,
871
+ 138037379,
872
+ 406318776,
873
+ 92301376,
874
+ 891215287,
875
+ 713880959,
876
+ 210068289,
877
+ 74761488,
878
+ 404205329,
879
+ 887848476,
880
+ 377336575,
881
+ 598591425,
882
+ 740241469,
883
+ 579039655,
884
+ 707424303,
885
+ 743508880,
886
+ 508044416,
887
+ 933801198,
888
+ 417336607,
889
+ 6641719,
890
+ 632493878,
891
+ 829949634,
892
+ 934986008,
893
+ 117558839,
894
+ 793324833,
895
+ 691881415,
896
+ 158669788,
897
+ 673145144,
898
+ 820731009,
899
+ 32414445,
900
+ 611205310,
901
+ 581553561,
902
+ 299672197,
903
+ 50087294,
904
+ 763828341,
905
+ 54649639,
906
+ 34603442,
907
+ 136776772,
908
+ 734063953,
909
+ 191306524,
910
+ 411957664,
911
+ 306220597,
912
+ 641010972,
913
+ 732062230,
914
+ 294024691,
915
+ 676209669,
916
+ 855152945,
917
+ 110310116,
918
+ 441955786,
919
+ 764396778,
920
+ 960076821,
921
+ 986605635,
922
+ 240924926,
923
+ 89200253,
924
+ 883564498,
925
+ 213610179,
926
+ 794284614,
927
+ 180504879,
928
+ 311532380,
929
+ 103685117,
930
+ 29318893,
931
+ 859497914,
932
+ 123022643,
933
+ 642491134,
934
+ 506975174,
935
+ 539188342,
936
+ 653062362,
937
+ 370329281,
938
+ 899862913,
939
+ 865854570,
940
+ 833716225,
941
+ 201342523,
942
+ 732034769,
943
+ 858640413,
944
+ 383934495,
945
+ 105403121,
946
+ 922169592,
947
+ 714395656,
948
+ 262004557,
949
+ 995525106,
950
+ 271470066,
951
+ 898640808,
952
+ 223086637,
953
+ 300555377,
954
+ 251021366,
955
+ 973949389,
956
+ 106904706,
957
+ 905028403,
958
+ 124542256,
959
+ 18729468,
960
+ 927960082,
961
+ 130713489,
962
+ 42978748,
963
+ 375630436,
964
+ 784068231,
965
+ 105581268,
966
+ 745310754,
967
+ 982387885,
968
+ 208110234,
969
+ 998472740,
970
+ 950242139,
971
+ 361480170,
972
+ 605835061,
973
+ 378791938,
974
+ 385426704,
975
+ 173490007,
976
+ 840989527,
977
+ 750889691,
978
+ 558296961,
979
+ 592578382,
980
+ 543430494,
981
+ 863101818,
982
+ 452224004,
983
+ 806813385,
984
+ 262208764,
985
+ 451457428,
986
+ 668767606,
987
+ 992312960,
988
+ 53772933,
989
+ 932568167,
990
+ 515094846,
991
+ 218715670,
992
+ 117192714,
993
+ 160127821,
994
+ 347549713,
995
+ 358842285,
996
+ 42881586,
997
+ 157404256,
998
+ 162188817,
999
+ 987671544,
1000
+ 34352859,
1001
+ 285529186,
1002
+ 187037073,
1003
+ 185282309,
1004
+ 613176701,
1005
+ 583805804,
1006
+ 415389541,
1007
+ 982504602,
1008
+ 582655326,
1009
+ 692944767,
1010
+ 791060529,
1011
+ 653901743,
1012
+ 758139384,
1013
+ 412842816,
1014
+ 591346325,
1015
+ 284856664,
1016
+ 604258399,
1017
+ 57101119,
1018
+ 417373117,
1019
+ 552335265,
1020
+ 306923153,
1021
+ 658164059,
1022
+ 693325423,
1023
+ 712496532,
1024
+ 243341024,
1025
+ 954079355,
1026
+ 954171997,
1027
+ 332665840,
1028
+ 100123831,
1029
+ 516429516,
1030
+ 224486773,
1031
+ 736914487,
1032
+ 103798490,
1033
+ 748436667,
1034
+ 460116016,
1035
+ 154132405,
1036
+ 133096029,
1037
+ 327951209,
1038
+ 693862799,
1039
+ 743760820,
1040
+ 368227215,
1041
+ 83833428,
1042
+ 706476338,
1043
+ 597799039,
1044
+ 887903365,
1045
+ 808868241,
1046
+ 819069341,
1047
+ 798366030,
1048
+ 409741371,
1049
+ 331989592,
1050
+ 974380265,
1051
+ 355152189,
1052
+ 502669015,
1053
+ 299669502,
1054
+ 658698592,
1055
+ 260721334,
1056
+ 756907437,
1057
+ 106131102,
1058
+ 554228613,
1059
+ 675166664,
1060
+ 316108544,
1061
+ 41960962,
1062
+ 258077325,
1063
+ 369512709,
1064
+ 418350618,
1065
+ 874766574,
1066
+ 376087919,
1067
+ 480195102,
1068
+ 610217443,
1069
+ 481367251,
1070
+ 17850657,
1071
+ 923139615,
1072
+ 773487855,
1073
+ 907166850,
1074
+ 818613197,
1075
+ 707741058,
1076
+ 538447172,
1077
+ 654448469,
1078
+ 301727530,
1079
+ 854575979,
1080
+ 617288980,
1081
+ 495740226,
1082
+ 384519077,
1083
+ 96426684,
1084
+ 36766398,
1085
+ 271761898,
1086
+ 80220413,
1087
+ 889315125,
1088
+ 460099516,
1089
+ 108304710,
1090
+ 648352858,
1091
+ 7314411,
1092
+ 220769737,
1093
+ 69095862,
1094
+ 850716074,
1095
+ 934288426,
1096
+ 603365099,
1097
+ 27452685,
1098
+ 423573676,
1099
+ 171631012,
1100
+ 219605931,
1101
+ 190726232,
1102
+ 619001091,
1103
+ 691641432,
1104
+ 404661929,
1105
+ 912200580,
1106
+ 60191502,
1107
+ 114705589,
1108
+ 563699388,
1109
+ 502459100,
1110
+ 582493068,
1111
+ 84088001,
1112
+ 496103606,
1113
+ 621610493,
1114
+ 907612877,
1115
+ 432882558,
1116
+ 881745477,
1117
+ 663664476,
1118
+ 45545571,
1119
+ 375574995,
1120
+ 364910810,
1121
+ 36413928,
1122
+ 158330550,
1123
+ 5056208,
1124
+ 170778091,
1125
+ 716452055,
1126
+ 974143473,
1127
+ 737038596,
1128
+ 67187161,
1129
+ 163282278,
1130
+ 239947775,
1131
+ 441358930,
1132
+ 938040191,
1133
+ 485374724,
1134
+ 760133531,
1135
+ 121152843,
1136
+ 192270637,
1137
+ 395353794,
1138
+ 628034439,
1139
+ 918570527,
1140
+ 421180159,
1141
+ 957821999,
1142
+ 872665061,
1143
+ 416003792,
1144
+ 541658539,
1145
+ 235698501,
1146
+ 206801418,
1147
+ 958944011,
1148
+ 772092674,
1149
+ 635997681,
1150
+ 756922613,
1151
+ 778723951,
1152
+ 595778086,
1153
+ 452249410,
1154
+ 278650048,
1155
+ 154538094,
1156
+ 593808447,
1157
+ 247046746,
1158
+ 645506659,
1159
+ 713209009,
1160
+ 362796769,
1161
+ 287679252,
1162
+ 211356787,
1163
+ 675393910,
1164
+ 648795529,
1165
+ 678918204,
1166
+ 181634500,
1167
+ 671169987,
1168
+ 243628940,
1169
+ 898107096,
1170
+ 606668651,
1171
+ 685422894,
1172
+ 948167874,
1173
+ 888202254,
1174
+ 602499367,
1175
+ 478380012,
1176
+ 660152465,
1177
+ 381546363,
1178
+ 573378116,
1179
+ 290546006,
1180
+ 519278660,
1181
+ 447312924,
1182
+ 226571410,
1183
+ 345078210,
1184
+ 21942937,
1185
+ 906487017,
1186
+ 748462085,
1187
+ 966453564,
1188
+ 660629529,
1189
+ 572178985,
1190
+ 30369095,
1191
+ 820953554,
1192
+ 521458401,
1193
+ 733228100,
1194
+ 706817886,
1195
+ 717736765,
1196
+ 859096943,
1197
+ 271561561,
1198
+ 961962384,
1199
+ 686499326,
1200
+ 789113257,
1201
+ 728015311,
1202
+ 234569562,
1203
+ 176116950,
1204
+ 537062437,
1205
+ 131187094,
1206
+ 838359764,
1207
+ 928432705,
1208
+ 277392721,
1209
+ 487093702,
1210
+ 415133899,
1211
+ 508578527,
1212
+ 614543521,
1213
+ 299349724,
1214
+ 17067654,
1215
+ 468477789,
1216
+ 266431305,
1217
+ 155320037,
1218
+ 122788656,
1219
+ 995651255,
1220
+ 245222103,
1221
+ 68691493,
1222
+ 851818713,
1223
+ 781600183,
1224
+ 979428001,
1225
+ 229131401,
1226
+ 313782109,
1227
+ 206489574,
1228
+ 472639045,
1229
+ 131994347,
1230
+ 33955895,
1231
+ 75839517,
1232
+ 701548425,
1233
+ 348529295,
1234
+ 234858359,
1235
+ 768882164,
1236
+ 7942677,
1237
+ 582139035,
1238
+ 621573387,
1239
+ 963435878,
1240
+ 967466898,
1241
+ 438075339,
1242
+ 911237022,
1243
+ 95282977,
1244
+ 296359508,
1245
+ 185726524,
1246
+ 21904235,
1247
+ 361730657,
1248
+ 759702368,
1249
+ 647093522,
1250
+ 415383055,
1251
+ 683639222,
1252
+ 691390411,
1253
+ 610235602,
1254
+ 199808090,
1255
+ 807009282,
1256
+ 38139895,
1257
+ 781786745,
1258
+ 310673206,
1259
+ 644914484,
1260
+ 213440225,
1261
+ 996327208,
1262
+ 646706306,
1263
+ 333518248,
1264
+ 630897579,
1265
+ 343255060,
1266
+ 131569387,
1267
+ 119573855,
1268
+ 112859612,
1269
+ 970824241,
1270
+ 183344288,
1271
+ 228657096,
1272
+ 629723452,
1273
+ 539791789,
1274
+ 967840886,
1275
+ 91137026,
1276
+ 127476119,
1277
+ 635470909,
1278
+ 826763616,
1279
+ 332750951,
1280
+ 474745742,
1281
+ 899517271,
1282
+ 232176115,
1283
+ 566884335,
1284
+ 963257190,
1285
+ 150004864,
1286
+ 286052863,
1287
+ 528233164,
1288
+ 390683191,
1289
+ 356865821,
1290
+ 638086204,
1291
+ 134714372,
1292
+ 683006182,
1293
+ 861120330,
1294
+ 760500517,
1295
+ 801720335,
1296
+ 142770209,
1297
+ 885664,
1298
+ 422751155,
1299
+ 906172245,
1300
+ 355580779,
1301
+ 444008582,
1302
+ 641496412,
1303
+ 569363180,
1304
+ 740393282,
1305
+ 626331121,
1306
+ 556107009,
1307
+ 738523784,
1308
+ 10521847,
1309
+ 820942454,
1310
+ 273092212,
1311
+ 805962000,
1312
+ 391860327,
1313
+ 726362960,
1314
+ 36305476,
1315
+ 997980139,
1316
+ 800133966,
1317
+ 214166604,
1318
+ 290174977,
1319
+ 553193710,
1320
+ 642912500,
1321
+ 130930501,
1322
+ 322147194,
1323
+ 188402765,
1324
+ 341690028,
1325
+ 499941060,
1326
+ 215811874,
1327
+ 565343097,
1328
+ 549268802,
1329
+ 912853119,
1330
+ 745677765,
1331
+ 835028225,
1332
+ 192007950,
1333
+ 590689710,
1334
+ 706754977,
1335
+ 346650674,
1336
+ 830600308,
1337
+ 116085278,
1338
+ 712200936,
1339
+ 705464333,
1340
+ 195831126,
1341
+ 486717000,
1342
+ 280041715,
1343
+ 888717645,
1344
+ 35969889,
1345
+ 881742578,
1346
+ 812953177,
1347
+ 622106874,
1348
+ 927489678,
1349
+ 576980430,
1350
+ 434571625,
1351
+ 906453207,
1352
+ 369384424,
1353
+ 308262272,
1354
+ 181218708,
1355
+ 427131182,
1356
+ 495473454,
1357
+ 39550886,
1358
+ 174247909,
1359
+ 437188682,
1360
+ 404995219,
1361
+ 249872322,
1362
+ 883607067,
1363
+ 753744310,
1364
+ 746127688,
1365
+ 266864206,
1366
+ 734661814,
1367
+ 71224714,
1368
+ 626051565,
1369
+ 922111874,
1370
+ 392695472,
1371
+ 989975594,
1372
+ 562080577,
1373
+ 755901281,
1374
+ 806968548,
1375
+ 658118435,
1376
+ 110920694
1377
+ ],
1378
+ "output": 21086879764
1379
+ },
1380
+ {
1381
+ "input": [
1382
+ 424606157,
1383
+ 868454057,
1384
+ 655926406,
1385
+ 762331124,
1386
+ 781007349,
1387
+ 25855609,
1388
+ 570337160,
1389
+ 81881830,
1390
+ 737899152,
1391
+ 312953431,
1392
+ 884938070,
1393
+ 235997467,
1394
+ 86058582,
1395
+ 815302859,
1396
+ 827527803,
1397
+ 544397461,
1398
+ 946318394,
1399
+ 356108153,
1400
+ 504015276,
1401
+ 427220221,
1402
+ 441271269,
1403
+ 31069231,
1404
+ 107818372,
1405
+ 52872058,
1406
+ 19848961,
1407
+ 330553928,
1408
+ 372003325,
1409
+ 737995396,
1410
+ 525942199,
1411
+ 401049977,
1412
+ 26726601,
1413
+ 979515788,
1414
+ 686337488,
1415
+ 770132231,
1416
+ 375088663,
1417
+ 991406714,
1418
+ 346788757,
1419
+ 289503141,
1420
+ 455306773,
1421
+ 178956050,
1422
+ 913809654,
1423
+ 275241557,
1424
+ 533300593,
1425
+ 461111987,
1426
+ 543237880,
1427
+ 608368438,
1428
+ 335171062,
1429
+ 675189964,
1430
+ 155074983,
1431
+ 758418989,
1432
+ 744258102,
1433
+ 974125618,
1434
+ 77927545,
1435
+ 713767968,
1436
+ 281155999,
1437
+ 21136709,
1438
+ 273804857,
1439
+ 950268204,
1440
+ 406663351,
1441
+ 702375623,
1442
+ 488537248,
1443
+ 915974358,
1444
+ 164891558,
1445
+ 190002552,
1446
+ 116587122,
1447
+ 370130084,
1448
+ 323681679,
1449
+ 696729073,
1450
+ 834934402,
1451
+ 628314849,
1452
+ 869524077,
1453
+ 231452623,
1454
+ 757609035,
1455
+ 23736135,
1456
+ 860659235,
1457
+ 181166350,
1458
+ 375604662,
1459
+ 304353680,
1460
+ 966671049,
1461
+ 735531524,
1462
+ 635797963,
1463
+ 305188124,
1464
+ 314552267,
1465
+ 298391059,
1466
+ 78545067,
1467
+ 263046541,
1468
+ 474262081,
1469
+ 922779117,
1470
+ 345985130,
1471
+ 642600391,
1472
+ 854275521,
1473
+ 306914969,
1474
+ 907582100,
1475
+ 798306637,
1476
+ 556785913,
1477
+ 187973090,
1478
+ 522310602,
1479
+ 711312015,
1480
+ 218472727,
1481
+ 88732618,
1482
+ 554238248,
1483
+ 227989467,
1484
+ 45365896,
1485
+ 774444438,
1486
+ 108846514,
1487
+ 326515214,
1488
+ 325065303,
1489
+ 251031880,
1490
+ 644311889,
1491
+ 167287703,
1492
+ 85204377,
1493
+ 868230181,
1494
+ 218266343,
1495
+ 744160377,
1496
+ 263854367,
1497
+ 244331712,
1498
+ 58844021,
1499
+ 903118259,
1500
+ 556287612,
1501
+ 190019233,
1502
+ 771859125,
1503
+ 342169397,
1504
+ 784733603,
1505
+ 238933499,
1506
+ 266178099,
1507
+ 516144760,
1508
+ 368890028,
1509
+ 667729610,
1510
+ 434066251,
1511
+ 202714480,
1512
+ 818461815,
1513
+ 854965399,
1514
+ 560715322,
1515
+ 454355059,
1516
+ 76432474,
1517
+ 656735994,
1518
+ 679447073,
1519
+ 704379861,
1520
+ 387127546,
1521
+ 983223219,
1522
+ 697044450,
1523
+ 561346869,
1524
+ 673964174,
1525
+ 114245755,
1526
+ 449714614,
1527
+ 785320588,
1528
+ 362896289,
1529
+ 57924709,
1530
+ 80015761,
1531
+ 537433189,
1532
+ 891746640,
1533
+ 144215527,
1534
+ 583050470,
1535
+ 281281821,
1536
+ 749663957,
1537
+ 125280947,
1538
+ 577503881,
1539
+ 507127357,
1540
+ 108628346,
1541
+ 142177361,
1542
+ 784462143,
1543
+ 721687750,
1544
+ 931718105,
1545
+ 29754667,
1546
+ 29208398,
1547
+ 977520400,
1548
+ 573193813,
1549
+ 866767172,
1550
+ 827175662,
1551
+ 589614103,
1552
+ 20615978,
1553
+ 711472113,
1554
+ 140858912,
1555
+ 413191106,
1556
+ 666654690,
1557
+ 56880625,
1558
+ 582281368,
1559
+ 303562665,
1560
+ 179724814,
1561
+ 227016583,
1562
+ 946491552,
1563
+ 866413166,
1564
+ 500024195,
1565
+ 920595438,
1566
+ 400748985,
1567
+ 288687709,
1568
+ 694700493,
1569
+ 920269270,
1570
+ 59632072,
1571
+ 546445586,
1572
+ 278555116,
1573
+ 450371127,
1574
+ 296763710,
1575
+ 155824082,
1576
+ 492019330,
1577
+ 300409610,
1578
+ 785064338,
1579
+ 379344940,
1580
+ 370932636,
1581
+ 853900020,
1582
+ 611290894,
1583
+ 581565453,
1584
+ 524955087,
1585
+ 751838654,
1586
+ 69164078,
1587
+ 771871184,
1588
+ 134568093,
1589
+ 862937525,
1590
+ 973435729,
1591
+ 654991468,
1592
+ 903994029,
1593
+ 202017348,
1594
+ 211821339,
1595
+ 918758225,
1596
+ 750466248,
1597
+ 707940663,
1598
+ 988570936,
1599
+ 353248311,
1600
+ 169809386,
1601
+ 12466109,
1602
+ 926429933,
1603
+ 68721569,
1604
+ 320245734,
1605
+ 140973873,
1606
+ 478987459,
1607
+ 184153875,
1608
+ 245644797,
1609
+ 560249473,
1610
+ 227631268,
1611
+ 340854964,
1612
+ 193767502,
1613
+ 919178674,
1614
+ 591530493,
1615
+ 900311978,
1616
+ 665261784,
1617
+ 669196522,
1618
+ 90400609,
1619
+ 274035862,
1620
+ 576961321,
1621
+ 355974973,
1622
+ 53101315,
1623
+ 511565237,
1624
+ 649854805,
1625
+ 382442072,
1626
+ 964893056,
1627
+ 602076069,
1628
+ 240342719,
1629
+ 658379798,
1630
+ 68178147,
1631
+ 669535029,
1632
+ 706663739,
1633
+ 416602389,
1634
+ 952407754,
1635
+ 646136040,
1636
+ 923991660,
1637
+ 624760968,
1638
+ 610630550,
1639
+ 394385581,
1640
+ 67744313,
1641
+ 194398744,
1642
+ 123954825,
1643
+ 859969001,
1644
+ 723743900,
1645
+ 217516228,
1646
+ 445858283,
1647
+ 878103916,
1648
+ 144473239,
1649
+ 342386250,
1650
+ 510919517,
1651
+ 377195171,
1652
+ 178433441,
1653
+ 767718879,
1654
+ 497965694,
1655
+ 686730537,
1656
+ 778768843,
1657
+ 242051661,
1658
+ 552753137,
1659
+ 785759839,
1660
+ 559299151,
1661
+ 909142441,
1662
+ 19319268,
1663
+ 419516906,
1664
+ 654019870,
1665
+ 605614378,
1666
+ 255491975,
1667
+ 527298072,
1668
+ 64779396,
1669
+ 478021401,
1670
+ 659045830,
1671
+ 766873821,
1672
+ 827969129,
1673
+ 673691819,
1674
+ 30365618,
1675
+ 960896766,
1676
+ 335097708,
1677
+ 489798109,
1678
+ 921830007,
1679
+ 870164787,
1680
+ 397261062,
1681
+ 622360329,
1682
+ 265427231,
1683
+ 706961899,
1684
+ 489120306,
1685
+ 565219862,
1686
+ 517274109,
1687
+ 178179911,
1688
+ 392584532,
1689
+ 398168359,
1690
+ 584999271,
1691
+ 599349068,
1692
+ 956247333,
1693
+ 669268372,
1694
+ 740633549,
1695
+ 367044198,
1696
+ 131208311,
1697
+ 136764698,
1698
+ 159858313,
1699
+ 548563514,
1700
+ 539813495,
1701
+ 482583735,
1702
+ 231032496,
1703
+ 56339918,
1704
+ 832002582,
1705
+ 437851358,
1706
+ 399382523,
1707
+ 808324321,
1708
+ 637459653,
1709
+ 391082127,
1710
+ 748156649,
1711
+ 126745564,
1712
+ 134272722,
1713
+ 765127694,
1714
+ 495404820,
1715
+ 297024658,
1716
+ 528430277,
1717
+ 462294099,
1718
+ 963565773,
1719
+ 469139409,
1720
+ 164191045,
1721
+ 828315666,
1722
+ 94436003,
1723
+ 656962525,
1724
+ 320207813,
1725
+ 81381744,
1726
+ 430428845,
1727
+ 118840139,
1728
+ 221836425,
1729
+ 852061224,
1730
+ 663646746,
1731
+ 432640065,
1732
+ 340408363,
1733
+ 916462826,
1734
+ 740636639,
1735
+ 965314087,
1736
+ 249134027,
1737
+ 357437555,
1738
+ 783662677,
1739
+ 959003618,
1740
+ 117779909,
1741
+ 495285889,
1742
+ 831385384,
1743
+ 511631262,
1744
+ 492121037,
1745
+ 779873555,
1746
+ 518203636,
1747
+ 586177914,
1748
+ 421687143,
1749
+ 369860335,
1750
+ 38658346,
1751
+ 670051264,
1752
+ 867121706,
1753
+ 912438125,
1754
+ 234494851,
1755
+ 971672226,
1756
+ 510298928,
1757
+ 226678346,
1758
+ 877815693,
1759
+ 812353194,
1760
+ 706620702,
1761
+ 564809286,
1762
+ 72154289,
1763
+ 116284180,
1764
+ 798849358,
1765
+ 193967092,
1766
+ 176614494,
1767
+ 229190066,
1768
+ 262282194,
1769
+ 48232542,
1770
+ 199835280,
1771
+ 920156238,
1772
+ 279010252,
1773
+ 246398634,
1774
+ 820992055,
1775
+ 338237260,
1776
+ 164567059,
1777
+ 431568261,
1778
+ 927216919,
1779
+ 323557761,
1780
+ 869886071,
1781
+ 888202210,
1782
+ 772949535,
1783
+ 569048048,
1784
+ 437134924,
1785
+ 914786836,
1786
+ 28876991,
1787
+ 467955658,
1788
+ 890127756,
1789
+ 943805096,
1790
+ 678478238,
1791
+ 835946260,
1792
+ 573773321,
1793
+ 25684875,
1794
+ 385829009,
1795
+ 135464298,
1796
+ 635338091,
1797
+ 824321911,
1798
+ 533758288,
1799
+ 692877528,
1800
+ 518653213,
1801
+ 427198719,
1802
+ 221885017,
1803
+ 382051126,
1804
+ 22094263,
1805
+ 520432351,
1806
+ 636963297,
1807
+ 381797747,
1808
+ 694307457,
1809
+ 523576875,
1810
+ 476510365,
1811
+ 485176822,
1812
+ 245411365,
1813
+ 445749010,
1814
+ 508290479,
1815
+ 971662211,
1816
+ 977383047,
1817
+ 255154004,
1818
+ 614121625,
1819
+ 393910624,
1820
+ 85020022,
1821
+ 22085371,
1822
+ 894921648,
1823
+ 256200279,
1824
+ 487534889,
1825
+ 167467436,
1826
+ 992429680,
1827
+ 558073444,
1828
+ 964630476,
1829
+ 806752623,
1830
+ 792760887,
1831
+ 595219021,
1832
+ 545989710,
1833
+ 13419880,
1834
+ 845956600,
1835
+ 385278405,
1836
+ 567069241,
1837
+ 148751919,
1838
+ 980548777,
1839
+ 309077876,
1840
+ 929669901,
1841
+ 244356340,
1842
+ 652410431,
1843
+ 776395412,
1844
+ 279847656,
1845
+ 121852842,
1846
+ 371053605,
1847
+ 819943711,
1848
+ 172876020,
1849
+ 169566739,
1850
+ 863698781,
1851
+ 69904254,
1852
+ 203432029,
1853
+ 164262275,
1854
+ 33145069,
1855
+ 746452383,
1856
+ 501107506,
1857
+ 518837227,
1858
+ 41103147,
1859
+ 800132215,
1860
+ 428771377,
1861
+ 477581888,
1862
+ 665130503,
1863
+ 939578870,
1864
+ 228709542,
1865
+ 138196179,
1866
+ 404632052,
1867
+ 466187409,
1868
+ 40936142,
1869
+ 293802515,
1870
+ 998329989,
1871
+ 130148363,
1872
+ 706213219,
1873
+ 918100558,
1874
+ 617385012,
1875
+ 943006814,
1876
+ 108772603,
1877
+ 838778853,
1878
+ 582382918,
1879
+ 940155581,
1880
+ 703646063
1881
+ ],
1882
+ "output": 17966263596
1883
+ },
1884
+ {
1885
+ "input": [
1886
+ 457307243,
1887
+ 538765441,
1888
+ 936585121,
1889
+ 891255631,
1890
+ 981400086,
1891
+ 785030154,
1892
+ 205823245,
1893
+ 366369370,
1894
+ 381995020,
1895
+ 620390059,
1896
+ 244571896,
1897
+ 946759161,
1898
+ 507788745,
1899
+ 871210585,
1900
+ 544518543,
1901
+ 783169450,
1902
+ 37124404,
1903
+ 946527946,
1904
+ 73127486,
1905
+ 607145768,
1906
+ 168991090,
1907
+ 134768122,
1908
+ 906205049,
1909
+ 364598861,
1910
+ 496385945,
1911
+ 186741170,
1912
+ 85470072,
1913
+ 984144055,
1914
+ 447287418,
1915
+ 382810184,
1916
+ 164359867,
1917
+ 626105760,
1918
+ 588155263,
1919
+ 367531644,
1920
+ 215006135,
1921
+ 930719828,
1922
+ 181463609,
1923
+ 721811508,
1924
+ 888191089,
1925
+ 700778940,
1926
+ 49229013,
1927
+ 305415785,
1928
+ 438730597,
1929
+ 215595615,
1930
+ 320778097,
1931
+ 553044877,
1932
+ 208579795,
1933
+ 650833235,
1934
+ 35788171,
1935
+ 199045946,
1936
+ 27204750,
1937
+ 96501563,
1938
+ 844752838,
1939
+ 351617059,
1940
+ 630805611,
1941
+ 511304463,
1942
+ 871828719,
1943
+ 299099113,
1944
+ 155592543,
1945
+ 828945189,
1946
+ 500207310,
1947
+ 964793055,
1948
+ 290570076,
1949
+ 520680881,
1950
+ 886441506,
1951
+ 964497646,
1952
+ 278497567,
1953
+ 721068849,
1954
+ 135725790,
1955
+ 902622141,
1956
+ 466434512,
1957
+ 17270282,
1958
+ 372613499,
1959
+ 209678454,
1960
+ 720325631,
1961
+ 696850901,
1962
+ 986931122,
1963
+ 892694579,
1964
+ 249379749,
1965
+ 115455210,
1966
+ 471418511,
1967
+ 170715949,
1968
+ 254608366,
1969
+ 385192501,
1970
+ 694035208,
1971
+ 369621614,
1972
+ 400753583,
1973
+ 799239314,
1974
+ 828994264,
1975
+ 999611810,
1976
+ 840022889,
1977
+ 460305770,
1978
+ 951120976,
1979
+ 170682134,
1980
+ 789538773,
1981
+ 172391908,
1982
+ 735854857,
1983
+ 483600955,
1984
+ 992172790,
1985
+ 799365599,
1986
+ 906797917,
1987
+ 705574376,
1988
+ 120953222,
1989
+ 491642449,
1990
+ 420558991,
1991
+ 812011453,
1992
+ 644593631,
1993
+ 972209414,
1994
+ 290494802,
1995
+ 740109977,
1996
+ 414164553,
1997
+ 553400073,
1998
+ 618722479,
1999
+ 782813288,
2000
+ 849053837,
2001
+ 554516352,
2002
+ 945517963,
2003
+ 443711395,
2004
+ 32675328,
2005
+ 652381001,
2006
+ 994255236,
2007
+ 846570317,
2008
+ 804694823,
2009
+ 945040848,
2010
+ 922473618,
2011
+ 671714748,
2012
+ 252981772,
2013
+ 583647023,
2014
+ 749518114,
2015
+ 953974681,
2016
+ 862900406,
2017
+ 253942102,
2018
+ 431788867,
2019
+ 815269881,
2020
+ 326969664,
2021
+ 902424068,
2022
+ 395939359,
2023
+ 899557123,
2024
+ 52751257,
2025
+ 702167344,
2026
+ 815551528,
2027
+ 534412689,
2028
+ 725722770,
2029
+ 84602638,
2030
+ 178963593,
2031
+ 677039164,
2032
+ 290622067,
2033
+ 533610726,
2034
+ 653549312,
2035
+ 309600592,
2036
+ 145614778,
2037
+ 833200618,
2038
+ 614029752,
2039
+ 253466773,
2040
+ 647625317,
2041
+ 848757408,
2042
+ 205925215,
2043
+ 2876869,
2044
+ 23530172,
2045
+ 332791049,
2046
+ 374010574,
2047
+ 262642293,
2048
+ 486224879,
2049
+ 38904308,
2050
+ 824146420,
2051
+ 832394838,
2052
+ 187700433,
2053
+ 167065764,
2054
+ 105549499,
2055
+ 793839801,
2056
+ 20114974,
2057
+ 566182026,
2058
+ 27713350,
2059
+ 51936313,
2060
+ 306272549,
2061
+ 412355222,
2062
+ 890558330,
2063
+ 363687500,
2064
+ 193037505,
2065
+ 355435245,
2066
+ 440293550,
2067
+ 270760354,
2068
+ 73284363,
2069
+ 326501935,
2070
+ 772556061,
2071
+ 837668668,
2072
+ 483897098,
2073
+ 133822042,
2074
+ 120951633,
2075
+ 106075138,
2076
+ 423223711,
2077
+ 619154519,
2078
+ 498849009,
2079
+ 903137903,
2080
+ 43411058,
2081
+ 913752568,
2082
+ 333563611,
2083
+ 617370463,
2084
+ 260224287,
2085
+ 332899347,
2086
+ 767911646,
2087
+ 405448163,
2088
+ 384440576,
2089
+ 43697943,
2090
+ 843637238,
2091
+ 219381769,
2092
+ 450409142,
2093
+ 848063703,
2094
+ 138831156,
2095
+ 335804379,
2096
+ 434239894,
2097
+ 309109060,
2098
+ 303386490,
2099
+ 662519062,
2100
+ 96550844,
2101
+ 335920951,
2102
+ 841873641,
2103
+ 797517841,
2104
+ 153090474,
2105
+ 946681167,
2106
+ 561913697,
2107
+ 519200726,
2108
+ 980514595,
2109
+ 453889782,
2110
+ 982715368,
2111
+ 649453828,
2112
+ 145539060,
2113
+ 28111331,
2114
+ 812543050,
2115
+ 73751290,
2116
+ 383915414,
2117
+ 730203629,
2118
+ 877136211,
2119
+ 11119242,
2120
+ 615256826,
2121
+ 778285564,
2122
+ 965386269,
2123
+ 287430642,
2124
+ 691052194,
2125
+ 973234437,
2126
+ 266954667,
2127
+ 109662819,
2128
+ 879457882,
2129
+ 220908892,
2130
+ 438829989,
2131
+ 695753536,
2132
+ 201052318,
2133
+ 545802781,
2134
+ 904881930,
2135
+ 967748446,
2136
+ 930138075,
2137
+ 312736777,
2138
+ 240172050,
2139
+ 187045751,
2140
+ 738761633,
2141
+ 929201592,
2142
+ 977670053,
2143
+ 328851403,
2144
+ 406551173,
2145
+ 445035869,
2146
+ 219643504,
2147
+ 90552121,
2148
+ 657060697,
2149
+ 577081112,
2150
+ 140668094,
2151
+ 907783637,
2152
+ 807013581,
2153
+ 490603966,
2154
+ 732800412,
2155
+ 734235959,
2156
+ 194766436,
2157
+ 320802990,
2158
+ 214150444,
2159
+ 209131452,
2160
+ 503701919,
2161
+ 133164428,
2162
+ 706130447,
2163
+ 404910401,
2164
+ 926559410,
2165
+ 120897612,
2166
+ 75490150,
2167
+ 526060275,
2168
+ 170067772,
2169
+ 382194198,
2170
+ 549940529,
2171
+ 284962367,
2172
+ 906928233,
2173
+ 793477356,
2174
+ 630340341,
2175
+ 406311890,
2176
+ 22757933,
2177
+ 755892043,
2178
+ 822405144,
2179
+ 293815665,
2180
+ 571632645,
2181
+ 31050454,
2182
+ 475685467,
2183
+ 953661075,
2184
+ 354774080,
2185
+ 113862075,
2186
+ 248454723,
2187
+ 652613382,
2188
+ 321059735,
2189
+ 805920014,
2190
+ 914167103,
2191
+ 883311914,
2192
+ 750335561,
2193
+ 85039012,
2194
+ 470272493,
2195
+ 573650489,
2196
+ 995008847,
2197
+ 591646702,
2198
+ 186196085,
2199
+ 129730843,
2200
+ 998557454,
2201
+ 312581705,
2202
+ 302755472,
2203
+ 56446966,
2204
+ 554891096,
2205
+ 810924335,
2206
+ 21682992,
2207
+ 950622889,
2208
+ 590313303,
2209
+ 916282879,
2210
+ 295238493,
2211
+ 568646916,
2212
+ 265195273,
2213
+ 546161348,
2214
+ 923142387,
2215
+ 625727303,
2216
+ 342578467,
2217
+ 57724596,
2218
+ 859826260,
2219
+ 591865883,
2220
+ 702589498,
2221
+ 82170410,
2222
+ 871056450,
2223
+ 469535669,
2224
+ 915940343,
2225
+ 301257348,
2226
+ 70176453,
2227
+ 554926646,
2228
+ 359633040,
2229
+ 931712390,
2230
+ 124546581,
2231
+ 869412811,
2232
+ 261926729,
2233
+ 971890272,
2234
+ 232559115,
2235
+ 533497879,
2236
+ 716205661,
2237
+ 274956060,
2238
+ 873877329,
2239
+ 293653555,
2240
+ 924275982,
2241
+ 805143133,
2242
+ 173078879,
2243
+ 461777516,
2244
+ 781869422,
2245
+ 455658862,
2246
+ 849049323,
2247
+ 339708903,
2248
+ 143910844,
2249
+ 551990625,
2250
+ 622263268,
2251
+ 293895814,
2252
+ 588402269,
2253
+ 492088189,
2254
+ 366049649,
2255
+ 807353761,
2256
+ 543011092,
2257
+ 903124866,
2258
+ 103647341,
2259
+ 180649478,
2260
+ 427217574,
2261
+ 418201939,
2262
+ 683506956,
2263
+ 249879624,
2264
+ 757134657,
2265
+ 671126995,
2266
+ 755503215,
2267
+ 765680711,
2268
+ 29704136,
2269
+ 237710711,
2270
+ 879018703,
2271
+ 554854569,
2272
+ 657916695,
2273
+ 524887262,
2274
+ 128359873,
2275
+ 89407448,
2276
+ 776936092,
2277
+ 992613157,
2278
+ 792521854,
2279
+ 150343568,
2280
+ 944030068,
2281
+ 687079014,
2282
+ 109230805,
2283
+ 930276197,
2284
+ 207558513,
2285
+ 262862664,
2286
+ 964158183,
2287
+ 500409240,
2288
+ 30167063,
2289
+ 22671953,
2290
+ 879012910,
2291
+ 884715414,
2292
+ 673955941,
2293
+ 187769527,
2294
+ 794159878,
2295
+ 97456296,
2296
+ 303996146,
2297
+ 488874729,
2298
+ 997249315,
2299
+ 135098215,
2300
+ 526943305,
2301
+ 443178379,
2302
+ 518456009,
2303
+ 783488317,
2304
+ 43949384,
2305
+ 909528144,
2306
+ 208833992,
2307
+ 942677336,
2308
+ 283302074,
2309
+ 744524642,
2310
+ 680184941,
2311
+ 859577404,
2312
+ 785100194,
2313
+ 433023662,
2314
+ 296074023,
2315
+ 336133862,
2316
+ 585826003,
2317
+ 351829228,
2318
+ 607324186,
2319
+ 557367648,
2320
+ 218719913,
2321
+ 29470005,
2322
+ 199409536,
2323
+ 864473342,
2324
+ 262405528,
2325
+ 766958349,
2326
+ 478825619,
2327
+ 34076570,
2328
+ 909608443,
2329
+ 900497866,
2330
+ 265618971,
2331
+ 201155937,
2332
+ 919890053,
2333
+ 314914658,
2334
+ 525911097,
2335
+ 208128285,
2336
+ 204988551,
2337
+ 384522452,
2338
+ 787590910,
2339
+ 524760376,
2340
+ 17671503,
2341
+ 86525451,
2342
+ 968344334,
2343
+ 470034628,
2344
+ 828250632,
2345
+ 818852926,
2346
+ 784738203,
2347
+ 922183528,
2348
+ 71247188,
2349
+ 198595481,
2350
+ 82140883,
2351
+ 969466856,
2352
+ 287406127,
2353
+ 346704548,
2354
+ 339102153,
2355
+ 360205909,
2356
+ 158195687,
2357
+ 464336282,
2358
+ 964871318,
2359
+ 585763946,
2360
+ 147226395,
2361
+ 765880325,
2362
+ 16773121,
2363
+ 958119523,
2364
+ 109487202,
2365
+ 322174005,
2366
+ 1895316,
2367
+ 856297377,
2368
+ 883744670,
2369
+ 585919364,
2370
+ 118300602,
2371
+ 402028209,
2372
+ 841437383,
2373
+ 813449282,
2374
+ 645555339,
2375
+ 395446594,
2376
+ 253061955,
2377
+ 36291401,
2378
+ 111268202,
2379
+ 332607952,
2380
+ 105963637,
2381
+ 217615637,
2382
+ 202732007,
2383
+ 188565158,
2384
+ 751144555,
2385
+ 976687785,
2386
+ 558182491,
2387
+ 602597125,
2388
+ 770279982,
2389
+ 486570410,
2390
+ 649658829,
2391
+ 544281812,
2392
+ 773295159,
2393
+ 925032664,
2394
+ 910570040,
2395
+ 728748874,
2396
+ 318551341,
2397
+ 707899470,
2398
+ 230399707,
2399
+ 596171570,
2400
+ 177619447,
2401
+ 876602832,
2402
+ 347506180,
2403
+ 732364349,
2404
+ 58383818,
2405
+ 805993915,
2406
+ 399011457,
2407
+ 240964851,
2408
+ 879905118,
2409
+ 885912112,
2410
+ 689985432,
2411
+ 554957148,
2412
+ 461679325,
2413
+ 246045619,
2414
+ 700249210,
2415
+ 556701758,
2416
+ 352008673,
2417
+ 558751975,
2418
+ 500834768,
2419
+ 617929893,
2420
+ 884189752,
2421
+ 875156266,
2422
+ 496105224,
2423
+ 912167843,
2424
+ 422742831,
2425
+ 871677984,
2426
+ 197232848,
2427
+ 613179711,
2428
+ 943044553,
2429
+ 352507515,
2430
+ 926360076,
2431
+ 646871293,
2432
+ 301195452,
2433
+ 532679668,
2434
+ 769348529,
2435
+ 841977871,
2436
+ 920822239,
2437
+ 399080785,
2438
+ 398129308,
2439
+ 674348896,
2440
+ 801444675,
2441
+ 501646583,
2442
+ 842744054,
2443
+ 808443215,
2444
+ 132085716,
2445
+ 145954246,
2446
+ 343941104,
2447
+ 704369464,
2448
+ 472292740,
2449
+ 534098278
2450
+ ],
2451
+ "output": 15701756896
2452
+ },
2453
+ {
2454
+ "input": [
2455
+ 336269634,
2456
+ 615505167,
2457
+ 902431139,
2458
+ 555442545,
2459
+ 462432320,
2460
+ 258326761,
2461
+ 49337782,
2462
+ 773274355,
2463
+ 678267702,
2464
+ 176399416,
2465
+ 316750347,
2466
+ 874026939,
2467
+ 149525606,
2468
+ 566144709,
2469
+ 17973605,
2470
+ 38060485,
2471
+ 190461140,
2472
+ 450132778,
2473
+ 95031841,
2474
+ 305978476,
2475
+ 645159534,
2476
+ 149090764,
2477
+ 444756193,
2478
+ 197818506,
2479
+ 127994969,
2480
+ 2405793,
2481
+ 360067266,
2482
+ 125489771,
2483
+ 241546507,
2484
+ 231019465,
2485
+ 871007133,
2486
+ 858346202,
2487
+ 184562288,
2488
+ 994857149,
2489
+ 954838489,
2490
+ 452089034,
2491
+ 305984495,
2492
+ 991739914,
2493
+ 16327074,
2494
+ 293466424,
2495
+ 919774810,
2496
+ 107737380,
2497
+ 697642494,
2498
+ 493604863,
2499
+ 822555742,
2500
+ 233332405,
2501
+ 453298155,
2502
+ 897326467,
2503
+ 871829445,
2504
+ 821635804,
2505
+ 641657766,
2506
+ 352992584,
2507
+ 200743420,
2508
+ 25478150,
2509
+ 760549387,
2510
+ 163389447,
2511
+ 197326657,
2512
+ 412356199,
2513
+ 364796452,
2514
+ 711322102,
2515
+ 218970744,
2516
+ 556339823,
2517
+ 423567914,
2518
+ 554002506,
2519
+ 249399490,
2520
+ 828362786,
2521
+ 347185754,
2522
+ 749059544,
2523
+ 926946284,
2524
+ 375830175,
2525
+ 352076755,
2526
+ 816691544,
2527
+ 127405945,
2528
+ 635616407,
2529
+ 419397136,
2530
+ 856462237,
2531
+ 939578049,
2532
+ 276243682,
2533
+ 297569943,
2534
+ 513054305,
2535
+ 80940267,
2536
+ 280109253,
2537
+ 834215245,
2538
+ 204661486,
2539
+ 301461695,
2540
+ 511370227,
2541
+ 734546790,
2542
+ 684909516,
2543
+ 757111653,
2544
+ 833205273,
2545
+ 999555822,
2546
+ 957808002,
2547
+ 852468625,
2548
+ 988137758,
2549
+ 411609999,
2550
+ 178341238,
2551
+ 131388328,
2552
+ 779082663,
2553
+ 744923897,
2554
+ 424292464,
2555
+ 60078425,
2556
+ 746737918,
2557
+ 274785348,
2558
+ 724769117,
2559
+ 537466817,
2560
+ 316919613,
2561
+ 67930109,
2562
+ 85089854,
2563
+ 119579800,
2564
+ 26761392,
2565
+ 422494003,
2566
+ 777524186,
2567
+ 1251509,
2568
+ 440380032,
2569
+ 100057860,
2570
+ 742534672,
2571
+ 816941787,
2572
+ 651531930,
2573
+ 25602548,
2574
+ 188109120,
2575
+ 23688057,
2576
+ 534566663,
2577
+ 401322007,
2578
+ 696871812,
2579
+ 330786631,
2580
+ 577597450,
2581
+ 214173588,
2582
+ 191810851,
2583
+ 996335985,
2584
+ 885130939,
2585
+ 712523714,
2586
+ 520694020,
2587
+ 608485376,
2588
+ 939113846,
2589
+ 433485780,
2590
+ 366955098,
2591
+ 606515489,
2592
+ 924949214,
2593
+ 652967346,
2594
+ 242737019,
2595
+ 293217079,
2596
+ 18558812,
2597
+ 868252938,
2598
+ 26783710,
2599
+ 265292904,
2600
+ 425033895,
2601
+ 760629714,
2602
+ 277721449,
2603
+ 544373174,
2604
+ 224428805,
2605
+ 291920070,
2606
+ 588236058,
2607
+ 372961707,
2608
+ 350786851,
2609
+ 461727292,
2610
+ 571003111,
2611
+ 397616785,
2612
+ 156841544,
2613
+ 744572529,
2614
+ 25047878,
2615
+ 588521301,
2616
+ 845735474,
2617
+ 193865200,
2618
+ 5855851,
2619
+ 637381868,
2620
+ 204494972,
2621
+ 387130730,
2622
+ 397641104,
2623
+ 437940646,
2624
+ 258113979,
2625
+ 699358189,
2626
+ 869067438,
2627
+ 141123665,
2628
+ 385811018,
2629
+ 16267907,
2630
+ 555174184,
2631
+ 668315211,
2632
+ 883755519,
2633
+ 46776324,
2634
+ 571890230,
2635
+ 977613966,
2636
+ 512360038,
2637
+ 781618204,
2638
+ 515341409,
2639
+ 57219224,
2640
+ 236780117,
2641
+ 572231421,
2642
+ 434264077,
2643
+ 583134340,
2644
+ 361805551,
2645
+ 298392285,
2646
+ 640141708,
2647
+ 998235369,
2648
+ 701768226,
2649
+ 861473960,
2650
+ 60763580,
2651
+ 705103088,
2652
+ 828008426,
2653
+ 420954126,
2654
+ 454640629,
2655
+ 114735057,
2656
+ 704268509,
2657
+ 616873636,
2658
+ 248519382,
2659
+ 106777611,
2660
+ 857698238,
2661
+ 766505574,
2662
+ 541890057,
2663
+ 131109584,
2664
+ 211014338,
2665
+ 34283759,
2666
+ 960813335,
2667
+ 320693430,
2668
+ 859971819,
2669
+ 763195961,
2670
+ 395346475,
2671
+ 695565206,
2672
+ 620453607,
2673
+ 779084763,
2674
+ 118375946,
2675
+ 123352242,
2676
+ 833740889,
2677
+ 264878999,
2678
+ 117295158,
2679
+ 877894966,
2680
+ 922971313,
2681
+ 103775456,
2682
+ 270485722,
2683
+ 439276681,
2684
+ 472560593,
2685
+ 963958614,
2686
+ 483426451,
2687
+ 8432699,
2688
+ 572959970,
2689
+ 396644976,
2690
+ 859825862,
2691
+ 309406332,
2692
+ 358134705,
2693
+ 634987567,
2694
+ 237044674,
2695
+ 652430766,
2696
+ 792200160,
2697
+ 46463459,
2698
+ 950556329,
2699
+ 660343964,
2700
+ 888732845,
2701
+ 756458417,
2702
+ 592750994,
2703
+ 499745364,
2704
+ 775319399,
2705
+ 722767119,
2706
+ 226204090,
2707
+ 913525978,
2708
+ 574224341,
2709
+ 911074795,
2710
+ 696529014,
2711
+ 196671271,
2712
+ 398858037,
2713
+ 643032749,
2714
+ 943073064,
2715
+ 859107314,
2716
+ 144414824,
2717
+ 361355566,
2718
+ 414817669,
2719
+ 413759190,
2720
+ 935748214,
2721
+ 752169656,
2722
+ 324235011,
2723
+ 949351201,
2724
+ 633160046,
2725
+ 256334985,
2726
+ 631235848,
2727
+ 817517121,
2728
+ 506493507,
2729
+ 198407760,
2730
+ 105075702,
2731
+ 977879444,
2732
+ 344776100,
2733
+ 513613590,
2734
+ 784884626,
2735
+ 319890704,
2736
+ 839775147,
2737
+ 760354336,
2738
+ 814403165,
2739
+ 338365233,
2740
+ 852665444,
2741
+ 353139719,
2742
+ 971686603,
2743
+ 42834773,
2744
+ 572591037,
2745
+ 173727000,
2746
+ 62304635,
2747
+ 155960978,
2748
+ 189197608,
2749
+ 732317742,
2750
+ 543788359,
2751
+ 552818370,
2752
+ 442470022,
2753
+ 950574533,
2754
+ 480874935,
2755
+ 969115983,
2756
+ 962400357,
2757
+ 693831115,
2758
+ 168896175,
2759
+ 501477434,
2760
+ 804606561,
2761
+ 987780309,
2762
+ 249584587,
2763
+ 139961252,
2764
+ 760976620,
2765
+ 961031845,
2766
+ 231044492,
2767
+ 729473172,
2768
+ 250646397,
2769
+ 80339964,
2770
+ 394253364,
2771
+ 176421111,
2772
+ 860773517,
2773
+ 985217749,
2774
+ 521427159,
2775
+ 835274633,
2776
+ 28599854,
2777
+ 420590331,
2778
+ 995520411,
2779
+ 961114780,
2780
+ 802343037,
2781
+ 817696324,
2782
+ 545342425,
2783
+ 297385450,
2784
+ 595256959,
2785
+ 999177910,
2786
+ 704730381,
2787
+ 730668876,
2788
+ 50134110,
2789
+ 839735329,
2790
+ 244549084,
2791
+ 303207114,
2792
+ 421763366,
2793
+ 294184622,
2794
+ 738663007,
2795
+ 824471573,
2796
+ 927626750,
2797
+ 560191373,
2798
+ 447441201,
2799
+ 957956902,
2800
+ 617069759,
2801
+ 129806423,
2802
+ 42788132,
2803
+ 308018457,
2804
+ 656704818,
2805
+ 46493913,
2806
+ 927942905,
2807
+ 39973430,
2808
+ 363163150,
2809
+ 485476138,
2810
+ 424501106,
2811
+ 122606242,
2812
+ 183554035,
2813
+ 924339800,
2814
+ 607331352,
2815
+ 624429732,
2816
+ 412036939,
2817
+ 169301948,
2818
+ 763073494,
2819
+ 95786736,
2820
+ 500294871,
2821
+ 415336390,
2822
+ 815949915,
2823
+ 630514933,
2824
+ 869491397,
2825
+ 190141524,
2826
+ 474241247,
2827
+ 298114637,
2828
+ 708966917,
2829
+ 921876167,
2830
+ 117306872,
2831
+ 664474094,
2832
+ 566087810,
2833
+ 437510104,
2834
+ 853550006,
2835
+ 317627022,
2836
+ 976535,
2837
+ 24234740,
2838
+ 621626330,
2839
+ 36570543,
2840
+ 401598222,
2841
+ 230217616,
2842
+ 689801133,
2843
+ 850507242,
2844
+ 485397068,
2845
+ 77384645,
2846
+ 887279023,
2847
+ 966449467,
2848
+ 458819583,
2849
+ 664580064,
2850
+ 63441509,
2851
+ 110962337,
2852
+ 128479917,
2853
+ 89397465,
2854
+ 91108189,
2855
+ 727312978,
2856
+ 830715228,
2857
+ 105565685,
2858
+ 995836833,
2859
+ 196583486,
2860
+ 706931293,
2861
+ 379707198,
2862
+ 775032636,
2863
+ 477589074,
2864
+ 406133084,
2865
+ 530218797,
2866
+ 748506159,
2867
+ 308188487,
2868
+ 764770484,
2869
+ 745297702,
2870
+ 350855665,
2871
+ 79751260,
2872
+ 58876477,
2873
+ 959834389,
2874
+ 663872221,
2875
+ 800158434,
2876
+ 976501229,
2877
+ 202632556,
2878
+ 78353430,
2879
+ 898755075,
2880
+ 219358136,
2881
+ 11106417,
2882
+ 871911861,
2883
+ 879298791,
2884
+ 424954842,
2885
+ 787637553,
2886
+ 504576037,
2887
+ 455524409,
2888
+ 480701297,
2889
+ 674391134,
2890
+ 450496504,
2891
+ 78685083,
2892
+ 621160543,
2893
+ 895771336,
2894
+ 630831622,
2895
+ 694809120,
2896
+ 182766955,
2897
+ 665837240,
2898
+ 982276097,
2899
+ 563012299,
2900
+ 339267806,
2901
+ 347909596,
2902
+ 401524297,
2903
+ 68664135,
2904
+ 84643939,
2905
+ 636167638,
2906
+ 108501305,
2907
+ 108983362,
2908
+ 191033958,
2909
+ 330368031,
2910
+ 496339366,
2911
+ 289921272,
2912
+ 135568120,
2913
+ 243667811,
2914
+ 11548094,
2915
+ 531422834,
2916
+ 454351560,
2917
+ 677110953,
2918
+ 187645581,
2919
+ 118592875,
2920
+ 819489607,
2921
+ 888553621,
2922
+ 474667595,
2923
+ 10312656,
2924
+ 578339086,
2925
+ 394613188,
2926
+ 43936745,
2927
+ 209549364,
2928
+ 159830925,
2929
+ 840198195,
2930
+ 745891578,
2931
+ 839131951,
2932
+ 574656960,
2933
+ 493803375,
2934
+ 376827162,
2935
+ 527862674,
2936
+ 933817764,
2937
+ 527751141,
2938
+ 154563984,
2939
+ 350059267,
2940
+ 468019032,
2941
+ 463220336,
2942
+ 222709591,
2943
+ 631213537,
2944
+ 867360611,
2945
+ 108554884,
2946
+ 680095206,
2947
+ 62339864,
2948
+ 361537171,
2949
+ 614210231,
2950
+ 757343222,
2951
+ 244915625,
2952
+ 449620749,
2953
+ 246404419,
2954
+ 867535090,
2955
+ 942523462,
2956
+ 794121594,
2957
+ 748554151,
2958
+ 692051140,
2959
+ 158808253,
2960
+ 672900232,
2961
+ 264824689,
2962
+ 591753118,
2963
+ 79990439,
2964
+ 828195165,
2965
+ 785430915,
2966
+ 866501050,
2967
+ 287349079,
2968
+ 393182895,
2969
+ 613761101,
2970
+ 807143026,
2971
+ 841561099,
2972
+ 882370543,
2973
+ 778226081,
2974
+ 337802020,
2975
+ 7125575,
2976
+ 193073248,
2977
+ 385596475,
2978
+ 898577466,
2979
+ 554363146,
2980
+ 49121468,
2981
+ 551757476,
2982
+ 208256816,
2983
+ 805731453,
2984
+ 330939041,
2985
+ 991764232,
2986
+ 284239276,
2987
+ 93316684,
2988
+ 643951578,
2989
+ 719981056,
2990
+ 719741740,
2991
+ 217569373,
2992
+ 200284224,
2993
+ 836519755,
2994
+ 374121500,
2995
+ 902007879,
2996
+ 703250717,
2997
+ 99934766,
2998
+ 980197405,
2999
+ 529088244,
3000
+ 65254296,
3001
+ 18326138,
3002
+ 310999816,
3003
+ 21884612,
3004
+ 410136737,
3005
+ 925087247,
3006
+ 437880793,
3007
+ 19699309,
3008
+ 664108912,
3009
+ 895933152,
3010
+ 49289076,
3011
+ 837930028,
3012
+ 13600353,
3013
+ 632546590,
3014
+ 924822774,
3015
+ 835812220,
3016
+ 559614661,
3017
+ 593298967,
3018
+ 869713682,
3019
+ 400139785,
3020
+ 69685513,
3021
+ 396975929,
3022
+ 550839926,
3023
+ 153487144,
3024
+ 196429194,
3025
+ 7879784,
3026
+ 457329112,
3027
+ 79210282,
3028
+ 876697912,
3029
+ 237499181,
3030
+ 566209162,
3031
+ 994544512,
3032
+ 845970885,
3033
+ 161800342,
3034
+ 685503894,
3035
+ 104805611,
3036
+ 247569491,
3037
+ 141739938,
3038
+ 150443134,
3039
+ 564138754,
3040
+ 303971982,
3041
+ 173031105,
3042
+ 54438358,
3043
+ 437442299,
3044
+ 74635908,
3045
+ 859382108,
3046
+ 47131374,
3047
+ 392820252,
3048
+ 525576960,
3049
+ 935990189,
3050
+ 68603155,
3051
+ 815408319,
3052
+ 619617060,
3053
+ 368797433,
3054
+ 181193713,
3055
+ 206799061,
3056
+ 724127994,
3057
+ 603724526,
3058
+ 309893907,
3059
+ 994049338,
3060
+ 21167196,
3061
+ 597871519,
3062
+ 482729332,
3063
+ 865967015,
3064
+ 852969719,
3065
+ 335942499,
3066
+ 128311350,
3067
+ 860585352,
3068
+ 219018164,
3069
+ 94718713,
3070
+ 575277619,
3071
+ 251723149,
3072
+ 752677395,
3073
+ 358323171,
3074
+ 529743287,
3075
+ 499818112,
3076
+ 319500847,
3077
+ 859781422,
3078
+ 762664619,
3079
+ 156194316,
3080
+ 478973228,
3081
+ 112094121,
3082
+ 733041278,
3083
+ 231852723,
3084
+ 435540007,
3085
+ 324443516,
3086
+ 833392012,
3087
+ 18990229,
3088
+ 914323368,
3089
+ 705180449,
3090
+ 147193534,
3091
+ 207406473,
3092
+ 1647053,
3093
+ 831939439,
3094
+ 278121613,
3095
+ 800480906,
3096
+ 311995307,
3097
+ 443640429,
3098
+ 967090620,
3099
+ 394970413,
3100
+ 382183330,
3101
+ 376145100,
3102
+ 522616772,
3103
+ 78178047,
3104
+ 75760323,
3105
+ 801330397,
3106
+ 67872831,
3107
+ 114500908,
3108
+ 28867052,
3109
+ 64210070,
3110
+ 577217953,
3111
+ 984196373,
3112
+ 429011170,
3113
+ 661835373,
3114
+ 715436826,
3115
+ 730560799,
3116
+ 534645511,
3117
+ 518679182,
3118
+ 134142686,
3119
+ 874268372,
3120
+ 493306289,
3121
+ 86518971,
3122
+ 233861997,
3123
+ 833381678,
3124
+ 65939279,
3125
+ 197311160,
3126
+ 330453714,
3127
+ 989237900,
3128
+ 901885389,
3129
+ 563420147,
3130
+ 267751669,
3131
+ 832520716,
3132
+ 824005233,
3133
+ 159109339,
3134
+ 768910200,
3135
+ 608691341,
3136
+ 300594434,
3137
+ 423535407,
3138
+ 456969971,
3139
+ 215716246,
3140
+ 604272579,
3141
+ 746279334,
3142
+ 111636467,
3143
+ 426136813,
3144
+ 372987610,
3145
+ 353962928,
3146
+ 546761709,
3147
+ 169794309,
3148
+ 630832965,
3149
+ 335570142,
3150
+ 129817511,
3151
+ 801818671,
3152
+ 722557692,
3153
+ 818231139,
3154
+ 975909512,
3155
+ 358331882,
3156
+ 860226545,
3157
+ 629524270,
3158
+ 4253131,
3159
+ 749982883,
3160
+ 554512857,
3161
+ 326556627,
3162
+ 786163156,
3163
+ 877898334,
3164
+ 275537899,
3165
+ 291838869,
3166
+ 445508992,
3167
+ 659743424,
3168
+ 815265689,
3169
+ 407011674,
3170
+ 750328268,
3171
+ 345953618,
3172
+ 245154084,
3173
+ 815338933,
3174
+ 919812631,
3175
+ 648079508,
3176
+ 521283073,
3177
+ 571180128,
3178
+ 457449963,
3179
+ 946409452,
3180
+ 723922109,
3181
+ 570411508,
3182
+ 606564844,
3183
+ 247098369,
3184
+ 394279720,
3185
+ 658848517,
3186
+ 731779039,
3187
+ 205677401,
3188
+ 159900436,
3189
+ 824927192,
3190
+ 939543657,
3191
+ 334228473,
3192
+ 425874328,
3193
+ 250603861,
3194
+ 202121043,
3195
+ 882697709,
3196
+ 825980269,
3197
+ 530500062,
3198
+ 174513126,
3199
+ 275957057,
3200
+ 85228406,
3201
+ 870577277,
3202
+ 187717318,
3203
+ 555598428,
3204
+ 700040955,
3205
+ 265003879,
3206
+ 862402368,
3207
+ 961267821,
3208
+ 885692556,
3209
+ 972886580,
3210
+ 492420429,
3211
+ 35323436,
3212
+ 111291048,
3213
+ 795718071,
3214
+ 745328393,
3215
+ 610758603,
3216
+ 166522395,
3217
+ 70895355,
3218
+ 26751790,
3219
+ 221683103,
3220
+ 922955080,
3221
+ 533635083,
3222
+ 362965595,
3223
+ 354718659,
3224
+ 70705851,
3225
+ 320018668,
3226
+ 491587775,
3227
+ 290195832,
3228
+ 258717844,
3229
+ 240889758,
3230
+ 593654042,
3231
+ 615356708,
3232
+ 683535185,
3233
+ 18483723,
3234
+ 316587273,
3235
+ 449283725,
3236
+ 279959021,
3237
+ 578908626,
3238
+ 826423708,
3239
+ 190484254,
3240
+ 395758053,
3241
+ 177793809,
3242
+ 937162185,
3243
+ 753342164,
3244
+ 964839798,
3245
+ 579838121,
3246
+ 817832647,
3247
+ 274586376,
3248
+ 872699587,
3249
+ 312440182,
3250
+ 780060763,
3251
+ 727166198,
3252
+ 360247523,
3253
+ 595480520,
3254
+ 39190344,
3255
+ 882481909,
3256
+ 740376586,
3257
+ 764208127,
3258
+ 972181715,
3259
+ 586343828,
3260
+ 397952034,
3261
+ 65105476,
3262
+ 769044077,
3263
+ 970589007,
3264
+ 986690063,
3265
+ 472951755,
3266
+ 730576828,
3267
+ 479256695,
3268
+ 695777716,
3269
+ 133526638,
3270
+ 62732226,
3271
+ 282105829,
3272
+ 696328130,
3273
+ 582736315
3274
+ ],
3275
+ "output": 15677354913
3276
+ }
3277
+ ],
3278
+ "haskell_template": "maximumSumOfHeights :: [Int] -> Int\nmaximumSumOfHeights heights ",
3279
+ "ocaml_template": "let maximumSumOfHeights (heights: int list) : int = ",
3280
+ "scala_template": "def maximumSumOfHeights(heights: List[Int]): Int = { \n \n}",
3281
+ "java_template": "class Solution {\n public long maximumSumOfHeights(int[] heights) {\n \n }\n}",
3282
+ "python_template": "class Solution(object):\n def maximumSumOfHeights(self, heights):\n \"\"\"\n :type heights: List[int]\n :rtype: int\n \"\"\"\n "
3283
+ }
beautiful_towers_i/ocaml_tests/main.ml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+ let maximumSumOfHeights (heights: int list) : int = failwith "Not implemented"
7
+
8
+ (* Program end *)
9
+
10
+ (* Test cases *)
11
+
12
+ let test1 _ = assert_equal 13 (maximumSumOfHeights [5;3;4;1;1])
13
+
14
+ let test2 _ = assert_equal 22 (maximumSumOfHeights [6;5;3;9;2;7])
15
+
16
+ let test3 _ = assert_equal 18 (maximumSumOfHeights [3;2;5;5;2;3])
17
+
18
+ let test4 _ = assert_equal 18 (maximumSumOfHeights [461095276; 386639795; 873859621; 892139800; 82516304; 785970576; 553100365; 677118346; 850406943; 598758632; 637390625; 974451679; 319236936; 312383614; 59877712; 773224528; 753820008; 319787930; 264076871; 348733454; 654886345; 225449408; 895039995; 907127873; 62848268; 348609545; 810191280; 598381971; 566981259; 831172922; 629628391; 702582341; 733614337; 416039432; 398836464; 404940226; 3470894; 580849934; 776304548; 542638485; 196250913; 876391110; 241686483; 400996037; 578773496; 150667439; 811461760; 350606183; 882289231; 255297066; 39806978; 358764343; 810199897; 64759314; 140000321; 625450396; 686288032; 686161871; 83161870; 94858363; 233833592; 499323855; 992994771; 597734416; 206271624; 368103649; 24046666; 120733110; 388984908; 445911553; 459177933; 791680055; 83734582; 688837531; 908021794; 411312939; 877927717; 544862368; 707377197; 834962716; 149821711; 945898435; 777370970; 954712241; 634655483; 787323351; 714271241; 981833176; 679967775; 400126079; 254451367; 196517991; 348792002; 531858352; 719062368; 431990640; 519637454; 491165006; 9058816; 642190752; 108698992; 696881776; 611943276; 735912326; 513669965; 560225773; 81698284; 671564736; 888253775; 240304203; 342300216; 84108757; 451038736; 21950892; 538584903; 709795658; 579033963; 807181554; 831429179; 949250084; 303874746; 827312083; 809040931; 93472747; 480647222; 982274636; 704863957; 545039611; 466842571; 451567304; 442498795; 902079568; 322400185; 139877080; 396515305; 643537107; 256936739; 716331581; 452575423; 354361018; 747197160; 254214553; 199994355; 264500185; 448310322; 112146618; 47811962; 415761742; 982241461; 373161582; 376761708; 169282385; 805438683; 698746189; 475374735; 7737254; 610476409; 750043086; 205149594; 824138373; 106479320; 855761208; 347130241; 614201013; 860686165; 581305605; 901324873; 833425680; 243687643; 111303573; 15280706; 480805256; 362315486; 476190492; 918418275; 780343460; 583579962; 105733612; 291524091; 570946298; 175973598; 942892574; 637444119; 101344912; 523257121; 484292781; 705948330; 504269027; 965369659; 12776539; 572047448; 778031372; 931748065; 143517938; 440680755; 697015205; 567393516; 310088668; 576855888; 885400659; 35431032; 423463286; 376743742; 120990657; 386460453; 541143942; 116415718; 723467338; 276814686; 876195228; 196860368; 939018117; 426354321; 639129227; 280872679; 495394011; 272069484; 391877682; 387758536; 97430330; 120011202; 392541888; 479436521; 700890141; 92394400; 661692013; 482125907; 420226798; 346736899; 913845156; 974720679; 476675766; 222080816; 529570088; 630971646; 138650185; 214818888; 374188846; 277131287; 821091731; 414340231; 785181908; 667620487; 427405473; 503939995; 534799677; 905116716; 988838919; 772171744; 721250159; 12313847; 426426130; 134742987; 444004691; 524280082; 839125586; 980378778; 652785683; 72763682; 319046202; 891261574; 62344712; 6449656; 830222229; 712440255; 965318053; 917757700; 15049006; 440359516; 906649023; 493578105; 306794447; 818492015; 65408026; 294810842; 454338704; 936078134; 393347901; 807894063; 926360057; 858900653; 456587484; 737367357; 444795246; 551855388; 193044400; 192139016; 493705408; 716745734; 943709274; 945258189; 206568536; 786500696; 865972597; 627977415; 226173117; 743619674; 297311139; 743914914; 719001765; 378329821; 896922515; 372439157; 991804379; 993912045; 538147267; 843222218; 165814768; 367995916; 632223098; 225447699; 110531119; 273223118; 853526600; 453220994; 944451714; 835460216; 388709121; 653513401; 608948501; 789372890; 637479025; 847533840; 550365224; 31460159; 121309553; 726082875; 398853963; 919501890; 929583234; 86186536; 222825606; 572316333; 762412144; 373828084; 377715356; 357920551; 107734292; 722401541; 648765037; 843011089; 871690143; 833184665; 618447338; 950453002; 618394744; 273096456; 528536506; 368596818; 672389838; 427850541; 197929941; 596041987; 917796372; 202672856; 553232360; 456687629; 173166875; 430719354; 345527883; 856019642; 103768759; 500914629; 813073321; 45959012; 981168755; 966719300; 685841525; 976479663; 496717948; 434198947; 852580769; 259014796; 585434867; 670196688; 363028211; 444430262; 475356575; 154896759; 185410352; 507727918; 846049566; 26924850; 830925567; 857098717; 545592455; 292925684; 391938446; 534704878; 839820354; 702897464; 976376547; 101996688; 464274791; 773577807; 698460121; 806800162; 932674647; 590402864; 837572015; 667380110; 674554973; 269085208; 845961128; 268011421; 935918127; 131095551; 606497761; 947821559; 635142377; 78432792; 105933739; 436184938; 993006363; 660772685; 190424187; 593506323; 135528488; 247006536; 598258484; 14407842; 798725043; 177496387; 952834982])
19
+
20
+ let test5 _ = assert_equal 18 (maximumSumOfHeights [907280058; 869376860; 854663685; 724511174; 357575887; 554601152; 937815738; 592437413; 992324857; 878495940; 17450552; 956432545; 804037092; 677837122; 694998479; 156762276; 955878302; 665780760; 112590518; 206803239; 553709274; 977333507; 42914022; 727817882; 949565522; 929356052; 821163730; 718397171; 153319605; 461193802; 789116137; 925605936; 802825886; 4737558; 11647712; 31189628; 942544256; 770042957; 395278757; 985733882; 123533901; 352242508; 40259458; 53501312; 539100225; 313069975; 405177308; 659044744; 284605989; 816626669; 918521271; 18239953; 276592645; 700050801; 38981362; 225961863; 46257112; 165334748; 236853795; 330921988; 768046016; 468836367; 768867591; 241190251; 154176258; 22335657; 949023192; 860545730; 805252393; 87221731; 776545542; 463480071; 402535206; 600906414; 389636841; 897829208; 140770278; 653323553; 921504312; 821487086; 873563035; 963692200; 461479036; 22708227; 529098620; 324691179; 938766376; 285418428; 897924225; 964545685; 549528092; 107339534; 565997299; 347026474; 192397458; 703149593; 39965638; 512937318; 997398536; 876923456; 115670903; 47064731; 90047526; 157492826; 807443800; 570877161; 358127496; 633705563; 164596493; 249397364; 356949161; 195958184; 769414933; 318511504; 262607666; 786449636; 615136310; 598195355; 836171069; 650874042; 603829588; 749642104; 321098959; 711418221; 527606075; 828808943; 678037729; 140290247; 113081094; 723084737; 185748697; 774770559; 869803837; 111914410; 722673287; 776295962; 315220696; 191649107; 815581512; 989959866; 440552460; 954917947; 51832643; 905359234; 773143062; 656936019; 694396762; 230381678; 210807153; 350381952; 808610035; 6255600; 34540935; 209273851; 850049691; 858488382; 518231702; 352113465; 62780225; 282807698; 831007791; 650980005; 574846098; 61553545; 274523676; 711602218; 385129492; 847405724; 926456940; 748171699; 449810302; 977518246; 985455433; 407941158; 944376098; 961465481; 397544002; 303218493; 232461671; 825676404; 73156937; 793859512; 229878239; 588044040; 885332225; 512768388; 861633285; 389606930; 694205634; 194738823; 879852754; 815534297; 976940265; 483320339; 549677209; 850304406; 537645732; 763800735; 285775368; 256937213; 626323579; 129602042; 164697882; 858050839; 508655093; 92498001; 413904133; 572605135; 938286180; 845867960; 331523486; 870971097; 742327289; 166738298; 852205239; 878706851; 518111783; 493899427; 625687318; 508889267; 975932896; 366338365; 586089838; 400821155; 519465376; 148599366; 233385079; 813214982; 213016271; 92651775; 915860250; 347210612; 138592882; 954499279; 193516954; 418315160; 334344868; 745343952; 661884753; 928697299; 896202641; 774306109; 433312680; 61535626; 551137703; 291277716; 569084857; 560850824; 207761645; 344411585; 541493117; 385881591; 527167296; 972233327; 435058595; 460703083; 808370051; 852361167; 842857436; 811548314; 71840691; 850230266; 444048795; 719568642; 841077643; 37374268; 910911036; 380889602; 591441142; 322484405; 686543010; 312730410; 296791668; 485513569; 762038181; 223210260; 208949131; 427736469; 854695282; 760863108; 644991768; 347597952; 617800021; 19052932; 893751395; 890515798; 740708512; 38270286; 79536163; 508038945; 950953359; 890422385; 608498474; 814271884; 134656944; 145958542; 919211570; 65580922; 831269158; 920725364; 758904322; 837289035; 909873432; 751347744; 571322117; 412310164; 554173921; 103197044; 321531552; 244143119; 606838431; 194182488; 595422111; 520145167; 779150926; 290754911; 514905902; 396823286; 638387592; 821376592; 250422322; 641508719; 443196302; 434432513; 580876960; 939807718; 679698500; 11928162; 617383215; 908103245; 955672507; 767518600; 506326023; 689470888; 555604927; 522942640; 653657429; 235305617; 297446847; 779782477; 208904077; 424325305; 956283053; 770105711; 441349935; 815608638; 18405552; 658812718; 972528815; 369404560; 183684391; 124265017; 267910927; 356894296; 111621739; 529345682; 104542192; 413221077; 320826511; 22878970; 936015591; 521358984; 707820868; 395512066; 77004612; 679404096; 522336398; 793321689; 559568738; 508685973; 578049973; 444891489; 503407698; 318836053; 348514436; 731735990; 144125725; 286678449; 527619095; 757313658; 594982669; 941157496; 232274069; 347985723; 773072315; 465547591; 461633227; 117732755; 810251922; 973570259; 690079220; 862125590; 405390982; 929531742; 919050452; 148479573; 469923670; 882510483; 938455480; 323804525; 807154980; 299129215; 512698337; 983783156; 751763213; 749312006; 815493791; 967738640; 225493197; 63704527; 296466004; 378971759; 296064821; 293022007; 138037379; 406318776; 92301376; 891215287; 713880959; 210068289; 74761488; 404205329; 887848476; 377336575; 598591425; 740241469; 579039655; 707424303; 743508880; 508044416; 933801198; 417336607; 6641719; 632493878; 829949634; 934986008; 117558839; 793324833; 691881415; 158669788; 673145144; 820731009; 32414445; 611205310; 581553561; 299672197; 50087294; 763828341; 54649639; 34603442; 136776772; 734063953; 191306524; 411957664; 306220597; 641010972; 732062230; 294024691; 676209669; 855152945; 110310116; 441955786; 764396778; 960076821; 986605635; 240924926; 89200253; 883564498; 213610179; 794284614; 180504879; 311532380; 103685117; 29318893; 859497914; 123022643; 642491134; 506975174; 539188342; 653062362; 370329281; 899862913; 865854570; 833716225; 201342523; 732034769; 858640413; 383934495; 105403121; 922169592; 714395656; 262004557; 995525106; 271470066; 898640808; 223086637; 300555377; 251021366; 973949389; 106904706; 905028403; 124542256; 18729468; 927960082; 130713489; 42978748; 375630436; 784068231; 105581268; 745310754; 982387885; 208110234; 998472740; 950242139; 361480170; 605835061; 378791938; 385426704; 173490007; 840989527; 750889691; 558296961; 592578382; 543430494; 863101818; 452224004; 806813385; 262208764; 451457428; 668767606; 992312960; 53772933; 932568167; 515094846; 218715670; 117192714; 160127821; 347549713; 358842285; 42881586; 157404256; 162188817; 987671544; 34352859; 285529186; 187037073; 185282309; 613176701; 583805804; 415389541; 982504602; 582655326; 692944767; 791060529; 653901743; 758139384; 412842816; 591346325; 284856664; 604258399; 57101119; 417373117; 552335265; 306923153; 658164059; 693325423; 712496532; 243341024; 954079355; 954171997; 332665840; 100123831; 516429516; 224486773; 736914487; 103798490; 748436667; 460116016; 154132405; 133096029; 327951209; 693862799; 743760820; 368227215; 83833428; 706476338; 597799039; 887903365; 808868241; 819069341; 798366030; 409741371; 331989592; 974380265; 355152189; 502669015; 299669502; 658698592; 260721334; 756907437; 106131102; 554228613; 675166664; 316108544; 41960962; 258077325; 369512709; 418350618; 874766574; 376087919; 480195102; 610217443; 481367251; 17850657; 923139615; 773487855; 907166850; 818613197; 707741058; 538447172; 654448469; 301727530; 854575979; 617288980; 495740226; 384519077; 96426684; 36766398; 271761898; 80220413; 889315125; 460099516; 108304710; 648352858; 7314411; 220769737; 69095862; 850716074; 934288426; 603365099; 27452685; 423573676; 171631012; 219605931; 190726232; 619001091; 691641432; 404661929; 912200580; 60191502; 114705589; 563699388; 502459100; 582493068; 84088001; 496103606; 621610493; 907612877; 432882558; 881745477; 663664476; 45545571; 375574995; 364910810; 36413928; 158330550; 5056208; 170778091; 716452055; 974143473; 737038596; 67187161; 163282278; 239947775; 441358930; 938040191; 485374724; 760133531; 121152843; 192270637; 395353794; 628034439; 918570527; 421180159; 957821999; 872665061; 416003792; 541658539; 235698501; 206801418; 958944011; 772092674; 635997681; 756922613; 778723951; 595778086; 452249410; 278650048; 154538094; 593808447; 247046746; 645506659; 713209009; 362796769; 287679252; 211356787; 675393910; 648795529; 678918204; 181634500; 671169987; 243628940; 898107096; 606668651; 685422894; 948167874; 888202254; 602499367; 478380012; 660152465; 381546363; 573378116; 290546006; 519278660; 447312924; 226571410; 345078210; 21942937; 906487017; 748462085; 966453564; 660629529; 572178985; 30369095; 820953554; 521458401; 733228100; 706817886; 717736765; 859096943; 271561561; 961962384; 686499326; 789113257; 728015311; 234569562; 176116950; 537062437; 131187094; 838359764; 928432705; 277392721; 487093702; 415133899; 508578527; 614543521; 299349724; 17067654; 468477789; 266431305; 155320037; 122788656; 995651255; 245222103; 68691493; 851818713; 781600183; 979428001; 229131401; 313782109; 206489574; 472639045; 131994347; 33955895; 75839517; 701548425; 348529295; 234858359; 768882164; 7942677; 582139035; 621573387; 963435878; 967466898; 438075339; 911237022; 95282977; 296359508; 185726524; 21904235; 361730657; 759702368; 647093522; 415383055; 683639222; 691390411; 610235602; 199808090; 807009282; 38139895; 781786745; 310673206; 644914484; 213440225; 996327208; 646706306; 333518248; 630897579; 343255060; 131569387; 119573855; 112859612; 970824241; 183344288; 228657096; 629723452; 539791789; 967840886; 91137026; 127476119; 635470909; 826763616; 332750951; 474745742; 899517271; 232176115; 566884335; 963257190; 150004864; 286052863; 528233164; 390683191; 356865821; 638086204; 134714372; 683006182; 861120330; 760500517; 801720335; 142770209; 885664; 422751155; 906172245; 355580779; 444008582; 641496412; 569363180; 740393282; 626331121; 556107009; 738523784; 10521847; 820942454; 273092212; 805962000; 391860327; 726362960; 36305476; 997980139; 800133966; 214166604; 290174977; 553193710; 642912500; 130930501; 322147194; 188402765; 341690028; 499941060; 215811874; 565343097; 549268802; 912853119; 745677765; 835028225; 192007950; 590689710; 706754977; 346650674; 830600308; 116085278; 712200936; 705464333; 195831126; 486717000; 280041715; 888717645; 35969889; 881742578; 812953177; 622106874; 927489678; 576980430; 434571625; 906453207; 369384424; 308262272; 181218708; 427131182; 495473454; 39550886; 174247909; 437188682; 404995219; 249872322; 883607067; 753744310; 746127688; 266864206; 734661814; 71224714; 626051565; 922111874; 392695472; 989975594; 562080577; 755901281; 806968548; 658118435; 110920694])
21
+
22
+ let test6 _ = assert_equal 18 (maximumSumOfHeights [424606157; 868454057; 655926406; 762331124; 781007349; 25855609; 570337160; 81881830; 737899152; 312953431; 884938070; 235997467; 86058582; 815302859; 827527803; 544397461; 946318394; 356108153; 504015276; 427220221; 441271269; 31069231; 107818372; 52872058; 19848961; 330553928; 372003325; 737995396; 525942199; 401049977; 26726601; 979515788; 686337488; 770132231; 375088663; 991406714; 346788757; 289503141; 455306773; 178956050; 913809654; 275241557; 533300593; 461111987; 543237880; 608368438; 335171062; 675189964; 155074983; 758418989; 744258102; 974125618; 77927545; 713767968; 281155999; 21136709; 273804857; 950268204; 406663351; 702375623; 488537248; 915974358; 164891558; 190002552; 116587122; 370130084; 323681679; 696729073; 834934402; 628314849; 869524077; 231452623; 757609035; 23736135; 860659235; 181166350; 375604662; 304353680; 966671049; 735531524; 635797963; 305188124; 314552267; 298391059; 78545067; 263046541; 474262081; 922779117; 345985130; 642600391; 854275521; 306914969; 907582100; 798306637; 556785913; 187973090; 522310602; 711312015; 218472727; 88732618; 554238248; 227989467; 45365896; 774444438; 108846514; 326515214; 325065303; 251031880; 644311889; 167287703; 85204377; 868230181; 218266343; 744160377; 263854367; 244331712; 58844021; 903118259; 556287612; 190019233; 771859125; 342169397; 784733603; 238933499; 266178099; 516144760; 368890028; 667729610; 434066251; 202714480; 818461815; 854965399; 560715322; 454355059; 76432474; 656735994; 679447073; 704379861; 387127546; 983223219; 697044450; 561346869; 673964174; 114245755; 449714614; 785320588; 362896289; 57924709; 80015761; 537433189; 891746640; 144215527; 583050470; 281281821; 749663957; 125280947; 577503881; 507127357; 108628346; 142177361; 784462143; 721687750; 931718105; 29754667; 29208398; 977520400; 573193813; 866767172; 827175662; 589614103; 20615978; 711472113; 140858912; 413191106; 666654690; 56880625; 582281368; 303562665; 179724814; 227016583; 946491552; 866413166; 500024195; 920595438; 400748985; 288687709; 694700493; 920269270; 59632072; 546445586; 278555116; 450371127; 296763710; 155824082; 492019330; 300409610; 785064338; 379344940; 370932636; 853900020; 611290894; 581565453; 524955087; 751838654; 69164078; 771871184; 134568093; 862937525; 973435729; 654991468; 903994029; 202017348; 211821339; 918758225; 750466248; 707940663; 988570936; 353248311; 169809386; 12466109; 926429933; 68721569; 320245734; 140973873; 478987459; 184153875; 245644797; 560249473; 227631268; 340854964; 193767502; 919178674; 591530493; 900311978; 665261784; 669196522; 90400609; 274035862; 576961321; 355974973; 53101315; 511565237; 649854805; 382442072; 964893056; 602076069; 240342719; 658379798; 68178147; 669535029; 706663739; 416602389; 952407754; 646136040; 923991660; 624760968; 610630550; 394385581; 67744313; 194398744; 123954825; 859969001; 723743900; 217516228; 445858283; 878103916; 144473239; 342386250; 510919517; 377195171; 178433441; 767718879; 497965694; 686730537; 778768843; 242051661; 552753137; 785759839; 559299151; 909142441; 19319268; 419516906; 654019870; 605614378; 255491975; 527298072; 64779396; 478021401; 659045830; 766873821; 827969129; 673691819; 30365618; 960896766; 335097708; 489798109; 921830007; 870164787; 397261062; 622360329; 265427231; 706961899; 489120306; 565219862; 517274109; 178179911; 392584532; 398168359; 584999271; 599349068; 956247333; 669268372; 740633549; 367044198; 131208311; 136764698; 159858313; 548563514; 539813495; 482583735; 231032496; 56339918; 832002582; 437851358; 399382523; 808324321; 637459653; 391082127; 748156649; 126745564; 134272722; 765127694; 495404820; 297024658; 528430277; 462294099; 963565773; 469139409; 164191045; 828315666; 94436003; 656962525; 320207813; 81381744; 430428845; 118840139; 221836425; 852061224; 663646746; 432640065; 340408363; 916462826; 740636639; 965314087; 249134027; 357437555; 783662677; 959003618; 117779909; 495285889; 831385384; 511631262; 492121037; 779873555; 518203636; 586177914; 421687143; 369860335; 38658346; 670051264; 867121706; 912438125; 234494851; 971672226; 510298928; 226678346; 877815693; 812353194; 706620702; 564809286; 72154289; 116284180; 798849358; 193967092; 176614494; 229190066; 262282194; 48232542; 199835280; 920156238; 279010252; 246398634; 820992055; 338237260; 164567059; 431568261; 927216919; 323557761; 869886071; 888202210; 772949535; 569048048; 437134924; 914786836; 28876991; 467955658; 890127756; 943805096; 678478238; 835946260; 573773321; 25684875; 385829009; 135464298; 635338091; 824321911; 533758288; 692877528; 518653213; 427198719; 221885017; 382051126; 22094263; 520432351; 636963297; 381797747; 694307457; 523576875; 476510365; 485176822; 245411365; 445749010; 508290479; 971662211; 977383047; 255154004; 614121625; 393910624; 85020022; 22085371; 894921648; 256200279; 487534889; 167467436; 992429680; 558073444; 964630476; 806752623; 792760887; 595219021; 545989710; 13419880; 845956600; 385278405; 567069241; 148751919; 980548777; 309077876; 929669901; 244356340; 652410431; 776395412; 279847656; 121852842; 371053605; 819943711; 172876020; 169566739; 863698781; 69904254; 203432029; 164262275; 33145069; 746452383; 501107506; 518837227; 41103147; 800132215; 428771377; 477581888; 665130503; 939578870; 228709542; 138196179; 404632052; 466187409; 40936142; 293802515; 998329989; 130148363; 706213219; 918100558; 617385012; 943006814; 108772603; 838778853; 582382918; 940155581; 703646063])
23
+
24
+ let test7 _ = assert_equal 18 (maximumSumOfHeights [457307243; 538765441; 936585121; 891255631; 981400086; 785030154; 205823245; 366369370; 381995020; 620390059; 244571896; 946759161; 507788745; 871210585; 544518543; 783169450; 37124404; 946527946; 73127486; 607145768; 168991090; 134768122; 906205049; 364598861; 496385945; 186741170; 85470072; 984144055; 447287418; 382810184; 164359867; 626105760; 588155263; 367531644; 215006135; 930719828; 181463609; 721811508; 888191089; 700778940; 49229013; 305415785; 438730597; 215595615; 320778097; 553044877; 208579795; 650833235; 35788171; 199045946; 27204750; 96501563; 844752838; 351617059; 630805611; 511304463; 871828719; 299099113; 155592543; 828945189; 500207310; 964793055; 290570076; 520680881; 886441506; 964497646; 278497567; 721068849; 135725790; 902622141; 466434512; 17270282; 372613499; 209678454; 720325631; 696850901; 986931122; 892694579; 249379749; 115455210; 471418511; 170715949; 254608366; 385192501; 694035208; 369621614; 400753583; 799239314; 828994264; 999611810; 840022889; 460305770; 951120976; 170682134; 789538773; 172391908; 735854857; 483600955; 992172790; 799365599; 906797917; 705574376; 120953222; 491642449; 420558991; 812011453; 644593631; 972209414; 290494802; 740109977; 414164553; 553400073; 618722479; 782813288; 849053837; 554516352; 945517963; 443711395; 32675328; 652381001; 994255236; 846570317; 804694823; 945040848; 922473618; 671714748; 252981772; 583647023; 749518114; 953974681; 862900406; 253942102; 431788867; 815269881; 326969664; 902424068; 395939359; 899557123; 52751257; 702167344; 815551528; 534412689; 725722770; 84602638; 178963593; 677039164; 290622067; 533610726; 653549312; 309600592; 145614778; 833200618; 614029752; 253466773; 647625317; 848757408; 205925215; 2876869; 23530172; 332791049; 374010574; 262642293; 486224879; 38904308; 824146420; 832394838; 187700433; 167065764; 105549499; 793839801; 20114974; 566182026; 27713350; 51936313; 306272549; 412355222; 890558330; 363687500; 193037505; 355435245; 440293550; 270760354; 73284363; 326501935; 772556061; 837668668; 483897098; 133822042; 120951633; 106075138; 423223711; 619154519; 498849009; 903137903; 43411058; 913752568; 333563611; 617370463; 260224287; 332899347; 767911646; 405448163; 384440576; 43697943; 843637238; 219381769; 450409142; 848063703; 138831156; 335804379; 434239894; 309109060; 303386490; 662519062; 96550844; 335920951; 841873641; 797517841; 153090474; 946681167; 561913697; 519200726; 980514595; 453889782; 982715368; 649453828; 145539060; 28111331; 812543050; 73751290; 383915414; 730203629; 877136211; 11119242; 615256826; 778285564; 965386269; 287430642; 691052194; 973234437; 266954667; 109662819; 879457882; 220908892; 438829989; 695753536; 201052318; 545802781; 904881930; 967748446; 930138075; 312736777; 240172050; 187045751; 738761633; 929201592; 977670053; 328851403; 406551173; 445035869; 219643504; 90552121; 657060697; 577081112; 140668094; 907783637; 807013581; 490603966; 732800412; 734235959; 194766436; 320802990; 214150444; 209131452; 503701919; 133164428; 706130447; 404910401; 926559410; 120897612; 75490150; 526060275; 170067772; 382194198; 549940529; 284962367; 906928233; 793477356; 630340341; 406311890; 22757933; 755892043; 822405144; 293815665; 571632645; 31050454; 475685467; 953661075; 354774080; 113862075; 248454723; 652613382; 321059735; 805920014; 914167103; 883311914; 750335561; 85039012; 470272493; 573650489; 995008847; 591646702; 186196085; 129730843; 998557454; 312581705; 302755472; 56446966; 554891096; 810924335; 21682992; 950622889; 590313303; 916282879; 295238493; 568646916; 265195273; 546161348; 923142387; 625727303; 342578467; 57724596; 859826260; 591865883; 702589498; 82170410; 871056450; 469535669; 915940343; 301257348; 70176453; 554926646; 359633040; 931712390; 124546581; 869412811; 261926729; 971890272; 232559115; 533497879; 716205661; 274956060; 873877329; 293653555; 924275982; 805143133; 173078879; 461777516; 781869422; 455658862; 849049323; 339708903; 143910844; 551990625; 622263268; 293895814; 588402269; 492088189; 366049649; 807353761; 543011092; 903124866; 103647341; 180649478; 427217574; 418201939; 683506956; 249879624; 757134657; 671126995; 755503215; 765680711; 29704136; 237710711; 879018703; 554854569; 657916695; 524887262; 128359873; 89407448; 776936092; 992613157; 792521854; 150343568; 944030068; 687079014; 109230805; 930276197; 207558513; 262862664; 964158183; 500409240; 30167063; 22671953; 879012910; 884715414; 673955941; 187769527; 794159878; 97456296; 303996146; 488874729; 997249315; 135098215; 526943305; 443178379; 518456009; 783488317; 43949384; 909528144; 208833992; 942677336; 283302074; 744524642; 680184941; 859577404; 785100194; 433023662; 296074023; 336133862; 585826003; 351829228; 607324186; 557367648; 218719913; 29470005; 199409536; 864473342; 262405528; 766958349; 478825619; 34076570; 909608443; 900497866; 265618971; 201155937; 919890053; 314914658; 525911097; 208128285; 204988551; 384522452; 787590910; 524760376; 17671503; 86525451; 968344334; 470034628; 828250632; 818852926; 784738203; 922183528; 71247188; 198595481; 82140883; 969466856; 287406127; 346704548; 339102153; 360205909; 158195687; 464336282; 964871318; 585763946; 147226395; 765880325; 16773121; 958119523; 109487202; 322174005; 1895316; 856297377; 883744670; 585919364; 118300602; 402028209; 841437383; 813449282; 645555339; 395446594; 253061955; 36291401; 111268202; 332607952; 105963637; 217615637; 202732007; 188565158; 751144555; 976687785; 558182491; 602597125; 770279982; 486570410; 649658829; 544281812; 773295159; 925032664; 910570040; 728748874; 318551341; 707899470; 230399707; 596171570; 177619447; 876602832; 347506180; 732364349; 58383818; 805993915; 399011457; 240964851; 879905118; 885912112; 689985432; 554957148; 461679325; 246045619; 700249210; 556701758; 352008673; 558751975; 500834768; 617929893; 884189752; 875156266; 496105224; 912167843; 422742831; 871677984; 197232848; 613179711; 943044553; 352507515; 926360076; 646871293; 301195452; 532679668; 769348529; 841977871; 920822239; 399080785; 398129308; 674348896; 801444675; 501646583; 842744054; 808443215; 132085716; 145954246; 343941104; 704369464; 472292740; 534098278])
25
+
26
+ let test8 _ = assert_equal 18 (maximumSumOfHeights [336269634; 615505167; 902431139; 555442545; 462432320; 258326761; 49337782; 773274355; 678267702; 176399416; 316750347; 874026939; 149525606; 566144709; 17973605; 38060485; 190461140; 450132778; 95031841; 305978476; 645159534; 149090764; 444756193; 197818506; 127994969; 2405793; 360067266; 125489771; 241546507; 231019465; 871007133; 858346202; 184562288; 994857149; 954838489; 452089034; 305984495; 991739914; 16327074; 293466424; 919774810; 107737380; 697642494; 493604863; 822555742; 233332405; 453298155; 897326467; 871829445; 821635804; 641657766; 352992584; 200743420; 25478150; 760549387; 163389447; 197326657; 412356199; 364796452; 711322102; 218970744; 556339823; 423567914; 554002506; 249399490; 828362786; 347185754; 749059544; 926946284; 375830175; 352076755; 816691544; 127405945; 635616407; 419397136; 856462237; 939578049; 276243682; 297569943; 513054305; 80940267; 280109253; 834215245; 204661486; 301461695; 511370227; 734546790; 684909516; 757111653; 833205273; 999555822; 957808002; 852468625; 988137758; 411609999; 178341238; 131388328; 779082663; 744923897; 424292464; 60078425; 746737918; 274785348; 724769117; 537466817; 316919613; 67930109; 85089854; 119579800; 26761392; 422494003; 777524186; 1251509; 440380032; 100057860; 742534672; 816941787; 651531930; 25602548; 188109120; 23688057; 534566663; 401322007; 696871812; 330786631; 577597450; 214173588; 191810851; 996335985; 885130939; 712523714; 520694020; 608485376; 939113846; 433485780; 366955098; 606515489; 924949214; 652967346; 242737019; 293217079; 18558812; 868252938; 26783710; 265292904; 425033895; 760629714; 277721449; 544373174; 224428805; 291920070; 588236058; 372961707; 350786851; 461727292; 571003111; 397616785; 156841544; 744572529; 25047878; 588521301; 845735474; 193865200; 5855851; 637381868; 204494972; 387130730; 397641104; 437940646; 258113979; 699358189; 869067438; 141123665; 385811018; 16267907; 555174184; 668315211; 883755519; 46776324; 571890230; 977613966; 512360038; 781618204; 515341409; 57219224; 236780117; 572231421; 434264077; 583134340; 361805551; 298392285; 640141708; 998235369; 701768226; 861473960; 60763580; 705103088; 828008426; 420954126; 454640629; 114735057; 704268509; 616873636; 248519382; 106777611; 857698238; 766505574; 541890057; 131109584; 211014338; 34283759; 960813335; 320693430; 859971819; 763195961; 395346475; 695565206; 620453607; 779084763; 118375946; 123352242; 833740889; 264878999; 117295158; 877894966; 922971313; 103775456; 270485722; 439276681; 472560593; 963958614; 483426451; 8432699; 572959970; 396644976; 859825862; 309406332; 358134705; 634987567; 237044674; 652430766; 792200160; 46463459; 950556329; 660343964; 888732845; 756458417; 592750994; 499745364; 775319399; 722767119; 226204090; 913525978; 574224341; 911074795; 696529014; 196671271; 398858037; 643032749; 943073064; 859107314; 144414824; 361355566; 414817669; 413759190; 935748214; 752169656; 324235011; 949351201; 633160046; 256334985; 631235848; 817517121; 506493507; 198407760; 105075702; 977879444; 344776100; 513613590; 784884626; 319890704; 839775147; 760354336; 814403165; 338365233; 852665444; 353139719; 971686603; 42834773; 572591037; 173727000; 62304635; 155960978; 189197608; 732317742; 543788359; 552818370; 442470022; 950574533; 480874935; 969115983; 962400357; 693831115; 168896175; 501477434; 804606561; 987780309; 249584587; 139961252; 760976620; 961031845; 231044492; 729473172; 250646397; 80339964; 394253364; 176421111; 860773517; 985217749; 521427159; 835274633; 28599854; 420590331; 995520411; 961114780; 802343037; 817696324; 545342425; 297385450; 595256959; 999177910; 704730381; 730668876; 50134110; 839735329; 244549084; 303207114; 421763366; 294184622; 738663007; 824471573; 927626750; 560191373; 447441201; 957956902; 617069759; 129806423; 42788132; 308018457; 656704818; 46493913; 927942905; 39973430; 363163150; 485476138; 424501106; 122606242; 183554035; 924339800; 607331352; 624429732; 412036939; 169301948; 763073494; 95786736; 500294871; 415336390; 815949915; 630514933; 869491397; 190141524; 474241247; 298114637; 708966917; 921876167; 117306872; 664474094; 566087810; 437510104; 853550006; 317627022; 976535; 24234740; 621626330; 36570543; 401598222; 230217616; 689801133; 850507242; 485397068; 77384645; 887279023; 966449467; 458819583; 664580064; 63441509; 110962337; 128479917; 89397465; 91108189; 727312978; 830715228; 105565685; 995836833; 196583486; 706931293; 379707198; 775032636; 477589074; 406133084; 530218797; 748506159; 308188487; 764770484; 745297702; 350855665; 79751260; 58876477; 959834389; 663872221; 800158434; 976501229; 202632556; 78353430; 898755075; 219358136; 11106417; 871911861; 879298791; 424954842; 787637553; 504576037; 455524409; 480701297; 674391134; 450496504; 78685083; 621160543; 895771336; 630831622; 694809120; 182766955; 665837240; 982276097; 563012299; 339267806; 347909596; 401524297; 68664135; 84643939; 636167638; 108501305; 108983362; 191033958; 330368031; 496339366; 289921272; 135568120; 243667811; 11548094; 531422834; 454351560; 677110953; 187645581; 118592875; 819489607; 888553621; 474667595; 10312656; 578339086; 394613188; 43936745; 209549364; 159830925; 840198195; 745891578; 839131951; 574656960; 493803375; 376827162; 527862674; 933817764; 527751141; 154563984; 350059267; 468019032; 463220336; 222709591; 631213537; 867360611; 108554884; 680095206; 62339864; 361537171; 614210231; 757343222; 244915625; 449620749; 246404419; 867535090; 942523462; 794121594; 748554151; 692051140; 158808253; 672900232; 264824689; 591753118; 79990439; 828195165; 785430915; 866501050; 287349079; 393182895; 613761101; 807143026; 841561099; 882370543; 778226081; 337802020; 7125575; 193073248; 385596475; 898577466; 554363146; 49121468; 551757476; 208256816; 805731453; 330939041; 991764232; 284239276; 93316684; 643951578; 719981056; 719741740; 217569373; 200284224; 836519755; 374121500; 902007879; 703250717; 99934766; 980197405; 529088244; 65254296; 18326138; 310999816; 21884612; 410136737; 925087247; 437880793; 19699309; 664108912; 895933152; 49289076; 837930028; 13600353; 632546590; 924822774; 835812220; 559614661; 593298967; 869713682; 400139785; 69685513; 396975929; 550839926; 153487144; 196429194; 7879784; 457329112; 79210282; 876697912; 237499181; 566209162; 994544512; 845970885; 161800342; 685503894; 104805611; 247569491; 141739938; 150443134; 564138754; 303971982; 173031105; 54438358; 437442299; 74635908; 859382108; 47131374; 392820252; 525576960; 935990189; 68603155; 815408319; 619617060; 368797433; 181193713; 206799061; 724127994; 603724526; 309893907; 994049338; 21167196; 597871519; 482729332; 865967015; 852969719; 335942499; 128311350; 860585352; 219018164; 94718713; 575277619; 251723149; 752677395; 358323171; 529743287; 499818112; 319500847; 859781422; 762664619; 156194316; 478973228; 112094121; 733041278; 231852723; 435540007; 324443516; 833392012; 18990229; 914323368; 705180449; 147193534; 207406473; 1647053; 831939439; 278121613; 800480906; 311995307; 443640429; 967090620; 394970413; 382183330; 376145100; 522616772; 78178047; 75760323; 801330397; 67872831; 114500908; 28867052; 64210070; 577217953; 984196373; 429011170; 661835373; 715436826; 730560799; 534645511; 518679182; 134142686; 874268372; 493306289; 86518971; 233861997; 833381678; 65939279; 197311160; 330453714; 989237900; 901885389; 563420147; 267751669; 832520716; 824005233; 159109339; 768910200; 608691341; 300594434; 423535407; 456969971; 215716246; 604272579; 746279334; 111636467; 426136813; 372987610; 353962928; 546761709; 169794309; 630832965; 335570142; 129817511; 801818671; 722557692; 818231139; 975909512; 358331882; 860226545; 629524270; 4253131; 749982883; 554512857; 326556627; 786163156; 877898334; 275537899; 291838869; 445508992; 659743424; 815265689; 407011674; 750328268; 345953618; 245154084; 815338933; 919812631; 648079508; 521283073; 571180128; 457449963; 946409452; 723922109; 570411508; 606564844; 247098369; 394279720; 658848517; 731779039; 205677401; 159900436; 824927192; 939543657; 334228473; 425874328; 250603861; 202121043; 882697709; 825980269; 530500062; 174513126; 275957057; 85228406; 870577277; 187717318; 555598428; 700040955; 265003879; 862402368; 961267821; 885692556; 972886580; 492420429; 35323436; 111291048; 795718071; 745328393; 610758603; 166522395; 70895355; 26751790; 221683103; 922955080; 533635083; 362965595; 354718659; 70705851; 320018668; 491587775; 290195832; 258717844; 240889758; 593654042; 615356708; 683535185; 18483723; 316587273; 449283725; 279959021; 578908626; 826423708; 190484254; 395758053; 177793809; 937162185; 753342164; 964839798; 579838121; 817832647; 274586376; 872699587; 312440182; 780060763; 727166198; 360247523; 595480520; 39190344; 882481909; 740376586; 764208127; 972181715; 586343828; 397952034; 65105476; 769044077; 970589007; 986690063; 472951755; 730576828; 479256695; 695777716; 133526638; 62732226; 282105829; 696328130; 582736315])
27
+
28
+
29
+ (* Grouping test cases *)
30
+ let suite = "Test Suite for maximumSumOfHeights" >::: [
31
+
32
+ "test1" >:: test1;
33
+ "test2" >:: test2;
34
+ "test3" >:: test3;
35
+ "test4" >:: test4;
36
+ "test5" >:: test5;
37
+ "test6" >:: test6;
38
+ "test7" >:: test7;
39
+ "test8" >:: test8;
40
+ ]
41
+
42
+
43
+ (* Running the tests *)
44
+ let () = run_test_tt_main suite
45
+ end
beautiful_towers_i/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.maximumSumOfHeights(List(5,3,4,1,1)), 13)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.maximumSumOfHeights(List(6,5,3,9,2,7)), 22)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.maximumSumOfHeights(List(3,2,5,5,2,3)), 18)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.maximumSumOfHeights(461095276,386639795,873859621,892139800,82516304,785970576,553100365,677118346,850406943,598758632,637390625,974451679,319236936,312383614,59877712,773224528,753820008,319787930,264076871,348733454,654886345,225449408,895039995,907127873,62848268,348609545,810191280,598381971,566981259,831172922,629628391,702582341,733614337,416039432,398836464,404940226,3470894,580849934,776304548,542638485,196250913,876391110,241686483,400996037,578773496,150667439,811461760,350606183,882289231,255297066,39806978,358764343,810199897,64759314,140000321,625450396,686288032,686161871,83161870,94858363,233833592,499323855,992994771,597734416,206271624,368103649,24046666,120733110,388984908,445911553,459177933,791680055,83734582,688837531,908021794,411312939,877927717,544862368,707377197,834962716,149821711,945898435,777370970,954712241,634655483,787323351,714271241,981833176,679967775,400126079,254451367,196517991,348792002,531858352,719062368,431990640,519637454,491165006,9058816,642190752,108698992,696881776,611943276,735912326,513669965,560225773,81698284,671564736,888253775,240304203,342300216,84108757,451038736,21950892,538584903,709795658,579033963,807181554,831429179,949250084,303874746,827312083,809040931,93472747,480647222,982274636,704863957,545039611,466842571,451567304,442498795,902079568,322400185,139877080,396515305,643537107,256936739,716331581,452575423,354361018,747197160,254214553,199994355,264500185,448310322,112146618,47811962,415761742,982241461,373161582,376761708,169282385,805438683,698746189,475374735,7737254,610476409,750043086,205149594,824138373,106479320,855761208,347130241,614201013,860686165,581305605,901324873,833425680,243687643,111303573,15280706,480805256,362315486,476190492,918418275,780343460,583579962,105733612,291524091,570946298,175973598,942892574,637444119,101344912,523257121,484292781,705948330,504269027,965369659,12776539,572047448,778031372,931748065,143517938,440680755,697015205,567393516,310088668,576855888,885400659,35431032,423463286,376743742,120990657,386460453,541143942,116415718,723467338,276814686,876195228,196860368,939018117,426354321,639129227,280872679,495394011,272069484,391877682,387758536,97430330,120011202,392541888,479436521,700890141,92394400,661692013,482125907,420226798,346736899,913845156,974720679,476675766,222080816,529570088,630971646,138650185,214818888,374188846,277131287,821091731,414340231,785181908,667620487,427405473,503939995,534799677,905116716,988838919,772171744,721250159,12313847,426426130,134742987,444004691,524280082,839125586,980378778,652785683,72763682,319046202,891261574,62344712,6449656,830222229,712440255,965318053,917757700,15049006,440359516,906649023,493578105,306794447,818492015,65408026,294810842,454338704,936078134,393347901,807894063,926360057,858900653,456587484,737367357,444795246,551855388,193044400,192139016,493705408,716745734,943709274,945258189,206568536,786500696,865972597,627977415,226173117,743619674,297311139,743914914,719001765,378329821,896922515,372439157,991804379,993912045,538147267,843222218,165814768,367995916,632223098,225447699,110531119,273223118,853526600,453220994,944451714,835460216,388709121,653513401,608948501,789372890,637479025,847533840,550365224,31460159,121309553,726082875,398853963,919501890,929583234,86186536,222825606,572316333,762412144,373828084,377715356,357920551,107734292,722401541,648765037,843011089,871690143,833184665,618447338,950453002,618394744,273096456,528536506,368596818,672389838,427850541,197929941,596041987,917796372,202672856,553232360,456687629,173166875,430719354,345527883,856019642,103768759,500914629,813073321,45959012,981168755,966719300,685841525,976479663,496717948,434198947,852580769,259014796,585434867,670196688,363028211,444430262,475356575,154896759,185410352,507727918,846049566,26924850,830925567,857098717,545592455,292925684,391938446,534704878,839820354,702897464,976376547,101996688,464274791,773577807,698460121,806800162,932674647,590402864,837572015,667380110,674554973,269085208,845961128,268011421,935918127,131095551,606497761,947821559,635142377,78432792,105933739,436184938,993006363,660772685,190424187,593506323,135528488,247006536,598258484,14407842,798725043,177496387,952834982), BigInt("17158105543"))
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.maximumSumOfHeights(907280058,869376860,854663685,724511174,357575887,554601152,937815738,592437413,992324857,878495940,17450552,956432545,804037092,677837122,694998479,156762276,955878302,665780760,112590518,206803239,553709274,977333507,42914022,727817882,949565522,929356052,821163730,718397171,153319605,461193802,789116137,925605936,802825886,4737558,11647712,31189628,942544256,770042957,395278757,985733882,123533901,352242508,40259458,53501312,539100225,313069975,405177308,659044744,284605989,816626669,918521271,18239953,276592645,700050801,38981362,225961863,46257112,165334748,236853795,330921988,768046016,468836367,768867591,241190251,154176258,22335657,949023192,860545730,805252393,87221731,776545542,463480071,402535206,600906414,389636841,897829208,140770278,653323553,921504312,821487086,873563035,963692200,461479036,22708227,529098620,324691179,938766376,285418428,897924225,964545685,549528092,107339534,565997299,347026474,192397458,703149593,39965638,512937318,997398536,876923456,115670903,47064731,90047526,157492826,807443800,570877161,358127496,633705563,164596493,249397364,356949161,195958184,769414933,318511504,262607666,786449636,615136310,598195355,836171069,650874042,603829588,749642104,321098959,711418221,527606075,828808943,678037729,140290247,113081094,723084737,185748697,774770559,869803837,111914410,722673287,776295962,315220696,191649107,815581512,989959866,440552460,954917947,51832643,905359234,773143062,656936019,694396762,230381678,210807153,350381952,808610035,6255600,34540935,209273851,850049691,858488382,518231702,352113465,62780225,282807698,831007791,650980005,574846098,61553545,274523676,711602218,385129492,847405724,926456940,748171699,449810302,977518246,985455433,407941158,944376098,961465481,397544002,303218493,232461671,825676404,73156937,793859512,229878239,588044040,885332225,512768388,861633285,389606930,694205634,194738823,879852754,815534297,976940265,483320339,549677209,850304406,537645732,763800735,285775368,256937213,626323579,129602042,164697882,858050839,508655093,92498001,413904133,572605135,938286180,845867960,331523486,870971097,742327289,166738298,852205239,878706851,518111783,493899427,625687318,508889267,975932896,366338365,586089838,400821155,519465376,148599366,233385079,813214982,213016271,92651775,915860250,347210612,138592882,954499279,193516954,418315160,334344868,745343952,661884753,928697299,896202641,774306109,433312680,61535626,551137703,291277716,569084857,560850824,207761645,344411585,541493117,385881591,527167296,972233327,435058595,460703083,808370051,852361167,842857436,811548314,71840691,850230266,444048795,719568642,841077643,37374268,910911036,380889602,591441142,322484405,686543010,312730410,296791668,485513569,762038181,223210260,208949131,427736469,854695282,760863108,644991768,347597952,617800021,19052932,893751395,890515798,740708512,38270286,79536163,508038945,950953359,890422385,608498474,814271884,134656944,145958542,919211570,65580922,831269158,920725364,758904322,837289035,909873432,751347744,571322117,412310164,554173921,103197044,321531552,244143119,606838431,194182488,595422111,520145167,779150926,290754911,514905902,396823286,638387592,821376592,250422322,641508719,443196302,434432513,580876960,939807718,679698500,11928162,617383215,908103245,955672507,767518600,506326023,689470888,555604927,522942640,653657429,235305617,297446847,779782477,208904077,424325305,956283053,770105711,441349935,815608638,18405552,658812718,972528815,369404560,183684391,124265017,267910927,356894296,111621739,529345682,104542192,413221077,320826511,22878970,936015591,521358984,707820868,395512066,77004612,679404096,522336398,793321689,559568738,508685973,578049973,444891489,503407698,318836053,348514436,731735990,144125725,286678449,527619095,757313658,594982669,941157496,232274069,347985723,773072315,465547591,461633227,117732755,810251922,973570259,690079220,862125590,405390982,929531742,919050452,148479573,469923670,882510483,938455480,323804525,807154980,299129215,512698337,983783156,751763213,749312006,815493791,967738640,225493197,63704527,296466004,378971759,296064821,293022007,138037379,406318776,92301376,891215287,713880959,210068289,74761488,404205329,887848476,377336575,598591425,740241469,579039655,707424303,743508880,508044416,933801198,417336607,6641719,632493878,829949634,934986008,117558839,793324833,691881415,158669788,673145144,820731009,32414445,611205310,581553561,299672197,50087294,763828341,54649639,34603442,136776772,734063953,191306524,411957664,306220597,641010972,732062230,294024691,676209669,855152945,110310116,441955786,764396778,960076821,986605635,240924926,89200253,883564498,213610179,794284614,180504879,311532380,103685117,29318893,859497914,123022643,642491134,506975174,539188342,653062362,370329281,899862913,865854570,833716225,201342523,732034769,858640413,383934495,105403121,922169592,714395656,262004557,995525106,271470066,898640808,223086637,300555377,251021366,973949389,106904706,905028403,124542256,18729468,927960082,130713489,42978748,375630436,784068231,105581268,745310754,982387885,208110234,998472740,950242139,361480170,605835061,378791938,385426704,173490007,840989527,750889691,558296961,592578382,543430494,863101818,452224004,806813385,262208764,451457428,668767606,992312960,53772933,932568167,515094846,218715670,117192714,160127821,347549713,358842285,42881586,157404256,162188817,987671544,34352859,285529186,187037073,185282309,613176701,583805804,415389541,982504602,582655326,692944767,791060529,653901743,758139384,412842816,591346325,284856664,604258399,57101119,417373117,552335265,306923153,658164059,693325423,712496532,243341024,954079355,954171997,332665840,100123831,516429516,224486773,736914487,103798490,748436667,460116016,154132405,133096029,327951209,693862799,743760820,368227215,83833428,706476338,597799039,887903365,808868241,819069341,798366030,409741371,331989592,974380265,355152189,502669015,299669502,658698592,260721334,756907437,106131102,554228613,675166664,316108544,41960962,258077325,369512709,418350618,874766574,376087919,480195102,610217443,481367251,17850657,923139615,773487855,907166850,818613197,707741058,538447172,654448469,301727530,854575979,617288980,495740226,384519077,96426684,36766398,271761898,80220413,889315125,460099516,108304710,648352858,7314411,220769737,69095862,850716074,934288426,603365099,27452685,423573676,171631012,219605931,190726232,619001091,691641432,404661929,912200580,60191502,114705589,563699388,502459100,582493068,84088001,496103606,621610493,907612877,432882558,881745477,663664476,45545571,375574995,364910810,36413928,158330550,5056208,170778091,716452055,974143473,737038596,67187161,163282278,239947775,441358930,938040191,485374724,760133531,121152843,192270637,395353794,628034439,918570527,421180159,957821999,872665061,416003792,541658539,235698501,206801418,958944011,772092674,635997681,756922613,778723951,595778086,452249410,278650048,154538094,593808447,247046746,645506659,713209009,362796769,287679252,211356787,675393910,648795529,678918204,181634500,671169987,243628940,898107096,606668651,685422894,948167874,888202254,602499367,478380012,660152465,381546363,573378116,290546006,519278660,447312924,226571410,345078210,21942937,906487017,748462085,966453564,660629529,572178985,30369095,820953554,521458401,733228100,706817886,717736765,859096943,271561561,961962384,686499326,789113257,728015311,234569562,176116950,537062437,131187094,838359764,928432705,277392721,487093702,415133899,508578527,614543521,299349724,17067654,468477789,266431305,155320037,122788656,995651255,245222103,68691493,851818713,781600183,979428001,229131401,313782109,206489574,472639045,131994347,33955895,75839517,701548425,348529295,234858359,768882164,7942677,582139035,621573387,963435878,967466898,438075339,911237022,95282977,296359508,185726524,21904235,361730657,759702368,647093522,415383055,683639222,691390411,610235602,199808090,807009282,38139895,781786745,310673206,644914484,213440225,996327208,646706306,333518248,630897579,343255060,131569387,119573855,112859612,970824241,183344288,228657096,629723452,539791789,967840886,91137026,127476119,635470909,826763616,332750951,474745742,899517271,232176115,566884335,963257190,150004864,286052863,528233164,390683191,356865821,638086204,134714372,683006182,861120330,760500517,801720335,142770209,885664,422751155,906172245,355580779,444008582,641496412,569363180,740393282,626331121,556107009,738523784,10521847,820942454,273092212,805962000,391860327,726362960,36305476,997980139,800133966,214166604,290174977,553193710,642912500,130930501,322147194,188402765,341690028,499941060,215811874,565343097,549268802,912853119,745677765,835028225,192007950,590689710,706754977,346650674,830600308,116085278,712200936,705464333,195831126,486717000,280041715,888717645,35969889,881742578,812953177,622106874,927489678,576980430,434571625,906453207,369384424,308262272,181218708,427131182,495473454,39550886,174247909,437188682,404995219,249872322,883607067,753744310,746127688,266864206,734661814,71224714,626051565,922111874,392695472,989975594,562080577,755901281,806968548,658118435,110920694), BigInt("21086879764"))
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.maximumSumOfHeights(424606157,868454057,655926406,762331124,781007349,25855609,570337160,81881830,737899152,312953431,884938070,235997467,86058582,815302859,827527803,544397461,946318394,356108153,504015276,427220221,441271269,31069231,107818372,52872058,19848961,330553928,372003325,737995396,525942199,401049977,26726601,979515788,686337488,770132231,375088663,991406714,346788757,289503141,455306773,178956050,913809654,275241557,533300593,461111987,543237880,608368438,335171062,675189964,155074983,758418989,744258102,974125618,77927545,713767968,281155999,21136709,273804857,950268204,406663351,702375623,488537248,915974358,164891558,190002552,116587122,370130084,323681679,696729073,834934402,628314849,869524077,231452623,757609035,23736135,860659235,181166350,375604662,304353680,966671049,735531524,635797963,305188124,314552267,298391059,78545067,263046541,474262081,922779117,345985130,642600391,854275521,306914969,907582100,798306637,556785913,187973090,522310602,711312015,218472727,88732618,554238248,227989467,45365896,774444438,108846514,326515214,325065303,251031880,644311889,167287703,85204377,868230181,218266343,744160377,263854367,244331712,58844021,903118259,556287612,190019233,771859125,342169397,784733603,238933499,266178099,516144760,368890028,667729610,434066251,202714480,818461815,854965399,560715322,454355059,76432474,656735994,679447073,704379861,387127546,983223219,697044450,561346869,673964174,114245755,449714614,785320588,362896289,57924709,80015761,537433189,891746640,144215527,583050470,281281821,749663957,125280947,577503881,507127357,108628346,142177361,784462143,721687750,931718105,29754667,29208398,977520400,573193813,866767172,827175662,589614103,20615978,711472113,140858912,413191106,666654690,56880625,582281368,303562665,179724814,227016583,946491552,866413166,500024195,920595438,400748985,288687709,694700493,920269270,59632072,546445586,278555116,450371127,296763710,155824082,492019330,300409610,785064338,379344940,370932636,853900020,611290894,581565453,524955087,751838654,69164078,771871184,134568093,862937525,973435729,654991468,903994029,202017348,211821339,918758225,750466248,707940663,988570936,353248311,169809386,12466109,926429933,68721569,320245734,140973873,478987459,184153875,245644797,560249473,227631268,340854964,193767502,919178674,591530493,900311978,665261784,669196522,90400609,274035862,576961321,355974973,53101315,511565237,649854805,382442072,964893056,602076069,240342719,658379798,68178147,669535029,706663739,416602389,952407754,646136040,923991660,624760968,610630550,394385581,67744313,194398744,123954825,859969001,723743900,217516228,445858283,878103916,144473239,342386250,510919517,377195171,178433441,767718879,497965694,686730537,778768843,242051661,552753137,785759839,559299151,909142441,19319268,419516906,654019870,605614378,255491975,527298072,64779396,478021401,659045830,766873821,827969129,673691819,30365618,960896766,335097708,489798109,921830007,870164787,397261062,622360329,265427231,706961899,489120306,565219862,517274109,178179911,392584532,398168359,584999271,599349068,956247333,669268372,740633549,367044198,131208311,136764698,159858313,548563514,539813495,482583735,231032496,56339918,832002582,437851358,399382523,808324321,637459653,391082127,748156649,126745564,134272722,765127694,495404820,297024658,528430277,462294099,963565773,469139409,164191045,828315666,94436003,656962525,320207813,81381744,430428845,118840139,221836425,852061224,663646746,432640065,340408363,916462826,740636639,965314087,249134027,357437555,783662677,959003618,117779909,495285889,831385384,511631262,492121037,779873555,518203636,586177914,421687143,369860335,38658346,670051264,867121706,912438125,234494851,971672226,510298928,226678346,877815693,812353194,706620702,564809286,72154289,116284180,798849358,193967092,176614494,229190066,262282194,48232542,199835280,920156238,279010252,246398634,820992055,338237260,164567059,431568261,927216919,323557761,869886071,888202210,772949535,569048048,437134924,914786836,28876991,467955658,890127756,943805096,678478238,835946260,573773321,25684875,385829009,135464298,635338091,824321911,533758288,692877528,518653213,427198719,221885017,382051126,22094263,520432351,636963297,381797747,694307457,523576875,476510365,485176822,245411365,445749010,508290479,971662211,977383047,255154004,614121625,393910624,85020022,22085371,894921648,256200279,487534889,167467436,992429680,558073444,964630476,806752623,792760887,595219021,545989710,13419880,845956600,385278405,567069241,148751919,980548777,309077876,929669901,244356340,652410431,776395412,279847656,121852842,371053605,819943711,172876020,169566739,863698781,69904254,203432029,164262275,33145069,746452383,501107506,518837227,41103147,800132215,428771377,477581888,665130503,939578870,228709542,138196179,404632052,466187409,40936142,293802515,998329989,130148363,706213219,918100558,617385012,943006814,108772603,838778853,582382918,940155581,703646063), BigInt("17966263596"))
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.maximumSumOfHeights(457307243,538765441,936585121,891255631,981400086,785030154,205823245,366369370,381995020,620390059,244571896,946759161,507788745,871210585,544518543,783169450,37124404,946527946,73127486,607145768,168991090,134768122,906205049,364598861,496385945,186741170,85470072,984144055,447287418,382810184,164359867,626105760,588155263,367531644,215006135,930719828,181463609,721811508,888191089,700778940,49229013,305415785,438730597,215595615,320778097,553044877,208579795,650833235,35788171,199045946,27204750,96501563,844752838,351617059,630805611,511304463,871828719,299099113,155592543,828945189,500207310,964793055,290570076,520680881,886441506,964497646,278497567,721068849,135725790,902622141,466434512,17270282,372613499,209678454,720325631,696850901,986931122,892694579,249379749,115455210,471418511,170715949,254608366,385192501,694035208,369621614,400753583,799239314,828994264,999611810,840022889,460305770,951120976,170682134,789538773,172391908,735854857,483600955,992172790,799365599,906797917,705574376,120953222,491642449,420558991,812011453,644593631,972209414,290494802,740109977,414164553,553400073,618722479,782813288,849053837,554516352,945517963,443711395,32675328,652381001,994255236,846570317,804694823,945040848,922473618,671714748,252981772,583647023,749518114,953974681,862900406,253942102,431788867,815269881,326969664,902424068,395939359,899557123,52751257,702167344,815551528,534412689,725722770,84602638,178963593,677039164,290622067,533610726,653549312,309600592,145614778,833200618,614029752,253466773,647625317,848757408,205925215,2876869,23530172,332791049,374010574,262642293,486224879,38904308,824146420,832394838,187700433,167065764,105549499,793839801,20114974,566182026,27713350,51936313,306272549,412355222,890558330,363687500,193037505,355435245,440293550,270760354,73284363,326501935,772556061,837668668,483897098,133822042,120951633,106075138,423223711,619154519,498849009,903137903,43411058,913752568,333563611,617370463,260224287,332899347,767911646,405448163,384440576,43697943,843637238,219381769,450409142,848063703,138831156,335804379,434239894,309109060,303386490,662519062,96550844,335920951,841873641,797517841,153090474,946681167,561913697,519200726,980514595,453889782,982715368,649453828,145539060,28111331,812543050,73751290,383915414,730203629,877136211,11119242,615256826,778285564,965386269,287430642,691052194,973234437,266954667,109662819,879457882,220908892,438829989,695753536,201052318,545802781,904881930,967748446,930138075,312736777,240172050,187045751,738761633,929201592,977670053,328851403,406551173,445035869,219643504,90552121,657060697,577081112,140668094,907783637,807013581,490603966,732800412,734235959,194766436,320802990,214150444,209131452,503701919,133164428,706130447,404910401,926559410,120897612,75490150,526060275,170067772,382194198,549940529,284962367,906928233,793477356,630340341,406311890,22757933,755892043,822405144,293815665,571632645,31050454,475685467,953661075,354774080,113862075,248454723,652613382,321059735,805920014,914167103,883311914,750335561,85039012,470272493,573650489,995008847,591646702,186196085,129730843,998557454,312581705,302755472,56446966,554891096,810924335,21682992,950622889,590313303,916282879,295238493,568646916,265195273,546161348,923142387,625727303,342578467,57724596,859826260,591865883,702589498,82170410,871056450,469535669,915940343,301257348,70176453,554926646,359633040,931712390,124546581,869412811,261926729,971890272,232559115,533497879,716205661,274956060,873877329,293653555,924275982,805143133,173078879,461777516,781869422,455658862,849049323,339708903,143910844,551990625,622263268,293895814,588402269,492088189,366049649,807353761,543011092,903124866,103647341,180649478,427217574,418201939,683506956,249879624,757134657,671126995,755503215,765680711,29704136,237710711,879018703,554854569,657916695,524887262,128359873,89407448,776936092,992613157,792521854,150343568,944030068,687079014,109230805,930276197,207558513,262862664,964158183,500409240,30167063,22671953,879012910,884715414,673955941,187769527,794159878,97456296,303996146,488874729,997249315,135098215,526943305,443178379,518456009,783488317,43949384,909528144,208833992,942677336,283302074,744524642,680184941,859577404,785100194,433023662,296074023,336133862,585826003,351829228,607324186,557367648,218719913,29470005,199409536,864473342,262405528,766958349,478825619,34076570,909608443,900497866,265618971,201155937,919890053,314914658,525911097,208128285,204988551,384522452,787590910,524760376,17671503,86525451,968344334,470034628,828250632,818852926,784738203,922183528,71247188,198595481,82140883,969466856,287406127,346704548,339102153,360205909,158195687,464336282,964871318,585763946,147226395,765880325,16773121,958119523,109487202,322174005,1895316,856297377,883744670,585919364,118300602,402028209,841437383,813449282,645555339,395446594,253061955,36291401,111268202,332607952,105963637,217615637,202732007,188565158,751144555,976687785,558182491,602597125,770279982,486570410,649658829,544281812,773295159,925032664,910570040,728748874,318551341,707899470,230399707,596171570,177619447,876602832,347506180,732364349,58383818,805993915,399011457,240964851,879905118,885912112,689985432,554957148,461679325,246045619,700249210,556701758,352008673,558751975,500834768,617929893,884189752,875156266,496105224,912167843,422742831,871677984,197232848,613179711,943044553,352507515,926360076,646871293,301195452,532679668,769348529,841977871,920822239,399080785,398129308,674348896,801444675,501646583,842744054,808443215,132085716,145954246,343941104,704369464,472292740,534098278), BigInt("15701756896"))
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.maximumSumOfHeights(336269634,615505167,902431139,555442545,462432320,258326761,49337782,773274355,678267702,176399416,316750347,874026939,149525606,566144709,17973605,38060485,190461140,450132778,95031841,305978476,645159534,149090764,444756193,197818506,127994969,2405793,360067266,125489771,241546507,231019465,871007133,858346202,184562288,994857149,954838489,452089034,305984495,991739914,16327074,293466424,919774810,107737380,697642494,493604863,822555742,233332405,453298155,897326467,871829445,821635804,641657766,352992584,200743420,25478150,760549387,163389447,197326657,412356199,364796452,711322102,218970744,556339823,423567914,554002506,249399490,828362786,347185754,749059544,926946284,375830175,352076755,816691544,127405945,635616407,419397136,856462237,939578049,276243682,297569943,513054305,80940267,280109253,834215245,204661486,301461695,511370227,734546790,684909516,757111653,833205273,999555822,957808002,852468625,988137758,411609999,178341238,131388328,779082663,744923897,424292464,60078425,746737918,274785348,724769117,537466817,316919613,67930109,85089854,119579800,26761392,422494003,777524186,1251509,440380032,100057860,742534672,816941787,651531930,25602548,188109120,23688057,534566663,401322007,696871812,330786631,577597450,214173588,191810851,996335985,885130939,712523714,520694020,608485376,939113846,433485780,366955098,606515489,924949214,652967346,242737019,293217079,18558812,868252938,26783710,265292904,425033895,760629714,277721449,544373174,224428805,291920070,588236058,372961707,350786851,461727292,571003111,397616785,156841544,744572529,25047878,588521301,845735474,193865200,5855851,637381868,204494972,387130730,397641104,437940646,258113979,699358189,869067438,141123665,385811018,16267907,555174184,668315211,883755519,46776324,571890230,977613966,512360038,781618204,515341409,57219224,236780117,572231421,434264077,583134340,361805551,298392285,640141708,998235369,701768226,861473960,60763580,705103088,828008426,420954126,454640629,114735057,704268509,616873636,248519382,106777611,857698238,766505574,541890057,131109584,211014338,34283759,960813335,320693430,859971819,763195961,395346475,695565206,620453607,779084763,118375946,123352242,833740889,264878999,117295158,877894966,922971313,103775456,270485722,439276681,472560593,963958614,483426451,8432699,572959970,396644976,859825862,309406332,358134705,634987567,237044674,652430766,792200160,46463459,950556329,660343964,888732845,756458417,592750994,499745364,775319399,722767119,226204090,913525978,574224341,911074795,696529014,196671271,398858037,643032749,943073064,859107314,144414824,361355566,414817669,413759190,935748214,752169656,324235011,949351201,633160046,256334985,631235848,817517121,506493507,198407760,105075702,977879444,344776100,513613590,784884626,319890704,839775147,760354336,814403165,338365233,852665444,353139719,971686603,42834773,572591037,173727000,62304635,155960978,189197608,732317742,543788359,552818370,442470022,950574533,480874935,969115983,962400357,693831115,168896175,501477434,804606561,987780309,249584587,139961252,760976620,961031845,231044492,729473172,250646397,80339964,394253364,176421111,860773517,985217749,521427159,835274633,28599854,420590331,995520411,961114780,802343037,817696324,545342425,297385450,595256959,999177910,704730381,730668876,50134110,839735329,244549084,303207114,421763366,294184622,738663007,824471573,927626750,560191373,447441201,957956902,617069759,129806423,42788132,308018457,656704818,46493913,927942905,39973430,363163150,485476138,424501106,122606242,183554035,924339800,607331352,624429732,412036939,169301948,763073494,95786736,500294871,415336390,815949915,630514933,869491397,190141524,474241247,298114637,708966917,921876167,117306872,664474094,566087810,437510104,853550006,317627022,976535,24234740,621626330,36570543,401598222,230217616,689801133,850507242,485397068,77384645,887279023,966449467,458819583,664580064,63441509,110962337,128479917,89397465,91108189,727312978,830715228,105565685,995836833,196583486,706931293,379707198,775032636,477589074,406133084,530218797,748506159,308188487,764770484,745297702,350855665,79751260,58876477,959834389,663872221,800158434,976501229,202632556,78353430,898755075,219358136,11106417,871911861,879298791,424954842,787637553,504576037,455524409,480701297,674391134,450496504,78685083,621160543,895771336,630831622,694809120,182766955,665837240,982276097,563012299,339267806,347909596,401524297,68664135,84643939,636167638,108501305,108983362,191033958,330368031,496339366,289921272,135568120,243667811,11548094,531422834,454351560,677110953,187645581,118592875,819489607,888553621,474667595,10312656,578339086,394613188,43936745,209549364,159830925,840198195,745891578,839131951,574656960,493803375,376827162,527862674,933817764,527751141,154563984,350059267,468019032,463220336,222709591,631213537,867360611,108554884,680095206,62339864,361537171,614210231,757343222,244915625,449620749,246404419,867535090,942523462,794121594,748554151,692051140,158808253,672900232,264824689,591753118,79990439,828195165,785430915,866501050,287349079,393182895,613761101,807143026,841561099,882370543,778226081,337802020,7125575,193073248,385596475,898577466,554363146,49121468,551757476,208256816,805731453,330939041,991764232,284239276,93316684,643951578,719981056,719741740,217569373,200284224,836519755,374121500,902007879,703250717,99934766,980197405,529088244,65254296,18326138,310999816,21884612,410136737,925087247,437880793,19699309,664108912,895933152,49289076,837930028,13600353,632546590,924822774,835812220,559614661,593298967,869713682,400139785,69685513,396975929,550839926,153487144,196429194,7879784,457329112,79210282,876697912,237499181,566209162,994544512,845970885,161800342,685503894,104805611,247569491,141739938,150443134,564138754,303971982,173031105,54438358,437442299,74635908,859382108,47131374,392820252,525576960,935990189,68603155,815408319,619617060,368797433,181193713,206799061,724127994,603724526,309893907,994049338,21167196,597871519,482729332,865967015,852969719,335942499,128311350,860585352,219018164,94718713,575277619,251723149,752677395,358323171,529743287,499818112,319500847,859781422,762664619,156194316,478973228,112094121,733041278,231852723,435540007,324443516,833392012,18990229,914323368,705180449,147193534,207406473,1647053,831939439,278121613,800480906,311995307,443640429,967090620,394970413,382183330,376145100,522616772,78178047,75760323,801330397,67872831,114500908,28867052,64210070,577217953,984196373,429011170,661835373,715436826,730560799,534645511,518679182,134142686,874268372,493306289,86518971,233861997,833381678,65939279,197311160,330453714,989237900,901885389,563420147,267751669,832520716,824005233,159109339,768910200,608691341,300594434,423535407,456969971,215716246,604272579,746279334,111636467,426136813,372987610,353962928,546761709,169794309,630832965,335570142,129817511,801818671,722557692,818231139,975909512,358331882,860226545,629524270,4253131,749982883,554512857,326556627,786163156,877898334,275537899,291838869,445508992,659743424,815265689,407011674,750328268,345953618,245154084,815338933,919812631,648079508,521283073,571180128,457449963,946409452,723922109,570411508,606564844,247098369,394279720,658848517,731779039,205677401,159900436,824927192,939543657,334228473,425874328,250603861,202121043,882697709,825980269,530500062,174513126,275957057,85228406,870577277,187717318,555598428,700040955,265003879,862402368,961267821,885692556,972886580,492420429,35323436,111291048,795718071,745328393,610758603,166522395,70895355,26751790,221683103,922955080,533635083,362965595,354718659,70705851,320018668,491587775,290195832,258717844,240889758,593654042,615356708,683535185,18483723,316587273,449283725,279959021,578908626,826423708,190484254,395758053,177793809,937162185,753342164,964839798,579838121,817832647,274586376,872699587,312440182,780060763,727166198,360247523,595480520,39190344,882481909,740376586,764208127,972181715,586343828,397952034,65105476,769044077,970589007,986690063,472951755,730576828,479256695,695777716,133526638,62732226,282105829,696328130,582736315), BigInt("15677354913"))
34
+ }
35
+
36
+ }
beautiful_towers_ii/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
beautiful_towers_ii/java_tests/Main.java ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ public class Main {
7
+ //Program start
8
+
9
+ //Program end
10
+
11
+ @Test
12
+ public void test1() {
13
+ assertEquals(13, maximumSumOfHeights(Arrays.asList(5,3,4,1,1)));
14
+ }
15
+ @Test
16
+ public void test2() {
17
+ assertEquals(22, maximumSumOfHeights(Arrays.asList(6,5,3,9,2,7)));
18
+ }
19
+ @Test
20
+ public void test3() {
21
+ assertEquals(18, maximumSumOfHeights(Arrays.asList(3,2,5,5,2,3)));
22
+ }
23
+
24
+ }
beautiful_towers_ii/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
beautiful_towers_ii/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
beautiful_towers_ii/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
best_poker_hand/.DS_Store ADDED
Binary file (6.15 kB). View file
 
best_poker_hand/haskell_tests/Main.hs ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (bestHand [13,2,3,1,9] [ \"a \", \"a \", \"a \", \"a \", \"a \"])," "Flush" (bestHand [13,2,3,1,9] ["a","a","a","a","a"]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (bestHand [4,4,2,4,4] [ \"d \", \"a \", \"a \", \"b \", \"c \"])," "ThreeofaKind" (bestHand [4,4,2,4,4] ["d","a","a","b","c"]))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (bestHand [10,10,2,12,9] [ \"a \", \"b \", \"c \", \"a \", \"d \"])," "Pair" (bestHand [10,10,2,12,9] ["a","b","c","a","d"]))
19
+
20
+
21
+ -- Grouping test cases
22
+ tests :: Test
23
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2]
24
+
25
+ -- Running the tests
26
+ main :: IO Counts
27
+ main = runTestTT tests
best_poker_hand/java_tests/Main.java ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals("new ArrayList<>(Arrays.asList(a,a,a,a,a))", bestHand(new ArrayList<>(Arrays.asList(13,2,3,1,9)), new ArrayList<>(Arrays.asList("a","a","a","a","a"))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("new ArrayList<>(Arrays.asList(d,a,a,b,c))", bestHand(new ArrayList<>(Arrays.asList(4,4,2,4,4)), new ArrayList<>(Arrays.asList("d","a","a","b","c"))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals("new ArrayList<>(Arrays.asList(a,b,c,a,d))", bestHand(new ArrayList<>(Arrays.asList(10,10,2,12,9)), new ArrayList<>(Arrays.asList("a","b","c","a","d"))));
23
+ }
24
+
25
+ }
best_poker_hand/meta.json ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2433,
3
+ "name": "best_poker_hand",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/best-poker-hand/",
6
+ "date": "1657324800000",
7
+ "task_description": "You are given an integer array `ranks` and a character array `suits`. You have `5` cards where the `ith` card has a rank of `ranks[i]` and a suit of `suits[i]`. The following are the types of **poker hands** you can make from best to worst: `\"Flush\"`: Five cards of the same suit. `\"Three of a Kind\"`: Three cards of the same rank. `\"Pair\"`: Two cards of the same rank. `\"High Card\"`: Any single card. Return _a string representing the **best** type of **poker hand** you can make with the given cards._ **Note** that the return values are **case-sensitive**. **Example 1:** ``` **Input:** ranks = [13,2,3,1,9], suits = [\"a\",\"a\",\"a\",\"a\",\"a\"] **Output:** \"Flush\" **Explanation:** The hand with all the cards consists of 5 cards with the same suit, so we have a \"Flush\". ``` **Example 2:** ``` **Input:** ranks = [4,4,2,4,4], suits = [\"d\",\"a\",\"a\",\"b\",\"c\"] **Output:** \"Three of a Kind\" **Explanation:** The hand with the first, second, and fourth card consists of 3 cards with the same rank, so we have a \"Three of a Kind\". Note that we could also make a \"Pair\" hand but \"Three of a Kind\" is a better hand. Also note that other cards could be used to make the \"Three of a Kind\" hand. ``` **Example 3:** ``` **Input:** ranks = [10,10,2,12,9], suits = [\"a\",\"b\",\"c\",\"a\",\"d\"] **Output:** \"Pair\" **Explanation:** The hand with the first and second card consists of 2 cards with the same rank, so we have a \"Pair\". Note that we cannot make a \"Flush\" or a \"Three of a Kind\". ``` **Constraints:** `ranks.length == suits.length == 5` `1 <= ranks[i] <= 13` `'a' <= suits[i] <= 'd'` No two cards have the same rank and suit.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "ranks = [13,2,3,1,9], suits = [\"a\",\"a\",\"a\",\"a\",\"a\"]",
12
+ "output": "\"Flush\" "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "ranks = [4,4,2,4,4], suits = [\"d\",\"a\",\"a\",\"b\",\"c\"]",
17
+ "output": "\"Three of a Kind\" "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "ranks = [10,10,2,12,9], suits = [\"a\",\"b\",\"c\",\"a\",\"d\"]",
22
+ "output": "\"Pair\" "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ [
29
+ 9,
30
+ 12,
31
+ 2,
32
+ 4,
33
+ 6
34
+ ],
35
+ [
36
+ "a",
37
+ "d",
38
+ "d",
39
+ "d",
40
+ "c"
41
+ ]
42
+ ],
43
+ "output": "High Card"
44
+ },
45
+ {
46
+ "input": [
47
+ [
48
+ 9,
49
+ 12,
50
+ 13,
51
+ 1,
52
+ 7
53
+ ],
54
+ [
55
+ "c",
56
+ "c",
57
+ "b",
58
+ "a",
59
+ "c"
60
+ ]
61
+ ],
62
+ "output": "High Card"
63
+ },
64
+ {
65
+ "input": [
66
+ [
67
+ 4,
68
+ 11,
69
+ 8,
70
+ 2,
71
+ 5
72
+ ],
73
+ [
74
+ "b",
75
+ "c",
76
+ "c",
77
+ "d",
78
+ "b"
79
+ ]
80
+ ],
81
+ "output": "High Card"
82
+ },
83
+ {
84
+ "input": [
85
+ [
86
+ 11,
87
+ 1,
88
+ 10,
89
+ 13,
90
+ 7
91
+ ],
92
+ [
93
+ "b",
94
+ "b",
95
+ "b",
96
+ "a",
97
+ "c"
98
+ ]
99
+ ],
100
+ "output": "High Card"
101
+ },
102
+ {
103
+ "input": [
104
+ [
105
+ 4,
106
+ 12,
107
+ 8,
108
+ 9,
109
+ 13
110
+ ],
111
+ [
112
+ "d",
113
+ "d",
114
+ "d",
115
+ "d",
116
+ "d"
117
+ ]
118
+ ],
119
+ "output": "Flush"
120
+ },
121
+ {
122
+ "input": [
123
+ [
124
+ 10,
125
+ 5,
126
+ 7,
127
+ 13,
128
+ 11
129
+ ],
130
+ [
131
+ "d",
132
+ "c",
133
+ "b",
134
+ "b",
135
+ "c"
136
+ ]
137
+ ],
138
+ "output": "High Card"
139
+ },
140
+ {
141
+ "input": [
142
+ [
143
+ 1,
144
+ 11,
145
+ 2,
146
+ 4,
147
+ 3
148
+ ],
149
+ [
150
+ "c",
151
+ "d",
152
+ "c",
153
+ "b",
154
+ "b"
155
+ ]
156
+ ],
157
+ "output": "High Card"
158
+ },
159
+ {
160
+ "input": [
161
+ [
162
+ 11,
163
+ 6,
164
+ 9,
165
+ 4,
166
+ 7
167
+ ],
168
+ [
169
+ "c",
170
+ "c",
171
+ "d",
172
+ "b",
173
+ "b"
174
+ ]
175
+ ],
176
+ "output": "High Card"
177
+ },
178
+ {
179
+ "input": [
180
+ [
181
+ 5,
182
+ 7,
183
+ 4,
184
+ 3,
185
+ 8
186
+ ],
187
+ [
188
+ "a",
189
+ "b",
190
+ "a",
191
+ "c",
192
+ "c"
193
+ ]
194
+ ],
195
+ "output": "High Card"
196
+ },
197
+ {
198
+ "input": [
199
+ [
200
+ 7,
201
+ 3,
202
+ 8,
203
+ 11,
204
+ 1
205
+ ],
206
+ [
207
+ "c",
208
+ "c",
209
+ "c",
210
+ "b",
211
+ "d"
212
+ ]
213
+ ],
214
+ "output": "High Card"
215
+ }
216
+ ],
217
+ "haskell_template": "bestHand :: [Int] -> [String] -> String\nbestHand ranks suits ",
218
+ "ocaml_template": "let bestHand (ranks: int list) (suits: string list) : string = ",
219
+ "scala_template": "def bestHand(ranks: List[Int],suits: List[String]): String = { \n \n}",
220
+ "java_template": "public static String bestHand(List<Integer> ranks, List<String> suits) {\n\n}",
221
+ "python_template": "class Solution(object):\n def bestHand(self, ranks, suits):\n \"\"\"\n :type ranks: List[int]\n :type suits: List[str]\n :rtype: str\n \"\"\"\n "
222
+ }
best_poker_hand/ocaml_tests/main.ml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal "Flush" (bestHand [13;2;3;1;9] ["a";"a";"a";"a";"a"])
12
+
13
+ let test2 _ = assert_equal "Three of a Kind" (bestHand [4;4;2;4;4] ["d";"a";"a";"b";"c"])
14
+
15
+ let test3 _ = assert_equal "Pair" (bestHand [10;10;2;12;9] ["a";"b";"c";"a";"d"])
16
+
17
+
18
+ (* Grouping test cases *)
19
+ let suite = "Test Suite for bestHand" >::: [
20
+
21
+ "test1" >:: test1;
22
+ "test2" >:: test2;
23
+ "test3" >:: test3;
24
+ ]
25
+
26
+
27
+ (* Running the tests *)
28
+ let () = run_test_tt_main suite
29
+ end
best_poker_hand/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.bestHand(List(13,2,3,1,9),List("a","a","a","a","a")), "Flush")
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.bestHand(List(4,4,2,4,4),List("d","a","a","b","c")), "ThreeofaKind")
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.bestHand(List(10,10,2,12,9),List("a","b","c","a","d")), "Pair")
14
+ }
15
+
16
+ }
bitwise_xor_of_all_pairings/.DS_Store ADDED
Binary file (6.15 kB). View file
 
bitwise_xor_of_all_pairings/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (xorAllNums [2,1,3] [10,2,5,0])," 13 (xorAllNums [2,1,3] [10,2,5,0]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (xorAllNums [1,2] [3,4])," 0 (xorAllNums [1,2] [3,4]))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
bitwise_xor_of_all_pairings/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(13, xorAllNums(new ArrayList<>(Arrays.asList(2,1,3)), new ArrayList<>(Arrays.asList(10,2,5,0))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(0, xorAllNums(new ArrayList<>(Arrays.asList(1,2)), new ArrayList<>(Arrays.asList(3,4))));
19
+ }
20
+
21
+ }
bitwise_xor_of_all_pairings/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2533,
3
+ "name": "bitwise_xor_of_all_pairings",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/bitwise-xor-of-all-pairings/",
6
+ "date": "1663372800000",
7
+ "task_description": "You are given two **0-indexed** arrays, `nums1` and `nums2`, consisting of non-negative integers. Let there be another array, `nums3`, which contains the bitwise XOR of **all pairings** of integers between `nums1` and `nums2` (every integer in `nums1` is paired with every integer in `nums2` **exactly once**). Return_ the **bitwise XOR** of all integers in _`nums3`. **Example 1:** ``` **Input:** nums1 = [2,1,3], nums2 = [10,2,5,0] **Output:** 13 **Explanation:** A possible nums3 array is [8,0,7,2,11,3,4,1,9,1,6,3]. The bitwise XOR of all these numbers is 13, so we return 13. ``` **Example 2:** ``` **Input:** nums1 = [1,2], nums2 = [3,4] **Output:** 0 **Explanation:** All possible pairs of bitwise XORs are nums1[0] ^ nums2[0], nums1[0] ^ nums2[1], nums1[1] ^ nums2[0], and nums1[1] ^ nums2[1]. Thus, one possible nums3 array is [2,5,1,6]. 2 ^ 5 ^ 1 ^ 6 = 0, so we return 0. ``` **Constraints:** `1 <= nums1.length, nums2.length <= 105` `0 <= nums1[i], nums2[j] <= 109`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums1 = [2,1,3], nums2 = [10,2,5,0]",
12
+ "output": "13 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums1 = [1,2], nums2 = [3,4]",
17
+ "output": "0 "
18
+ }
19
+ ],
20
+ "private_test_cases": [],
21
+ "haskell_template": "xorAllNums :: [Int] -> [Int] -> Int\nxorAllNums nums1 nums2 ",
22
+ "ocaml_template": "let xorAllNums (nums1: int list) (nums2: int list) : int = ",
23
+ "scala_template": "def xorAllNums(nums1: List[Int],nums2: List[Int]): Int = { \n \n}",
24
+ "java_template": "public static int xorAllNums(List<Integer> nums1, List<Integer> nums2) {\n\n}",
25
+ "python_template": "class Solution(object):\n def xorAllNums(self, nums1, nums2):\n \"\"\"\n :type nums1: List[int]\n :type nums2: List[int]\n :rtype: int\n \"\"\"\n "
26
+ }
bitwise_xor_of_all_pairings/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 13 (xorAllNums [2;1;3] [10;2;5;0])
12
+
13
+ let test2 _ = assert_equal 0 (xorAllNums [1;2] [3;4])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for xorAllNums" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
bitwise_xor_of_all_pairings/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.xorAllNums(List(2,1,3),List(10,2,5,0)), 13)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.xorAllNums(List(1,2),List(3,4)), 0)
10
+ }
11
+
12
+ }
build_a_matrix_with_conditions/.DS_Store ADDED
Binary file (6.15 kB). View file
 
build_a_matrix_with_conditions/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (buildMatrix 3 [[1,2],[3,2]] [[2,1],[3,2]])," [[3,0,0],[0,0,1],[0,2,0]] (buildMatrix 3 [[1,2],[3,2]] [[2,1],[3,2]]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (buildMatrix 3 [[1,2],[2,3],[3,1],[2,3]] [[2,1]])," [] (buildMatrix 3 [[1,2],[2,3],[3,1],[2,3]] [[2,1]]))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
build_a_matrix_with_conditions/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(3,0,0)),new ArrayList<>(Arrays.asList(0,0,1)),new ArrayList<>(Arrays.asList(0,2,0)))), buildMatrix(3, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,2)),new ArrayList<>(Arrays.asList(3,2)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(2,1)),new ArrayList<>(Arrays.asList(3,2))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals([], buildMatrix(3, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,2)),new ArrayList<>(Arrays.asList(2,3)),new ArrayList<>(Arrays.asList(3,1)),new ArrayList<>(Arrays.asList(2,3)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(2,1))))));
19
+ }
20
+
21
+ }
build_a_matrix_with_conditions/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
build_a_matrix_with_conditions/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal [[3;0;0];[0;0;1];[0;2;0]] (buildMatrix 3 [[1;2];[3;2]] [[2;1];[3;2]])
12
+
13
+ let test2 _ = assert_equal [] (buildMatrix 3 [[1;2];[2;3];[3;1];[2;3]] [[2;1]])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for buildMatrix" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
build_a_matrix_with_conditions/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.buildMatrix(3,List(List(1,2),List(3,2)),List(List(2,1),List(3,2))), List(List(3,0,0),List(0,0,1),List(0,2,0)))
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.buildMatrix(3,List(List(1,2),List(2,3),List(3,1),List(2,3)),List(List(2,1))), List())
10
+ }
11
+
12
+ }
buy_two_chocolates/haskell_tests/Main.hs ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (buyChoco [1,2,2] 3)," 0 (buyChoco [1,2,2] 3))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (buyChoco [3,2,3] 3)," 3 (buyChoco [3,2,3] 3))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (buyChoco [61, 75, 67] 77)," 77 (buyChoco [61, 75, 67] 77))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (buyChoco [81, 8, 10, 44, 100, 38, 7, 47] 64)," 49 (buyChoco [81, 8, 10, 44, 100, 38, 7, 47] 64))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (buyChoco [19, 6, 24, 7, 94, 40, 97, 60, 82, 62, 53, 12, 8, 56, 42, 48, 85, 76, 34, 29, 57, 28, 17, 31, 36, 3, 90, 92, 78, 64, 80, 84, 50, 39, 73, 86, 41, 11, 95, 88, 37, 1, 27] 2)," 2 (buyChoco [19, 6, 24, 7, 94, 40, 97, 60, 82, 62, 53, 12, 8, 56, 42, 48, 85, 76, 34, 29, 57, 28, 17, 31, 36, 3, 90, 92, 78, 64, 80, 84, 50, 39, 73, 86, 41, 11, 95, 88, 37, 1, 27] 2))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (buyChoco [60, 32, 4, 35, 36, 45] 38)," 2 (buyChoco [60, 32, 4, 35, 36, 45] 38))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (buyChoco [51, 80, 78, 44, 72, 50, 74, 81, 30, 63, 58, 43, 16, 65, 39, 66, 96, 42, 31, 17, 15, 92, 25, 75, 6, 33, 45, 14] 7)," 7 (buyChoco [51, 80, 78, 44, 72, 50, 74, 81, 30, 63, 58, 43, 16, 65, 39, 66, 96, 42, 31, 17, 15, 92, 25, 75, 6, 33, 45, 14] 7))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (buyChoco [14, 55, 19, 73, 75, 69, 88, 18, 28, 22, 2, 72, 29, 5, 17, 64, 68, 60, 3, 96, 95, 47, 7, 53, 78, 70, 21, 84, 46, 27, 38] 37)," 32 (buyChoco [14, 55, 19, 73, 75, 69, 88, 18, 28, 22, 2, 72, 29, 5, 17, 64, 68, 60, 3, 96, 95, 47, 7, 53, 78, 70, 21, 84, 46, 27, 38] 37))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (buyChoco [51, 50, 22, 39, 21, 23, 99, 97, 66, 41, 3, 79, 89, 91, 31, 35, 14, 5, 11, 71, 38, 82, 7, 84, 48, 30, 28, 90, 58, 60, 94, 53, 9, 87, 47, 72, 74, 75, 25, 43, 4, 57, 86] 41)," 34 (buyChoco [51, 50, 22, 39, 21, 23, 99, 97, 66, 41, 3, 79, 89, 91, 31, 35, 14, 5, 11, 71, 38, 82, 7, 84, 48, 30, 28, 90, 58, 60, 94, 53, 9, 87, 47, 72, 74, 75, 25, 43, 4, 57, 86] 41))
37
+
38
+
39
+ -- Grouping test cases
40
+ tests :: Test
41
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6, TestLabel "Test7" test7, TestLabel "Test8" test8]
42
+
43
+ -- Running the tests
44
+ main :: IO Counts
45
+ main = runTestTT tests
buy_two_chocolates/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(0, buyChoco(new ArrayList<>(Arrays.asList(1,2,2)), 3));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(3, buyChoco(new ArrayList<>(Arrays.asList(3,2,3)), 3));
19
+ }
20
+
21
+ }
buy_two_chocolates/meta.json ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2756,
3
+ "name": "buy_two_chocolates",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/buy-two-chocolates/",
6
+ "date": "2023-05-13 00:00:00",
7
+ "task_description": "You are given an integer array `prices` representing the prices of various chocolates in a store. You are also given a single integer `money`, which represents your initial amount of money. You must buy **exactly** two chocolates in such a way that you still have some **non-negative** leftover money. You would like to minimize the sum of the prices of the two chocolates you buy. Return _the amount of money you will have leftover after buying the two chocolates_. If there is no way for you to buy two chocolates without ending up in debt, return `money`. Note that the leftover must be non-negative. **Example 1:** ``` **Input:** prices = [1,2,2], money = 3 **Output:** 0 **Explanation:** Purchase the chocolates priced at 1 and 2 units respectively. You will have 3 - 3 = 0 units of money afterwards. Thus, we return 0. ``` **Example 2:** ``` **Input:** prices = [3,2,3], money = 3 **Output:** 3 **Explanation:** You cannot buy 2 chocolates without going in debt, so we return 3. ``` **Constraints:** `2 <= prices.length <= 50` `1 <= prices[i] <= 100` `1 <= money <= 100`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "prices = [1,2,2], money = 3",
12
+ "output": "0 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "prices = [3,2,3], money = 3",
17
+ "output": "3 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ [
24
+ 61,
25
+ 75,
26
+ 67
27
+ ],
28
+ 77
29
+ ],
30
+ "output": 77
31
+ },
32
+ {
33
+ "input": [
34
+ [
35
+ 81,
36
+ 8,
37
+ 10,
38
+ 44,
39
+ 100,
40
+ 38,
41
+ 7,
42
+ 47
43
+ ],
44
+ 64
45
+ ],
46
+ "output": 49
47
+ },
48
+ {
49
+ "input": [
50
+ [
51
+ 19,
52
+ 6,
53
+ 24,
54
+ 7,
55
+ 94,
56
+ 40,
57
+ 97,
58
+ 60,
59
+ 82,
60
+ 62,
61
+ 53,
62
+ 12,
63
+ 8,
64
+ 56,
65
+ 42,
66
+ 48,
67
+ 85,
68
+ 76,
69
+ 34,
70
+ 29,
71
+ 57,
72
+ 28,
73
+ 17,
74
+ 31,
75
+ 36,
76
+ 3,
77
+ 90,
78
+ 92,
79
+ 78,
80
+ 64,
81
+ 80,
82
+ 84,
83
+ 50,
84
+ 39,
85
+ 73,
86
+ 86,
87
+ 41,
88
+ 11,
89
+ 95,
90
+ 88,
91
+ 37,
92
+ 1,
93
+ 27
94
+ ],
95
+ 2
96
+ ],
97
+ "output": 2
98
+ },
99
+ {
100
+ "input": [
101
+ [
102
+ 60,
103
+ 32,
104
+ 4,
105
+ 35,
106
+ 36,
107
+ 45
108
+ ],
109
+ 38
110
+ ],
111
+ "output": 2
112
+ },
113
+ {
114
+ "input": [
115
+ [
116
+ 51,
117
+ 80,
118
+ 78,
119
+ 44,
120
+ 72,
121
+ 50,
122
+ 74,
123
+ 81,
124
+ 30,
125
+ 63,
126
+ 58,
127
+ 43,
128
+ 16,
129
+ 65,
130
+ 39,
131
+ 66,
132
+ 96,
133
+ 42,
134
+ 31,
135
+ 17,
136
+ 15,
137
+ 92,
138
+ 25,
139
+ 75,
140
+ 6,
141
+ 33,
142
+ 45,
143
+ 14
144
+ ],
145
+ 7
146
+ ],
147
+ "output": 7
148
+ },
149
+ {
150
+ "input": [
151
+ [
152
+ 14,
153
+ 55,
154
+ 19,
155
+ 73,
156
+ 75,
157
+ 69,
158
+ 88,
159
+ 18,
160
+ 28,
161
+ 22,
162
+ 2,
163
+ 72,
164
+ 29,
165
+ 5,
166
+ 17,
167
+ 64,
168
+ 68,
169
+ 60,
170
+ 3,
171
+ 96,
172
+ 95,
173
+ 47,
174
+ 7,
175
+ 53,
176
+ 78,
177
+ 70,
178
+ 21,
179
+ 84,
180
+ 46,
181
+ 27,
182
+ 38
183
+ ],
184
+ 37
185
+ ],
186
+ "output": 32
187
+ },
188
+ {
189
+ "input": [
190
+ [
191
+ 51,
192
+ 50,
193
+ 22,
194
+ 39,
195
+ 21,
196
+ 23,
197
+ 99,
198
+ 97,
199
+ 66,
200
+ 41,
201
+ 3,
202
+ 79,
203
+ 89,
204
+ 91,
205
+ 31,
206
+ 35,
207
+ 14,
208
+ 5,
209
+ 11,
210
+ 71,
211
+ 38,
212
+ 82,
213
+ 7,
214
+ 84,
215
+ 48,
216
+ 30,
217
+ 28,
218
+ 90,
219
+ 58,
220
+ 60,
221
+ 94,
222
+ 53,
223
+ 9,
224
+ 87,
225
+ 47,
226
+ 72,
227
+ 74,
228
+ 75,
229
+ 25,
230
+ 43,
231
+ 4,
232
+ 57,
233
+ 86
234
+ ],
235
+ 41
236
+ ],
237
+ "output": 34
238
+ }
239
+ ],
240
+ "haskell_template": "buyChoco :: [Int] -> Int -> Int\nbuyChoco prices money ",
241
+ "ocaml_template": "let buyChoco (prices: int list) (money: int) : int = ",
242
+ "scala_template": "def buyChoco(prices: List[Int],money: Int): Int = { \n \n}",
243
+ "java_template": "class Solution {\n public int buyChoco(int[] prices, int money) {\n \n }\n}",
244
+ "python_template": "class Solution(object):\n def buyChoco(self, prices, money):\n \"\"\"\n :type prices: List[int]\n :type money: int\n :rtype: int\n \"\"\"\n "
245
+ }