DatasetRepo commited on
Commit
9ec8ded
·
verified ·
1 Parent(s): dc84da3

d01b35c5439261f08011d6fb1004bf5de26e932d5d4318d528035d5a82f46ffa

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 +1 -0
  2. collect_coins_in_a_tree/.DS_Store +0 -0
  3. collect_coins_in_a_tree/haskell_tests/Main.hs +24 -0
  4. collect_coins_in_a_tree/java_tests/Main.java +21 -0
  5. collect_coins_in_a_tree/meta.json +3 -0
  6. collect_coins_in_a_tree/ocaml_tests/main.ml +26 -0
  7. collect_coins_in_a_tree/scala_tests/MySuite.scala +12 -0
  8. collecting_chocolates/haskell_tests/Main.hs +45 -0
  9. collecting_chocolates/java_tests/Main.java +21 -0
  10. collecting_chocolates/meta.json +0 -0
  11. collecting_chocolates/ocaml_tests/main.ml +50 -0
  12. collecting_chocolates/scala_tests/MySuite.scala +44 -0
  13. construct_2d_grid_matching_graph_layout/haskell_tests/Main.hs +0 -0
  14. construct_2d_grid_matching_graph_layout/java_tests/Main.java +25 -0
  15. construct_2d_grid_matching_graph_layout/meta.json +0 -0
  16. construct_2d_grid_matching_graph_layout/ocaml_tests/main.ml +0 -0
  17. construct_2d_grid_matching_graph_layout/scala_tests/MySuite.scala +0 -0
  18. construct_product_matrix/haskell_tests/Main.hs +41 -0
  19. construct_product_matrix/java_tests/Main.java +20 -0
  20. construct_product_matrix/meta.json +327 -0
  21. construct_product_matrix/ocaml_tests/main.ml +42 -0
  22. construct_product_matrix/scala_tests/MySuite.scala +32 -0
  23. construct_smallest_number_from_di_string/.DS_Store +0 -0
  24. construct_smallest_number_from_di_string/haskell_tests/Main.hs +24 -0
  25. construct_smallest_number_from_di_string/java_tests/Main.java +21 -0
  26. construct_smallest_number_from_di_string/meta.json +67 -0
  27. construct_smallest_number_from_di_string/ocaml_tests/main.ml +26 -0
  28. construct_smallest_number_from_di_string/scala_tests/MySuite.scala +12 -0
  29. construct_string_with_repeat_limit/.DS_Store +0 -0
  30. construct_string_with_repeat_limit/haskell_tests/Main.hs +24 -0
  31. construct_string_with_repeat_limit/java_tests/Main.java +21 -0
  32. construct_string_with_repeat_limit/meta.json +0 -0
  33. construct_string_with_repeat_limit/ocaml_tests/main.ml +26 -0
  34. construct_string_with_repeat_limit/scala_tests/MySuite.scala +12 -0
  35. construct_the_longest_new_string/haskell_tests/Main.hs +45 -0
  36. construct_the_longest_new_string/java_tests/Main.java +21 -0
  37. construct_the_longest_new_string/meta.json +107 -0
  38. construct_the_longest_new_string/ocaml_tests/main.ml +50 -0
  39. construct_the_longest_new_string/scala_tests/MySuite.scala +44 -0
  40. continuous_subarrays/haskell_tests/Main.hs +0 -0
  41. continuous_subarrays/java_tests/Main.java +20 -0
  42. continuous_subarrays/meta.json +0 -0
  43. continuous_subarrays/ocaml_tests/main.ml +0 -0
  44. continuous_subarrays/scala_tests/MySuite.scala +0 -0
  45. convert_an_array_into_a_2d_array_with_conditions/.DS_Store +0 -0
  46. convert_an_array_into_a_2d_array_with_conditions/haskell_tests/Main.hs +24 -0
  47. convert_an_array_into_a_2d_array_with_conditions/java_tests/Main.java +21 -0
  48. convert_an_array_into_a_2d_array_with_conditions/meta.json +2509 -0
  49. convert_an_array_into_a_2d_array_with_conditions/ocaml_tests/main.ml +26 -0
  50. convert_an_array_into_a_2d_array_with_conditions/scala_tests/MySuite.scala +12 -0
.gitattributes CHANGED
@@ -72,3 +72,4 @@ check_if_grid_can_be_cut_into_sections/meta.json filter=lfs diff=lfs merge=lfs -
72
  check_if_grid_can_be_cut_into_sections/ocaml_tests/main.ml filter=lfs diff=lfs merge=lfs -text
73
  check_if_grid_can_be_cut_into_sections/scala_tests/MySuite.scala filter=lfs diff=lfs merge=lfs -text
74
  closest_equal_element_queries/meta.json filter=lfs diff=lfs merge=lfs -text
 
 
72
  check_if_grid_can_be_cut_into_sections/ocaml_tests/main.ml filter=lfs diff=lfs merge=lfs -text
73
  check_if_grid_can_be_cut_into_sections/scala_tests/MySuite.scala filter=lfs diff=lfs merge=lfs -text
74
  closest_equal_element_queries/meta.json filter=lfs diff=lfs merge=lfs -text
75
+ collect_coins_in_a_tree/meta.json filter=lfs diff=lfs merge=lfs -text
collect_coins_in_a_tree/.DS_Store ADDED
Binary file (6.15 kB). View file
 
collect_coins_in_a_tree/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 (collectTheCoins [1,0,0,0,0,1] [[0,1],[1,2],[2,3],[3,4],[4,5]])," 2 (collectTheCoins [1,0,0,0,0,1] [[0,1],[1,2],[2,3],[3,4],[4,5]]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (collectTheCoins [0,0,0,1,1,0,0,1] [[0,1],[0,2],[1,3],[1,4],[2,5],[5,6],[5,7]])," 2 (collectTheCoins [0,0,0,1,1,0,0,1] [[0,1],[0,2],[1,3],[1,4],[2,5],[5,6],[5,7]]))
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
collect_coins_in_a_tree/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(2, collectTheCoins(new ArrayList<>(Arrays.asList(1,0,0,0,0,1)), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(1,2)),new ArrayList<>(Arrays.asList(2,3)),new ArrayList<>(Arrays.asList(3,4)),new ArrayList<>(Arrays.asList(4,5))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(2, collectTheCoins(new ArrayList<>(Arrays.asList(0,0,0,1,1,0,0,1)), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(0,2)),new ArrayList<>(Arrays.asList(1,3)),new ArrayList<>(Arrays.asList(1,4)),new ArrayList<>(Arrays.asList(2,5)),new ArrayList<>(Arrays.asList(5,6)),new ArrayList<>(Arrays.asList(5,7))))));
19
+ }
20
+
21
+ }
collect_coins_in_a_tree/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c63bd2ffe409b59c8ec2bc3e681aff08ad7090e07972397236f2733219f185ab
3
+ size 27078695
collect_coins_in_a_tree/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 2 (collectTheCoins [1;0;0;0;0;1] [[0;1];[1;2];[2;3];[3;4];[4;5]])
12
+
13
+ let test2 _ = assert_equal 2 (collectTheCoins [0;0;0;1;1;0;0;1] [[0;1];[0;2];[1;3];[1;4];[2;5];[5;6];[5;7]])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for collectTheCoins" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
collect_coins_in_a_tree/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.collectTheCoins(List(1,0,0,0,0,1),List(List(0,1),List(1,2),List(2,3),List(3,4),List(4,5))), 2)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.collectTheCoins(List(0,0,0,1,1,0,0,1),List(List(0,1),List(0,2),List(1,3),List(1,4),List(2,5),List(5,6),List(5,7))), 2)
10
+ }
11
+
12
+ }
collecting_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 (minCost [20,1,15] 5)," 13 (minCost [20,1,15] 5))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (minCost [1,2,3] 4)," 6 (minCost [1,2,3] 4))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (minCost [195199014, 984800196, 607924423, 36348739, 813130315, 153065099, 588296506, 617132062, 781027683, 116629882, 581208811, 569440617, 870838107, 939227748, 574241627, 488909059, 479214749, 920077184, 809104907, 97812621, 739489242, 733086437, 654080955, 987436545, 140526391, 372643245, 149983222, 229866605, 912832555, 986734995, 161610887, 660721797, 431179104, 37923818, 337467714, 344568419, 408880028, 298866142, 586368843, 655456322, 182642371, 81945619, 607613577, 887811013, 626376923, 715066277, 27312739, 242413291, 491056317, 626066721, 329827884, 51373087, 377603455, 285888257, 289189990, 437036712, 51492615, 773483380, 273050223, 239823783, 178687773, 86195843, 311103091, 513170145, 818474194, 861218557, 673632638, 973212016, 990596428, 584797315, 390187131, 16063215, 671830121, 403723544, 368926620, 291577238, 836588088, 603827758, 2606594, 259323471, 249091497, 372920588, 781724843, 390173853, 817933194, 302969239, 164540460, 652257475, 452847149, 751974372, 417340325, 609385790, 325428582, 5518899, 689255278, 306884488, 240441423, 990221737, 127779717, 469798221, 809710543, 76651043, 114721605, 811337085, 838269422, 210573940, 550804251, 151059732, 963856152, 454169768, 649700828, 863499421, 666400114, 739255458, 148479307, 810214197, 701169766, 224247585, 528904494, 677094434, 656368211, 964745763, 285343955, 354199258, 604592293, 84075276, 171162476, 198006259, 792771994, 921766273, 513057436, 442342857, 393647274, 928913521, 129759381, 926801252, 382921119, 590703484, 947689972, 645597832, 80489849, 402504867, 793560817, 304668159, 752099804, 272063343, 237287828, 311417665, 110016486, 391816426, 573541853, 412955906, 774375508, 988828191, 529616010, 365784851, 130714687, 625023361, 51870264, 3921080, 970552943, 831690784, 304632280, 163415864, 945698689, 992319209, 607764312, 916603382, 69904958, 529364651, 877540295, 742675142, 217211577, 929501124, 359606819, 792089571, 628840547, 470317204, 245666470, 538467321, 542525942, 301217535, 254924657, 494655010, 462250827, 480408495, 21908896, 994013811, 32823489, 900377181, 767397312, 536885644, 109915622, 739194012, 394242870, 281165002, 684530302, 642378737, 252917803, 289701811, 920316781, 561202250, 485794592, 985927864, 452933034, 396341427, 464970466, 650547832, 435718719, 407937592, 825524338, 342161946, 794783327, 78363130, 758859001, 339179672, 276222116, 331080978, 355655498, 529702137, 246833303, 444240535, 390433754, 383207254, 685984136, 776310837, 971712059, 291328757, 498988370, 944595442, 210158741, 474588291, 728452333, 327892670, 633123722, 280937805, 961564731, 896302261, 364818399, 791196212, 678626404, 702912193, 966940719, 697837937, 229233322, 615904816, 142873499, 239716403, 88386028, 814798561, 518353881, 498482718, 458907246, 296617630, 685054486, 159771808, 423294860, 494014169, 150924742, 12436220, 755400713, 258190124, 65531288, 454041355, 221518994, 860222475, 932970280, 531681169, 602109256, 585029274, 24112250, 832975854, 702277613, 886158293, 993671856, 745950250, 9815904, 428057692, 951726244, 182913765, 886722589, 752178138, 941397089, 754737490, 328291852, 179288814, 959223573, 523585699, 542035645, 184733133, 198371804, 304883176, 998452141, 124524129, 885584699, 481174985, 616696757, 593324918, 454968615, 52844661, 970336457, 59652415, 503863689, 763412487, 318086037, 431678900, 772961494, 379979411, 748770602, 564912364, 176131533, 33162653, 811147845, 911170860, 147574219, 147811026, 152613327, 313470576, 67773459, 635593023, 923663369, 940797858, 353228924, 894589838, 113893957, 270912429, 810499926, 343383832, 999461432, 428879623, 882203250, 137842711, 963733831, 228328390, 388609130, 444731715, 876905523, 820643216, 292901933, 300114876, 646370184, 139589078, 173813411, 641490002, 511780675, 138009273, 168326041, 455523429, 577968590, 822486887, 206628466, 406962072, 776818543, 243949136, 773326982, 943666446, 751147131, 535649421, 445290504, 493015215, 441504843, 460178556, 176659001, 966315793, 622966118, 99102348, 959671731, 489578182, 700131590, 692678432, 843997706, 84316992, 295052242, 553321387, 675541223, 343432650, 389473733, 370807758, 385237489, 945158723, 227527971, 875594740, 125454021, 423896252, 15560748, 6210546, 794287516, 458892965, 645223642, 996372617, 537229661, 954211580, 293738043, 696027865, 46737506, 80039731, 692608133, 145885645, 560041641, 318623001, 562827220, 742688194, 100673661, 178786795, 289815352, 652188537, 735242308, 734937272, 891739424, 664946181, 987635466, 788629312, 402822043, 955411387, 929766648, 410007672, 377269822, 561962151, 937239079, 13238555, 966880602, 905525735, 233868138, 123894478, 827850053, 613602240, 649224028, 208377928, 317404952, 872164249, 238027473, 603347539, 15913528, 511476986, 60472308, 825530316, 575387964, 10613894, 817509174, 745601985, 316498340, 393598793, 909624006, 14905850, 215533967, 411912051, 984884312, 749494941, 678806049, 509115086, 312513897, 436730186, 622622583, 410981845, 6187747, 240335095, 871466569, 298738342, 753964255, 842764464, 763669249, 726831257, 262805735, 456928993, 921464338, 398268879, 902183475, 491502741, 872348170, 244442294, 715060792, 925352396, 588960406, 463602725, 881739070, 317752390, 709787883, 704456597, 239353639, 42648361, 330506671, 881390592, 270400733, 431217820, 923604163, 199350714, 730784157, 618816379, 390154481, 510752733, 419362979, 7864821, 670638993, 931944085, 877025976, 356710805, 580480749, 523376265, 32536697, 534640272, 658422828, 602869101, 257627936, 19353320, 307231189, 767777638, 116075954, 910132199, 890785831, 112656238, 535125877, 899585967, 212528780, 52594748, 476910963, 702000280, 914379828, 232401095, 815622453, 170806089, 142026010, 974803062, 446266689, 647729617, 141540830, 209984756, 917469850, 366614793, 505088170, 336199776, 458282243, 776726118, 65898399, 588747470, 336803515, 227473240, 807022596, 76282996, 556822238, 890598517, 320719589, 833641979, 274922280, 850612850, 805689839, 350345518, 268524345, 537854273, 133048817, 941825930, 531193388, 234420006, 652476571, 376886332, 471886483, 966682042, 169210281, 794515277, 84541212, 702197814, 294385154, 932048350, 357165852, 106845267, 838294046, 268767026, 768928242, 317757906, 642134607, 866468112, 408162350, 316778091, 315071199, 946231322, 462597803, 803470909, 113477738, 981387113, 350882681, 622688065, 877058174, 707677845, 678125185, 987244185, 416176335, 435153468, 898770636, 739742120, 368770071, 718975205, 132449699, 112157585, 614954407, 277410771, 845349804, 41620036, 459533573, 440667505, 351711058, 51265070, 692281115, 414086736, 582255027, 278173598, 837369224, 134070537, 411382375, 783386478, 59113229, 20075845, 11128092, 578770990, 239563044, 539793169, 405961871, 465019583, 881445046, 379539062, 604898363, 846257377, 120473440, 286543229, 554792750, 360420609, 994274929, 647518644, 639628224, 958244598, 134806133, 982204738, 969696721, 438608528, 684891723, 401247476, 263136938, 690073753, 429568456, 758466696, 834591579, 765511214, 245834044, 5432691, 949868089, 189205914, 182922234, 267536500, 556288860, 275325798, 228763038, 43198009, 626958467, 589408140, 157891879, 191866252, 566237343, 489338090, 316442951, 378261638, 250879999, 678793094, 863771713, 91704092, 254836077, 169623528, 3163204, 173845140, 346893958, 776113836, 973508092, 645340992, 590430401, 951563534, 473705954, 729796359, 97394867, 103018547, 254535655, 60538203, 584520812, 986220593, 444323091, 965536113, 869419091, 5081692, 327462154, 643651844, 579512728, 908311364, 223782800, 784660433, 354251199, 223432445, 557927372, 132706843, 207201606, 244254156, 597845799, 764449087, 586516681, 815675472, 517278658, 500556000, 970376215, 989955500, 72034657, 206722688] 59772293)," 10633276482 (minCost [195199014, 984800196, 607924423, 36348739, 813130315, 153065099, 588296506, 617132062, 781027683, 116629882, 581208811, 569440617, 870838107, 939227748, 574241627, 488909059, 479214749, 920077184, 809104907, 97812621, 739489242, 733086437, 654080955, 987436545, 140526391, 372643245, 149983222, 229866605, 912832555, 986734995, 161610887, 660721797, 431179104, 37923818, 337467714, 344568419, 408880028, 298866142, 586368843, 655456322, 182642371, 81945619, 607613577, 887811013, 626376923, 715066277, 27312739, 242413291, 491056317, 626066721, 329827884, 51373087, 377603455, 285888257, 289189990, 437036712, 51492615, 773483380, 273050223, 239823783, 178687773, 86195843, 311103091, 513170145, 818474194, 861218557, 673632638, 973212016, 990596428, 584797315, 390187131, 16063215, 671830121, 403723544, 368926620, 291577238, 836588088, 603827758, 2606594, 259323471, 249091497, 372920588, 781724843, 390173853, 817933194, 302969239, 164540460, 652257475, 452847149, 751974372, 417340325, 609385790, 325428582, 5518899, 689255278, 306884488, 240441423, 990221737, 127779717, 469798221, 809710543, 76651043, 114721605, 811337085, 838269422, 210573940, 550804251, 151059732, 963856152, 454169768, 649700828, 863499421, 666400114, 739255458, 148479307, 810214197, 701169766, 224247585, 528904494, 677094434, 656368211, 964745763, 285343955, 354199258, 604592293, 84075276, 171162476, 198006259, 792771994, 921766273, 513057436, 442342857, 393647274, 928913521, 129759381, 926801252, 382921119, 590703484, 947689972, 645597832, 80489849, 402504867, 793560817, 304668159, 752099804, 272063343, 237287828, 311417665, 110016486, 391816426, 573541853, 412955906, 774375508, 988828191, 529616010, 365784851, 130714687, 625023361, 51870264, 3921080, 970552943, 831690784, 304632280, 163415864, 945698689, 992319209, 607764312, 916603382, 69904958, 529364651, 877540295, 742675142, 217211577, 929501124, 359606819, 792089571, 628840547, 470317204, 245666470, 538467321, 542525942, 301217535, 254924657, 494655010, 462250827, 480408495, 21908896, 994013811, 32823489, 900377181, 767397312, 536885644, 109915622, 739194012, 394242870, 281165002, 684530302, 642378737, 252917803, 289701811, 920316781, 561202250, 485794592, 985927864, 452933034, 396341427, 464970466, 650547832, 435718719, 407937592, 825524338, 342161946, 794783327, 78363130, 758859001, 339179672, 276222116, 331080978, 355655498, 529702137, 246833303, 444240535, 390433754, 383207254, 685984136, 776310837, 971712059, 291328757, 498988370, 944595442, 210158741, 474588291, 728452333, 327892670, 633123722, 280937805, 961564731, 896302261, 364818399, 791196212, 678626404, 702912193, 966940719, 697837937, 229233322, 615904816, 142873499, 239716403, 88386028, 814798561, 518353881, 498482718, 458907246, 296617630, 685054486, 159771808, 423294860, 494014169, 150924742, 12436220, 755400713, 258190124, 65531288, 454041355, 221518994, 860222475, 932970280, 531681169, 602109256, 585029274, 24112250, 832975854, 702277613, 886158293, 993671856, 745950250, 9815904, 428057692, 951726244, 182913765, 886722589, 752178138, 941397089, 754737490, 328291852, 179288814, 959223573, 523585699, 542035645, 184733133, 198371804, 304883176, 998452141, 124524129, 885584699, 481174985, 616696757, 593324918, 454968615, 52844661, 970336457, 59652415, 503863689, 763412487, 318086037, 431678900, 772961494, 379979411, 748770602, 564912364, 176131533, 33162653, 811147845, 911170860, 147574219, 147811026, 152613327, 313470576, 67773459, 635593023, 923663369, 940797858, 353228924, 894589838, 113893957, 270912429, 810499926, 343383832, 999461432, 428879623, 882203250, 137842711, 963733831, 228328390, 388609130, 444731715, 876905523, 820643216, 292901933, 300114876, 646370184, 139589078, 173813411, 641490002, 511780675, 138009273, 168326041, 455523429, 577968590, 822486887, 206628466, 406962072, 776818543, 243949136, 773326982, 943666446, 751147131, 535649421, 445290504, 493015215, 441504843, 460178556, 176659001, 966315793, 622966118, 99102348, 959671731, 489578182, 700131590, 692678432, 843997706, 84316992, 295052242, 553321387, 675541223, 343432650, 389473733, 370807758, 385237489, 945158723, 227527971, 875594740, 125454021, 423896252, 15560748, 6210546, 794287516, 458892965, 645223642, 996372617, 537229661, 954211580, 293738043, 696027865, 46737506, 80039731, 692608133, 145885645, 560041641, 318623001, 562827220, 742688194, 100673661, 178786795, 289815352, 652188537, 735242308, 734937272, 891739424, 664946181, 987635466, 788629312, 402822043, 955411387, 929766648, 410007672, 377269822, 561962151, 937239079, 13238555, 966880602, 905525735, 233868138, 123894478, 827850053, 613602240, 649224028, 208377928, 317404952, 872164249, 238027473, 603347539, 15913528, 511476986, 60472308, 825530316, 575387964, 10613894, 817509174, 745601985, 316498340, 393598793, 909624006, 14905850, 215533967, 411912051, 984884312, 749494941, 678806049, 509115086, 312513897, 436730186, 622622583, 410981845, 6187747, 240335095, 871466569, 298738342, 753964255, 842764464, 763669249, 726831257, 262805735, 456928993, 921464338, 398268879, 902183475, 491502741, 872348170, 244442294, 715060792, 925352396, 588960406, 463602725, 881739070, 317752390, 709787883, 704456597, 239353639, 42648361, 330506671, 881390592, 270400733, 431217820, 923604163, 199350714, 730784157, 618816379, 390154481, 510752733, 419362979, 7864821, 670638993, 931944085, 877025976, 356710805, 580480749, 523376265, 32536697, 534640272, 658422828, 602869101, 257627936, 19353320, 307231189, 767777638, 116075954, 910132199, 890785831, 112656238, 535125877, 899585967, 212528780, 52594748, 476910963, 702000280, 914379828, 232401095, 815622453, 170806089, 142026010, 974803062, 446266689, 647729617, 141540830, 209984756, 917469850, 366614793, 505088170, 336199776, 458282243, 776726118, 65898399, 588747470, 336803515, 227473240, 807022596, 76282996, 556822238, 890598517, 320719589, 833641979, 274922280, 850612850, 805689839, 350345518, 268524345, 537854273, 133048817, 941825930, 531193388, 234420006, 652476571, 376886332, 471886483, 966682042, 169210281, 794515277, 84541212, 702197814, 294385154, 932048350, 357165852, 106845267, 838294046, 268767026, 768928242, 317757906, 642134607, 866468112, 408162350, 316778091, 315071199, 946231322, 462597803, 803470909, 113477738, 981387113, 350882681, 622688065, 877058174, 707677845, 678125185, 987244185, 416176335, 435153468, 898770636, 739742120, 368770071, 718975205, 132449699, 112157585, 614954407, 277410771, 845349804, 41620036, 459533573, 440667505, 351711058, 51265070, 692281115, 414086736, 582255027, 278173598, 837369224, 134070537, 411382375, 783386478, 59113229, 20075845, 11128092, 578770990, 239563044, 539793169, 405961871, 465019583, 881445046, 379539062, 604898363, 846257377, 120473440, 286543229, 554792750, 360420609, 994274929, 647518644, 639628224, 958244598, 134806133, 982204738, 969696721, 438608528, 684891723, 401247476, 263136938, 690073753, 429568456, 758466696, 834591579, 765511214, 245834044, 5432691, 949868089, 189205914, 182922234, 267536500, 556288860, 275325798, 228763038, 43198009, 626958467, 589408140, 157891879, 191866252, 566237343, 489338090, 316442951, 378261638, 250879999, 678793094, 863771713, 91704092, 254836077, 169623528, 3163204, 173845140, 346893958, 776113836, 973508092, 645340992, 590430401, 951563534, 473705954, 729796359, 97394867, 103018547, 254535655, 60538203, 584520812, 986220593, 444323091, 965536113, 869419091, 5081692, 327462154, 643651844, 579512728, 908311364, 223782800, 784660433, 354251199, 223432445, 557927372, 132706843, 207201606, 244254156, 597845799, 764449087, 586516681, 815675472, 517278658, 500556000, 970376215, 989955500, 72034657, 206722688] 59772293))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (minCost [563669213, 825855133, 170715616, 848248921, 900296610, 887903420, 675871814, 486596683, 235735391, 414856374, 822396398, 44266810, 771867053, 915395390, 407577458, 526132977, 435493588, 200118428, 522821959, 508699245, 209107510, 775835633, 848773024, 737330318, 49170263, 680427509, 573882300, 47975331, 107865654, 717536143, 530193469, 815833575, 172088373, 245232698, 13843861, 505703667, 920495124, 239600583, 738826172, 885854894, 287143084, 855637308, 143274687, 483262375, 405384251, 100977809, 953509786, 841235525, 575644136, 728039828, 448530985, 15997067, 72457869, 101030668, 373958835, 405681725, 405119064, 640524495, 878589097, 853263253, 326180319, 905875964, 224218040, 191497343, 54231792, 209037869, 375754140, 733021805, 872850958, 680061098, 909589897, 283417467, 992550860, 786664967, 204480733, 694702469, 695974678, 964700834, 592869236, 401811813, 56938882, 269231172, 766091455, 884761542, 38371452, 154205087, 416251331, 891071809, 869898081, 49865978, 975945402, 890700102, 988503568, 763930157, 815989390, 971377022, 282112026, 877551177, 580863559, 786925081, 447744173, 90081861, 22716552, 610375817, 696503886, 894129516, 643629922, 361399122, 212873496, 24950850, 272084837, 225407940, 69118584, 585427257, 93199531, 759303736, 892684401, 54387311, 219211102, 734932330, 253133867, 287296779, 356393711, 521830829, 942986574, 835526734, 775641657, 793444573, 234586574, 305990543, 589957492, 840715257, 18793840, 61463393, 771904419, 174384737, 449298523, 998770680, 385905690, 556897939, 257114939, 75136071, 458396933, 568211851, 482458998, 156091396, 439827914, 296595468, 806556096, 759274512, 359380225, 11956902, 840335491, 186135643, 512506043, 431375016, 209975739, 955020417, 3503802, 400814123, 234876476, 576947222, 266791712, 608870365, 766466346, 707602090, 428120087, 958082253, 184905080, 433493060, 602373693, 607604421, 812112090, 502237719, 952452187, 987786539, 64846139, 324252439, 59882599, 902241415, 371692197, 546742761, 659820907, 578700678, 551662153, 613246026, 639899097, 117406911, 301855994, 957388774, 897991451, 582703892, 88142700, 266915022, 151060378, 985016617, 149325809, 67085982, 417947811, 510895036, 18308997, 718674228, 332240402, 17036994, 482912726, 351285736, 931679892, 132057383, 15285131, 726581011, 856968187, 152149953, 848842139, 282301851, 885802920, 190876914, 136959644, 148312259, 519113422, 38376962, 356726594, 942808169, 238367302, 976641835, 560402238, 39078265, 846300705, 862455098, 392081438, 13303271, 407489581, 516158738, 426092730, 230270579, 566857210, 671558383, 501070302, 305494756, 149996375, 604973608, 475691854, 535650477, 68341824, 564713481, 675904594, 571734504, 481381942, 499047210, 960241932, 559188621, 339907471, 414845928, 381969569, 412056007, 222429126, 759873667, 95557112, 447973200, 562821228, 719714521, 711258907, 102339783, 482924658, 586039964, 28020821, 110040334, 311022027, 940526292, 648295974, 922554876, 660908464, 757134079, 846179529, 416721229, 980355072, 843258633, 773348852, 966317083, 903796445, 761515397, 962889142, 201745268, 873174137, 212674858, 910042856, 94088310, 168163893, 869159155, 233037439, 230987328, 589828823, 826806352, 664994060, 471688622, 745134907, 103187429, 603229400, 516560254, 955406852, 194155723, 683367090, 424942924, 106958578, 354855672, 35586725, 477587633, 906879483, 747824680, 815731568, 209223077, 478948459, 443136667, 720477753, 440977862, 389579185, 409137367, 666006140, 759594819, 381334522, 126128657, 456579003, 930758953, 190764978, 273220669, 613582969, 239713242, 538056745, 805006158, 752633857, 703024704, 467664263, 53684952, 390578805, 577204112, 323682769, 786364144, 893936510, 950948160, 261353949, 507236096, 366069533, 494139795, 971364473, 39447797, 365220426, 851906154, 317619002, 557803119, 716377485, 174428191, 383384919, 549160022, 571289329, 76711012, 890877483, 712773829, 167470644, 354483046, 477986720, 618472061, 405821922, 218831336, 116007746, 567271319, 477663635, 580816817, 559175243, 606926231, 890403431, 339487787, 248300406, 687048731, 511158806, 678359920, 696800477, 587350397, 179474495, 340894123, 700777902, 845853210, 921124908, 918785967, 587770467, 630217706, 717362563, 595981553, 340289370, 427610929, 714563512, 262433294, 441327464, 401582640, 691140041, 420004646, 656741070, 230421845, 278214583, 730761322, 964957276, 358896796, 557503666, 853464006, 284632286, 459150133, 603336734, 385689302, 356957264, 335776266, 745677663, 725855548, 484327271, 313178752, 850926700, 101190892, 381544552, 337926553, 144349570, 880307824, 281718892, 403045929, 193797651, 519465702, 615842736, 424666106, 214198330, 283598578, 143950066, 16833080, 12717220, 786413914, 249071653, 912424496, 830410107, 366021503, 22560213, 91875567, 567986445, 848426556, 605599362, 54189090, 616921622, 302844160, 477888837, 902147730, 618349759, 30587427, 389475281, 862036284, 248639560, 820585713, 635906374, 449218765, 693837644, 435514535, 995952207, 826467537, 144181767, 531526221, 340055046, 549225799, 387397015, 197758328, 568382231, 639706585, 48358540, 791921427, 185327646, 295792559, 443161478, 443872978, 424874990, 923516857, 98659777, 929205398, 669133063, 287396465, 849895730, 69046697, 474835650, 847853778, 140104095, 603196275, 523573889, 47107877, 895667802, 45583203, 903207368, 922597616, 386665134, 315102966, 16407145, 384915734, 921778962, 804382200, 423945781, 220550809, 880908973, 4152442, 728298706, 749757480, 562235361, 345139267, 77185567, 345823595, 983601915, 844182963, 904106483, 789976799, 394995796, 82586936, 121974183, 967632643, 429796764, 982269365, 799074126, 311149901, 437651442, 519844447, 954891471, 24148725, 538572729, 332529359, 907714845, 215990041, 560502859, 423822439, 484209522, 802193948, 585532543, 966855721, 200591667, 305209084, 400852719, 50671693, 404032320, 836515671, 312576225, 827106112, 285294081, 174463950, 679285468, 855122537, 717877225, 464754682, 345419570, 998396795, 251008696, 742790620, 459229454, 11261094, 483876617, 419697596, 148940629, 916650484, 33264727, 664756256, 81541957, 31814968, 347554098, 417890484, 48888814, 495002841, 990763108, 91580699, 944404984, 133622568, 529489280, 598349305, 841118162, 827171820, 256554468, 94338459, 399748009, 691901866, 296185971, 352638666, 594647125, 284659950, 246324504, 861359917, 821604100, 759018272, 51574016, 982530864, 772588041, 626960703, 131355704, 384815790, 45503822, 96419317, 636778033, 470926487, 456342901, 840785056, 660147669, 563952086, 45348807, 353249931, 926870983, 881556238, 901518240, 925996126, 55810296, 34775496, 472505851, 61286877, 412891222, 179747697, 593260017, 373768607, 130175796, 36417300, 527747064, 92429350, 179745521, 471709998, 912637451, 627440640, 17569947, 252263488, 399000684, 559218361, 383375566, 562068110, 269335761, 101801587, 377797666, 751335451, 958800405, 57913847, 157753477, 921672660, 109999537, 808578430, 903864677, 484110353, 394313430, 136556627, 288535485, 958769834, 300259254, 352195823, 950518461, 180748521, 798899893, 676189982, 606037456, 313955024, 75729256, 680539579, 2269609, 519317676, 875184572, 694575379, 878790683, 979567404, 944184077, 155049229, 436317053, 321749806, 489236705, 763323080, 282028232, 743281357, 498966870, 430221940, 681965311, 926694370, 632135135, 849107909, 230079556, 410061048, 707095537, 634290942, 600545868, 269760407, 452093469, 210219975, 375030799, 76429274, 611824173, 328943400, 105374470, 590497554, 38692832, 349252667, 212616107, 97050040, 404986286, 336667660, 17726065, 1811947, 672254249, 37398438, 691024006, 676578843, 294227226, 194888207, 29543539, 190425768, 322122266, 617590658, 644977987, 93719533, 224317322, 35597134, 101594741, 722223993, 841288301, 154003983, 290603441, 261695433, 343905287, 732488771, 771405000, 12824855, 397055298, 798549264, 375310777, 3160687, 860014925, 873755466, 687485790, 108741641, 591548296, 119514663, 93335768, 494385986, 212548822, 536529513, 101582885, 751996751, 216014136, 346551331, 466701529, 438133154, 467953069, 334942634, 243440098, 457302027, 674636140, 718529249, 921612110, 779217058, 713583046, 666824893, 530074627, 9576019, 634073373, 231163140, 678924307, 997121878, 775112239, 83159589, 589772529, 212385868, 829768562, 821963365, 976623024, 324977907, 280158329, 88452334, 779077084, 671705193, 842545869, 727153452, 617856355, 911851809, 288511425, 607060512, 328007906, 637897761, 242534940, 103623504, 246256, 690448636, 660405358, 549713658, 129667412, 790180837, 57599614] 531004303)," 37685090039 (minCost [563669213, 825855133, 170715616, 848248921, 900296610, 887903420, 675871814, 486596683, 235735391, 414856374, 822396398, 44266810, 771867053, 915395390, 407577458, 526132977, 435493588, 200118428, 522821959, 508699245, 209107510, 775835633, 848773024, 737330318, 49170263, 680427509, 573882300, 47975331, 107865654, 717536143, 530193469, 815833575, 172088373, 245232698, 13843861, 505703667, 920495124, 239600583, 738826172, 885854894, 287143084, 855637308, 143274687, 483262375, 405384251, 100977809, 953509786, 841235525, 575644136, 728039828, 448530985, 15997067, 72457869, 101030668, 373958835, 405681725, 405119064, 640524495, 878589097, 853263253, 326180319, 905875964, 224218040, 191497343, 54231792, 209037869, 375754140, 733021805, 872850958, 680061098, 909589897, 283417467, 992550860, 786664967, 204480733, 694702469, 695974678, 964700834, 592869236, 401811813, 56938882, 269231172, 766091455, 884761542, 38371452, 154205087, 416251331, 891071809, 869898081, 49865978, 975945402, 890700102, 988503568, 763930157, 815989390, 971377022, 282112026, 877551177, 580863559, 786925081, 447744173, 90081861, 22716552, 610375817, 696503886, 894129516, 643629922, 361399122, 212873496, 24950850, 272084837, 225407940, 69118584, 585427257, 93199531, 759303736, 892684401, 54387311, 219211102, 734932330, 253133867, 287296779, 356393711, 521830829, 942986574, 835526734, 775641657, 793444573, 234586574, 305990543, 589957492, 840715257, 18793840, 61463393, 771904419, 174384737, 449298523, 998770680, 385905690, 556897939, 257114939, 75136071, 458396933, 568211851, 482458998, 156091396, 439827914, 296595468, 806556096, 759274512, 359380225, 11956902, 840335491, 186135643, 512506043, 431375016, 209975739, 955020417, 3503802, 400814123, 234876476, 576947222, 266791712, 608870365, 766466346, 707602090, 428120087, 958082253, 184905080, 433493060, 602373693, 607604421, 812112090, 502237719, 952452187, 987786539, 64846139, 324252439, 59882599, 902241415, 371692197, 546742761, 659820907, 578700678, 551662153, 613246026, 639899097, 117406911, 301855994, 957388774, 897991451, 582703892, 88142700, 266915022, 151060378, 985016617, 149325809, 67085982, 417947811, 510895036, 18308997, 718674228, 332240402, 17036994, 482912726, 351285736, 931679892, 132057383, 15285131, 726581011, 856968187, 152149953, 848842139, 282301851, 885802920, 190876914, 136959644, 148312259, 519113422, 38376962, 356726594, 942808169, 238367302, 976641835, 560402238, 39078265, 846300705, 862455098, 392081438, 13303271, 407489581, 516158738, 426092730, 230270579, 566857210, 671558383, 501070302, 305494756, 149996375, 604973608, 475691854, 535650477, 68341824, 564713481, 675904594, 571734504, 481381942, 499047210, 960241932, 559188621, 339907471, 414845928, 381969569, 412056007, 222429126, 759873667, 95557112, 447973200, 562821228, 719714521, 711258907, 102339783, 482924658, 586039964, 28020821, 110040334, 311022027, 940526292, 648295974, 922554876, 660908464, 757134079, 846179529, 416721229, 980355072, 843258633, 773348852, 966317083, 903796445, 761515397, 962889142, 201745268, 873174137, 212674858, 910042856, 94088310, 168163893, 869159155, 233037439, 230987328, 589828823, 826806352, 664994060, 471688622, 745134907, 103187429, 603229400, 516560254, 955406852, 194155723, 683367090, 424942924, 106958578, 354855672, 35586725, 477587633, 906879483, 747824680, 815731568, 209223077, 478948459, 443136667, 720477753, 440977862, 389579185, 409137367, 666006140, 759594819, 381334522, 126128657, 456579003, 930758953, 190764978, 273220669, 613582969, 239713242, 538056745, 805006158, 752633857, 703024704, 467664263, 53684952, 390578805, 577204112, 323682769, 786364144, 893936510, 950948160, 261353949, 507236096, 366069533, 494139795, 971364473, 39447797, 365220426, 851906154, 317619002, 557803119, 716377485, 174428191, 383384919, 549160022, 571289329, 76711012, 890877483, 712773829, 167470644, 354483046, 477986720, 618472061, 405821922, 218831336, 116007746, 567271319, 477663635, 580816817, 559175243, 606926231, 890403431, 339487787, 248300406, 687048731, 511158806, 678359920, 696800477, 587350397, 179474495, 340894123, 700777902, 845853210, 921124908, 918785967, 587770467, 630217706, 717362563, 595981553, 340289370, 427610929, 714563512, 262433294, 441327464, 401582640, 691140041, 420004646, 656741070, 230421845, 278214583, 730761322, 964957276, 358896796, 557503666, 853464006, 284632286, 459150133, 603336734, 385689302, 356957264, 335776266, 745677663, 725855548, 484327271, 313178752, 850926700, 101190892, 381544552, 337926553, 144349570, 880307824, 281718892, 403045929, 193797651, 519465702, 615842736, 424666106, 214198330, 283598578, 143950066, 16833080, 12717220, 786413914, 249071653, 912424496, 830410107, 366021503, 22560213, 91875567, 567986445, 848426556, 605599362, 54189090, 616921622, 302844160, 477888837, 902147730, 618349759, 30587427, 389475281, 862036284, 248639560, 820585713, 635906374, 449218765, 693837644, 435514535, 995952207, 826467537, 144181767, 531526221, 340055046, 549225799, 387397015, 197758328, 568382231, 639706585, 48358540, 791921427, 185327646, 295792559, 443161478, 443872978, 424874990, 923516857, 98659777, 929205398, 669133063, 287396465, 849895730, 69046697, 474835650, 847853778, 140104095, 603196275, 523573889, 47107877, 895667802, 45583203, 903207368, 922597616, 386665134, 315102966, 16407145, 384915734, 921778962, 804382200, 423945781, 220550809, 880908973, 4152442, 728298706, 749757480, 562235361, 345139267, 77185567, 345823595, 983601915, 844182963, 904106483, 789976799, 394995796, 82586936, 121974183, 967632643, 429796764, 982269365, 799074126, 311149901, 437651442, 519844447, 954891471, 24148725, 538572729, 332529359, 907714845, 215990041, 560502859, 423822439, 484209522, 802193948, 585532543, 966855721, 200591667, 305209084, 400852719, 50671693, 404032320, 836515671, 312576225, 827106112, 285294081, 174463950, 679285468, 855122537, 717877225, 464754682, 345419570, 998396795, 251008696, 742790620, 459229454, 11261094, 483876617, 419697596, 148940629, 916650484, 33264727, 664756256, 81541957, 31814968, 347554098, 417890484, 48888814, 495002841, 990763108, 91580699, 944404984, 133622568, 529489280, 598349305, 841118162, 827171820, 256554468, 94338459, 399748009, 691901866, 296185971, 352638666, 594647125, 284659950, 246324504, 861359917, 821604100, 759018272, 51574016, 982530864, 772588041, 626960703, 131355704, 384815790, 45503822, 96419317, 636778033, 470926487, 456342901, 840785056, 660147669, 563952086, 45348807, 353249931, 926870983, 881556238, 901518240, 925996126, 55810296, 34775496, 472505851, 61286877, 412891222, 179747697, 593260017, 373768607, 130175796, 36417300, 527747064, 92429350, 179745521, 471709998, 912637451, 627440640, 17569947, 252263488, 399000684, 559218361, 383375566, 562068110, 269335761, 101801587, 377797666, 751335451, 958800405, 57913847, 157753477, 921672660, 109999537, 808578430, 903864677, 484110353, 394313430, 136556627, 288535485, 958769834, 300259254, 352195823, 950518461, 180748521, 798899893, 676189982, 606037456, 313955024, 75729256, 680539579, 2269609, 519317676, 875184572, 694575379, 878790683, 979567404, 944184077, 155049229, 436317053, 321749806, 489236705, 763323080, 282028232, 743281357, 498966870, 430221940, 681965311, 926694370, 632135135, 849107909, 230079556, 410061048, 707095537, 634290942, 600545868, 269760407, 452093469, 210219975, 375030799, 76429274, 611824173, 328943400, 105374470, 590497554, 38692832, 349252667, 212616107, 97050040, 404986286, 336667660, 17726065, 1811947, 672254249, 37398438, 691024006, 676578843, 294227226, 194888207, 29543539, 190425768, 322122266, 617590658, 644977987, 93719533, 224317322, 35597134, 101594741, 722223993, 841288301, 154003983, 290603441, 261695433, 343905287, 732488771, 771405000, 12824855, 397055298, 798549264, 375310777, 3160687, 860014925, 873755466, 687485790, 108741641, 591548296, 119514663, 93335768, 494385986, 212548822, 536529513, 101582885, 751996751, 216014136, 346551331, 466701529, 438133154, 467953069, 334942634, 243440098, 457302027, 674636140, 718529249, 921612110, 779217058, 713583046, 666824893, 530074627, 9576019, 634073373, 231163140, 678924307, 997121878, 775112239, 83159589, 589772529, 212385868, 829768562, 821963365, 976623024, 324977907, 280158329, 88452334, 779077084, 671705193, 842545869, 727153452, 617856355, 911851809, 288511425, 607060512, 328007906, 637897761, 242534940, 103623504, 246256, 690448636, 660405358, 549713658, 129667412, 790180837, 57599614] 531004303))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (minCost [945389577, 111116927, 908783196, 50140358, 959492443, 621625254, 255471618, 856293880, 431497048, 900080555, 48615242, 323695831, 793401948, 608032497, 260323249, 285572990, 862673209, 78379502, 715463944, 37841067, 420529343, 276556515, 156938055, 173291667, 926533023, 328825349, 264424263, 752255385, 748648849, 537908816, 312660609, 359083047, 552517006, 785901828, 196167296, 638340718, 38593887, 35570012, 889452149, 16700288, 309876496, 710489470, 604364097, 492912622, 578030825, 150666894, 226441865, 90711201, 185333530, 810486129, 182405455, 977957785, 733122422, 731408912, 139960041, 682401220, 681191578, 288147530, 359241124, 460311391, 233998545, 297952008, 384311367, 675987422, 273406652, 75287910, 928290128, 911238607, 407990495, 442488131, 405884137, 947079047, 99554214, 172487863, 761521355, 102878896, 560390374, 692136718, 871641505, 88140349, 989265733, 784844735, 77851623, 532924433, 269564404, 239015610, 96460813, 833932146, 121652526, 447560438, 133295611, 743001807, 500374245, 588026399, 3819236, 625802651, 303736893, 459491326, 890973172, 174644956, 948494548, 521105607, 696773235, 620297778, 573600818, 448402914, 689951348, 884451527, 521556556, 425962194, 622297134, 69255638, 321694010, 631009365, 878790060, 280461764, 594134385, 827229758, 12614167, 210065853, 169933731, 417683964, 296424875, 442481395, 718309338, 40996448, 859871255, 956044770, 231098868, 227130473, 297031090, 165391123, 873882665, 320097267, 96680241, 603126670, 267280993, 717061802, 583684867, 770546931, 638458902, 521598847, 590697046, 156440944] 711762576)," 16912494358 (minCost [945389577, 111116927, 908783196, 50140358, 959492443, 621625254, 255471618, 856293880, 431497048, 900080555, 48615242, 323695831, 793401948, 608032497, 260323249, 285572990, 862673209, 78379502, 715463944, 37841067, 420529343, 276556515, 156938055, 173291667, 926533023, 328825349, 264424263, 752255385, 748648849, 537908816, 312660609, 359083047, 552517006, 785901828, 196167296, 638340718, 38593887, 35570012, 889452149, 16700288, 309876496, 710489470, 604364097, 492912622, 578030825, 150666894, 226441865, 90711201, 185333530, 810486129, 182405455, 977957785, 733122422, 731408912, 139960041, 682401220, 681191578, 288147530, 359241124, 460311391, 233998545, 297952008, 384311367, 675987422, 273406652, 75287910, 928290128, 911238607, 407990495, 442488131, 405884137, 947079047, 99554214, 172487863, 761521355, 102878896, 560390374, 692136718, 871641505, 88140349, 989265733, 784844735, 77851623, 532924433, 269564404, 239015610, 96460813, 833932146, 121652526, 447560438, 133295611, 743001807, 500374245, 588026399, 3819236, 625802651, 303736893, 459491326, 890973172, 174644956, 948494548, 521105607, 696773235, 620297778, 573600818, 448402914, 689951348, 884451527, 521556556, 425962194, 622297134, 69255638, 321694010, 631009365, 878790060, 280461764, 594134385, 827229758, 12614167, 210065853, 169933731, 417683964, 296424875, 442481395, 718309338, 40996448, 859871255, 956044770, 231098868, 227130473, 297031090, 165391123, 873882665, 320097267, 96680241, 603126670, 267280993, 717061802, 583684867, 770546931, 638458902, 521598847, 590697046, 156440944] 711762576))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (minCost [787044169, 658711407, 94074275, 518527340, 34958046, 505968638, 169866082, 558364066, 996780256, 807172519, 269776645, 99028021, 824248729, 776042943, 216887087, 637195070] 76134123)," 1582855757 (minCost [787044169, 658711407, 94074275, 518527340, 34958046, 505968638, 169866082, 558364066, 996780256, 807172519, 269776645, 99028021, 824248729, 776042943, 216887087, 637195070] 76134123))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (minCost [344462152, 518399184, 880998883, 58782508, 790383971, 864942378, 59627709, 567315136, 855963427, 547840897, 151786106, 589178272, 308159637, 581325866, 100244626, 283608608, 931355483, 328502929, 930244029, 511510575, 46817944, 5338318, 157404917, 815197944, 325433842, 84231679, 748075803, 828287903, 8387073, 251955639, 575094145, 607580139, 154192555, 980508200, 93058551, 290680967, 657705472, 779852865, 454998097, 123457301, 994226095, 83038978, 379519601, 34603979, 963477073, 951008106, 468889481, 735796466, 764612791, 469426754, 434955762, 908077968, 564363547, 961088234, 682873684, 8497475, 439654182, 650932583, 822607245, 432758275, 58649489, 227528566, 576808310, 504387581, 9141019, 328214886, 578952787, 395355360, 245225549, 447453961, 540696166, 698804759, 183421132, 444162781, 463583501, 215760045, 682405797, 464452971, 647603901, 729797926, 812157873, 602698965, 73213430, 241471084, 115633527, 517757700, 752877919, 21976531, 558811947, 243850752, 716695544, 873580098, 635786483, 210826307, 939935933, 598383482, 825557738, 774316246, 661754805, 227134150, 514056456, 257448674, 224162661, 21418403, 606040140, 973723153, 519156314, 231883583, 879163585, 930007110, 41100278, 883953923, 154520847, 597963810, 962106202, 700236450, 369521824, 226023028, 227323918, 826345463, 930965437, 793193291, 676334092, 618862703, 201686699, 164911651, 946358967, 260389388, 392618184, 819534507, 277812808, 786004237, 182528976, 553686390, 686545749, 676005740, 27831442, 63870888, 499080954, 754947669, 559054420, 393642239, 338923114, 314311653, 245166285, 822129996, 847529195, 508783637, 196238488, 363779432, 568657291, 520788279, 88677710, 850428026, 912347444, 45701807, 105229272, 725063713, 35840745, 724133111, 168414756, 905513219, 712188313, 173025450, 778275732, 382790428, 769256959, 593775855, 478944403, 965141935, 397605536, 40816612, 637701620, 549543044, 303433120, 215515311, 503344038, 960503392, 125927893, 769639350, 172198738, 409886942, 164086343, 113582093, 41507235, 545784551, 482214174, 467822998, 483866501, 896380206, 105958129, 706589928, 680575992, 634970221, 960229785, 620362142, 439456071, 599007767, 130298623, 832938662, 43415045, 722595762, 126902357, 90494682, 949523086, 82424995, 634896590, 726282247, 750641246, 388095389, 416810383, 994674254, 378352116, 873605161, 455838986, 860091491, 817685439, 568558790, 57511057, 161342889, 943932858, 65932576, 346817904, 235733593, 728594621, 30865080, 399700749, 453468943, 126122076, 948908980, 65180579, 604714248, 997164443, 236228594, 582895182, 45770372, 480498668, 621848783, 607314949, 10806189, 903237607, 863301456, 973198812, 245329831, 648047559, 714954589, 863828161, 979659644, 461579152, 369928711, 588770319, 843757700, 682203634, 900715296, 880849515, 545693107, 714620921, 40971249, 110073571, 770641488, 563878597, 346083622, 828750480, 856927768, 424639975, 408252541, 171924937, 802760742, 256395241, 643004100, 768390236, 991956218, 296222942, 143467579, 201999757, 896876919, 540599326, 480775018, 511058071, 937205711, 585056180, 883135618, 958680743, 281901385, 675368724, 372853006, 362078981, 528829438, 51328736, 163429997, 235123483, 190318944, 637447372, 747076884] 923775125)," 26998829529 (minCost [344462152, 518399184, 880998883, 58782508, 790383971, 864942378, 59627709, 567315136, 855963427, 547840897, 151786106, 589178272, 308159637, 581325866, 100244626, 283608608, 931355483, 328502929, 930244029, 511510575, 46817944, 5338318, 157404917, 815197944, 325433842, 84231679, 748075803, 828287903, 8387073, 251955639, 575094145, 607580139, 154192555, 980508200, 93058551, 290680967, 657705472, 779852865, 454998097, 123457301, 994226095, 83038978, 379519601, 34603979, 963477073, 951008106, 468889481, 735796466, 764612791, 469426754, 434955762, 908077968, 564363547, 961088234, 682873684, 8497475, 439654182, 650932583, 822607245, 432758275, 58649489, 227528566, 576808310, 504387581, 9141019, 328214886, 578952787, 395355360, 245225549, 447453961, 540696166, 698804759, 183421132, 444162781, 463583501, 215760045, 682405797, 464452971, 647603901, 729797926, 812157873, 602698965, 73213430, 241471084, 115633527, 517757700, 752877919, 21976531, 558811947, 243850752, 716695544, 873580098, 635786483, 210826307, 939935933, 598383482, 825557738, 774316246, 661754805, 227134150, 514056456, 257448674, 224162661, 21418403, 606040140, 973723153, 519156314, 231883583, 879163585, 930007110, 41100278, 883953923, 154520847, 597963810, 962106202, 700236450, 369521824, 226023028, 227323918, 826345463, 930965437, 793193291, 676334092, 618862703, 201686699, 164911651, 946358967, 260389388, 392618184, 819534507, 277812808, 786004237, 182528976, 553686390, 686545749, 676005740, 27831442, 63870888, 499080954, 754947669, 559054420, 393642239, 338923114, 314311653, 245166285, 822129996, 847529195, 508783637, 196238488, 363779432, 568657291, 520788279, 88677710, 850428026, 912347444, 45701807, 105229272, 725063713, 35840745, 724133111, 168414756, 905513219, 712188313, 173025450, 778275732, 382790428, 769256959, 593775855, 478944403, 965141935, 397605536, 40816612, 637701620, 549543044, 303433120, 215515311, 503344038, 960503392, 125927893, 769639350, 172198738, 409886942, 164086343, 113582093, 41507235, 545784551, 482214174, 467822998, 483866501, 896380206, 105958129, 706589928, 680575992, 634970221, 960229785, 620362142, 439456071, 599007767, 130298623, 832938662, 43415045, 722595762, 126902357, 90494682, 949523086, 82424995, 634896590, 726282247, 750641246, 388095389, 416810383, 994674254, 378352116, 873605161, 455838986, 860091491, 817685439, 568558790, 57511057, 161342889, 943932858, 65932576, 346817904, 235733593, 728594621, 30865080, 399700749, 453468943, 126122076, 948908980, 65180579, 604714248, 997164443, 236228594, 582895182, 45770372, 480498668, 621848783, 607314949, 10806189, 903237607, 863301456, 973198812, 245329831, 648047559, 714954589, 863828161, 979659644, 461579152, 369928711, 588770319, 843757700, 682203634, 900715296, 880849515, 545693107, 714620921, 40971249, 110073571, 770641488, 563878597, 346083622, 828750480, 856927768, 424639975, 408252541, 171924937, 802760742, 256395241, 643004100, 768390236, 991956218, 296222942, 143467579, 201999757, 896876919, 540599326, 480775018, 511058071, 937205711, 585056180, 883135618, 958680743, 281901385, 675368724, 372853006, 362078981, 528829438, 51328736, 163429997, 235123483, 190318944, 637447372, 747076884] 923775125))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (minCost [73349594, 18843730, 656162099, 684433155, 13226514, 423983113, 765687789, 430398257, 290509135, 322348965, 704207495, 34083908, 444200690, 638623723, 123907037, 382686429, 965558186, 342527130, 335924564, 65126042, 236371836, 222790206, 769928664, 119302029, 202127738, 435994086, 923453752, 528400152, 424391130, 235187596, 600339609, 753668297, 839119919, 751070429, 960075585, 7443942, 315154950, 621732343, 761189424, 184642820, 6940890, 911063475, 622641120, 85837377, 647396778, 141505681, 155372287, 730012489, 19728620, 531023860, 497632163, 894995511, 493986159, 481463655, 464892392, 239820032, 703563390, 722067825, 951236797, 336243873, 735655408, 465794264, 984129082, 625906202, 636956521, 914338016, 574701587, 671935566, 318342651, 94987502, 202931506, 516517643, 741936417, 57957476, 452167236, 578276004, 984604893, 16441776, 630976802, 51106781, 10550039, 669962123, 163713000, 773850469, 174025572, 19518653, 803145634, 456041045, 665634843, 522308886, 13632988, 154974854, 408444011, 911628704, 815814669, 77224893, 201349904, 880612586, 270004008, 106408714, 384828990, 507309355, 719140605, 821135403, 191687935, 701390846, 28685387, 630615649, 537644452, 751047535, 154938223, 331543854, 197067061, 940909520, 355795924, 14509145, 651762200, 587458258, 484319565, 917779060, 415827282, 513921628, 914906031, 166196268, 842168971, 998767397, 7573687, 610972943, 443117447, 722028433, 265517549, 573760125, 999309255, 255415904, 194384066, 893465569, 183403744, 696356290, 952114946, 608950454, 502596164, 397727286, 954670358, 625244598, 702843032, 314343541, 437085433, 386707815, 565335822, 710263874, 646685777, 872220555, 672937088, 707892514, 383335678, 236236390, 190265080, 70402226, 366573021, 562865179, 261285052, 3700697, 872631939, 198644504, 291792136, 538177704, 640419422, 707052052, 837799811, 815449212, 630614876, 887573826, 897050840, 362042929, 217897115, 394668900, 784700760, 643836345, 181168174, 804953487, 647075184, 165049474, 32815617, 543536977, 212929493, 50279732, 623608418, 239073892, 144937972, 563184730, 240238830, 775112043, 315162273, 117661248, 483406074, 703243135, 679067137, 387049486, 651492619, 354753372, 575529134, 90845560, 155269823, 22092039, 862123307, 839206152, 88616784, 167034756, 97526490, 849611811, 198993990, 251914398, 384588694, 905944714, 883034767, 784758384, 973611862, 624994894, 53369112, 853961830, 189454111, 271256998, 600621789, 531461318, 455681286, 520992070, 295625425, 384414422, 420115385, 296758306, 594698057, 138773267, 123286126, 854994720, 178519394, 640778402, 404595870, 614558314, 856935997, 960452945, 967627809, 388397496, 376852547, 493499683, 111783177, 672310267, 647841265, 150107407, 4495301, 705908698, 928143684, 32973296, 775142042, 408153744, 409554005, 243021330, 426843036, 482493139, 996562109, 42338808, 744645558, 673456108, 378467098, 70425411, 436583117, 933504242, 649105661, 46890228, 849154185, 211088391, 265724624, 924861275, 927416441, 320356788, 118361154, 221637134, 809648667, 168490818, 376611335, 258007826, 956777719, 494859764, 643298863, 809609644, 883143605, 296259859, 529825461, 132611244, 485211769, 72473640, 303172197, 454007012, 845518819, 104931448, 318878344, 383003839, 347917497, 932306982, 978390636, 592335878, 722712031, 526240979, 731352897, 980715070, 254951708, 829051841, 729086263, 450990429, 110465367, 501062798, 406925918, 534144256, 557255755, 96280574, 93145647, 657967282, 71730074, 333603029, 524777672, 636573501, 120897119, 605136947, 7377400, 985615489, 739243993, 26537612, 302341787, 908823001, 761317801, 451723953, 869586374, 226229063, 579168227, 269828521, 586368858, 496389431, 556338345, 14756943, 354283251, 637955569, 990906843, 836736825, 175354731, 503885388, 244336323, 672802997, 416820981, 936718213, 255797520, 133449123, 645010808, 49835670, 909164966, 422777047, 184975250, 312411268, 723050455, 546280479, 276902296, 161098314, 775967898, 24348724, 672173236, 614667415, 749864218, 291502550, 258298788, 17262379, 449988340, 927371862, 890798513, 607960434, 936461075, 799552118, 630600884, 200839570, 182107734, 604048147, 670931799, 480546175, 506087151, 139410620, 829107848, 532317558, 354990881, 76968365, 140452440, 182527920, 233832630, 343975090, 424646397, 646544034, 637284632, 570979591, 783688356, 661354722, 627948934, 267455362, 677248686, 86661979, 742295338, 861265849, 115214081, 188361835, 342823825, 616312559, 548653470, 324605972, 674829250, 440195763, 874502545, 570058500, 699449831, 28108906, 54977773, 853008032, 607484810, 3221800, 173352506, 410061895, 989622480, 369017478, 246336327, 773272471, 842869218, 949507509, 972025944, 71209074, 68314616, 338213857, 991161332, 948876355, 31966703, 428909990, 851756807, 774303958, 782080314, 333723847, 863069047, 605737832, 644392736, 779469280, 542434779, 440255903, 538968929, 795033940, 950816010, 661986297, 367698122, 459297080, 801275661, 281662342, 447720137, 776593612, 896748278, 358596579, 432030875, 679262946, 676719267, 48500356, 499805070, 908012839, 283255214, 234570167, 351017562, 615060968, 871533898, 815124175, 146977924, 629942640, 409316288, 569895198, 272313379, 624750713, 295888774, 380179233, 620145975, 342605675, 196803090, 902674568, 627986540, 784793585, 681393196, 423105551, 467646957, 905402213, 940533796, 421660018, 764459173, 113627796, 96605240, 370072833, 624831289, 936206722, 796985376, 903024204, 678640983, 375613088, 858967151, 77859555, 672848621, 169844863, 391182217, 835055732, 154983357, 145374404, 165291938, 991376810, 580313916, 54018078, 773609970, 181741592, 389040103, 846012116, 45604765, 537558344, 264122183, 38893507, 386085740, 223059408, 856985578, 516461823, 753092701, 735302582, 732634831, 422281959, 423584239, 219528395, 796163137, 800471322, 113305943, 603235381, 612651224, 637441236, 232603244, 123505898, 506656131, 395403933, 427109971, 784114229, 780405280, 173156464, 49085757, 415133643, 834774864, 493630071, 669480906, 249310740, 919428187, 941742614, 906521552, 698087954, 857308532, 313804315, 557037327, 775171539, 983462619, 940334019, 852591, 776107103, 517637924, 242339225, 467473999, 40899203, 648483641, 175149372, 390700334, 859635637, 822439571, 296097567, 914589363, 825216059, 951898853, 273631024] 242057952)," 20226095086 (minCost [73349594, 18843730, 656162099, 684433155, 13226514, 423983113, 765687789, 430398257, 290509135, 322348965, 704207495, 34083908, 444200690, 638623723, 123907037, 382686429, 965558186, 342527130, 335924564, 65126042, 236371836, 222790206, 769928664, 119302029, 202127738, 435994086, 923453752, 528400152, 424391130, 235187596, 600339609, 753668297, 839119919, 751070429, 960075585, 7443942, 315154950, 621732343, 761189424, 184642820, 6940890, 911063475, 622641120, 85837377, 647396778, 141505681, 155372287, 730012489, 19728620, 531023860, 497632163, 894995511, 493986159, 481463655, 464892392, 239820032, 703563390, 722067825, 951236797, 336243873, 735655408, 465794264, 984129082, 625906202, 636956521, 914338016, 574701587, 671935566, 318342651, 94987502, 202931506, 516517643, 741936417, 57957476, 452167236, 578276004, 984604893, 16441776, 630976802, 51106781, 10550039, 669962123, 163713000, 773850469, 174025572, 19518653, 803145634, 456041045, 665634843, 522308886, 13632988, 154974854, 408444011, 911628704, 815814669, 77224893, 201349904, 880612586, 270004008, 106408714, 384828990, 507309355, 719140605, 821135403, 191687935, 701390846, 28685387, 630615649, 537644452, 751047535, 154938223, 331543854, 197067061, 940909520, 355795924, 14509145, 651762200, 587458258, 484319565, 917779060, 415827282, 513921628, 914906031, 166196268, 842168971, 998767397, 7573687, 610972943, 443117447, 722028433, 265517549, 573760125, 999309255, 255415904, 194384066, 893465569, 183403744, 696356290, 952114946, 608950454, 502596164, 397727286, 954670358, 625244598, 702843032, 314343541, 437085433, 386707815, 565335822, 710263874, 646685777, 872220555, 672937088, 707892514, 383335678, 236236390, 190265080, 70402226, 366573021, 562865179, 261285052, 3700697, 872631939, 198644504, 291792136, 538177704, 640419422, 707052052, 837799811, 815449212, 630614876, 887573826, 897050840, 362042929, 217897115, 394668900, 784700760, 643836345, 181168174, 804953487, 647075184, 165049474, 32815617, 543536977, 212929493, 50279732, 623608418, 239073892, 144937972, 563184730, 240238830, 775112043, 315162273, 117661248, 483406074, 703243135, 679067137, 387049486, 651492619, 354753372, 575529134, 90845560, 155269823, 22092039, 862123307, 839206152, 88616784, 167034756, 97526490, 849611811, 198993990, 251914398, 384588694, 905944714, 883034767, 784758384, 973611862, 624994894, 53369112, 853961830, 189454111, 271256998, 600621789, 531461318, 455681286, 520992070, 295625425, 384414422, 420115385, 296758306, 594698057, 138773267, 123286126, 854994720, 178519394, 640778402, 404595870, 614558314, 856935997, 960452945, 967627809, 388397496, 376852547, 493499683, 111783177, 672310267, 647841265, 150107407, 4495301, 705908698, 928143684, 32973296, 775142042, 408153744, 409554005, 243021330, 426843036, 482493139, 996562109, 42338808, 744645558, 673456108, 378467098, 70425411, 436583117, 933504242, 649105661, 46890228, 849154185, 211088391, 265724624, 924861275, 927416441, 320356788, 118361154, 221637134, 809648667, 168490818, 376611335, 258007826, 956777719, 494859764, 643298863, 809609644, 883143605, 296259859, 529825461, 132611244, 485211769, 72473640, 303172197, 454007012, 845518819, 104931448, 318878344, 383003839, 347917497, 932306982, 978390636, 592335878, 722712031, 526240979, 731352897, 980715070, 254951708, 829051841, 729086263, 450990429, 110465367, 501062798, 406925918, 534144256, 557255755, 96280574, 93145647, 657967282, 71730074, 333603029, 524777672, 636573501, 120897119, 605136947, 7377400, 985615489, 739243993, 26537612, 302341787, 908823001, 761317801, 451723953, 869586374, 226229063, 579168227, 269828521, 586368858, 496389431, 556338345, 14756943, 354283251, 637955569, 990906843, 836736825, 175354731, 503885388, 244336323, 672802997, 416820981, 936718213, 255797520, 133449123, 645010808, 49835670, 909164966, 422777047, 184975250, 312411268, 723050455, 546280479, 276902296, 161098314, 775967898, 24348724, 672173236, 614667415, 749864218, 291502550, 258298788, 17262379, 449988340, 927371862, 890798513, 607960434, 936461075, 799552118, 630600884, 200839570, 182107734, 604048147, 670931799, 480546175, 506087151, 139410620, 829107848, 532317558, 354990881, 76968365, 140452440, 182527920, 233832630, 343975090, 424646397, 646544034, 637284632, 570979591, 783688356, 661354722, 627948934, 267455362, 677248686, 86661979, 742295338, 861265849, 115214081, 188361835, 342823825, 616312559, 548653470, 324605972, 674829250, 440195763, 874502545, 570058500, 699449831, 28108906, 54977773, 853008032, 607484810, 3221800, 173352506, 410061895, 989622480, 369017478, 246336327, 773272471, 842869218, 949507509, 972025944, 71209074, 68314616, 338213857, 991161332, 948876355, 31966703, 428909990, 851756807, 774303958, 782080314, 333723847, 863069047, 605737832, 644392736, 779469280, 542434779, 440255903, 538968929, 795033940, 950816010, 661986297, 367698122, 459297080, 801275661, 281662342, 447720137, 776593612, 896748278, 358596579, 432030875, 679262946, 676719267, 48500356, 499805070, 908012839, 283255214, 234570167, 351017562, 615060968, 871533898, 815124175, 146977924, 629942640, 409316288, 569895198, 272313379, 624750713, 295888774, 380179233, 620145975, 342605675, 196803090, 902674568, 627986540, 784793585, 681393196, 423105551, 467646957, 905402213, 940533796, 421660018, 764459173, 113627796, 96605240, 370072833, 624831289, 936206722, 796985376, 903024204, 678640983, 375613088, 858967151, 77859555, 672848621, 169844863, 391182217, 835055732, 154983357, 145374404, 165291938, 991376810, 580313916, 54018078, 773609970, 181741592, 389040103, 846012116, 45604765, 537558344, 264122183, 38893507, 386085740, 223059408, 856985578, 516461823, 753092701, 735302582, 732634831, 422281959, 423584239, 219528395, 796163137, 800471322, 113305943, 603235381, 612651224, 637441236, 232603244, 123505898, 506656131, 395403933, 427109971, 784114229, 780405280, 173156464, 49085757, 415133643, 834774864, 493630071, 669480906, 249310740, 919428187, 941742614, 906521552, 698087954, 857308532, 313804315, 557037327, 775171539, 983462619, 940334019, 852591, 776107103, 517637924, 242339225, 467473999, 40899203, 648483641, 175149372, 390700334, 859635637, 822439571, 296097567, 914589363, 825216059, 951898853, 273631024] 242057952))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (minCost [425254684, 789699586, 176719709, 591540453, 677519448, 616408960, 419232769, 23023996, 335980679, 344379396, 678299390, 263176889, 94432418, 240120911, 159472211, 938490883, 839999189, 4546566, 67516685, 511857371, 148666704, 655902630, 785808493, 859139571, 28047068, 797282432, 991186450, 695919791, 182168185, 527562205, 691850494, 384384258, 39169180, 813590919, 814732776, 759889358, 3035120, 102478272, 770187137, 140334385, 896055107, 707568156, 497675460, 357679116, 850690716, 573027688, 16533059, 351210689, 117787744, 182515717, 559001924, 554601274, 911889785, 70201541, 697573069, 135554601, 912690408, 128329873, 361174463, 230256453, 574178412, 467147258, 4856529, 135166876, 604677104, 511652464, 907273319, 297487312, 819200135, 281037328, 377127950, 63398184, 623461021, 106894227, 502861730, 226782101, 675316836, 453350447, 544994049, 773834624, 481798977, 300205006, 233766131, 912613057, 112644316, 164606959, 468495271, 566816331, 91982538, 715343397, 720522899, 471213495, 224887693, 404226009, 113178174, 203243240, 4269437, 630673049, 89426618, 565527200, 368913199, 267084861, 863912404, 462543786, 12372219, 5438409, 378502188, 660576138, 913732767, 85750613, 888265816, 559182003, 910568422, 28860277, 948653182, 822536317, 201946566, 652437976, 808952704, 494798358, 965001211, 322193897, 654657859, 958530365, 482857021, 646926613, 428943857, 663145331, 214875780, 320149268, 491565929, 223652882, 965967912, 797841028, 930365706, 557185354, 797477294, 67710036, 413032144, 264776605, 235407699, 434335266, 732994983, 96446728, 455721547, 514527609, 950127861, 724688686, 918652338, 307023695, 518990699, 773622737, 933704889, 996275150, 513288590, 727191531, 398789874, 710672536, 316433984, 202737333, 644849163, 676102643, 293708169, 655237012, 166865611, 820098044, 664066712, 789760179, 342957626, 514949020, 269455206, 211555235, 541913607, 110928789, 792085550, 734577571, 427436652, 753654844, 194452851, 505545602, 352202349, 327112155, 561250025, 768276031, 636342581, 758985283, 390985568, 263570962, 194375367, 395440200, 495840427, 58774402, 98218434, 426326706, 508172289, 153870038, 306105453, 847398190, 327447886, 78364594, 332997036, 883837624, 780351821, 798242039, 931220599, 251576138, 593257224, 838790815, 52902269, 503421841, 523967558, 813212807, 747409226, 574002128, 432487337, 235365263, 31103775, 895260314, 453465220, 180199053, 859932439, 364960946, 85070788, 617167468, 389486148, 445918510, 680415189, 818057981, 232439179, 474617272, 590255109, 142599749, 64118808, 501542620, 670494388, 716365631, 985540348, 719256170, 905126716, 711577324, 191090139, 741298133, 170161685, 176972818, 177189726, 932226259, 631528724, 52089355, 486017688, 740460553, 997735237, 760123498, 553932613, 117747134, 161938075, 74399538, 960947525, 59269061, 633412512, 972348172, 167509535, 312357740, 568480786, 209674666, 652764959, 479611869, 789666363, 221193008, 647337833, 175735089, 271748430, 955155222, 340369678, 561837903, 936456519, 69196640, 330737103, 765929344, 653780800, 268635731, 647452265, 862903616, 337490707, 682267666, 937869467, 193371976, 158297483, 512602206, 890702600, 501716782, 980795913, 235499200, 310692588, 854514569, 512199021, 876598929, 609346426, 795761691, 215361076, 867754311, 293637541, 101127129, 878403716, 932412582, 520160573, 896453637, 986067302, 890246247, 987127082, 891485096, 41910843, 841030374, 306347047, 731922429, 834480153, 388005387, 267583246, 446779090, 847363676, 197066135, 768542647, 304404255, 765609402, 604365586, 90280380, 33947293, 295572588, 927772712, 575031317, 841815358, 669801948, 895931334, 666251251, 447271358, 339150153, 439809087, 636966421, 95073189, 120094864, 724216358, 648466512, 986214841, 595756994, 764585991, 797784250, 474708845, 489984034, 950834912, 280187025, 334690121, 311728535, 898742882, 827078115, 243072688, 160602464, 89648214, 757439879, 100451964, 694253263, 632124432, 459858292, 788649791, 293541649, 563865342, 923252753, 634484805, 322121510, 93809928, 345839538, 662243652, 456525176, 623974163, 785269305, 883270483, 76633116, 722777797, 527318058, 861039004, 680285242, 788678069, 203894403, 396236442, 372152348, 298957776, 573257661, 781041646, 518381883, 579993382, 44808192, 45109649, 493383209, 495025827, 892958739, 740817392, 951458279, 815011652, 330123825, 179500137, 139072840, 562610724, 218756925, 35859717, 393250151, 400482915, 334959185, 258768509, 667717124, 951484453, 334834725, 741240644, 899249177, 327641080, 601496982, 388984457, 105618491, 340997278, 423756896, 267133162, 856431025, 907599362, 746571907, 481426513, 548514573, 173662619, 468385700, 19040270, 351548924, 994224480, 232805696, 727821318, 877223237, 792869903, 921258903, 706694601, 610447468, 224967562, 414877357, 747172222, 222822165, 661604802, 565788675, 204464935, 991018823, 663320318, 914249489, 274261090, 558532339, 988264704, 899150808, 273016201, 883776958, 929684339, 750331359, 387490482, 471376870, 4053263, 788329502, 944166978, 507839185, 82845531, 432931248, 930749176, 871084887, 317753262, 596219785, 252234046, 570869638, 477302307, 532492662, 300727276, 43884252, 42304032, 408076532, 273926677, 483758410, 20198442, 858005202, 880633274, 966933985, 586522266, 319203090, 221985826, 824306772, 974977024, 788528887, 472311030, 365740922, 383050445, 633346853, 861784603, 518183650, 817473830, 176401317, 366278232, 564913272, 686170203, 675190887, 337693240, 143185043, 778292312, 679519713, 921758497, 576385503, 580218368, 542333146, 329396899, 695513889, 909191076, 526984661, 976129039, 154175602, 905568777, 764017252, 510986855, 523706197, 700014178, 118039873, 795143461, 610107704, 721914976, 118570932, 117794381, 704610359, 889180603, 124792373, 359394026, 809447775, 785449026, 844132069, 339380796, 867992771, 411744195, 393904595, 194894207, 874153231, 185524799, 878957794, 913051145, 532607726, 379002718, 439219160, 931097818, 559998096, 136201558, 372537584, 138104349, 138964900, 563850467, 449537477, 796958697, 158059824, 407934489, 174240304, 933645503, 94807416, 618651469, 258850185, 756310129, 418751161, 551198232, 895387254, 665580405, 12182957, 764178494, 434565709, 550431683, 560104936, 304856602, 658879860, 754218462, 520641117, 839060875, 867092916, 448586770, 725567540, 457885159, 862153220, 320392649, 608161970, 717286295, 889436722, 707629508, 887288338, 640124949, 246461851, 447247431, 61944920, 458072743, 22059319, 760585101, 812992620, 94208476, 179234940, 154388424, 746816071, 868196869, 101689701, 104237654, 169539607, 449668579, 243755662, 1538021, 811676805, 453334006, 205183057, 274742668, 667838343, 111946884, 962125160, 169152381, 164757107, 820778605, 40608265, 833933113, 597760325, 733832682, 34725313, 750514380, 648265931, 39369503, 423306694, 716955111, 599282441, 843946040, 590277616, 978431349, 468703128, 319783020, 968032855, 121112679, 322647094, 532683175, 785682928, 563305425, 807831834, 993492168, 280461808, 110696119, 18897288, 439523902, 568699607, 133201213, 670941319, 84754153, 482824980, 595587070, 177164200, 296358001, 604354785, 82842106, 433923044, 915933477, 448880627, 60737025, 418176514, 362936073, 563805258, 68570912, 404353998, 186126991, 823995182, 172728738, 374855658, 774614148, 120429944, 126745046, 931336076, 820478542, 980493003, 113784768, 717055260, 72269742, 42644502, 361627105, 567929817, 703348957, 946532162, 730642775, 896565553, 245687784, 678886682, 796306620, 618830891, 70806116, 880226499, 743923745, 402031437, 585925331, 546959035, 694849664, 450106285, 498504148, 164995692, 97797831, 201780478, 101383412, 837310657, 452459656, 80216301, 958261341, 757410412, 388221532, 299764838, 191388302, 107825463, 933699557, 946349222, 189743058, 905413045, 618057814, 595168624, 523627016, 701547170, 742272892, 523647710, 893526925, 974602185, 597983769, 752832519, 199225694, 398649835, 390751544, 126116328, 133778449, 844667619, 483019918, 921255724, 963507932, 531012367, 107268093, 619054525, 669392857, 754911136, 749025261, 84945136, 581497114, 82766065, 207819127, 638553163, 92480875, 384365757, 323053687, 5335950, 908997439, 398885318, 542185510, 508718168, 73800825, 936205007, 413642617, 440819321, 216651241, 579426546, 168774394, 637442179, 952984013, 526897232, 719833277, 592277078, 919016023, 589278432, 48295221, 928897773, 117537829, 220773587, 761919328, 37246179, 481792597, 518672953, 560915046, 22325812, 496384293, 129782091, 333684424, 277361475, 413749111, 307133884, 17027839, 948783130, 90125010, 23914083, 686549723, 758164487, 904698606, 276543444, 507287692, 774063218, 523462132, 996476226, 727343657, 632688181, 982638228, 945078904, 694865378, 512178539, 65038175, 166185516, 973025316, 31273959, 719119487, 709316127, 988643972, 659087929, 442618137, 694169527, 144824914, 355679957, 954492231, 42099116, 664835628, 784690056, 824238517, 609449964, 282716011, 878462139, 751283952, 603802723, 984556230, 402594395, 767982778, 204132253, 817564239, 841983787, 708680912, 507695129, 193801617, 315453446, 27054988, 435496777, 288750174, 452232102, 262241270, 781900442, 701528289, 210605476, 809292716, 244573828, 143639996, 796164060, 268977976, 928924013, 143457554, 337780952, 697284710, 629748888, 488316226, 821506584, 972262198, 449040254, 555479004, 684372077, 370007796, 895106216, 576169014, 432416051, 693259707, 904504326, 373788784, 187447211, 576781174, 42031404, 212913198, 323940113, 545675325, 66740570, 768153458, 177686137, 76583477, 433055702, 306097592, 351369454, 26100261, 338661445, 552403268, 444444517, 361464398, 745902080, 368071382, 501669490, 881056461, 633986960, 92376521, 447312538, 322056866, 952126970, 132907180, 779437822, 82777802, 399448521, 884216749, 755285575, 294926371, 583851237, 576562945, 363823158, 450600075, 424313903, 786756845, 317550027, 247481030, 676669472, 739666372, 222690360, 374740931, 135111876, 831106891, 173398375, 577965686, 270699985, 58752635, 177661348, 285790708, 594167835, 460062379, 573540212, 749436637, 67410690, 317300888, 271813820, 576195472, 605875333, 712345746, 648327215, 43543676, 36471202, 521878399, 852729858, 17090846, 599089449, 442278455, 32560312, 613125160, 297078716, 860258691, 811901814, 360235499, 621345610, 432328080, 940026951, 730048267, 330424156, 17400432, 844934671, 14136916, 717972741, 55003792, 820767376, 221871409, 622212918, 528119283, 82241353, 61944471, 527338055, 463757456, 95879940, 952855769, 210255149, 443105133, 83188365, 785569758, 243451089, 99791535, 946058739, 28283302, 232002549, 484217223, 351357885, 399213220, 967524989, 671336735, 293833515, 344303480, 125877988, 538086241, 472786797, 821425810, 319486050, 263760956, 237070956, 981210255, 295774140, 34348328, 439119445, 334466056, 144458817, 954458062, 131551735, 564453968] 259451167)," 38202065813 (minCost [425254684, 789699586, 176719709, 591540453, 677519448, 616408960, 419232769, 23023996, 335980679, 344379396, 678299390, 263176889, 94432418, 240120911, 159472211, 938490883, 839999189, 4546566, 67516685, 511857371, 148666704, 655902630, 785808493, 859139571, 28047068, 797282432, 991186450, 695919791, 182168185, 527562205, 691850494, 384384258, 39169180, 813590919, 814732776, 759889358, 3035120, 102478272, 770187137, 140334385, 896055107, 707568156, 497675460, 357679116, 850690716, 573027688, 16533059, 351210689, 117787744, 182515717, 559001924, 554601274, 911889785, 70201541, 697573069, 135554601, 912690408, 128329873, 361174463, 230256453, 574178412, 467147258, 4856529, 135166876, 604677104, 511652464, 907273319, 297487312, 819200135, 281037328, 377127950, 63398184, 623461021, 106894227, 502861730, 226782101, 675316836, 453350447, 544994049, 773834624, 481798977, 300205006, 233766131, 912613057, 112644316, 164606959, 468495271, 566816331, 91982538, 715343397, 720522899, 471213495, 224887693, 404226009, 113178174, 203243240, 4269437, 630673049, 89426618, 565527200, 368913199, 267084861, 863912404, 462543786, 12372219, 5438409, 378502188, 660576138, 913732767, 85750613, 888265816, 559182003, 910568422, 28860277, 948653182, 822536317, 201946566, 652437976, 808952704, 494798358, 965001211, 322193897, 654657859, 958530365, 482857021, 646926613, 428943857, 663145331, 214875780, 320149268, 491565929, 223652882, 965967912, 797841028, 930365706, 557185354, 797477294, 67710036, 413032144, 264776605, 235407699, 434335266, 732994983, 96446728, 455721547, 514527609, 950127861, 724688686, 918652338, 307023695, 518990699, 773622737, 933704889, 996275150, 513288590, 727191531, 398789874, 710672536, 316433984, 202737333, 644849163, 676102643, 293708169, 655237012, 166865611, 820098044, 664066712, 789760179, 342957626, 514949020, 269455206, 211555235, 541913607, 110928789, 792085550, 734577571, 427436652, 753654844, 194452851, 505545602, 352202349, 327112155, 561250025, 768276031, 636342581, 758985283, 390985568, 263570962, 194375367, 395440200, 495840427, 58774402, 98218434, 426326706, 508172289, 153870038, 306105453, 847398190, 327447886, 78364594, 332997036, 883837624, 780351821, 798242039, 931220599, 251576138, 593257224, 838790815, 52902269, 503421841, 523967558, 813212807, 747409226, 574002128, 432487337, 235365263, 31103775, 895260314, 453465220, 180199053, 859932439, 364960946, 85070788, 617167468, 389486148, 445918510, 680415189, 818057981, 232439179, 474617272, 590255109, 142599749, 64118808, 501542620, 670494388, 716365631, 985540348, 719256170, 905126716, 711577324, 191090139, 741298133, 170161685, 176972818, 177189726, 932226259, 631528724, 52089355, 486017688, 740460553, 997735237, 760123498, 553932613, 117747134, 161938075, 74399538, 960947525, 59269061, 633412512, 972348172, 167509535, 312357740, 568480786, 209674666, 652764959, 479611869, 789666363, 221193008, 647337833, 175735089, 271748430, 955155222, 340369678, 561837903, 936456519, 69196640, 330737103, 765929344, 653780800, 268635731, 647452265, 862903616, 337490707, 682267666, 937869467, 193371976, 158297483, 512602206, 890702600, 501716782, 980795913, 235499200, 310692588, 854514569, 512199021, 876598929, 609346426, 795761691, 215361076, 867754311, 293637541, 101127129, 878403716, 932412582, 520160573, 896453637, 986067302, 890246247, 987127082, 891485096, 41910843, 841030374, 306347047, 731922429, 834480153, 388005387, 267583246, 446779090, 847363676, 197066135, 768542647, 304404255, 765609402, 604365586, 90280380, 33947293, 295572588, 927772712, 575031317, 841815358, 669801948, 895931334, 666251251, 447271358, 339150153, 439809087, 636966421, 95073189, 120094864, 724216358, 648466512, 986214841, 595756994, 764585991, 797784250, 474708845, 489984034, 950834912, 280187025, 334690121, 311728535, 898742882, 827078115, 243072688, 160602464, 89648214, 757439879, 100451964, 694253263, 632124432, 459858292, 788649791, 293541649, 563865342, 923252753, 634484805, 322121510, 93809928, 345839538, 662243652, 456525176, 623974163, 785269305, 883270483, 76633116, 722777797, 527318058, 861039004, 680285242, 788678069, 203894403, 396236442, 372152348, 298957776, 573257661, 781041646, 518381883, 579993382, 44808192, 45109649, 493383209, 495025827, 892958739, 740817392, 951458279, 815011652, 330123825, 179500137, 139072840, 562610724, 218756925, 35859717, 393250151, 400482915, 334959185, 258768509, 667717124, 951484453, 334834725, 741240644, 899249177, 327641080, 601496982, 388984457, 105618491, 340997278, 423756896, 267133162, 856431025, 907599362, 746571907, 481426513, 548514573, 173662619, 468385700, 19040270, 351548924, 994224480, 232805696, 727821318, 877223237, 792869903, 921258903, 706694601, 610447468, 224967562, 414877357, 747172222, 222822165, 661604802, 565788675, 204464935, 991018823, 663320318, 914249489, 274261090, 558532339, 988264704, 899150808, 273016201, 883776958, 929684339, 750331359, 387490482, 471376870, 4053263, 788329502, 944166978, 507839185, 82845531, 432931248, 930749176, 871084887, 317753262, 596219785, 252234046, 570869638, 477302307, 532492662, 300727276, 43884252, 42304032, 408076532, 273926677, 483758410, 20198442, 858005202, 880633274, 966933985, 586522266, 319203090, 221985826, 824306772, 974977024, 788528887, 472311030, 365740922, 383050445, 633346853, 861784603, 518183650, 817473830, 176401317, 366278232, 564913272, 686170203, 675190887, 337693240, 143185043, 778292312, 679519713, 921758497, 576385503, 580218368, 542333146, 329396899, 695513889, 909191076, 526984661, 976129039, 154175602, 905568777, 764017252, 510986855, 523706197, 700014178, 118039873, 795143461, 610107704, 721914976, 118570932, 117794381, 704610359, 889180603, 124792373, 359394026, 809447775, 785449026, 844132069, 339380796, 867992771, 411744195, 393904595, 194894207, 874153231, 185524799, 878957794, 913051145, 532607726, 379002718, 439219160, 931097818, 559998096, 136201558, 372537584, 138104349, 138964900, 563850467, 449537477, 796958697, 158059824, 407934489, 174240304, 933645503, 94807416, 618651469, 258850185, 756310129, 418751161, 551198232, 895387254, 665580405, 12182957, 764178494, 434565709, 550431683, 560104936, 304856602, 658879860, 754218462, 520641117, 839060875, 867092916, 448586770, 725567540, 457885159, 862153220, 320392649, 608161970, 717286295, 889436722, 707629508, 887288338, 640124949, 246461851, 447247431, 61944920, 458072743, 22059319, 760585101, 812992620, 94208476, 179234940, 154388424, 746816071, 868196869, 101689701, 104237654, 169539607, 449668579, 243755662, 1538021, 811676805, 453334006, 205183057, 274742668, 667838343, 111946884, 962125160, 169152381, 164757107, 820778605, 40608265, 833933113, 597760325, 733832682, 34725313, 750514380, 648265931, 39369503, 423306694, 716955111, 599282441, 843946040, 590277616, 978431349, 468703128, 319783020, 968032855, 121112679, 322647094, 532683175, 785682928, 563305425, 807831834, 993492168, 280461808, 110696119, 18897288, 439523902, 568699607, 133201213, 670941319, 84754153, 482824980, 595587070, 177164200, 296358001, 604354785, 82842106, 433923044, 915933477, 448880627, 60737025, 418176514, 362936073, 563805258, 68570912, 404353998, 186126991, 823995182, 172728738, 374855658, 774614148, 120429944, 126745046, 931336076, 820478542, 980493003, 113784768, 717055260, 72269742, 42644502, 361627105, 567929817, 703348957, 946532162, 730642775, 896565553, 245687784, 678886682, 796306620, 618830891, 70806116, 880226499, 743923745, 402031437, 585925331, 546959035, 694849664, 450106285, 498504148, 164995692, 97797831, 201780478, 101383412, 837310657, 452459656, 80216301, 958261341, 757410412, 388221532, 299764838, 191388302, 107825463, 933699557, 946349222, 189743058, 905413045, 618057814, 595168624, 523627016, 701547170, 742272892, 523647710, 893526925, 974602185, 597983769, 752832519, 199225694, 398649835, 390751544, 126116328, 133778449, 844667619, 483019918, 921255724, 963507932, 531012367, 107268093, 619054525, 669392857, 754911136, 749025261, 84945136, 581497114, 82766065, 207819127, 638553163, 92480875, 384365757, 323053687, 5335950, 908997439, 398885318, 542185510, 508718168, 73800825, 936205007, 413642617, 440819321, 216651241, 579426546, 168774394, 637442179, 952984013, 526897232, 719833277, 592277078, 919016023, 589278432, 48295221, 928897773, 117537829, 220773587, 761919328, 37246179, 481792597, 518672953, 560915046, 22325812, 496384293, 129782091, 333684424, 277361475, 413749111, 307133884, 17027839, 948783130, 90125010, 23914083, 686549723, 758164487, 904698606, 276543444, 507287692, 774063218, 523462132, 996476226, 727343657, 632688181, 982638228, 945078904, 694865378, 512178539, 65038175, 166185516, 973025316, 31273959, 719119487, 709316127, 988643972, 659087929, 442618137, 694169527, 144824914, 355679957, 954492231, 42099116, 664835628, 784690056, 824238517, 609449964, 282716011, 878462139, 751283952, 603802723, 984556230, 402594395, 767982778, 204132253, 817564239, 841983787, 708680912, 507695129, 193801617, 315453446, 27054988, 435496777, 288750174, 452232102, 262241270, 781900442, 701528289, 210605476, 809292716, 244573828, 143639996, 796164060, 268977976, 928924013, 143457554, 337780952, 697284710, 629748888, 488316226, 821506584, 972262198, 449040254, 555479004, 684372077, 370007796, 895106216, 576169014, 432416051, 693259707, 904504326, 373788784, 187447211, 576781174, 42031404, 212913198, 323940113, 545675325, 66740570, 768153458, 177686137, 76583477, 433055702, 306097592, 351369454, 26100261, 338661445, 552403268, 444444517, 361464398, 745902080, 368071382, 501669490, 881056461, 633986960, 92376521, 447312538, 322056866, 952126970, 132907180, 779437822, 82777802, 399448521, 884216749, 755285575, 294926371, 583851237, 576562945, 363823158, 450600075, 424313903, 786756845, 317550027, 247481030, 676669472, 739666372, 222690360, 374740931, 135111876, 831106891, 173398375, 577965686, 270699985, 58752635, 177661348, 285790708, 594167835, 460062379, 573540212, 749436637, 67410690, 317300888, 271813820, 576195472, 605875333, 712345746, 648327215, 43543676, 36471202, 521878399, 852729858, 17090846, 599089449, 442278455, 32560312, 613125160, 297078716, 860258691, 811901814, 360235499, 621345610, 432328080, 940026951, 730048267, 330424156, 17400432, 844934671, 14136916, 717972741, 55003792, 820767376, 221871409, 622212918, 528119283, 82241353, 61944471, 527338055, 463757456, 95879940, 952855769, 210255149, 443105133, 83188365, 785569758, 243451089, 99791535, 946058739, 28283302, 232002549, 484217223, 351357885, 399213220, 967524989, 671336735, 293833515, 344303480, 125877988, 538086241, 472786797, 821425810, 319486050, 263760956, 237070956, 981210255, 295774140, 34348328, 439119445, 334466056, 144458817, 954458062, 131551735, 564453968] 259451167))
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, TestLabel "Test9" test9]
42
+
43
+ -- Running the tests
44
+ main :: IO Counts
45
+ main = runTestTT tests
collecting_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(13, minCost(new ArrayList<>(Arrays.asList(20,1,15)), 5));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(6, minCost(new ArrayList<>(Arrays.asList(1,2,3)), 4));
19
+ }
20
+
21
+ }
collecting_chocolates/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
collecting_chocolates/ocaml_tests/main.ml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 (minCost [20;1;15] 5)
12
+
13
+ let test2 _ = assert_equal 6 (minCost [1;2;3] 4)
14
+
15
+ let test3 _ = assert_equal 10633276482 (minCost [195199014; 984800196; 607924423; 36348739; 813130315; 153065099; 588296506; 617132062; 781027683; 116629882; 581208811; 569440617; 870838107; 939227748; 574241627; 488909059; 479214749; 920077184; 809104907; 97812621; 739489242; 733086437; 654080955; 987436545; 140526391; 372643245; 149983222; 229866605; 912832555; 986734995; 161610887; 660721797; 431179104; 37923818; 337467714; 344568419; 408880028; 298866142; 586368843; 655456322; 182642371; 81945619; 607613577; 887811013; 626376923; 715066277; 27312739; 242413291; 491056317; 626066721; 329827884; 51373087; 377603455; 285888257; 289189990; 437036712; 51492615; 773483380; 273050223; 239823783; 178687773; 86195843; 311103091; 513170145; 818474194; 861218557; 673632638; 973212016; 990596428; 584797315; 390187131; 16063215; 671830121; 403723544; 368926620; 291577238; 836588088; 603827758; 2606594; 259323471; 249091497; 372920588; 781724843; 390173853; 817933194; 302969239; 164540460; 652257475; 452847149; 751974372; 417340325; 609385790; 325428582; 5518899; 689255278; 306884488; 240441423; 990221737; 127779717; 469798221; 809710543; 76651043; 114721605; 811337085; 838269422; 210573940; 550804251; 151059732; 963856152; 454169768; 649700828; 863499421; 666400114; 739255458; 148479307; 810214197; 701169766; 224247585; 528904494; 677094434; 656368211; 964745763; 285343955; 354199258; 604592293; 84075276; 171162476; 198006259; 792771994; 921766273; 513057436; 442342857; 393647274; 928913521; 129759381; 926801252; 382921119; 590703484; 947689972; 645597832; 80489849; 402504867; 793560817; 304668159; 752099804; 272063343; 237287828; 311417665; 110016486; 391816426; 573541853; 412955906; 774375508; 988828191; 529616010; 365784851; 130714687; 625023361; 51870264; 3921080; 970552943; 831690784; 304632280; 163415864; 945698689; 992319209; 607764312; 916603382; 69904958; 529364651; 877540295; 742675142; 217211577; 929501124; 359606819; 792089571; 628840547; 470317204; 245666470; 538467321; 542525942; 301217535; 254924657; 494655010; 462250827; 480408495; 21908896; 994013811; 32823489; 900377181; 767397312; 536885644; 109915622; 739194012; 394242870; 281165002; 684530302; 642378737; 252917803; 289701811; 920316781; 561202250; 485794592; 985927864; 452933034; 396341427; 464970466; 650547832; 435718719; 407937592; 825524338; 342161946; 794783327; 78363130; 758859001; 339179672; 276222116; 331080978; 355655498; 529702137; 246833303; 444240535; 390433754; 383207254; 685984136; 776310837; 971712059; 291328757; 498988370; 944595442; 210158741; 474588291; 728452333; 327892670; 633123722; 280937805; 961564731; 896302261; 364818399; 791196212; 678626404; 702912193; 966940719; 697837937; 229233322; 615904816; 142873499; 239716403; 88386028; 814798561; 518353881; 498482718; 458907246; 296617630; 685054486; 159771808; 423294860; 494014169; 150924742; 12436220; 755400713; 258190124; 65531288; 454041355; 221518994; 860222475; 932970280; 531681169; 602109256; 585029274; 24112250; 832975854; 702277613; 886158293; 993671856; 745950250; 9815904; 428057692; 951726244; 182913765; 886722589; 752178138; 941397089; 754737490; 328291852; 179288814; 959223573; 523585699; 542035645; 184733133; 198371804; 304883176; 998452141; 124524129; 885584699; 481174985; 616696757; 593324918; 454968615; 52844661; 970336457; 59652415; 503863689; 763412487; 318086037; 431678900; 772961494; 379979411; 748770602; 564912364; 176131533; 33162653; 811147845; 911170860; 147574219; 147811026; 152613327; 313470576; 67773459; 635593023; 923663369; 940797858; 353228924; 894589838; 113893957; 270912429; 810499926; 343383832; 999461432; 428879623; 882203250; 137842711; 963733831; 228328390; 388609130; 444731715; 876905523; 820643216; 292901933; 300114876; 646370184; 139589078; 173813411; 641490002; 511780675; 138009273; 168326041; 455523429; 577968590; 822486887; 206628466; 406962072; 776818543; 243949136; 773326982; 943666446; 751147131; 535649421; 445290504; 493015215; 441504843; 460178556; 176659001; 966315793; 622966118; 99102348; 959671731; 489578182; 700131590; 692678432; 843997706; 84316992; 295052242; 553321387; 675541223; 343432650; 389473733; 370807758; 385237489; 945158723; 227527971; 875594740; 125454021; 423896252; 15560748; 6210546; 794287516; 458892965; 645223642; 996372617; 537229661; 954211580; 293738043; 696027865; 46737506; 80039731; 692608133; 145885645; 560041641; 318623001; 562827220; 742688194; 100673661; 178786795; 289815352; 652188537; 735242308; 734937272; 891739424; 664946181; 987635466; 788629312; 402822043; 955411387; 929766648; 410007672; 377269822; 561962151; 937239079; 13238555; 966880602; 905525735; 233868138; 123894478; 827850053; 613602240; 649224028; 208377928; 317404952; 872164249; 238027473; 603347539; 15913528; 511476986; 60472308; 825530316; 575387964; 10613894; 817509174; 745601985; 316498340; 393598793; 909624006; 14905850; 215533967; 411912051; 984884312; 749494941; 678806049; 509115086; 312513897; 436730186; 622622583; 410981845; 6187747; 240335095; 871466569; 298738342; 753964255; 842764464; 763669249; 726831257; 262805735; 456928993; 921464338; 398268879; 902183475; 491502741; 872348170; 244442294; 715060792; 925352396; 588960406; 463602725; 881739070; 317752390; 709787883; 704456597; 239353639; 42648361; 330506671; 881390592; 270400733; 431217820; 923604163; 199350714; 730784157; 618816379; 390154481; 510752733; 419362979; 7864821; 670638993; 931944085; 877025976; 356710805; 580480749; 523376265; 32536697; 534640272; 658422828; 602869101; 257627936; 19353320; 307231189; 767777638; 116075954; 910132199; 890785831; 112656238; 535125877; 899585967; 212528780; 52594748; 476910963; 702000280; 914379828; 232401095; 815622453; 170806089; 142026010; 974803062; 446266689; 647729617; 141540830; 209984756; 917469850; 366614793; 505088170; 336199776; 458282243; 776726118; 65898399; 588747470; 336803515; 227473240; 807022596; 76282996; 556822238; 890598517; 320719589; 833641979; 274922280; 850612850; 805689839; 350345518; 268524345; 537854273; 133048817; 941825930; 531193388; 234420006; 652476571; 376886332; 471886483; 966682042; 169210281; 794515277; 84541212; 702197814; 294385154; 932048350; 357165852; 106845267; 838294046; 268767026; 768928242; 317757906; 642134607; 866468112; 408162350; 316778091; 315071199; 946231322; 462597803; 803470909; 113477738; 981387113; 350882681; 622688065; 877058174; 707677845; 678125185; 987244185; 416176335; 435153468; 898770636; 739742120; 368770071; 718975205; 132449699; 112157585; 614954407; 277410771; 845349804; 41620036; 459533573; 440667505; 351711058; 51265070; 692281115; 414086736; 582255027; 278173598; 837369224; 134070537; 411382375; 783386478; 59113229; 20075845; 11128092; 578770990; 239563044; 539793169; 405961871; 465019583; 881445046; 379539062; 604898363; 846257377; 120473440; 286543229; 554792750; 360420609; 994274929; 647518644; 639628224; 958244598; 134806133; 982204738; 969696721; 438608528; 684891723; 401247476; 263136938; 690073753; 429568456; 758466696; 834591579; 765511214; 245834044; 5432691; 949868089; 189205914; 182922234; 267536500; 556288860; 275325798; 228763038; 43198009; 626958467; 589408140; 157891879; 191866252; 566237343; 489338090; 316442951; 378261638; 250879999; 678793094; 863771713; 91704092; 254836077; 169623528; 3163204; 173845140; 346893958; 776113836; 973508092; 645340992; 590430401; 951563534; 473705954; 729796359; 97394867; 103018547; 254535655; 60538203; 584520812; 986220593; 444323091; 965536113; 869419091; 5081692; 327462154; 643651844; 579512728; 908311364; 223782800; 784660433; 354251199; 223432445; 557927372; 132706843; 207201606; 244254156; 597845799; 764449087; 586516681; 815675472; 517278658; 500556000; 970376215; 989955500; 72034657; 206722688] 59772293)
16
+
17
+ let test4 _ = assert_equal 37685090039 (minCost [563669213; 825855133; 170715616; 848248921; 900296610; 887903420; 675871814; 486596683; 235735391; 414856374; 822396398; 44266810; 771867053; 915395390; 407577458; 526132977; 435493588; 200118428; 522821959; 508699245; 209107510; 775835633; 848773024; 737330318; 49170263; 680427509; 573882300; 47975331; 107865654; 717536143; 530193469; 815833575; 172088373; 245232698; 13843861; 505703667; 920495124; 239600583; 738826172; 885854894; 287143084; 855637308; 143274687; 483262375; 405384251; 100977809; 953509786; 841235525; 575644136; 728039828; 448530985; 15997067; 72457869; 101030668; 373958835; 405681725; 405119064; 640524495; 878589097; 853263253; 326180319; 905875964; 224218040; 191497343; 54231792; 209037869; 375754140; 733021805; 872850958; 680061098; 909589897; 283417467; 992550860; 786664967; 204480733; 694702469; 695974678; 964700834; 592869236; 401811813; 56938882; 269231172; 766091455; 884761542; 38371452; 154205087; 416251331; 891071809; 869898081; 49865978; 975945402; 890700102; 988503568; 763930157; 815989390; 971377022; 282112026; 877551177; 580863559; 786925081; 447744173; 90081861; 22716552; 610375817; 696503886; 894129516; 643629922; 361399122; 212873496; 24950850; 272084837; 225407940; 69118584; 585427257; 93199531; 759303736; 892684401; 54387311; 219211102; 734932330; 253133867; 287296779; 356393711; 521830829; 942986574; 835526734; 775641657; 793444573; 234586574; 305990543; 589957492; 840715257; 18793840; 61463393; 771904419; 174384737; 449298523; 998770680; 385905690; 556897939; 257114939; 75136071; 458396933; 568211851; 482458998; 156091396; 439827914; 296595468; 806556096; 759274512; 359380225; 11956902; 840335491; 186135643; 512506043; 431375016; 209975739; 955020417; 3503802; 400814123; 234876476; 576947222; 266791712; 608870365; 766466346; 707602090; 428120087; 958082253; 184905080; 433493060; 602373693; 607604421; 812112090; 502237719; 952452187; 987786539; 64846139; 324252439; 59882599; 902241415; 371692197; 546742761; 659820907; 578700678; 551662153; 613246026; 639899097; 117406911; 301855994; 957388774; 897991451; 582703892; 88142700; 266915022; 151060378; 985016617; 149325809; 67085982; 417947811; 510895036; 18308997; 718674228; 332240402; 17036994; 482912726; 351285736; 931679892; 132057383; 15285131; 726581011; 856968187; 152149953; 848842139; 282301851; 885802920; 190876914; 136959644; 148312259; 519113422; 38376962; 356726594; 942808169; 238367302; 976641835; 560402238; 39078265; 846300705; 862455098; 392081438; 13303271; 407489581; 516158738; 426092730; 230270579; 566857210; 671558383; 501070302; 305494756; 149996375; 604973608; 475691854; 535650477; 68341824; 564713481; 675904594; 571734504; 481381942; 499047210; 960241932; 559188621; 339907471; 414845928; 381969569; 412056007; 222429126; 759873667; 95557112; 447973200; 562821228; 719714521; 711258907; 102339783; 482924658; 586039964; 28020821; 110040334; 311022027; 940526292; 648295974; 922554876; 660908464; 757134079; 846179529; 416721229; 980355072; 843258633; 773348852; 966317083; 903796445; 761515397; 962889142; 201745268; 873174137; 212674858; 910042856; 94088310; 168163893; 869159155; 233037439; 230987328; 589828823; 826806352; 664994060; 471688622; 745134907; 103187429; 603229400; 516560254; 955406852; 194155723; 683367090; 424942924; 106958578; 354855672; 35586725; 477587633; 906879483; 747824680; 815731568; 209223077; 478948459; 443136667; 720477753; 440977862; 389579185; 409137367; 666006140; 759594819; 381334522; 126128657; 456579003; 930758953; 190764978; 273220669; 613582969; 239713242; 538056745; 805006158; 752633857; 703024704; 467664263; 53684952; 390578805; 577204112; 323682769; 786364144; 893936510; 950948160; 261353949; 507236096; 366069533; 494139795; 971364473; 39447797; 365220426; 851906154; 317619002; 557803119; 716377485; 174428191; 383384919; 549160022; 571289329; 76711012; 890877483; 712773829; 167470644; 354483046; 477986720; 618472061; 405821922; 218831336; 116007746; 567271319; 477663635; 580816817; 559175243; 606926231; 890403431; 339487787; 248300406; 687048731; 511158806; 678359920; 696800477; 587350397; 179474495; 340894123; 700777902; 845853210; 921124908; 918785967; 587770467; 630217706; 717362563; 595981553; 340289370; 427610929; 714563512; 262433294; 441327464; 401582640; 691140041; 420004646; 656741070; 230421845; 278214583; 730761322; 964957276; 358896796; 557503666; 853464006; 284632286; 459150133; 603336734; 385689302; 356957264; 335776266; 745677663; 725855548; 484327271; 313178752; 850926700; 101190892; 381544552; 337926553; 144349570; 880307824; 281718892; 403045929; 193797651; 519465702; 615842736; 424666106; 214198330; 283598578; 143950066; 16833080; 12717220; 786413914; 249071653; 912424496; 830410107; 366021503; 22560213; 91875567; 567986445; 848426556; 605599362; 54189090; 616921622; 302844160; 477888837; 902147730; 618349759; 30587427; 389475281; 862036284; 248639560; 820585713; 635906374; 449218765; 693837644; 435514535; 995952207; 826467537; 144181767; 531526221; 340055046; 549225799; 387397015; 197758328; 568382231; 639706585; 48358540; 791921427; 185327646; 295792559; 443161478; 443872978; 424874990; 923516857; 98659777; 929205398; 669133063; 287396465; 849895730; 69046697; 474835650; 847853778; 140104095; 603196275; 523573889; 47107877; 895667802; 45583203; 903207368; 922597616; 386665134; 315102966; 16407145; 384915734; 921778962; 804382200; 423945781; 220550809; 880908973; 4152442; 728298706; 749757480; 562235361; 345139267; 77185567; 345823595; 983601915; 844182963; 904106483; 789976799; 394995796; 82586936; 121974183; 967632643; 429796764; 982269365; 799074126; 311149901; 437651442; 519844447; 954891471; 24148725; 538572729; 332529359; 907714845; 215990041; 560502859; 423822439; 484209522; 802193948; 585532543; 966855721; 200591667; 305209084; 400852719; 50671693; 404032320; 836515671; 312576225; 827106112; 285294081; 174463950; 679285468; 855122537; 717877225; 464754682; 345419570; 998396795; 251008696; 742790620; 459229454; 11261094; 483876617; 419697596; 148940629; 916650484; 33264727; 664756256; 81541957; 31814968; 347554098; 417890484; 48888814; 495002841; 990763108; 91580699; 944404984; 133622568; 529489280; 598349305; 841118162; 827171820; 256554468; 94338459; 399748009; 691901866; 296185971; 352638666; 594647125; 284659950; 246324504; 861359917; 821604100; 759018272; 51574016; 982530864; 772588041; 626960703; 131355704; 384815790; 45503822; 96419317; 636778033; 470926487; 456342901; 840785056; 660147669; 563952086; 45348807; 353249931; 926870983; 881556238; 901518240; 925996126; 55810296; 34775496; 472505851; 61286877; 412891222; 179747697; 593260017; 373768607; 130175796; 36417300; 527747064; 92429350; 179745521; 471709998; 912637451; 627440640; 17569947; 252263488; 399000684; 559218361; 383375566; 562068110; 269335761; 101801587; 377797666; 751335451; 958800405; 57913847; 157753477; 921672660; 109999537; 808578430; 903864677; 484110353; 394313430; 136556627; 288535485; 958769834; 300259254; 352195823; 950518461; 180748521; 798899893; 676189982; 606037456; 313955024; 75729256; 680539579; 2269609; 519317676; 875184572; 694575379; 878790683; 979567404; 944184077; 155049229; 436317053; 321749806; 489236705; 763323080; 282028232; 743281357; 498966870; 430221940; 681965311; 926694370; 632135135; 849107909; 230079556; 410061048; 707095537; 634290942; 600545868; 269760407; 452093469; 210219975; 375030799; 76429274; 611824173; 328943400; 105374470; 590497554; 38692832; 349252667; 212616107; 97050040; 404986286; 336667660; 17726065; 1811947; 672254249; 37398438; 691024006; 676578843; 294227226; 194888207; 29543539; 190425768; 322122266; 617590658; 644977987; 93719533; 224317322; 35597134; 101594741; 722223993; 841288301; 154003983; 290603441; 261695433; 343905287; 732488771; 771405000; 12824855; 397055298; 798549264; 375310777; 3160687; 860014925; 873755466; 687485790; 108741641; 591548296; 119514663; 93335768; 494385986; 212548822; 536529513; 101582885; 751996751; 216014136; 346551331; 466701529; 438133154; 467953069; 334942634; 243440098; 457302027; 674636140; 718529249; 921612110; 779217058; 713583046; 666824893; 530074627; 9576019; 634073373; 231163140; 678924307; 997121878; 775112239; 83159589; 589772529; 212385868; 829768562; 821963365; 976623024; 324977907; 280158329; 88452334; 779077084; 671705193; 842545869; 727153452; 617856355; 911851809; 288511425; 607060512; 328007906; 637897761; 242534940; 103623504; 246256; 690448636; 660405358; 549713658; 129667412; 790180837; 57599614] 531004303)
18
+
19
+ let test5 _ = assert_equal 16912494358 (minCost [945389577; 111116927; 908783196; 50140358; 959492443; 621625254; 255471618; 856293880; 431497048; 900080555; 48615242; 323695831; 793401948; 608032497; 260323249; 285572990; 862673209; 78379502; 715463944; 37841067; 420529343; 276556515; 156938055; 173291667; 926533023; 328825349; 264424263; 752255385; 748648849; 537908816; 312660609; 359083047; 552517006; 785901828; 196167296; 638340718; 38593887; 35570012; 889452149; 16700288; 309876496; 710489470; 604364097; 492912622; 578030825; 150666894; 226441865; 90711201; 185333530; 810486129; 182405455; 977957785; 733122422; 731408912; 139960041; 682401220; 681191578; 288147530; 359241124; 460311391; 233998545; 297952008; 384311367; 675987422; 273406652; 75287910; 928290128; 911238607; 407990495; 442488131; 405884137; 947079047; 99554214; 172487863; 761521355; 102878896; 560390374; 692136718; 871641505; 88140349; 989265733; 784844735; 77851623; 532924433; 269564404; 239015610; 96460813; 833932146; 121652526; 447560438; 133295611; 743001807; 500374245; 588026399; 3819236; 625802651; 303736893; 459491326; 890973172; 174644956; 948494548; 521105607; 696773235; 620297778; 573600818; 448402914; 689951348; 884451527; 521556556; 425962194; 622297134; 69255638; 321694010; 631009365; 878790060; 280461764; 594134385; 827229758; 12614167; 210065853; 169933731; 417683964; 296424875; 442481395; 718309338; 40996448; 859871255; 956044770; 231098868; 227130473; 297031090; 165391123; 873882665; 320097267; 96680241; 603126670; 267280993; 717061802; 583684867; 770546931; 638458902; 521598847; 590697046; 156440944] 711762576)
20
+
21
+ let test6 _ = assert_equal 1582855757 (minCost [787044169; 658711407; 94074275; 518527340; 34958046; 505968638; 169866082; 558364066; 996780256; 807172519; 269776645; 99028021; 824248729; 776042943; 216887087; 637195070] 76134123)
22
+
23
+ let test7 _ = assert_equal 26998829529 (minCost [344462152; 518399184; 880998883; 58782508; 790383971; 864942378; 59627709; 567315136; 855963427; 547840897; 151786106; 589178272; 308159637; 581325866; 100244626; 283608608; 931355483; 328502929; 930244029; 511510575; 46817944; 5338318; 157404917; 815197944; 325433842; 84231679; 748075803; 828287903; 8387073; 251955639; 575094145; 607580139; 154192555; 980508200; 93058551; 290680967; 657705472; 779852865; 454998097; 123457301; 994226095; 83038978; 379519601; 34603979; 963477073; 951008106; 468889481; 735796466; 764612791; 469426754; 434955762; 908077968; 564363547; 961088234; 682873684; 8497475; 439654182; 650932583; 822607245; 432758275; 58649489; 227528566; 576808310; 504387581; 9141019; 328214886; 578952787; 395355360; 245225549; 447453961; 540696166; 698804759; 183421132; 444162781; 463583501; 215760045; 682405797; 464452971; 647603901; 729797926; 812157873; 602698965; 73213430; 241471084; 115633527; 517757700; 752877919; 21976531; 558811947; 243850752; 716695544; 873580098; 635786483; 210826307; 939935933; 598383482; 825557738; 774316246; 661754805; 227134150; 514056456; 257448674; 224162661; 21418403; 606040140; 973723153; 519156314; 231883583; 879163585; 930007110; 41100278; 883953923; 154520847; 597963810; 962106202; 700236450; 369521824; 226023028; 227323918; 826345463; 930965437; 793193291; 676334092; 618862703; 201686699; 164911651; 946358967; 260389388; 392618184; 819534507; 277812808; 786004237; 182528976; 553686390; 686545749; 676005740; 27831442; 63870888; 499080954; 754947669; 559054420; 393642239; 338923114; 314311653; 245166285; 822129996; 847529195; 508783637; 196238488; 363779432; 568657291; 520788279; 88677710; 850428026; 912347444; 45701807; 105229272; 725063713; 35840745; 724133111; 168414756; 905513219; 712188313; 173025450; 778275732; 382790428; 769256959; 593775855; 478944403; 965141935; 397605536; 40816612; 637701620; 549543044; 303433120; 215515311; 503344038; 960503392; 125927893; 769639350; 172198738; 409886942; 164086343; 113582093; 41507235; 545784551; 482214174; 467822998; 483866501; 896380206; 105958129; 706589928; 680575992; 634970221; 960229785; 620362142; 439456071; 599007767; 130298623; 832938662; 43415045; 722595762; 126902357; 90494682; 949523086; 82424995; 634896590; 726282247; 750641246; 388095389; 416810383; 994674254; 378352116; 873605161; 455838986; 860091491; 817685439; 568558790; 57511057; 161342889; 943932858; 65932576; 346817904; 235733593; 728594621; 30865080; 399700749; 453468943; 126122076; 948908980; 65180579; 604714248; 997164443; 236228594; 582895182; 45770372; 480498668; 621848783; 607314949; 10806189; 903237607; 863301456; 973198812; 245329831; 648047559; 714954589; 863828161; 979659644; 461579152; 369928711; 588770319; 843757700; 682203634; 900715296; 880849515; 545693107; 714620921; 40971249; 110073571; 770641488; 563878597; 346083622; 828750480; 856927768; 424639975; 408252541; 171924937; 802760742; 256395241; 643004100; 768390236; 991956218; 296222942; 143467579; 201999757; 896876919; 540599326; 480775018; 511058071; 937205711; 585056180; 883135618; 958680743; 281901385; 675368724; 372853006; 362078981; 528829438; 51328736; 163429997; 235123483; 190318944; 637447372; 747076884] 923775125)
24
+
25
+ let test8 _ = assert_equal 20226095086 (minCost [73349594; 18843730; 656162099; 684433155; 13226514; 423983113; 765687789; 430398257; 290509135; 322348965; 704207495; 34083908; 444200690; 638623723; 123907037; 382686429; 965558186; 342527130; 335924564; 65126042; 236371836; 222790206; 769928664; 119302029; 202127738; 435994086; 923453752; 528400152; 424391130; 235187596; 600339609; 753668297; 839119919; 751070429; 960075585; 7443942; 315154950; 621732343; 761189424; 184642820; 6940890; 911063475; 622641120; 85837377; 647396778; 141505681; 155372287; 730012489; 19728620; 531023860; 497632163; 894995511; 493986159; 481463655; 464892392; 239820032; 703563390; 722067825; 951236797; 336243873; 735655408; 465794264; 984129082; 625906202; 636956521; 914338016; 574701587; 671935566; 318342651; 94987502; 202931506; 516517643; 741936417; 57957476; 452167236; 578276004; 984604893; 16441776; 630976802; 51106781; 10550039; 669962123; 163713000; 773850469; 174025572; 19518653; 803145634; 456041045; 665634843; 522308886; 13632988; 154974854; 408444011; 911628704; 815814669; 77224893; 201349904; 880612586; 270004008; 106408714; 384828990; 507309355; 719140605; 821135403; 191687935; 701390846; 28685387; 630615649; 537644452; 751047535; 154938223; 331543854; 197067061; 940909520; 355795924; 14509145; 651762200; 587458258; 484319565; 917779060; 415827282; 513921628; 914906031; 166196268; 842168971; 998767397; 7573687; 610972943; 443117447; 722028433; 265517549; 573760125; 999309255; 255415904; 194384066; 893465569; 183403744; 696356290; 952114946; 608950454; 502596164; 397727286; 954670358; 625244598; 702843032; 314343541; 437085433; 386707815; 565335822; 710263874; 646685777; 872220555; 672937088; 707892514; 383335678; 236236390; 190265080; 70402226; 366573021; 562865179; 261285052; 3700697; 872631939; 198644504; 291792136; 538177704; 640419422; 707052052; 837799811; 815449212; 630614876; 887573826; 897050840; 362042929; 217897115; 394668900; 784700760; 643836345; 181168174; 804953487; 647075184; 165049474; 32815617; 543536977; 212929493; 50279732; 623608418; 239073892; 144937972; 563184730; 240238830; 775112043; 315162273; 117661248; 483406074; 703243135; 679067137; 387049486; 651492619; 354753372; 575529134; 90845560; 155269823; 22092039; 862123307; 839206152; 88616784; 167034756; 97526490; 849611811; 198993990; 251914398; 384588694; 905944714; 883034767; 784758384; 973611862; 624994894; 53369112; 853961830; 189454111; 271256998; 600621789; 531461318; 455681286; 520992070; 295625425; 384414422; 420115385; 296758306; 594698057; 138773267; 123286126; 854994720; 178519394; 640778402; 404595870; 614558314; 856935997; 960452945; 967627809; 388397496; 376852547; 493499683; 111783177; 672310267; 647841265; 150107407; 4495301; 705908698; 928143684; 32973296; 775142042; 408153744; 409554005; 243021330; 426843036; 482493139; 996562109; 42338808; 744645558; 673456108; 378467098; 70425411; 436583117; 933504242; 649105661; 46890228; 849154185; 211088391; 265724624; 924861275; 927416441; 320356788; 118361154; 221637134; 809648667; 168490818; 376611335; 258007826; 956777719; 494859764; 643298863; 809609644; 883143605; 296259859; 529825461; 132611244; 485211769; 72473640; 303172197; 454007012; 845518819; 104931448; 318878344; 383003839; 347917497; 932306982; 978390636; 592335878; 722712031; 526240979; 731352897; 980715070; 254951708; 829051841; 729086263; 450990429; 110465367; 501062798; 406925918; 534144256; 557255755; 96280574; 93145647; 657967282; 71730074; 333603029; 524777672; 636573501; 120897119; 605136947; 7377400; 985615489; 739243993; 26537612; 302341787; 908823001; 761317801; 451723953; 869586374; 226229063; 579168227; 269828521; 586368858; 496389431; 556338345; 14756943; 354283251; 637955569; 990906843; 836736825; 175354731; 503885388; 244336323; 672802997; 416820981; 936718213; 255797520; 133449123; 645010808; 49835670; 909164966; 422777047; 184975250; 312411268; 723050455; 546280479; 276902296; 161098314; 775967898; 24348724; 672173236; 614667415; 749864218; 291502550; 258298788; 17262379; 449988340; 927371862; 890798513; 607960434; 936461075; 799552118; 630600884; 200839570; 182107734; 604048147; 670931799; 480546175; 506087151; 139410620; 829107848; 532317558; 354990881; 76968365; 140452440; 182527920; 233832630; 343975090; 424646397; 646544034; 637284632; 570979591; 783688356; 661354722; 627948934; 267455362; 677248686; 86661979; 742295338; 861265849; 115214081; 188361835; 342823825; 616312559; 548653470; 324605972; 674829250; 440195763; 874502545; 570058500; 699449831; 28108906; 54977773; 853008032; 607484810; 3221800; 173352506; 410061895; 989622480; 369017478; 246336327; 773272471; 842869218; 949507509; 972025944; 71209074; 68314616; 338213857; 991161332; 948876355; 31966703; 428909990; 851756807; 774303958; 782080314; 333723847; 863069047; 605737832; 644392736; 779469280; 542434779; 440255903; 538968929; 795033940; 950816010; 661986297; 367698122; 459297080; 801275661; 281662342; 447720137; 776593612; 896748278; 358596579; 432030875; 679262946; 676719267; 48500356; 499805070; 908012839; 283255214; 234570167; 351017562; 615060968; 871533898; 815124175; 146977924; 629942640; 409316288; 569895198; 272313379; 624750713; 295888774; 380179233; 620145975; 342605675; 196803090; 902674568; 627986540; 784793585; 681393196; 423105551; 467646957; 905402213; 940533796; 421660018; 764459173; 113627796; 96605240; 370072833; 624831289; 936206722; 796985376; 903024204; 678640983; 375613088; 858967151; 77859555; 672848621; 169844863; 391182217; 835055732; 154983357; 145374404; 165291938; 991376810; 580313916; 54018078; 773609970; 181741592; 389040103; 846012116; 45604765; 537558344; 264122183; 38893507; 386085740; 223059408; 856985578; 516461823; 753092701; 735302582; 732634831; 422281959; 423584239; 219528395; 796163137; 800471322; 113305943; 603235381; 612651224; 637441236; 232603244; 123505898; 506656131; 395403933; 427109971; 784114229; 780405280; 173156464; 49085757; 415133643; 834774864; 493630071; 669480906; 249310740; 919428187; 941742614; 906521552; 698087954; 857308532; 313804315; 557037327; 775171539; 983462619; 940334019; 852591; 776107103; 517637924; 242339225; 467473999; 40899203; 648483641; 175149372; 390700334; 859635637; 822439571; 296097567; 914589363; 825216059; 951898853; 273631024] 242057952)
26
+
27
+ let test9 _ = assert_equal 38202065813 (minCost [425254684; 789699586; 176719709; 591540453; 677519448; 616408960; 419232769; 23023996; 335980679; 344379396; 678299390; 263176889; 94432418; 240120911; 159472211; 938490883; 839999189; 4546566; 67516685; 511857371; 148666704; 655902630; 785808493; 859139571; 28047068; 797282432; 991186450; 695919791; 182168185; 527562205; 691850494; 384384258; 39169180; 813590919; 814732776; 759889358; 3035120; 102478272; 770187137; 140334385; 896055107; 707568156; 497675460; 357679116; 850690716; 573027688; 16533059; 351210689; 117787744; 182515717; 559001924; 554601274; 911889785; 70201541; 697573069; 135554601; 912690408; 128329873; 361174463; 230256453; 574178412; 467147258; 4856529; 135166876; 604677104; 511652464; 907273319; 297487312; 819200135; 281037328; 377127950; 63398184; 623461021; 106894227; 502861730; 226782101; 675316836; 453350447; 544994049; 773834624; 481798977; 300205006; 233766131; 912613057; 112644316; 164606959; 468495271; 566816331; 91982538; 715343397; 720522899; 471213495; 224887693; 404226009; 113178174; 203243240; 4269437; 630673049; 89426618; 565527200; 368913199; 267084861; 863912404; 462543786; 12372219; 5438409; 378502188; 660576138; 913732767; 85750613; 888265816; 559182003; 910568422; 28860277; 948653182; 822536317; 201946566; 652437976; 808952704; 494798358; 965001211; 322193897; 654657859; 958530365; 482857021; 646926613; 428943857; 663145331; 214875780; 320149268; 491565929; 223652882; 965967912; 797841028; 930365706; 557185354; 797477294; 67710036; 413032144; 264776605; 235407699; 434335266; 732994983; 96446728; 455721547; 514527609; 950127861; 724688686; 918652338; 307023695; 518990699; 773622737; 933704889; 996275150; 513288590; 727191531; 398789874; 710672536; 316433984; 202737333; 644849163; 676102643; 293708169; 655237012; 166865611; 820098044; 664066712; 789760179; 342957626; 514949020; 269455206; 211555235; 541913607; 110928789; 792085550; 734577571; 427436652; 753654844; 194452851; 505545602; 352202349; 327112155; 561250025; 768276031; 636342581; 758985283; 390985568; 263570962; 194375367; 395440200; 495840427; 58774402; 98218434; 426326706; 508172289; 153870038; 306105453; 847398190; 327447886; 78364594; 332997036; 883837624; 780351821; 798242039; 931220599; 251576138; 593257224; 838790815; 52902269; 503421841; 523967558; 813212807; 747409226; 574002128; 432487337; 235365263; 31103775; 895260314; 453465220; 180199053; 859932439; 364960946; 85070788; 617167468; 389486148; 445918510; 680415189; 818057981; 232439179; 474617272; 590255109; 142599749; 64118808; 501542620; 670494388; 716365631; 985540348; 719256170; 905126716; 711577324; 191090139; 741298133; 170161685; 176972818; 177189726; 932226259; 631528724; 52089355; 486017688; 740460553; 997735237; 760123498; 553932613; 117747134; 161938075; 74399538; 960947525; 59269061; 633412512; 972348172; 167509535; 312357740; 568480786; 209674666; 652764959; 479611869; 789666363; 221193008; 647337833; 175735089; 271748430; 955155222; 340369678; 561837903; 936456519; 69196640; 330737103; 765929344; 653780800; 268635731; 647452265; 862903616; 337490707; 682267666; 937869467; 193371976; 158297483; 512602206; 890702600; 501716782; 980795913; 235499200; 310692588; 854514569; 512199021; 876598929; 609346426; 795761691; 215361076; 867754311; 293637541; 101127129; 878403716; 932412582; 520160573; 896453637; 986067302; 890246247; 987127082; 891485096; 41910843; 841030374; 306347047; 731922429; 834480153; 388005387; 267583246; 446779090; 847363676; 197066135; 768542647; 304404255; 765609402; 604365586; 90280380; 33947293; 295572588; 927772712; 575031317; 841815358; 669801948; 895931334; 666251251; 447271358; 339150153; 439809087; 636966421; 95073189; 120094864; 724216358; 648466512; 986214841; 595756994; 764585991; 797784250; 474708845; 489984034; 950834912; 280187025; 334690121; 311728535; 898742882; 827078115; 243072688; 160602464; 89648214; 757439879; 100451964; 694253263; 632124432; 459858292; 788649791; 293541649; 563865342; 923252753; 634484805; 322121510; 93809928; 345839538; 662243652; 456525176; 623974163; 785269305; 883270483; 76633116; 722777797; 527318058; 861039004; 680285242; 788678069; 203894403; 396236442; 372152348; 298957776; 573257661; 781041646; 518381883; 579993382; 44808192; 45109649; 493383209; 495025827; 892958739; 740817392; 951458279; 815011652; 330123825; 179500137; 139072840; 562610724; 218756925; 35859717; 393250151; 400482915; 334959185; 258768509; 667717124; 951484453; 334834725; 741240644; 899249177; 327641080; 601496982; 388984457; 105618491; 340997278; 423756896; 267133162; 856431025; 907599362; 746571907; 481426513; 548514573; 173662619; 468385700; 19040270; 351548924; 994224480; 232805696; 727821318; 877223237; 792869903; 921258903; 706694601; 610447468; 224967562; 414877357; 747172222; 222822165; 661604802; 565788675; 204464935; 991018823; 663320318; 914249489; 274261090; 558532339; 988264704; 899150808; 273016201; 883776958; 929684339; 750331359; 387490482; 471376870; 4053263; 788329502; 944166978; 507839185; 82845531; 432931248; 930749176; 871084887; 317753262; 596219785; 252234046; 570869638; 477302307; 532492662; 300727276; 43884252; 42304032; 408076532; 273926677; 483758410; 20198442; 858005202; 880633274; 966933985; 586522266; 319203090; 221985826; 824306772; 974977024; 788528887; 472311030; 365740922; 383050445; 633346853; 861784603; 518183650; 817473830; 176401317; 366278232; 564913272; 686170203; 675190887; 337693240; 143185043; 778292312; 679519713; 921758497; 576385503; 580218368; 542333146; 329396899; 695513889; 909191076; 526984661; 976129039; 154175602; 905568777; 764017252; 510986855; 523706197; 700014178; 118039873; 795143461; 610107704; 721914976; 118570932; 117794381; 704610359; 889180603; 124792373; 359394026; 809447775; 785449026; 844132069; 339380796; 867992771; 411744195; 393904595; 194894207; 874153231; 185524799; 878957794; 913051145; 532607726; 379002718; 439219160; 931097818; 559998096; 136201558; 372537584; 138104349; 138964900; 563850467; 449537477; 796958697; 158059824; 407934489; 174240304; 933645503; 94807416; 618651469; 258850185; 756310129; 418751161; 551198232; 895387254; 665580405; 12182957; 764178494; 434565709; 550431683; 560104936; 304856602; 658879860; 754218462; 520641117; 839060875; 867092916; 448586770; 725567540; 457885159; 862153220; 320392649; 608161970; 717286295; 889436722; 707629508; 887288338; 640124949; 246461851; 447247431; 61944920; 458072743; 22059319; 760585101; 812992620; 94208476; 179234940; 154388424; 746816071; 868196869; 101689701; 104237654; 169539607; 449668579; 243755662; 1538021; 811676805; 453334006; 205183057; 274742668; 667838343; 111946884; 962125160; 169152381; 164757107; 820778605; 40608265; 833933113; 597760325; 733832682; 34725313; 750514380; 648265931; 39369503; 423306694; 716955111; 599282441; 843946040; 590277616; 978431349; 468703128; 319783020; 968032855; 121112679; 322647094; 532683175; 785682928; 563305425; 807831834; 993492168; 280461808; 110696119; 18897288; 439523902; 568699607; 133201213; 670941319; 84754153; 482824980; 595587070; 177164200; 296358001; 604354785; 82842106; 433923044; 915933477; 448880627; 60737025; 418176514; 362936073; 563805258; 68570912; 404353998; 186126991; 823995182; 172728738; 374855658; 774614148; 120429944; 126745046; 931336076; 820478542; 980493003; 113784768; 717055260; 72269742; 42644502; 361627105; 567929817; 703348957; 946532162; 730642775; 896565553; 245687784; 678886682; 796306620; 618830891; 70806116; 880226499; 743923745; 402031437; 585925331; 546959035; 694849664; 450106285; 498504148; 164995692; 97797831; 201780478; 101383412; 837310657; 452459656; 80216301; 958261341; 757410412; 388221532; 299764838; 191388302; 107825463; 933699557; 946349222; 189743058; 905413045; 618057814; 595168624; 523627016; 701547170; 742272892; 523647710; 893526925; 974602185; 597983769; 752832519; 199225694; 398649835; 390751544; 126116328; 133778449; 844667619; 483019918; 921255724; 963507932; 531012367; 107268093; 619054525; 669392857; 754911136; 749025261; 84945136; 581497114; 82766065; 207819127; 638553163; 92480875; 384365757; 323053687; 5335950; 908997439; 398885318; 542185510; 508718168; 73800825; 936205007; 413642617; 440819321; 216651241; 579426546; 168774394; 637442179; 952984013; 526897232; 719833277; 592277078; 919016023; 589278432; 48295221; 928897773; 117537829; 220773587; 761919328; 37246179; 481792597; 518672953; 560915046; 22325812; 496384293; 129782091; 333684424; 277361475; 413749111; 307133884; 17027839; 948783130; 90125010; 23914083; 686549723; 758164487; 904698606; 276543444; 507287692; 774063218; 523462132; 996476226; 727343657; 632688181; 982638228; 945078904; 694865378; 512178539; 65038175; 166185516; 973025316; 31273959; 719119487; 709316127; 988643972; 659087929; 442618137; 694169527; 144824914; 355679957; 954492231; 42099116; 664835628; 784690056; 824238517; 609449964; 282716011; 878462139; 751283952; 603802723; 984556230; 402594395; 767982778; 204132253; 817564239; 841983787; 708680912; 507695129; 193801617; 315453446; 27054988; 435496777; 288750174; 452232102; 262241270; 781900442; 701528289; 210605476; 809292716; 244573828; 143639996; 796164060; 268977976; 928924013; 143457554; 337780952; 697284710; 629748888; 488316226; 821506584; 972262198; 449040254; 555479004; 684372077; 370007796; 895106216; 576169014; 432416051; 693259707; 904504326; 373788784; 187447211; 576781174; 42031404; 212913198; 323940113; 545675325; 66740570; 768153458; 177686137; 76583477; 433055702; 306097592; 351369454; 26100261; 338661445; 552403268; 444444517; 361464398; 745902080; 368071382; 501669490; 881056461; 633986960; 92376521; 447312538; 322056866; 952126970; 132907180; 779437822; 82777802; 399448521; 884216749; 755285575; 294926371; 583851237; 576562945; 363823158; 450600075; 424313903; 786756845; 317550027; 247481030; 676669472; 739666372; 222690360; 374740931; 135111876; 831106891; 173398375; 577965686; 270699985; 58752635; 177661348; 285790708; 594167835; 460062379; 573540212; 749436637; 67410690; 317300888; 271813820; 576195472; 605875333; 712345746; 648327215; 43543676; 36471202; 521878399; 852729858; 17090846; 599089449; 442278455; 32560312; 613125160; 297078716; 860258691; 811901814; 360235499; 621345610; 432328080; 940026951; 730048267; 330424156; 17400432; 844934671; 14136916; 717972741; 55003792; 820767376; 221871409; 622212918; 528119283; 82241353; 61944471; 527338055; 463757456; 95879940; 952855769; 210255149; 443105133; 83188365; 785569758; 243451089; 99791535; 946058739; 28283302; 232002549; 484217223; 351357885; 399213220; 967524989; 671336735; 293833515; 344303480; 125877988; 538086241; 472786797; 821425810; 319486050; 263760956; 237070956; 981210255; 295774140; 34348328; 439119445; 334466056; 144458817; 954458062; 131551735; 564453968] 259451167)
28
+
29
+ let test10 _ = assert_equal 16431925969 (minCost [124245873; 75955780; 633127073; 728554799; 702034054; 402993725; 717230559; 16860297; 492577281; 16436964; 712143779; 355646013; 159972585; 117770220; 682541034; 219463735; 147207383; 438732138; 994635148; 331829971; 27900128; 37369372; 185022842; 577089026; 288940703; 486594905; 921518205; 820012207; 69561028; 352390633; 211662115; 696698115; 803912393; 23810250; 777857427; 541256593; 988678958; 704733041; 658378828; 972699575; 295488462; 341912127; 166946417; 361596377; 300388702; 784469844; 292444355; 309247322; 858211651; 490583267; 763993876; 501264277; 978880909; 402628899; 714711300; 870532968; 715863499; 262674265; 362112034; 858460662; 213828071; 849295993; 735012872; 944321644; 92991605; 423964107; 76272008; 709135907; 621066326; 717860988; 721506519; 963552166; 923792565; 376591237; 585106572; 939674255; 75263353; 597772983; 766852186; 401283739; 644467102; 38315339; 760440116; 504639943; 827469897; 247756798; 465946099; 837376165; 484911763; 640604378; 334814053; 345949067; 458981570; 526582055; 83643997; 220181839; 547030720; 579293773; 550506031; 122046120; 168587439; 81342864; 968446082; 308934323; 111859331; 904843644; 719670892; 692297614; 75835822; 584849108; 789195909; 416388718; 59644069; 347858663; 364984072; 416605344; 595959258; 375938558; 953808489; 144260086; 674623229; 758954183; 112293134; 355381781; 206101115; 443198149; 923857137; 617454551; 906698952; 639085908; 108568919; 405413379; 594331625; 59580094; 510105774; 766130798; 725674904; 456163787; 997152059; 614234347; 272115329; 603748719; 556676795; 400971309; 608237716; 987506677; 271636102; 986279922; 272281664; 483918831; 748158773; 123246089; 597991905; 122991471; 883107682; 690523778; 111441420; 985334622; 60126618; 878352729; 998910312; 933268653; 321848930; 703789061; 397146113; 271307328; 822718762; 618483952; 144680132; 757562788; 219358090; 290126496; 452205143; 650888051; 613512169; 782107061; 467386012; 548448277; 28462042; 837568606; 974692004; 145608583; 753231980; 563281193; 653831799; 407639373; 375700663; 273214709; 794551559; 193634191; 478905466; 517023355; 680754845; 573378852; 167394151; 677321407; 783970886; 223792378; 747350280; 580510494; 106309832; 880414468; 326612387; 767420014; 88404698; 242531875; 486923093; 326240231; 616072361; 596127398; 554600865; 206511541; 498348651; 799334590; 136603748; 827079951; 594621676; 450432942; 109417203; 823346777; 718531071; 498771659; 884911933; 742876618; 314162349; 465714176; 863018670; 862797123; 699580015; 830343252; 984973055; 195625092; 317482908; 180973130; 202058618; 129908926; 480389216; 589967600; 990590791; 529855446; 87621334; 535498111; 792824787; 587719554; 738777889; 885484790; 953584958; 73679405; 156493973; 710135956; 133306846; 171648672; 451574675; 568678770; 15433889; 652623981; 402564876; 722596134; 38482508; 898274496; 918778262; 556577064; 777043028; 49420358; 973411966; 632761678; 832220139; 234232561; 428705356; 898642231; 617301353; 307310155; 434648934; 633841927; 871204202; 291106737; 707936; 128651473; 64817645; 211236154; 72426666; 54907852; 746421739; 364219499; 637803277; 140550432; 504005436; 926128153; 950986769; 250898385; 32451282; 431920859; 829558745; 887165155; 600359318; 404158049; 18602242; 715753; 175442028; 75845363; 653871668; 961395823; 111735912; 544612181; 145381340; 50498556; 9943351; 564783402; 613553542; 247999588; 179386883; 358295131; 244858394; 982976366; 544323051; 549374625; 846934908; 632011736; 411108229; 45023874; 607111663; 918351809; 746696503; 273389877; 635021086; 935304185; 213266408; 459592421; 641419508; 202658807; 488697363; 836031151; 392244797; 331378822; 834982560; 917713677; 295616661; 423620736; 102951645; 275922289; 226258919; 917161295; 176514800; 566834457; 47259829; 296132360; 72959007; 578688971; 376055940; 525741575; 413470131; 982638878; 858730962; 282615178; 795930180; 123593499; 624766813; 640755873; 303661608; 333318019; 347154032; 481264173; 208245567; 917820254; 592078100; 906796524; 131952289; 856218039; 951978357; 754987567; 294139702; 837754745; 569592942; 590537612; 334062402; 294033448; 161333609; 981780289; 908851943; 475013028; 982829683; 411380151; 436754169; 542070151; 385148996; 532221870; 354067379; 741370327; 711168168; 465159254; 980008539; 831737444; 323004804; 893406924; 766373768; 784319469; 888778337; 763367930; 778751875; 262073374; 74186556; 342756180; 421198552; 738033005; 746781375; 330543796; 667104546; 431850348; 136818269; 817596268; 663429056; 246412427; 67351386; 796694562; 75996084; 456272283; 501807449; 72749648; 477043911; 947244735; 997213728; 266023228; 744064039; 499088459; 862113670; 439465442; 979063837; 331482710; 657570076; 894138491; 866811624; 514228765; 898599592; 42703112; 295735072; 133017253; 172431472; 753481202; 110726989; 413764133; 232754212; 845194710; 25427623; 615627867; 385957522; 120257860; 808826815; 833728829; 782675620; 235562589; 6931112; 571410266; 26841058; 771321103; 676335778; 92428604; 389421028; 316270520; 928759317; 650881661; 546771751; 594053186; 609416110; 317315321; 41490708; 743032983; 465760694; 385858016; 330387441; 402371565; 746021659; 539052584; 863394909; 214451730; 876580813; 660007577; 474150439; 138647681; 683129465; 942547626; 799193507; 953078977; 167506998; 49539148; 319609366; 730890879; 361511870; 228641747; 632331146; 490605536; 362120407; 476520993; 789919715; 407205225; 862012392; 474066351; 769820755; 953539751; 55297607; 261579818; 404238042; 907070109; 207901824; 12020610; 74905694; 9150712; 86239973; 401194175; 280600545; 332909763; 37729773; 468283270; 588395343; 263486191; 532647780; 152193230; 885590009; 469463587; 561125180; 735579139; 488407293; 970633068; 169159420; 660655527; 907149359; 395473581; 997106588; 631626510; 483230811; 842998033; 345871638; 389093621; 710135277; 975426072; 863950616; 547652757; 709058723; 705508293; 360850487; 581297115; 660245460; 703369190; 84908253; 728141414; 800217458; 830152928; 743160850; 107386123; 338636446; 673109827; 669873849; 902938068; 991431640; 258735947; 581604189; 926875663; 724668508; 60884433; 469669539; 337900084; 244790671; 903980489; 332822674; 1597578; 990411949; 171242766; 464017415; 710955726; 326231732; 823694032; 651851020; 570569249; 511096465; 348115998; 117903120; 498186537; 807894740; 298964650; 560020862; 604083568; 46904318; 972618569; 475635570; 173084259; 257055705; 16439169; 24578684; 340857244; 384014626; 975264570; 97941276; 456680502; 89366516; 151087392; 354033134; 935653830; 58855864; 153134855; 189012379; 847441631; 126475735; 593706146; 941846268; 933169078; 497259128; 894057459; 564705099; 575019210; 131331240; 166936338; 932350180; 588192970; 400889087; 428059480; 187803129; 91647471; 650217479; 673209589; 549896447; 681895109; 938148174; 274116332; 750418722; 606153389; 764335078; 573500512; 694180634; 113674150; 621126432; 207083602; 298407480; 870555774; 37434811; 128171873; 116543456; 500080829; 210044437; 764954779; 216867556; 361972709; 438881658; 155071687; 400182604; 634579529; 459464118; 501143486; 618073929; 925822079; 969174321; 760578700; 659118214; 203148702; 413198307; 227715372; 65922500; 330923511; 175824753; 669851770; 630683497; 796635231; 535131576; 66872066; 940786963; 753001213; 191737835; 819988404; 14453801; 516256792; 542615413; 727600290; 522885219; 910506184; 493819072; 322198571; 248052109; 162236759; 857210112; 997799611; 957721479; 987973295; 17465650; 237422471; 781188645; 667566220; 663842552; 456028091; 828842240; 162777856; 701088514; 673289246; 69628167; 598757300; 580194236; 431890813; 412769490; 293677065; 383014358; 584204387; 198722183; 983810666; 938949893; 279969120; 358214385; 426502614; 970149759; 60525544; 650400593; 980511761; 637252690; 686629979; 249234267; 842555985; 574832861; 893942413; 929374087; 556122008; 550539274; 566624888; 881919529; 126158641; 666898253; 841076358; 797762072; 461795586; 483662843; 723990935; 788898317; 743573168; 662323787; 765637980; 42283755; 107529430; 373116047; 515170745; 902523414; 64317041; 844686994; 52360279; 179907927; 589208161; 333430287; 93330963; 401619712; 785082414; 948721620; 408959616; 972814408; 391845949; 138448654; 17182111; 707488060; 613642930; 547428118; 640721952; 672879530; 810507570; 111828889; 628373703; 682206063; 744672244; 961994461; 433116380; 405537997; 20286310; 627710656; 963675797; 429800329; 887335963; 331696231; 101080149; 771106583; 887818809; 931675270; 397915336; 360929839; 465935337; 560724816; 718905356; 622190034; 931409575; 519844550; 207818770; 75630137; 192787078; 227176214; 242792853; 917745866; 745416604; 827090690; 612847249; 732515032; 101634729; 912706869; 591482903; 413254308; 67910699; 151657165; 851432522; 612649273; 623066007; 771117193; 422135339; 115291846; 181496065; 911927095; 413816783; 443490981; 766104857; 610303291; 412781820; 40298545; 901789274; 386397038; 941601095; 527354722; 209232590; 826931376; 840959670; 826945397; 774561987; 298400800; 993747396; 873714792; 273158928; 933649052; 944833550; 326005025; 796375942; 329814298; 791199198; 70270375; 251468776; 449083571; 595167500; 5912643; 934868603; 762291277; 574514660; 915073327; 706290988; 538338078; 121579047; 930408501; 961501726; 720472269; 122644891; 315183685; 614013223; 630600910; 936271287; 132325306; 329074227; 611391723; 738993005; 24780272; 106741367; 186089088; 257542763; 580346308; 78197151; 866636383; 915165040; 637200475; 179140378; 754441528; 479361100; 302755233; 554385033; 778512279; 563709831; 723108200; 261122832; 888714801; 21411887; 14799093; 189683303; 92932032; 531227; 183403347; 742832224; 799580047; 471544539; 16166225; 879479632; 796150602; 934108151; 453844881; 798597493] 66717029)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for minCost" >::: [
34
+
35
+ "test1" >:: test1;
36
+ "test2" >:: test2;
37
+ "test3" >:: test3;
38
+ "test4" >:: test4;
39
+ "test5" >:: test5;
40
+ "test6" >:: test6;
41
+ "test7" >:: test7;
42
+ "test8" >:: test8;
43
+ "test9" >:: test9;
44
+ "test10" >:: test10;
45
+ ]
46
+
47
+
48
+ (* Running the tests *)
49
+ let () = run_test_tt_main suite
50
+ end
collecting_chocolates/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.minCost(List(20,1,15),5), 13)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.minCost(List(1,2,3),4), 6)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.minCost(List(195199014, 984800196, 607924423, 36348739, 813130315, 153065099, 588296506, 617132062, 781027683, 116629882, 581208811, 569440617, 870838107, 939227748, 574241627, 488909059, 479214749, 920077184, 809104907, 97812621, 739489242, 733086437, 654080955, 987436545, 140526391, 372643245, 149983222, 229866605, 912832555, 986734995, 161610887, 660721797, 431179104, 37923818, 337467714, 344568419, 408880028, 298866142, 586368843, 655456322, 182642371, 81945619, 607613577, 887811013, 626376923, 715066277, 27312739, 242413291, 491056317, 626066721, 329827884, 51373087, 377603455, 285888257, 289189990, 437036712, 51492615, 773483380, 273050223, 239823783, 178687773, 86195843, 311103091, 513170145, 818474194, 861218557, 673632638, 973212016, 990596428, 584797315, 390187131, 16063215, 671830121, 403723544, 368926620, 291577238, 836588088, 603827758, 2606594, 259323471, 249091497, 372920588, 781724843, 390173853, 817933194, 302969239, 164540460, 652257475, 452847149, 751974372, 417340325, 609385790, 325428582, 5518899, 689255278, 306884488, 240441423, 990221737, 127779717, 469798221, 809710543, 76651043, 114721605, 811337085, 838269422, 210573940, 550804251, 151059732, 963856152, 454169768, 649700828, 863499421, 666400114, 739255458, 148479307, 810214197, 701169766, 224247585, 528904494, 677094434, 656368211, 964745763, 285343955, 354199258, 604592293, 84075276, 171162476, 198006259, 792771994, 921766273, 513057436, 442342857, 393647274, 928913521, 129759381, 926801252, 382921119, 590703484, 947689972, 645597832, 80489849, 402504867, 793560817, 304668159, 752099804, 272063343, 237287828, 311417665, 110016486, 391816426, 573541853, 412955906, 774375508, 988828191, 529616010, 365784851, 130714687, 625023361, 51870264, 3921080, 970552943, 831690784, 304632280, 163415864, 945698689, 992319209, 607764312, 916603382, 69904958, 529364651, 877540295, 742675142, 217211577, 929501124, 359606819, 792089571, 628840547, 470317204, 245666470, 538467321, 542525942, 301217535, 254924657, 494655010, 462250827, 480408495, 21908896, 994013811, 32823489, 900377181, 767397312, 536885644, 109915622, 739194012, 394242870, 281165002, 684530302, 642378737, 252917803, 289701811, 920316781, 561202250, 485794592, 985927864, 452933034, 396341427, 464970466, 650547832, 435718719, 407937592, 825524338, 342161946, 794783327, 78363130, 758859001, 339179672, 276222116, 331080978, 355655498, 529702137, 246833303, 444240535, 390433754, 383207254, 685984136, 776310837, 971712059, 291328757, 498988370, 944595442, 210158741, 474588291, 728452333, 327892670, 633123722, 280937805, 961564731, 896302261, 364818399, 791196212, 678626404, 702912193, 966940719, 697837937, 229233322, 615904816, 142873499, 239716403, 88386028, 814798561, 518353881, 498482718, 458907246, 296617630, 685054486, 159771808, 423294860, 494014169, 150924742, 12436220, 755400713, 258190124, 65531288, 454041355, 221518994, 860222475, 932970280, 531681169, 602109256, 585029274, 24112250, 832975854, 702277613, 886158293, 993671856, 745950250, 9815904, 428057692, 951726244, 182913765, 886722589, 752178138, 941397089, 754737490, 328291852, 179288814, 959223573, 523585699, 542035645, 184733133, 198371804, 304883176, 998452141, 124524129, 885584699, 481174985, 616696757, 593324918, 454968615, 52844661, 970336457, 59652415, 503863689, 763412487, 318086037, 431678900, 772961494, 379979411, 748770602, 564912364, 176131533, 33162653, 811147845, 911170860, 147574219, 147811026, 152613327, 313470576, 67773459, 635593023, 923663369, 940797858, 353228924, 894589838, 113893957, 270912429, 810499926, 343383832, 999461432, 428879623, 882203250, 137842711, 963733831, 228328390, 388609130, 444731715, 876905523, 820643216, 292901933, 300114876, 646370184, 139589078, 173813411, 641490002, 511780675, 138009273, 168326041, 455523429, 577968590, 822486887, 206628466, 406962072, 776818543, 243949136, 773326982, 943666446, 751147131, 535649421, 445290504, 493015215, 441504843, 460178556, 176659001, 966315793, 622966118, 99102348, 959671731, 489578182, 700131590, 692678432, 843997706, 84316992, 295052242, 553321387, 675541223, 343432650, 389473733, 370807758, 385237489, 945158723, 227527971, 875594740, 125454021, 423896252, 15560748, 6210546, 794287516, 458892965, 645223642, 996372617, 537229661, 954211580, 293738043, 696027865, 46737506, 80039731, 692608133, 145885645, 560041641, 318623001, 562827220, 742688194, 100673661, 178786795, 289815352, 652188537, 735242308, 734937272, 891739424, 664946181, 987635466, 788629312, 402822043, 955411387, 929766648, 410007672, 377269822, 561962151, 937239079, 13238555, 966880602, 905525735, 233868138, 123894478, 827850053, 613602240, 649224028, 208377928, 317404952, 872164249, 238027473, 603347539, 15913528, 511476986, 60472308, 825530316, 575387964, 10613894, 817509174, 745601985, 316498340, 393598793, 909624006, 14905850, 215533967, 411912051, 984884312, 749494941, 678806049, 509115086, 312513897, 436730186, 622622583, 410981845, 6187747, 240335095, 871466569, 298738342, 753964255, 842764464, 763669249, 726831257, 262805735, 456928993, 921464338, 398268879, 902183475, 491502741, 872348170, 244442294, 715060792, 925352396, 588960406, 463602725, 881739070, 317752390, 709787883, 704456597, 239353639, 42648361, 330506671, 881390592, 270400733, 431217820, 923604163, 199350714, 730784157, 618816379, 390154481, 510752733, 419362979, 7864821, 670638993, 931944085, 877025976, 356710805, 580480749, 523376265, 32536697, 534640272, 658422828, 602869101, 257627936, 19353320, 307231189, 767777638, 116075954, 910132199, 890785831, 112656238, 535125877, 899585967, 212528780, 52594748, 476910963, 702000280, 914379828, 232401095, 815622453, 170806089, 142026010, 974803062, 446266689, 647729617, 141540830, 209984756, 917469850, 366614793, 505088170, 336199776, 458282243, 776726118, 65898399, 588747470, 336803515, 227473240, 807022596, 76282996, 556822238, 890598517, 320719589, 833641979, 274922280, 850612850, 805689839, 350345518, 268524345, 537854273, 133048817, 941825930, 531193388, 234420006, 652476571, 376886332, 471886483, 966682042, 169210281, 794515277, 84541212, 702197814, 294385154, 932048350, 357165852, 106845267, 838294046, 268767026, 768928242, 317757906, 642134607, 866468112, 408162350, 316778091, 315071199, 946231322, 462597803, 803470909, 113477738, 981387113, 350882681, 622688065, 877058174, 707677845, 678125185, 987244185, 416176335, 435153468, 898770636, 739742120, 368770071, 718975205, 132449699, 112157585, 614954407, 277410771, 845349804, 41620036, 459533573, 440667505, 351711058, 51265070, 692281115, 414086736, 582255027, 278173598, 837369224, 134070537, 411382375, 783386478, 59113229, 20075845, 11128092, 578770990, 239563044, 539793169, 405961871, 465019583, 881445046, 379539062, 604898363, 846257377, 120473440, 286543229, 554792750, 360420609, 994274929, 647518644, 639628224, 958244598, 134806133, 982204738, 969696721, 438608528, 684891723, 401247476, 263136938, 690073753, 429568456, 758466696, 834591579, 765511214, 245834044, 5432691, 949868089, 189205914, 182922234, 267536500, 556288860, 275325798, 228763038, 43198009, 626958467, 589408140, 157891879, 191866252, 566237343, 489338090, 316442951, 378261638, 250879999, 678793094, 863771713, 91704092, 254836077, 169623528, 3163204, 173845140, 346893958, 776113836, 973508092, 645340992, 590430401, 951563534, 473705954, 729796359, 97394867, 103018547, 254535655, 60538203, 584520812, 986220593, 444323091, 965536113, 869419091, 5081692, 327462154, 643651844, 579512728, 908311364, 223782800, 784660433, 354251199, 223432445, 557927372, 132706843, 207201606, 244254156, 597845799, 764449087, 586516681, 815675472, 517278658, 500556000, 970376215, 989955500, 72034657, 206722688),59772293), BigInt("10633276482"))
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.minCost(List(563669213, 825855133, 170715616, 848248921, 900296610, 887903420, 675871814, 486596683, 235735391, 414856374, 822396398, 44266810, 771867053, 915395390, 407577458, 526132977, 435493588, 200118428, 522821959, 508699245, 209107510, 775835633, 848773024, 737330318, 49170263, 680427509, 573882300, 47975331, 107865654, 717536143, 530193469, 815833575, 172088373, 245232698, 13843861, 505703667, 920495124, 239600583, 738826172, 885854894, 287143084, 855637308, 143274687, 483262375, 405384251, 100977809, 953509786, 841235525, 575644136, 728039828, 448530985, 15997067, 72457869, 101030668, 373958835, 405681725, 405119064, 640524495, 878589097, 853263253, 326180319, 905875964, 224218040, 191497343, 54231792, 209037869, 375754140, 733021805, 872850958, 680061098, 909589897, 283417467, 992550860, 786664967, 204480733, 694702469, 695974678, 964700834, 592869236, 401811813, 56938882, 269231172, 766091455, 884761542, 38371452, 154205087, 416251331, 891071809, 869898081, 49865978, 975945402, 890700102, 988503568, 763930157, 815989390, 971377022, 282112026, 877551177, 580863559, 786925081, 447744173, 90081861, 22716552, 610375817, 696503886, 894129516, 643629922, 361399122, 212873496, 24950850, 272084837, 225407940, 69118584, 585427257, 93199531, 759303736, 892684401, 54387311, 219211102, 734932330, 253133867, 287296779, 356393711, 521830829, 942986574, 835526734, 775641657, 793444573, 234586574, 305990543, 589957492, 840715257, 18793840, 61463393, 771904419, 174384737, 449298523, 998770680, 385905690, 556897939, 257114939, 75136071, 458396933, 568211851, 482458998, 156091396, 439827914, 296595468, 806556096, 759274512, 359380225, 11956902, 840335491, 186135643, 512506043, 431375016, 209975739, 955020417, 3503802, 400814123, 234876476, 576947222, 266791712, 608870365, 766466346, 707602090, 428120087, 958082253, 184905080, 433493060, 602373693, 607604421, 812112090, 502237719, 952452187, 987786539, 64846139, 324252439, 59882599, 902241415, 371692197, 546742761, 659820907, 578700678, 551662153, 613246026, 639899097, 117406911, 301855994, 957388774, 897991451, 582703892, 88142700, 266915022, 151060378, 985016617, 149325809, 67085982, 417947811, 510895036, 18308997, 718674228, 332240402, 17036994, 482912726, 351285736, 931679892, 132057383, 15285131, 726581011, 856968187, 152149953, 848842139, 282301851, 885802920, 190876914, 136959644, 148312259, 519113422, 38376962, 356726594, 942808169, 238367302, 976641835, 560402238, 39078265, 846300705, 862455098, 392081438, 13303271, 407489581, 516158738, 426092730, 230270579, 566857210, 671558383, 501070302, 305494756, 149996375, 604973608, 475691854, 535650477, 68341824, 564713481, 675904594, 571734504, 481381942, 499047210, 960241932, 559188621, 339907471, 414845928, 381969569, 412056007, 222429126, 759873667, 95557112, 447973200, 562821228, 719714521, 711258907, 102339783, 482924658, 586039964, 28020821, 110040334, 311022027, 940526292, 648295974, 922554876, 660908464, 757134079, 846179529, 416721229, 980355072, 843258633, 773348852, 966317083, 903796445, 761515397, 962889142, 201745268, 873174137, 212674858, 910042856, 94088310, 168163893, 869159155, 233037439, 230987328, 589828823, 826806352, 664994060, 471688622, 745134907, 103187429, 603229400, 516560254, 955406852, 194155723, 683367090, 424942924, 106958578, 354855672, 35586725, 477587633, 906879483, 747824680, 815731568, 209223077, 478948459, 443136667, 720477753, 440977862, 389579185, 409137367, 666006140, 759594819, 381334522, 126128657, 456579003, 930758953, 190764978, 273220669, 613582969, 239713242, 538056745, 805006158, 752633857, 703024704, 467664263, 53684952, 390578805, 577204112, 323682769, 786364144, 893936510, 950948160, 261353949, 507236096, 366069533, 494139795, 971364473, 39447797, 365220426, 851906154, 317619002, 557803119, 716377485, 174428191, 383384919, 549160022, 571289329, 76711012, 890877483, 712773829, 167470644, 354483046, 477986720, 618472061, 405821922, 218831336, 116007746, 567271319, 477663635, 580816817, 559175243, 606926231, 890403431, 339487787, 248300406, 687048731, 511158806, 678359920, 696800477, 587350397, 179474495, 340894123, 700777902, 845853210, 921124908, 918785967, 587770467, 630217706, 717362563, 595981553, 340289370, 427610929, 714563512, 262433294, 441327464, 401582640, 691140041, 420004646, 656741070, 230421845, 278214583, 730761322, 964957276, 358896796, 557503666, 853464006, 284632286, 459150133, 603336734, 385689302, 356957264, 335776266, 745677663, 725855548, 484327271, 313178752, 850926700, 101190892, 381544552, 337926553, 144349570, 880307824, 281718892, 403045929, 193797651, 519465702, 615842736, 424666106, 214198330, 283598578, 143950066, 16833080, 12717220, 786413914, 249071653, 912424496, 830410107, 366021503, 22560213, 91875567, 567986445, 848426556, 605599362, 54189090, 616921622, 302844160, 477888837, 902147730, 618349759, 30587427, 389475281, 862036284, 248639560, 820585713, 635906374, 449218765, 693837644, 435514535, 995952207, 826467537, 144181767, 531526221, 340055046, 549225799, 387397015, 197758328, 568382231, 639706585, 48358540, 791921427, 185327646, 295792559, 443161478, 443872978, 424874990, 923516857, 98659777, 929205398, 669133063, 287396465, 849895730, 69046697, 474835650, 847853778, 140104095, 603196275, 523573889, 47107877, 895667802, 45583203, 903207368, 922597616, 386665134, 315102966, 16407145, 384915734, 921778962, 804382200, 423945781, 220550809, 880908973, 4152442, 728298706, 749757480, 562235361, 345139267, 77185567, 345823595, 983601915, 844182963, 904106483, 789976799, 394995796, 82586936, 121974183, 967632643, 429796764, 982269365, 799074126, 311149901, 437651442, 519844447, 954891471, 24148725, 538572729, 332529359, 907714845, 215990041, 560502859, 423822439, 484209522, 802193948, 585532543, 966855721, 200591667, 305209084, 400852719, 50671693, 404032320, 836515671, 312576225, 827106112, 285294081, 174463950, 679285468, 855122537, 717877225, 464754682, 345419570, 998396795, 251008696, 742790620, 459229454, 11261094, 483876617, 419697596, 148940629, 916650484, 33264727, 664756256, 81541957, 31814968, 347554098, 417890484, 48888814, 495002841, 990763108, 91580699, 944404984, 133622568, 529489280, 598349305, 841118162, 827171820, 256554468, 94338459, 399748009, 691901866, 296185971, 352638666, 594647125, 284659950, 246324504, 861359917, 821604100, 759018272, 51574016, 982530864, 772588041, 626960703, 131355704, 384815790, 45503822, 96419317, 636778033, 470926487, 456342901, 840785056, 660147669, 563952086, 45348807, 353249931, 926870983, 881556238, 901518240, 925996126, 55810296, 34775496, 472505851, 61286877, 412891222, 179747697, 593260017, 373768607, 130175796, 36417300, 527747064, 92429350, 179745521, 471709998, 912637451, 627440640, 17569947, 252263488, 399000684, 559218361, 383375566, 562068110, 269335761, 101801587, 377797666, 751335451, 958800405, 57913847, 157753477, 921672660, 109999537, 808578430, 903864677, 484110353, 394313430, 136556627, 288535485, 958769834, 300259254, 352195823, 950518461, 180748521, 798899893, 676189982, 606037456, 313955024, 75729256, 680539579, 2269609, 519317676, 875184572, 694575379, 878790683, 979567404, 944184077, 155049229, 436317053, 321749806, 489236705, 763323080, 282028232, 743281357, 498966870, 430221940, 681965311, 926694370, 632135135, 849107909, 230079556, 410061048, 707095537, 634290942, 600545868, 269760407, 452093469, 210219975, 375030799, 76429274, 611824173, 328943400, 105374470, 590497554, 38692832, 349252667, 212616107, 97050040, 404986286, 336667660, 17726065, 1811947, 672254249, 37398438, 691024006, 676578843, 294227226, 194888207, 29543539, 190425768, 322122266, 617590658, 644977987, 93719533, 224317322, 35597134, 101594741, 722223993, 841288301, 154003983, 290603441, 261695433, 343905287, 732488771, 771405000, 12824855, 397055298, 798549264, 375310777, 3160687, 860014925, 873755466, 687485790, 108741641, 591548296, 119514663, 93335768, 494385986, 212548822, 536529513, 101582885, 751996751, 216014136, 346551331, 466701529, 438133154, 467953069, 334942634, 243440098, 457302027, 674636140, 718529249, 921612110, 779217058, 713583046, 666824893, 530074627, 9576019, 634073373, 231163140, 678924307, 997121878, 775112239, 83159589, 589772529, 212385868, 829768562, 821963365, 976623024, 324977907, 280158329, 88452334, 779077084, 671705193, 842545869, 727153452, 617856355, 911851809, 288511425, 607060512, 328007906, 637897761, 242534940, 103623504, 246256, 690448636, 660405358, 549713658, 129667412, 790180837, 57599614),531004303), BigInt("37685090039"))
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.minCost(List(945389577, 111116927, 908783196, 50140358, 959492443, 621625254, 255471618, 856293880, 431497048, 900080555, 48615242, 323695831, 793401948, 608032497, 260323249, 285572990, 862673209, 78379502, 715463944, 37841067, 420529343, 276556515, 156938055, 173291667, 926533023, 328825349, 264424263, 752255385, 748648849, 537908816, 312660609, 359083047, 552517006, 785901828, 196167296, 638340718, 38593887, 35570012, 889452149, 16700288, 309876496, 710489470, 604364097, 492912622, 578030825, 150666894, 226441865, 90711201, 185333530, 810486129, 182405455, 977957785, 733122422, 731408912, 139960041, 682401220, 681191578, 288147530, 359241124, 460311391, 233998545, 297952008, 384311367, 675987422, 273406652, 75287910, 928290128, 911238607, 407990495, 442488131, 405884137, 947079047, 99554214, 172487863, 761521355, 102878896, 560390374, 692136718, 871641505, 88140349, 989265733, 784844735, 77851623, 532924433, 269564404, 239015610, 96460813, 833932146, 121652526, 447560438, 133295611, 743001807, 500374245, 588026399, 3819236, 625802651, 303736893, 459491326, 890973172, 174644956, 948494548, 521105607, 696773235, 620297778, 573600818, 448402914, 689951348, 884451527, 521556556, 425962194, 622297134, 69255638, 321694010, 631009365, 878790060, 280461764, 594134385, 827229758, 12614167, 210065853, 169933731, 417683964, 296424875, 442481395, 718309338, 40996448, 859871255, 956044770, 231098868, 227130473, 297031090, 165391123, 873882665, 320097267, 96680241, 603126670, 267280993, 717061802, 583684867, 770546931, 638458902, 521598847, 590697046, 156440944),711762576), BigInt("16912494358"))
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.minCost(List(787044169, 658711407, 94074275, 518527340, 34958046, 505968638, 169866082, 558364066, 996780256, 807172519, 269776645, 99028021, 824248729, 776042943, 216887087, 637195070),76134123), 1582855757)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.minCost(List(344462152, 518399184, 880998883, 58782508, 790383971, 864942378, 59627709, 567315136, 855963427, 547840897, 151786106, 589178272, 308159637, 581325866, 100244626, 283608608, 931355483, 328502929, 930244029, 511510575, 46817944, 5338318, 157404917, 815197944, 325433842, 84231679, 748075803, 828287903, 8387073, 251955639, 575094145, 607580139, 154192555, 980508200, 93058551, 290680967, 657705472, 779852865, 454998097, 123457301, 994226095, 83038978, 379519601, 34603979, 963477073, 951008106, 468889481, 735796466, 764612791, 469426754, 434955762, 908077968, 564363547, 961088234, 682873684, 8497475, 439654182, 650932583, 822607245, 432758275, 58649489, 227528566, 576808310, 504387581, 9141019, 328214886, 578952787, 395355360, 245225549, 447453961, 540696166, 698804759, 183421132, 444162781, 463583501, 215760045, 682405797, 464452971, 647603901, 729797926, 812157873, 602698965, 73213430, 241471084, 115633527, 517757700, 752877919, 21976531, 558811947, 243850752, 716695544, 873580098, 635786483, 210826307, 939935933, 598383482, 825557738, 774316246, 661754805, 227134150, 514056456, 257448674, 224162661, 21418403, 606040140, 973723153, 519156314, 231883583, 879163585, 930007110, 41100278, 883953923, 154520847, 597963810, 962106202, 700236450, 369521824, 226023028, 227323918, 826345463, 930965437, 793193291, 676334092, 618862703, 201686699, 164911651, 946358967, 260389388, 392618184, 819534507, 277812808, 786004237, 182528976, 553686390, 686545749, 676005740, 27831442, 63870888, 499080954, 754947669, 559054420, 393642239, 338923114, 314311653, 245166285, 822129996, 847529195, 508783637, 196238488, 363779432, 568657291, 520788279, 88677710, 850428026, 912347444, 45701807, 105229272, 725063713, 35840745, 724133111, 168414756, 905513219, 712188313, 173025450, 778275732, 382790428, 769256959, 593775855, 478944403, 965141935, 397605536, 40816612, 637701620, 549543044, 303433120, 215515311, 503344038, 960503392, 125927893, 769639350, 172198738, 409886942, 164086343, 113582093, 41507235, 545784551, 482214174, 467822998, 483866501, 896380206, 105958129, 706589928, 680575992, 634970221, 960229785, 620362142, 439456071, 599007767, 130298623, 832938662, 43415045, 722595762, 126902357, 90494682, 949523086, 82424995, 634896590, 726282247, 750641246, 388095389, 416810383, 994674254, 378352116, 873605161, 455838986, 860091491, 817685439, 568558790, 57511057, 161342889, 943932858, 65932576, 346817904, 235733593, 728594621, 30865080, 399700749, 453468943, 126122076, 948908980, 65180579, 604714248, 997164443, 236228594, 582895182, 45770372, 480498668, 621848783, 607314949, 10806189, 903237607, 863301456, 973198812, 245329831, 648047559, 714954589, 863828161, 979659644, 461579152, 369928711, 588770319, 843757700, 682203634, 900715296, 880849515, 545693107, 714620921, 40971249, 110073571, 770641488, 563878597, 346083622, 828750480, 856927768, 424639975, 408252541, 171924937, 802760742, 256395241, 643004100, 768390236, 991956218, 296222942, 143467579, 201999757, 896876919, 540599326, 480775018, 511058071, 937205711, 585056180, 883135618, 958680743, 281901385, 675368724, 372853006, 362078981, 528829438, 51328736, 163429997, 235123483, 190318944, 637447372, 747076884),923775125), BigInt("26998829529"))
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.minCost(List(73349594, 18843730, 656162099, 684433155, 13226514, 423983113, 765687789, 430398257, 290509135, 322348965, 704207495, 34083908, 444200690, 638623723, 123907037, 382686429, 965558186, 342527130, 335924564, 65126042, 236371836, 222790206, 769928664, 119302029, 202127738, 435994086, 923453752, 528400152, 424391130, 235187596, 600339609, 753668297, 839119919, 751070429, 960075585, 7443942, 315154950, 621732343, 761189424, 184642820, 6940890, 911063475, 622641120, 85837377, 647396778, 141505681, 155372287, 730012489, 19728620, 531023860, 497632163, 894995511, 493986159, 481463655, 464892392, 239820032, 703563390, 722067825, 951236797, 336243873, 735655408, 465794264, 984129082, 625906202, 636956521, 914338016, 574701587, 671935566, 318342651, 94987502, 202931506, 516517643, 741936417, 57957476, 452167236, 578276004, 984604893, 16441776, 630976802, 51106781, 10550039, 669962123, 163713000, 773850469, 174025572, 19518653, 803145634, 456041045, 665634843, 522308886, 13632988, 154974854, 408444011, 911628704, 815814669, 77224893, 201349904, 880612586, 270004008, 106408714, 384828990, 507309355, 719140605, 821135403, 191687935, 701390846, 28685387, 630615649, 537644452, 751047535, 154938223, 331543854, 197067061, 940909520, 355795924, 14509145, 651762200, 587458258, 484319565, 917779060, 415827282, 513921628, 914906031, 166196268, 842168971, 998767397, 7573687, 610972943, 443117447, 722028433, 265517549, 573760125, 999309255, 255415904, 194384066, 893465569, 183403744, 696356290, 952114946, 608950454, 502596164, 397727286, 954670358, 625244598, 702843032, 314343541, 437085433, 386707815, 565335822, 710263874, 646685777, 872220555, 672937088, 707892514, 383335678, 236236390, 190265080, 70402226, 366573021, 562865179, 261285052, 3700697, 872631939, 198644504, 291792136, 538177704, 640419422, 707052052, 837799811, 815449212, 630614876, 887573826, 897050840, 362042929, 217897115, 394668900, 784700760, 643836345, 181168174, 804953487, 647075184, 165049474, 32815617, 543536977, 212929493, 50279732, 623608418, 239073892, 144937972, 563184730, 240238830, 775112043, 315162273, 117661248, 483406074, 703243135, 679067137, 387049486, 651492619, 354753372, 575529134, 90845560, 155269823, 22092039, 862123307, 839206152, 88616784, 167034756, 97526490, 849611811, 198993990, 251914398, 384588694, 905944714, 883034767, 784758384, 973611862, 624994894, 53369112, 853961830, 189454111, 271256998, 600621789, 531461318, 455681286, 520992070, 295625425, 384414422, 420115385, 296758306, 594698057, 138773267, 123286126, 854994720, 178519394, 640778402, 404595870, 614558314, 856935997, 960452945, 967627809, 388397496, 376852547, 493499683, 111783177, 672310267, 647841265, 150107407, 4495301, 705908698, 928143684, 32973296, 775142042, 408153744, 409554005, 243021330, 426843036, 482493139, 996562109, 42338808, 744645558, 673456108, 378467098, 70425411, 436583117, 933504242, 649105661, 46890228, 849154185, 211088391, 265724624, 924861275, 927416441, 320356788, 118361154, 221637134, 809648667, 168490818, 376611335, 258007826, 956777719, 494859764, 643298863, 809609644, 883143605, 296259859, 529825461, 132611244, 485211769, 72473640, 303172197, 454007012, 845518819, 104931448, 318878344, 383003839, 347917497, 932306982, 978390636, 592335878, 722712031, 526240979, 731352897, 980715070, 254951708, 829051841, 729086263, 450990429, 110465367, 501062798, 406925918, 534144256, 557255755, 96280574, 93145647, 657967282, 71730074, 333603029, 524777672, 636573501, 120897119, 605136947, 7377400, 985615489, 739243993, 26537612, 302341787, 908823001, 761317801, 451723953, 869586374, 226229063, 579168227, 269828521, 586368858, 496389431, 556338345, 14756943, 354283251, 637955569, 990906843, 836736825, 175354731, 503885388, 244336323, 672802997, 416820981, 936718213, 255797520, 133449123, 645010808, 49835670, 909164966, 422777047, 184975250, 312411268, 723050455, 546280479, 276902296, 161098314, 775967898, 24348724, 672173236, 614667415, 749864218, 291502550, 258298788, 17262379, 449988340, 927371862, 890798513, 607960434, 936461075, 799552118, 630600884, 200839570, 182107734, 604048147, 670931799, 480546175, 506087151, 139410620, 829107848, 532317558, 354990881, 76968365, 140452440, 182527920, 233832630, 343975090, 424646397, 646544034, 637284632, 570979591, 783688356, 661354722, 627948934, 267455362, 677248686, 86661979, 742295338, 861265849, 115214081, 188361835, 342823825, 616312559, 548653470, 324605972, 674829250, 440195763, 874502545, 570058500, 699449831, 28108906, 54977773, 853008032, 607484810, 3221800, 173352506, 410061895, 989622480, 369017478, 246336327, 773272471, 842869218, 949507509, 972025944, 71209074, 68314616, 338213857, 991161332, 948876355, 31966703, 428909990, 851756807, 774303958, 782080314, 333723847, 863069047, 605737832, 644392736, 779469280, 542434779, 440255903, 538968929, 795033940, 950816010, 661986297, 367698122, 459297080, 801275661, 281662342, 447720137, 776593612, 896748278, 358596579, 432030875, 679262946, 676719267, 48500356, 499805070, 908012839, 283255214, 234570167, 351017562, 615060968, 871533898, 815124175, 146977924, 629942640, 409316288, 569895198, 272313379, 624750713, 295888774, 380179233, 620145975, 342605675, 196803090, 902674568, 627986540, 784793585, 681393196, 423105551, 467646957, 905402213, 940533796, 421660018, 764459173, 113627796, 96605240, 370072833, 624831289, 936206722, 796985376, 903024204, 678640983, 375613088, 858967151, 77859555, 672848621, 169844863, 391182217, 835055732, 154983357, 145374404, 165291938, 991376810, 580313916, 54018078, 773609970, 181741592, 389040103, 846012116, 45604765, 537558344, 264122183, 38893507, 386085740, 223059408, 856985578, 516461823, 753092701, 735302582, 732634831, 422281959, 423584239, 219528395, 796163137, 800471322, 113305943, 603235381, 612651224, 637441236, 232603244, 123505898, 506656131, 395403933, 427109971, 784114229, 780405280, 173156464, 49085757, 415133643, 834774864, 493630071, 669480906, 249310740, 919428187, 941742614, 906521552, 698087954, 857308532, 313804315, 557037327, 775171539, 983462619, 940334019, 852591, 776107103, 517637924, 242339225, 467473999, 40899203, 648483641, 175149372, 390700334, 859635637, 822439571, 296097567, 914589363, 825216059, 951898853, 273631024),242057952), BigInt("20226095086"))
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.minCost(List(425254684, 789699586, 176719709, 591540453, 677519448, 616408960, 419232769, 23023996, 335980679, 344379396, 678299390, 263176889, 94432418, 240120911, 159472211, 938490883, 839999189, 4546566, 67516685, 511857371, 148666704, 655902630, 785808493, 859139571, 28047068, 797282432, 991186450, 695919791, 182168185, 527562205, 691850494, 384384258, 39169180, 813590919, 814732776, 759889358, 3035120, 102478272, 770187137, 140334385, 896055107, 707568156, 497675460, 357679116, 850690716, 573027688, 16533059, 351210689, 117787744, 182515717, 559001924, 554601274, 911889785, 70201541, 697573069, 135554601, 912690408, 128329873, 361174463, 230256453, 574178412, 467147258, 4856529, 135166876, 604677104, 511652464, 907273319, 297487312, 819200135, 281037328, 377127950, 63398184, 623461021, 106894227, 502861730, 226782101, 675316836, 453350447, 544994049, 773834624, 481798977, 300205006, 233766131, 912613057, 112644316, 164606959, 468495271, 566816331, 91982538, 715343397, 720522899, 471213495, 224887693, 404226009, 113178174, 203243240, 4269437, 630673049, 89426618, 565527200, 368913199, 267084861, 863912404, 462543786, 12372219, 5438409, 378502188, 660576138, 913732767, 85750613, 888265816, 559182003, 910568422, 28860277, 948653182, 822536317, 201946566, 652437976, 808952704, 494798358, 965001211, 322193897, 654657859, 958530365, 482857021, 646926613, 428943857, 663145331, 214875780, 320149268, 491565929, 223652882, 965967912, 797841028, 930365706, 557185354, 797477294, 67710036, 413032144, 264776605, 235407699, 434335266, 732994983, 96446728, 455721547, 514527609, 950127861, 724688686, 918652338, 307023695, 518990699, 773622737, 933704889, 996275150, 513288590, 727191531, 398789874, 710672536, 316433984, 202737333, 644849163, 676102643, 293708169, 655237012, 166865611, 820098044, 664066712, 789760179, 342957626, 514949020, 269455206, 211555235, 541913607, 110928789, 792085550, 734577571, 427436652, 753654844, 194452851, 505545602, 352202349, 327112155, 561250025, 768276031, 636342581, 758985283, 390985568, 263570962, 194375367, 395440200, 495840427, 58774402, 98218434, 426326706, 508172289, 153870038, 306105453, 847398190, 327447886, 78364594, 332997036, 883837624, 780351821, 798242039, 931220599, 251576138, 593257224, 838790815, 52902269, 503421841, 523967558, 813212807, 747409226, 574002128, 432487337, 235365263, 31103775, 895260314, 453465220, 180199053, 859932439, 364960946, 85070788, 617167468, 389486148, 445918510, 680415189, 818057981, 232439179, 474617272, 590255109, 142599749, 64118808, 501542620, 670494388, 716365631, 985540348, 719256170, 905126716, 711577324, 191090139, 741298133, 170161685, 176972818, 177189726, 932226259, 631528724, 52089355, 486017688, 740460553, 997735237, 760123498, 553932613, 117747134, 161938075, 74399538, 960947525, 59269061, 633412512, 972348172, 167509535, 312357740, 568480786, 209674666, 652764959, 479611869, 789666363, 221193008, 647337833, 175735089, 271748430, 955155222, 340369678, 561837903, 936456519, 69196640, 330737103, 765929344, 653780800, 268635731, 647452265, 862903616, 337490707, 682267666, 937869467, 193371976, 158297483, 512602206, 890702600, 501716782, 980795913, 235499200, 310692588, 854514569, 512199021, 876598929, 609346426, 795761691, 215361076, 867754311, 293637541, 101127129, 878403716, 932412582, 520160573, 896453637, 986067302, 890246247, 987127082, 891485096, 41910843, 841030374, 306347047, 731922429, 834480153, 388005387, 267583246, 446779090, 847363676, 197066135, 768542647, 304404255, 765609402, 604365586, 90280380, 33947293, 295572588, 927772712, 575031317, 841815358, 669801948, 895931334, 666251251, 447271358, 339150153, 439809087, 636966421, 95073189, 120094864, 724216358, 648466512, 986214841, 595756994, 764585991, 797784250, 474708845, 489984034, 950834912, 280187025, 334690121, 311728535, 898742882, 827078115, 243072688, 160602464, 89648214, 757439879, 100451964, 694253263, 632124432, 459858292, 788649791, 293541649, 563865342, 923252753, 634484805, 322121510, 93809928, 345839538, 662243652, 456525176, 623974163, 785269305, 883270483, 76633116, 722777797, 527318058, 861039004, 680285242, 788678069, 203894403, 396236442, 372152348, 298957776, 573257661, 781041646, 518381883, 579993382, 44808192, 45109649, 493383209, 495025827, 892958739, 740817392, 951458279, 815011652, 330123825, 179500137, 139072840, 562610724, 218756925, 35859717, 393250151, 400482915, 334959185, 258768509, 667717124, 951484453, 334834725, 741240644, 899249177, 327641080, 601496982, 388984457, 105618491, 340997278, 423756896, 267133162, 856431025, 907599362, 746571907, 481426513, 548514573, 173662619, 468385700, 19040270, 351548924, 994224480, 232805696, 727821318, 877223237, 792869903, 921258903, 706694601, 610447468, 224967562, 414877357, 747172222, 222822165, 661604802, 565788675, 204464935, 991018823, 663320318, 914249489, 274261090, 558532339, 988264704, 899150808, 273016201, 883776958, 929684339, 750331359, 387490482, 471376870, 4053263, 788329502, 944166978, 507839185, 82845531, 432931248, 930749176, 871084887, 317753262, 596219785, 252234046, 570869638, 477302307, 532492662, 300727276, 43884252, 42304032, 408076532, 273926677, 483758410, 20198442, 858005202, 880633274, 966933985, 586522266, 319203090, 221985826, 824306772, 974977024, 788528887, 472311030, 365740922, 383050445, 633346853, 861784603, 518183650, 817473830, 176401317, 366278232, 564913272, 686170203, 675190887, 337693240, 143185043, 778292312, 679519713, 921758497, 576385503, 580218368, 542333146, 329396899, 695513889, 909191076, 526984661, 976129039, 154175602, 905568777, 764017252, 510986855, 523706197, 700014178, 118039873, 795143461, 610107704, 721914976, 118570932, 117794381, 704610359, 889180603, 124792373, 359394026, 809447775, 785449026, 844132069, 339380796, 867992771, 411744195, 393904595, 194894207, 874153231, 185524799, 878957794, 913051145, 532607726, 379002718, 439219160, 931097818, 559998096, 136201558, 372537584, 138104349, 138964900, 563850467, 449537477, 796958697, 158059824, 407934489, 174240304, 933645503, 94807416, 618651469, 258850185, 756310129, 418751161, 551198232, 895387254, 665580405, 12182957, 764178494, 434565709, 550431683, 560104936, 304856602, 658879860, 754218462, 520641117, 839060875, 867092916, 448586770, 725567540, 457885159, 862153220, 320392649, 608161970, 717286295, 889436722, 707629508, 887288338, 640124949, 246461851, 447247431, 61944920, 458072743, 22059319, 760585101, 812992620, 94208476, 179234940, 154388424, 746816071, 868196869, 101689701, 104237654, 169539607, 449668579, 243755662, 1538021, 811676805, 453334006, 205183057, 274742668, 667838343, 111946884, 962125160, 169152381, 164757107, 820778605, 40608265, 833933113, 597760325, 733832682, 34725313, 750514380, 648265931, 39369503, 423306694, 716955111, 599282441, 843946040, 590277616, 978431349, 468703128, 319783020, 968032855, 121112679, 322647094, 532683175, 785682928, 563305425, 807831834, 993492168, 280461808, 110696119, 18897288, 439523902, 568699607, 133201213, 670941319, 84754153, 482824980, 595587070, 177164200, 296358001, 604354785, 82842106, 433923044, 915933477, 448880627, 60737025, 418176514, 362936073, 563805258, 68570912, 404353998, 186126991, 823995182, 172728738, 374855658, 774614148, 120429944, 126745046, 931336076, 820478542, 980493003, 113784768, 717055260, 72269742, 42644502, 361627105, 567929817, 703348957, 946532162, 730642775, 896565553, 245687784, 678886682, 796306620, 618830891, 70806116, 880226499, 743923745, 402031437, 585925331, 546959035, 694849664, 450106285, 498504148, 164995692, 97797831, 201780478, 101383412, 837310657, 452459656, 80216301, 958261341, 757410412, 388221532, 299764838, 191388302, 107825463, 933699557, 946349222, 189743058, 905413045, 618057814, 595168624, 523627016, 701547170, 742272892, 523647710, 893526925, 974602185, 597983769, 752832519, 199225694, 398649835, 390751544, 126116328, 133778449, 844667619, 483019918, 921255724, 963507932, 531012367, 107268093, 619054525, 669392857, 754911136, 749025261, 84945136, 581497114, 82766065, 207819127, 638553163, 92480875, 384365757, 323053687, 5335950, 908997439, 398885318, 542185510, 508718168, 73800825, 936205007, 413642617, 440819321, 216651241, 579426546, 168774394, 637442179, 952984013, 526897232, 719833277, 592277078, 919016023, 589278432, 48295221, 928897773, 117537829, 220773587, 761919328, 37246179, 481792597, 518672953, 560915046, 22325812, 496384293, 129782091, 333684424, 277361475, 413749111, 307133884, 17027839, 948783130, 90125010, 23914083, 686549723, 758164487, 904698606, 276543444, 507287692, 774063218, 523462132, 996476226, 727343657, 632688181, 982638228, 945078904, 694865378, 512178539, 65038175, 166185516, 973025316, 31273959, 719119487, 709316127, 988643972, 659087929, 442618137, 694169527, 144824914, 355679957, 954492231, 42099116, 664835628, 784690056, 824238517, 609449964, 282716011, 878462139, 751283952, 603802723, 984556230, 402594395, 767982778, 204132253, 817564239, 841983787, 708680912, 507695129, 193801617, 315453446, 27054988, 435496777, 288750174, 452232102, 262241270, 781900442, 701528289, 210605476, 809292716, 244573828, 143639996, 796164060, 268977976, 928924013, 143457554, 337780952, 697284710, 629748888, 488316226, 821506584, 972262198, 449040254, 555479004, 684372077, 370007796, 895106216, 576169014, 432416051, 693259707, 904504326, 373788784, 187447211, 576781174, 42031404, 212913198, 323940113, 545675325, 66740570, 768153458, 177686137, 76583477, 433055702, 306097592, 351369454, 26100261, 338661445, 552403268, 444444517, 361464398, 745902080, 368071382, 501669490, 881056461, 633986960, 92376521, 447312538, 322056866, 952126970, 132907180, 779437822, 82777802, 399448521, 884216749, 755285575, 294926371, 583851237, 576562945, 363823158, 450600075, 424313903, 786756845, 317550027, 247481030, 676669472, 739666372, 222690360, 374740931, 135111876, 831106891, 173398375, 577965686, 270699985, 58752635, 177661348, 285790708, 594167835, 460062379, 573540212, 749436637, 67410690, 317300888, 271813820, 576195472, 605875333, 712345746, 648327215, 43543676, 36471202, 521878399, 852729858, 17090846, 599089449, 442278455, 32560312, 613125160, 297078716, 860258691, 811901814, 360235499, 621345610, 432328080, 940026951, 730048267, 330424156, 17400432, 844934671, 14136916, 717972741, 55003792, 820767376, 221871409, 622212918, 528119283, 82241353, 61944471, 527338055, 463757456, 95879940, 952855769, 210255149, 443105133, 83188365, 785569758, 243451089, 99791535, 946058739, 28283302, 232002549, 484217223, 351357885, 399213220, 967524989, 671336735, 293833515, 344303480, 125877988, 538086241, 472786797, 821425810, 319486050, 263760956, 237070956, 981210255, 295774140, 34348328, 439119445, 334466056, 144458817, 954458062, 131551735, 564453968),259451167), BigInt("38202065813"))
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.minCost(List(124245873, 75955780, 633127073, 728554799, 702034054, 402993725, 717230559, 16860297, 492577281, 16436964, 712143779, 355646013, 159972585, 117770220, 682541034, 219463735, 147207383, 438732138, 994635148, 331829971, 27900128, 37369372, 185022842, 577089026, 288940703, 486594905, 921518205, 820012207, 69561028, 352390633, 211662115, 696698115, 803912393, 23810250, 777857427, 541256593, 988678958, 704733041, 658378828, 972699575, 295488462, 341912127, 166946417, 361596377, 300388702, 784469844, 292444355, 309247322, 858211651, 490583267, 763993876, 501264277, 978880909, 402628899, 714711300, 870532968, 715863499, 262674265, 362112034, 858460662, 213828071, 849295993, 735012872, 944321644, 92991605, 423964107, 76272008, 709135907, 621066326, 717860988, 721506519, 963552166, 923792565, 376591237, 585106572, 939674255, 75263353, 597772983, 766852186, 401283739, 644467102, 38315339, 760440116, 504639943, 827469897, 247756798, 465946099, 837376165, 484911763, 640604378, 334814053, 345949067, 458981570, 526582055, 83643997, 220181839, 547030720, 579293773, 550506031, 122046120, 168587439, 81342864, 968446082, 308934323, 111859331, 904843644, 719670892, 692297614, 75835822, 584849108, 789195909, 416388718, 59644069, 347858663, 364984072, 416605344, 595959258, 375938558, 953808489, 144260086, 674623229, 758954183, 112293134, 355381781, 206101115, 443198149, 923857137, 617454551, 906698952, 639085908, 108568919, 405413379, 594331625, 59580094, 510105774, 766130798, 725674904, 456163787, 997152059, 614234347, 272115329, 603748719, 556676795, 400971309, 608237716, 987506677, 271636102, 986279922, 272281664, 483918831, 748158773, 123246089, 597991905, 122991471, 883107682, 690523778, 111441420, 985334622, 60126618, 878352729, 998910312, 933268653, 321848930, 703789061, 397146113, 271307328, 822718762, 618483952, 144680132, 757562788, 219358090, 290126496, 452205143, 650888051, 613512169, 782107061, 467386012, 548448277, 28462042, 837568606, 974692004, 145608583, 753231980, 563281193, 653831799, 407639373, 375700663, 273214709, 794551559, 193634191, 478905466, 517023355, 680754845, 573378852, 167394151, 677321407, 783970886, 223792378, 747350280, 580510494, 106309832, 880414468, 326612387, 767420014, 88404698, 242531875, 486923093, 326240231, 616072361, 596127398, 554600865, 206511541, 498348651, 799334590, 136603748, 827079951, 594621676, 450432942, 109417203, 823346777, 718531071, 498771659, 884911933, 742876618, 314162349, 465714176, 863018670, 862797123, 699580015, 830343252, 984973055, 195625092, 317482908, 180973130, 202058618, 129908926, 480389216, 589967600, 990590791, 529855446, 87621334, 535498111, 792824787, 587719554, 738777889, 885484790, 953584958, 73679405, 156493973, 710135956, 133306846, 171648672, 451574675, 568678770, 15433889, 652623981, 402564876, 722596134, 38482508, 898274496, 918778262, 556577064, 777043028, 49420358, 973411966, 632761678, 832220139, 234232561, 428705356, 898642231, 617301353, 307310155, 434648934, 633841927, 871204202, 291106737, 707936, 128651473, 64817645, 211236154, 72426666, 54907852, 746421739, 364219499, 637803277, 140550432, 504005436, 926128153, 950986769, 250898385, 32451282, 431920859, 829558745, 887165155, 600359318, 404158049, 18602242, 715753, 175442028, 75845363, 653871668, 961395823, 111735912, 544612181, 145381340, 50498556, 9943351, 564783402, 613553542, 247999588, 179386883, 358295131, 244858394, 982976366, 544323051, 549374625, 846934908, 632011736, 411108229, 45023874, 607111663, 918351809, 746696503, 273389877, 635021086, 935304185, 213266408, 459592421, 641419508, 202658807, 488697363, 836031151, 392244797, 331378822, 834982560, 917713677, 295616661, 423620736, 102951645, 275922289, 226258919, 917161295, 176514800, 566834457, 47259829, 296132360, 72959007, 578688971, 376055940, 525741575, 413470131, 982638878, 858730962, 282615178, 795930180, 123593499, 624766813, 640755873, 303661608, 333318019, 347154032, 481264173, 208245567, 917820254, 592078100, 906796524, 131952289, 856218039, 951978357, 754987567, 294139702, 837754745, 569592942, 590537612, 334062402, 294033448, 161333609, 981780289, 908851943, 475013028, 982829683, 411380151, 436754169, 542070151, 385148996, 532221870, 354067379, 741370327, 711168168, 465159254, 980008539, 831737444, 323004804, 893406924, 766373768, 784319469, 888778337, 763367930, 778751875, 262073374, 74186556, 342756180, 421198552, 738033005, 746781375, 330543796, 667104546, 431850348, 136818269, 817596268, 663429056, 246412427, 67351386, 796694562, 75996084, 456272283, 501807449, 72749648, 477043911, 947244735, 997213728, 266023228, 744064039, 499088459, 862113670, 439465442, 979063837, 331482710, 657570076, 894138491, 866811624, 514228765, 898599592, 42703112, 295735072, 133017253, 172431472, 753481202, 110726989, 413764133, 232754212, 845194710, 25427623, 615627867, 385957522, 120257860, 808826815, 833728829, 782675620, 235562589, 6931112, 571410266, 26841058, 771321103, 676335778, 92428604, 389421028, 316270520, 928759317, 650881661, 546771751, 594053186, 609416110, 317315321, 41490708, 743032983, 465760694, 385858016, 330387441, 402371565, 746021659, 539052584, 863394909, 214451730, 876580813, 660007577, 474150439, 138647681, 683129465, 942547626, 799193507, 953078977, 167506998, 49539148, 319609366, 730890879, 361511870, 228641747, 632331146, 490605536, 362120407, 476520993, 789919715, 407205225, 862012392, 474066351, 769820755, 953539751, 55297607, 261579818, 404238042, 907070109, 207901824, 12020610, 74905694, 9150712, 86239973, 401194175, 280600545, 332909763, 37729773, 468283270, 588395343, 263486191, 532647780, 152193230, 885590009, 469463587, 561125180, 735579139, 488407293, 970633068, 169159420, 660655527, 907149359, 395473581, 997106588, 631626510, 483230811, 842998033, 345871638, 389093621, 710135277, 975426072, 863950616, 547652757, 709058723, 705508293, 360850487, 581297115, 660245460, 703369190, 84908253, 728141414, 800217458, 830152928, 743160850, 107386123, 338636446, 673109827, 669873849, 902938068, 991431640, 258735947, 581604189, 926875663, 724668508, 60884433, 469669539, 337900084, 244790671, 903980489, 332822674, 1597578, 990411949, 171242766, 464017415, 710955726, 326231732, 823694032, 651851020, 570569249, 511096465, 348115998, 117903120, 498186537, 807894740, 298964650, 560020862, 604083568, 46904318, 972618569, 475635570, 173084259, 257055705, 16439169, 24578684, 340857244, 384014626, 975264570, 97941276, 456680502, 89366516, 151087392, 354033134, 935653830, 58855864, 153134855, 189012379, 847441631, 126475735, 593706146, 941846268, 933169078, 497259128, 894057459, 564705099, 575019210, 131331240, 166936338, 932350180, 588192970, 400889087, 428059480, 187803129, 91647471, 650217479, 673209589, 549896447, 681895109, 938148174, 274116332, 750418722, 606153389, 764335078, 573500512, 694180634, 113674150, 621126432, 207083602, 298407480, 870555774, 37434811, 128171873, 116543456, 500080829, 210044437, 764954779, 216867556, 361972709, 438881658, 155071687, 400182604, 634579529, 459464118, 501143486, 618073929, 925822079, 969174321, 760578700, 659118214, 203148702, 413198307, 227715372, 65922500, 330923511, 175824753, 669851770, 630683497, 796635231, 535131576, 66872066, 940786963, 753001213, 191737835, 819988404, 14453801, 516256792, 542615413, 727600290, 522885219, 910506184, 493819072, 322198571, 248052109, 162236759, 857210112, 997799611, 957721479, 987973295, 17465650, 237422471, 781188645, 667566220, 663842552, 456028091, 828842240, 162777856, 701088514, 673289246, 69628167, 598757300, 580194236, 431890813, 412769490, 293677065, 383014358, 584204387, 198722183, 983810666, 938949893, 279969120, 358214385, 426502614, 970149759, 60525544, 650400593, 980511761, 637252690, 686629979, 249234267, 842555985, 574832861, 893942413, 929374087, 556122008, 550539274, 566624888, 881919529, 126158641, 666898253, 841076358, 797762072, 461795586, 483662843, 723990935, 788898317, 743573168, 662323787, 765637980, 42283755, 107529430, 373116047, 515170745, 902523414, 64317041, 844686994, 52360279, 179907927, 589208161, 333430287, 93330963, 401619712, 785082414, 948721620, 408959616, 972814408, 391845949, 138448654, 17182111, 707488060, 613642930, 547428118, 640721952, 672879530, 810507570, 111828889, 628373703, 682206063, 744672244, 961994461, 433116380, 405537997, 20286310, 627710656, 963675797, 429800329, 887335963, 331696231, 101080149, 771106583, 887818809, 931675270, 397915336, 360929839, 465935337, 560724816, 718905356, 622190034, 931409575, 519844550, 207818770, 75630137, 192787078, 227176214, 242792853, 917745866, 745416604, 827090690, 612847249, 732515032, 101634729, 912706869, 591482903, 413254308, 67910699, 151657165, 851432522, 612649273, 623066007, 771117193, 422135339, 115291846, 181496065, 911927095, 413816783, 443490981, 766104857, 610303291, 412781820, 40298545, 901789274, 386397038, 941601095, 527354722, 209232590, 826931376, 840959670, 826945397, 774561987, 298400800, 993747396, 873714792, 273158928, 933649052, 944833550, 326005025, 796375942, 329814298, 791199198, 70270375, 251468776, 449083571, 595167500, 5912643, 934868603, 762291277, 574514660, 915073327, 706290988, 538338078, 121579047, 930408501, 961501726, 720472269, 122644891, 315183685, 614013223, 630600910, 936271287, 132325306, 329074227, 611391723, 738993005, 24780272, 106741367, 186089088, 257542763, 580346308, 78197151, 866636383, 915165040, 637200475, 179140378, 754441528, 479361100, 302755233, 554385033, 778512279, 563709831, 723108200, 261122832, 888714801, 21411887, 14799093, 189683303, 92932032, 531227, 183403347, 742832224, 799580047, 471544539, 16166225, 879479632, 796150602, 934108151, 453844881, 798597493),66717029), BigInt("16431925969"))
42
+ }
43
+
44
+ }
construct_2d_grid_matching_graph_layout/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
construct_2d_grid_matching_graph_layout/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(new ArrayList<>(Arrays.asList(3,1)),new ArrayList<>(Arrays.asList(2,0)))), constructGridLayout(4, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(0,2)),new ArrayList<>(Arrays.asList(1,3)),new ArrayList<>(Arrays.asList(2,3))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(4,2,3,1,0)))), constructGridLayout(5, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(1,3)),new ArrayList<>(Arrays.asList(2,3)),new ArrayList<>(Arrays.asList(2,4))))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(8,6,3)),new ArrayList<>(Arrays.asList(7,4,2)),new ArrayList<>(Arrays.asList(1,0,5)))), constructGridLayout(9, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(0,4)),new ArrayList<>(Arrays.asList(0,5)),new ArrayList<>(Arrays.asList(1,7)),new ArrayList<>(Arrays.asList(2,3)),new ArrayList<>(Arrays.asList(2,4)),new ArrayList<>(Arrays.asList(2,5)),new ArrayList<>(Arrays.asList(3,6)),new ArrayList<>(Arrays.asList(4,6)),new ArrayList<>(Arrays.asList(4,7)),new ArrayList<>(Arrays.asList(6,8)),new ArrayList<>(Arrays.asList(7,8))))));
23
+ }
24
+
25
+ }
construct_2d_grid_matching_graph_layout/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
construct_2d_grid_matching_graph_layout/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
construct_2d_grid_matching_graph_layout/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
construct_product_matrix/haskell_tests/Main.hs ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+ constructProductMatrix :: [[Int]] -> [[Int]]
7
+ constructProductMatrix grid = undefined
8
+
9
+ --Program end
10
+
11
+ -- Test cases
12
+
13
+ test1 :: Test
14
+ test1 = TestCase (assertEqual "for (constructProductMatrix [[1,2],[3,4]])," [[24,12],[8,6]] (constructProductMatrix [[1,2],[3,4]]))
15
+
16
+ test2 :: Test
17
+ test2 = TestCase (assertEqual "for (constructProductMatrix [[12345],[2],[1]])," [[2],[0],[0]] (constructProductMatrix [[12345],[2],[1]]))
18
+
19
+ test3 :: Test
20
+ test3 = TestCase (assertEqual "for (constructProductMatrix [[12075, 12075, 7245, 2145, 10350, 11805, 11535], [11940, 12165, 2145, 10725, 11535, 2145, 11535], [10350, 10350, 11535, 5970, 11940, 10350, 7245]])," [[12075,12075,7245,2145,10350,11805,11535],[11940,12165,2145,10725,11535,2145,11535],[10350,10350,11535,5970,11940,10350,7245]] (constructProductMatrix [[12075, 12075, 7245, 2145, 10350, 11805, 11535], [11940, 12165, 2145, 10725, 11535, 2145, 11535], [10350, 10350, 11535, 5970, 11940, 10350, 7245]]))
21
+
22
+ test4 :: Test
23
+ test4 = TestCase (assertEqual "for (constructProductMatrix [[60, 120, 9975, 2550, 240], [9375, 8535, 1680, 11460, 10650], [4305, 9975, 240, 8265, 825], [5448, 3360, 1335, 4440, 8790]])," [[60,120,9975,2550,240],[9375,8535,1680,11460,10650],[4305,9975,240,8265,825],[5448,3360,1335,4440,8790]] (constructProductMatrix [[60, 120, 9975, 2550, 240], [9375, 8535, 1680, 11460, 10650], [4305, 9975, 240, 8265, 825], [5448, 3360, 1335, 4440, 8790]]))
24
+
25
+ test5 :: Test
26
+ test5 = TestCase (assertEqual "for (constructProductMatrix [[6705], [4794], [3855], [12270], [3240], [11550], [6750], [4755], [11250]])," [[6705],[4794],[3855],[12270],[3240],[11550],[6750],[4755],[11250]] (constructProductMatrix [[6705], [4794], [3855], [12270], [3240], [11550], [6750], [4755], [11250]]))
27
+
28
+ test6 :: Test
29
+ test6 = TestCase (assertEqual "for (constructProductMatrix [[9285], [2235], [4700], [3375], [9615], [3600]])," [[9285],[2235],[4700],[3375],[9615],[3600]] (constructProductMatrix [[9285], [2235], [4700], [3375], [9615], [3600]]))
30
+
31
+ test7 :: Test
32
+ test7 = TestCase (assertEqual "for (constructProductMatrix [[9780, 9345, 11940, 5865, 6480], [7320, 11640, 9240, 1080, 4410], [30, 3435, 12075, 10755, 150], [1215, 8415, 7410, 8925, 12225], [8340, 4500, 4785, 768, 855]])," [[9780,9345,11940,5865,6480],[7320,11640,9240,1080,4410],[30,3435,12075,10755,150],[1215,8415,7410,8925,12225],[8340,4500,4785,768,855]] (constructProductMatrix [[9780, 9345, 11940, 5865, 6480], [7320, 11640, 9240, 1080, 4410], [30, 3435, 12075, 10755, 150], [1215, 8415, 7410, 8925, 12225], [8340, 4500, 4785, 768, 855]]))
33
+
34
+
35
+ -- Grouping test cases
36
+ tests :: Test
37
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6]
38
+
39
+ -- Running the tests
40
+ main :: IO Counts
41
+ main = runTestTT tests
construct_product_matrix/java_tests/Main.java ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(Arrays.asList(Arrays.asList(24,12),Arrays.asList(8,6)), constructProductMatrix(Arrays.asList(Arrays.asList(1,2),Arrays.asList(3,4))));
14
+ }
15
+ @Test
16
+ public void test2() {
17
+ assertEquals(Arrays.asList(Arrays.asList(2),Arrays.asList(0),Arrays.asList(0)), constructProductMatrix(Arrays.asList(Arrays.asList(12345),Arrays.asList(2),Arrays.asList(1))));
18
+ }
19
+
20
+ }
construct_product_matrix/meta.json ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3031,
3
+ "name": "construct_product_matrix",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/construct-product-matrix/",
6
+ "date": "2023-10-08 00:00:00",
7
+ "task_description": "Given a **0-indexed** 2D integer matrix `grid` of size `n * m`, we define a **0-indexed** 2D matrix `p` of size `n * m` as the **product** matrix of `grid` if the following condition is met: Each element `p[i][j]` is calculated as the product of all elements in `grid` except for the element `grid[i][j]`. This product is then taken modulo `12345`. Return _the product matrix of_ `grid`. **Example 1:** ``` **Input:** grid = [[1,2],[3,4]] **Output:** [[24,12],[8,6]] **Explanation:** p[0][0] = grid[0][1] * grid[1][0] * grid[1][1] = 2 * 3 * 4 = 24 p[0][1] = grid[0][0] * grid[1][0] * grid[1][1] = 1 * 3 * 4 = 12 p[1][0] = grid[0][0] * grid[0][1] * grid[1][1] = 1 * 2 * 4 = 8 p[1][1] = grid[0][0] * grid[0][1] * grid[1][0] = 1 * 2 * 3 = 6 So the answer is [[24,12],[8,6]]. ``` **Example 2:** ``` **Input:** grid = [[12345],[2],[1]] **Output:** [[2],[0],[0]] **Explanation:** p[0][0] = grid[0][1] * grid[0][2] = 2 * 1 = 2. p[0][1] = grid[0][0] * grid[0][2] = 12345 * 1 = 12345. 12345 % 12345 = 0. So p[0][1] = 0. p[0][2] = grid[0][0] * grid[0][1] = 12345 * 2 = 24690. 24690 % 12345 = 0. So p[0][2] = 0. So the answer is [[2],[0],[0]]. ``` **Constraints:** `1 <= n == grid.length <= 105` `1 <= m == grid[i].length <= 105` `2 <= n * m <= 105` `1 <= grid[i][j] <= 109`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "grid = [[1,2],[3,4]]",
12
+ "output": "[[24,12],[8,6]] "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "grid = [[12345],[2],[1]]",
17
+ "output": "[[2],[0],[0]] "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ [
24
+ 12075,
25
+ 12075,
26
+ 7245,
27
+ 2145,
28
+ 10350,
29
+ 11805,
30
+ 11535
31
+ ],
32
+ [
33
+ 11940,
34
+ 12165,
35
+ 2145,
36
+ 10725,
37
+ 11535,
38
+ 2145,
39
+ 11535
40
+ ],
41
+ [
42
+ 10350,
43
+ 10350,
44
+ 11535,
45
+ 5970,
46
+ 11940,
47
+ 10350,
48
+ 7245
49
+ ]
50
+ ],
51
+ "output": [
52
+ [
53
+ 12075,
54
+ 12075,
55
+ 7245,
56
+ 2145,
57
+ 10350,
58
+ 11805,
59
+ 11535
60
+ ],
61
+ [
62
+ 11940,
63
+ 12165,
64
+ 2145,
65
+ 10725,
66
+ 11535,
67
+ 2145,
68
+ 11535
69
+ ],
70
+ [
71
+ 10350,
72
+ 10350,
73
+ 11535,
74
+ 5970,
75
+ 11940,
76
+ 10350,
77
+ 7245
78
+ ]
79
+ ]
80
+ },
81
+ {
82
+ "input": [
83
+ [
84
+ 60,
85
+ 120,
86
+ 9975,
87
+ 2550,
88
+ 240
89
+ ],
90
+ [
91
+ 9375,
92
+ 8535,
93
+ 1680,
94
+ 11460,
95
+ 10650
96
+ ],
97
+ [
98
+ 4305,
99
+ 9975,
100
+ 240,
101
+ 8265,
102
+ 825
103
+ ],
104
+ [
105
+ 5448,
106
+ 3360,
107
+ 1335,
108
+ 4440,
109
+ 8790
110
+ ]
111
+ ],
112
+ "output": [
113
+ [
114
+ 60,
115
+ 120,
116
+ 9975,
117
+ 2550,
118
+ 240
119
+ ],
120
+ [
121
+ 9375,
122
+ 8535,
123
+ 1680,
124
+ 11460,
125
+ 10650
126
+ ],
127
+ [
128
+ 4305,
129
+ 9975,
130
+ 240,
131
+ 8265,
132
+ 825
133
+ ],
134
+ [
135
+ 5448,
136
+ 3360,
137
+ 1335,
138
+ 4440,
139
+ 8790
140
+ ]
141
+ ]
142
+ },
143
+ {
144
+ "input": [
145
+ [
146
+ 6705
147
+ ],
148
+ [
149
+ 4794
150
+ ],
151
+ [
152
+ 3855
153
+ ],
154
+ [
155
+ 12270
156
+ ],
157
+ [
158
+ 3240
159
+ ],
160
+ [
161
+ 11550
162
+ ],
163
+ [
164
+ 6750
165
+ ],
166
+ [
167
+ 4755
168
+ ],
169
+ [
170
+ 11250
171
+ ]
172
+ ],
173
+ "output": [
174
+ [
175
+ 6705
176
+ ],
177
+ [
178
+ 4794
179
+ ],
180
+ [
181
+ 3855
182
+ ],
183
+ [
184
+ 12270
185
+ ],
186
+ [
187
+ 3240
188
+ ],
189
+ [
190
+ 11550
191
+ ],
192
+ [
193
+ 6750
194
+ ],
195
+ [
196
+ 4755
197
+ ],
198
+ [
199
+ 11250
200
+ ]
201
+ ]
202
+ },
203
+ {
204
+ "input": [
205
+ [
206
+ 9285
207
+ ],
208
+ [
209
+ 2235
210
+ ],
211
+ [
212
+ 4700
213
+ ],
214
+ [
215
+ 3375
216
+ ],
217
+ [
218
+ 9615
219
+ ],
220
+ [
221
+ 3600
222
+ ]
223
+ ],
224
+ "output": [
225
+ [
226
+ 9285
227
+ ],
228
+ [
229
+ 2235
230
+ ],
231
+ [
232
+ 4700
233
+ ],
234
+ [
235
+ 3375
236
+ ],
237
+ [
238
+ 9615
239
+ ],
240
+ [
241
+ 3600
242
+ ]
243
+ ]
244
+ },
245
+ {
246
+ "input": [
247
+ [
248
+ 9780,
249
+ 9345,
250
+ 11940,
251
+ 5865,
252
+ 6480
253
+ ],
254
+ [
255
+ 7320,
256
+ 11640,
257
+ 9240,
258
+ 1080,
259
+ 4410
260
+ ],
261
+ [
262
+ 30,
263
+ 3435,
264
+ 12075,
265
+ 10755,
266
+ 150
267
+ ],
268
+ [
269
+ 1215,
270
+ 8415,
271
+ 7410,
272
+ 8925,
273
+ 12225
274
+ ],
275
+ [
276
+ 8340,
277
+ 4500,
278
+ 4785,
279
+ 768,
280
+ 855
281
+ ]
282
+ ],
283
+ "output": [
284
+ [
285
+ 9780,
286
+ 9345,
287
+ 11940,
288
+ 5865,
289
+ 6480
290
+ ],
291
+ [
292
+ 7320,
293
+ 11640,
294
+ 9240,
295
+ 1080,
296
+ 4410
297
+ ],
298
+ [
299
+ 30,
300
+ 3435,
301
+ 12075,
302
+ 10755,
303
+ 150
304
+ ],
305
+ [
306
+ 1215,
307
+ 8415,
308
+ 7410,
309
+ 8925,
310
+ 12225
311
+ ],
312
+ [
313
+ 8340,
314
+ 4500,
315
+ 4785,
316
+ 768,
317
+ 855
318
+ ]
319
+ ]
320
+ }
321
+ ],
322
+ "haskell_template": "constructProductMatrix :: [[Int]] -> [[Int]]\nconstructProductMatrix grid ",
323
+ "ocaml_template": "let constructProductMatrix (grid: int list list) : int list list = ",
324
+ "scala_template": "def constructProductMatrix(grid: List[List[Int]]): List[List[Int]] = { \n \n}",
325
+ "java_template": "class Solution {\n public int[][] constructProductMatrix(int[][] grid) {\n \n }\n}",
326
+ "python_template": "class Solution(object):\n def constructProductMatrix(self, grid):\n \"\"\"\n :type grid: List[List[int]]\n :rtype: List[List[int]]\n \"\"\"\n "
327
+ }
construct_product_matrix/ocaml_tests/main.ml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+ let constructProductMatrix (grid: int list list) : int list list = failwith "Not implemented"
7
+
8
+ (* Program end *)
9
+
10
+ (* Test cases *)
11
+
12
+ let test1 _ = assert_equal [[24;12];[8;6]] (constructProductMatrix [[1;2];[3;4]])
13
+
14
+ let test2 _ = assert_equal [[2];[0];[0]] (constructProductMatrix [[12345];[2];[1]])
15
+
16
+ let test3 _ = assert_equal [[2];[0];[0]] (constructProductMatrix [[12075; 12075; 7245; 2145; 10350; 11805; 11535]; [11940; 12165; 2145; 10725; 11535; 2145; 11535]; [10350; 10350; 11535; 5970; 11940; 10350; 7245]])
17
+
18
+ let test4 _ = assert_equal [[2];[0];[0]] (constructProductMatrix [[60; 120; 9975; 2550; 240]; [9375; 8535; 1680; 11460; 10650]; [4305; 9975; 240; 8265; 825]; [5448; 3360; 1335; 4440; 8790]])
19
+
20
+ let test5 _ = assert_equal [[2];[0];[0]] (constructProductMatrix [[6705]; [4794]; [3855]; [12270]; [3240]; [11550]; [6750]; [4755]; [11250]])
21
+
22
+ let test6 _ = assert_equal [[2];[0];[0]] (constructProductMatrix [[9285]; [2235]; [4700]; [3375]; [9615]; [3600]])
23
+
24
+ let test7 _ = assert_equal [[2];[0];[0]] (constructProductMatrix [[9780; 9345; 11940; 5865; 6480]; [7320; 11640; 9240; 1080; 4410]; [30; 3435; 12075; 10755; 150]; [1215; 8415; 7410; 8925; 12225]; [8340; 4500; 4785; 768; 855]])
25
+
26
+
27
+ (* Grouping test cases *)
28
+ let suite = "Test Suite for constructProductMatrix" >::: [
29
+
30
+ "test1" >:: test1;
31
+ "test2" >:: test2;
32
+ "test3" >:: test3;
33
+ "test4" >:: test4;
34
+ "test5" >:: test5;
35
+ "test6" >:: test6;
36
+ "test7" >:: test7;
37
+ ]
38
+
39
+
40
+ (* Running the tests *)
41
+ let () = run_test_tt_main suite
42
+ end
construct_product_matrix/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.constructProductMatrix(List(List(1,2),List(3,4))), List(List(24,12),List(8,6)))
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.constructProductMatrix(List(List(12345),List(2),List(1))), List(List(2),List(0),List(0)))
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.constructProductMatrix(List(12075, 12075, 7245, 2145, 10350, 11805, 11535),List(11940, 12165, 2145, 10725, 11535, 2145, 11535),List(10350, 10350, 11535, 5970, 11940, 10350, 7245)), List(List(12075,12075,7245,2145,10350,11805,11535),List(11940,12165,2145,10725,11535,2145,11535),List(10350,10350,11535,5970,11940,10350,7245)))
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.constructProductMatrix(List(60, 120, 9975, 2550, 240),List(9375, 8535, 1680, 11460, 10650),List(4305, 9975, 240, 8265, 825),List(5448, 3360, 1335, 4440, 8790)), List(List(60,120,9975,2550,240),List(9375,8535,1680,11460,10650),List(4305,9975,240,8265,825),List(5448,3360,1335,4440,8790)))
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.constructProductMatrix(List(6705),List(4794),List(3855),List(12270),List(3240),List(11550),List(6750),List(4755),List(11250)), List(List(6705),List(4794),List(3855),List(12270),List(3240),List(11550),List(6750),List(4755),List(11250)))
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.constructProductMatrix(List(9285),List(2235),List(4700),List(3375),List(9615),List(3600)), List(List(9285),List(2235),List(4700),List(3375),List(9615),List(3600)))
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.constructProductMatrix(List(9780, 9345, 11940, 5865, 6480),List(7320, 11640, 9240, 1080, 4410),List(30, 3435, 12075, 10755, 150),List(1215, 8415, 7410, 8925, 12225),List(8340, 4500, 4785, 768, 855)), List(List(9780,9345,11940,5865,6480),List(7320,11640,9240,1080,4410),List(30,3435,12075,10755,150),List(1215,8415,7410,8925,12225),List(8340,4500,4785,768,855)))
30
+ }
31
+
32
+ }
construct_smallest_number_from_di_string/.DS_Store ADDED
Binary file (6.15 kB). View file
 
construct_smallest_number_from_di_string/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 (smallestNumber \"IIIDIDDD \")," "123549876" (smallestNumber "IIIDIDDD"))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (smallestNumber \"DDD \")," "4321" (smallestNumber "DDD"))
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
construct_smallest_number_from_di_string/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("IIIDIDDD", smallestNumber("IIIDIDDD"));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("DDD", smallestNumber("DDD"));
19
+ }
20
+
21
+ }
construct_smallest_number_from_di_string/meta.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2456,
3
+ "name": "construct_smallest_number_from_di_string",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/construct-smallest-number-from-di-string/",
6
+ "date": "1659830400000",
7
+ "task_description": "You are given a **0-indexed** string `pattern` of length `n` consisting of the characters `'I'` meaning **increasing** and `'D'` meaning **decreasing**. A **0-indexed** string `num` of length `n + 1` is created using the following conditions: `num` consists of the digits `'1'` to `'9'`, where each digit is used **at most** once. If `pattern[i] == 'I'`, then `num[i] < num[i + 1]`. If `pattern[i] == 'D'`, then `num[i] > num[i + 1]`. Return _the lexicographically **smallest** possible string _`num`_ that meets the conditions._ **Example 1:** ``` **Input:** pattern = \"IIIDIDDD\" **Output:** \"123549876\" **Explanation: **At indices 0, 1, 2, and 4 we must have that num[i] < num[i+1]. At indices 3, 5, 6, and 7 we must have that num[i] > num[i+1]. Some possible values of num are \"245639871\", \"135749862\", and \"123849765\". It can be proven that \"123549876\" is the smallest possible num that meets the conditions. Note that \"123414321\" is not possible because the digit '1' is used more than once. ``` **Example 2:** ``` **Input:** pattern = \"DDD\" **Output:** \"4321\" **Explanation:** Some possible values of num are \"9876\", \"7321\", and \"8742\". It can be proven that \"4321\" is the smallest possible num that meets the conditions. ``` **Constraints:** `1 <= pattern.length <= 8` `pattern` consists of only the letters `'I'` and `'D'`.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "pattern = \"IIIDIDDD\"",
12
+ "output": "\"123549876\" "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "pattern = \"DDD\"",
17
+ "output": "\"4321\" "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": "DIDDIIII",
23
+ "output": "215436789"
24
+ },
25
+ {
26
+ "input": "IDIDDI",
27
+ "output": "1326547"
28
+ },
29
+ {
30
+ "input": "DDD",
31
+ "output": "4321"
32
+ },
33
+ {
34
+ "input": "IIIII",
35
+ "output": "123456"
36
+ },
37
+ {
38
+ "input": "IIDDIDD",
39
+ "output": "12543876"
40
+ },
41
+ {
42
+ "input": "IDIDDD",
43
+ "output": "1327654"
44
+ },
45
+ {
46
+ "input": "I",
47
+ "output": "12"
48
+ },
49
+ {
50
+ "input": "III",
51
+ "output": "1234"
52
+ },
53
+ {
54
+ "input": "DDDIIDI",
55
+ "output": "43215768"
56
+ },
57
+ {
58
+ "input": "II",
59
+ "output": "123"
60
+ }
61
+ ],
62
+ "haskell_template": "smallestNumber :: String -> String\nsmallestNumber pattern ",
63
+ "ocaml_template": "let smallestNumber (pattern: string) : string = ",
64
+ "scala_template": "def smallestNumber(pattern: String): String = { \n \n}",
65
+ "java_template": "public static String smallestNumber(String pattern) {\n\n}",
66
+ "python_template": "class Solution(object):\n def smallestNumber(self, pattern):\n \"\"\"\n :type pattern: str\n :rtype: str\n \"\"\"\n "
67
+ }
construct_smallest_number_from_di_string/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 "123549876" (smallestNumber "IIIDIDDD")
12
+
13
+ let test2 _ = assert_equal "4321" (smallestNumber "DDD")
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for smallestNumber" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
construct_smallest_number_from_di_string/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.smallestNumber("IIIDIDDD"), "123549876")
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.smallestNumber("DDD"), "4321")
10
+ }
11
+
12
+ }
construct_string_with_repeat_limit/.DS_Store ADDED
Binary file (6.15 kB). View file
 
construct_string_with_repeat_limit/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 (repeatLimitedString \"cczazcc \" 3)," "zzcccac" (repeatLimitedString "cczazcc" 3))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (repeatLimitedString \"aababab \" 2)," "bbabaa" (repeatLimitedString "aababab" 2))
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
construct_string_with_repeat_limit/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("3", repeatLimitedString("cczazcc", 3));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("2", repeatLimitedString("aababab", 2));
19
+ }
20
+
21
+ }
construct_string_with_repeat_limit/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
construct_string_with_repeat_limit/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 "zzcccac" (repeatLimitedString "cczazcc" 3)
12
+
13
+ let test2 _ = assert_equal "bbabaa" (repeatLimitedString "aababab" 2)
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for repeatLimitedString" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
construct_string_with_repeat_limit/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.repeatLimitedString("cczazcc",3), "zzcccac")
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.repeatLimitedString("aababab",2), "bbabaa")
10
+ }
11
+
12
+ }
construct_the_longest_new_string/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 (longestString 2 5 1)," 12 (longestString 2 5 1))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (longestString 3 2 2)," 14 (longestString 3 2 2))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (longestString 36 18 13)," 100 (longestString 36 18 13))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (longestString 48 31 5)," 136 (longestString 48 31 5))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (longestString 46 17 28)," 126 (longestString 46 17 28))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (longestString 3 24 18)," 50 (longestString 3 24 18))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (longestString 17 30 17)," 104 (longestString 17 30 17))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (longestString 4 40 28)," 74 (longestString 4 40 28))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (longestString 4 35 25)," 68 (longestString 4 35 25))
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, TestLabel "Test9" test9]
42
+
43
+ -- Running the tests
44
+ main :: IO Counts
45
+ main = runTestTT tests
construct_the_longest_new_string/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(12, longestString(2, 5, 1));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(14, longestString(3, 2, 2));
19
+ }
20
+
21
+ }
construct_the_longest_new_string/meta.json ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2850,
3
+ "name": "construct_the_longest_new_string",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/construct-the-longest-new-string/",
6
+ "date": "2023-06-10 00:00:00",
7
+ "task_description": "You are given three integers `x`, `y`, and `z`. You have `x` strings equal to `\"AA\"`, `y` strings equal to `\"BB\"`, and `z` strings equal to `\"AB\"`. You want to choose some (possibly all or none) of these strings and concatenate them in some order to form a new string. This new string must not contain `\"AAA\"` or `\"BBB\"` as a substring. Return _the maximum possible length of the new string_. A substring is a contiguous **non-empty** sequence of characters within a string. **Example 1:** ``` **Input:** x = 2, y = 5, z = 1 **Output:** 12 **Explanation: **We can concatenate the strings \"BB\", \"AA\", \"BB\", \"AA\", \"BB\", and \"AB\" in that order. Then, our new string is \"BBAABBAABBAB\". That string has length 12, and we can show that it is impossible to construct a string of longer length. ``` **Example 2:** ``` **Input:** x = 3, y = 2, z = 2 **Output:** 14 **Explanation:** We can concatenate the strings \"AB\", \"AB\", \"AA\", \"BB\", \"AA\", \"BB\", and \"AA\" in that order. Then, our new string is \"ABABAABBAABBAA\". That string has length 14, and we can show that it is impossible to construct a string of longer length. ``` **Constraints:** `1 <= x, y, z <= 50`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "x = 2, y = 5, z = 1",
12
+ "output": "12 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "x = 3, y = 2, z = 2",
17
+ "output": "14 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ 36,
24
+ 18,
25
+ 13
26
+ ],
27
+ "output": 100
28
+ },
29
+ {
30
+ "input": [
31
+ 48,
32
+ 31,
33
+ 5
34
+ ],
35
+ "output": 136
36
+ },
37
+ {
38
+ "input": [
39
+ 46,
40
+ 17,
41
+ 28
42
+ ],
43
+ "output": 126
44
+ },
45
+ {
46
+ "input": [
47
+ 3,
48
+ 24,
49
+ 18
50
+ ],
51
+ "output": 50
52
+ },
53
+ {
54
+ "input": [
55
+ 17,
56
+ 30,
57
+ 17
58
+ ],
59
+ "output": 104
60
+ },
61
+ {
62
+ "input": [
63
+ 4,
64
+ 40,
65
+ 28
66
+ ],
67
+ "output": 74
68
+ },
69
+ {
70
+ "input": [
71
+ 4,
72
+ 35,
73
+ 25
74
+ ],
75
+ "output": 68
76
+ },
77
+ {
78
+ "input": [
79
+ 34,
80
+ 17,
81
+ 32
82
+ ],
83
+ "output": 134
84
+ },
85
+ {
86
+ "input": [
87
+ 32,
88
+ 11,
89
+ 17
90
+ ],
91
+ "output": 80
92
+ },
93
+ {
94
+ "input": [
95
+ 44,
96
+ 42,
97
+ 30
98
+ ],
99
+ "output": 230
100
+ }
101
+ ],
102
+ "haskell_template": "longestString :: Int -> Int -> Int -> Int\nlongestString x y z ",
103
+ "ocaml_template": "let longestString (x: int) (y: int) (z: int) : int = ",
104
+ "scala_template": "def longestString(x: Int,y: Int,z: Int): Int = { \n \n}",
105
+ "java_template": "class Solution {\n public int longestString(int x, int y, int z) {\n \n }\n}",
106
+ "python_template": "class Solution(object):\n def longestString(self, x, y, z):\n \"\"\"\n :type x: int\n :type y: int\n :type z: int\n :rtype: int\n \"\"\"\n "
107
+ }
construct_the_longest_new_string/ocaml_tests/main.ml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 12 (longestString 2 5 1)
12
+
13
+ let test2 _ = assert_equal 14 (longestString 3 2 2)
14
+
15
+ let test3 _ = assert_equal 100 (longestString 36 18 13)
16
+
17
+ let test4 _ = assert_equal 136 (longestString 48 31 5)
18
+
19
+ let test5 _ = assert_equal 126 (longestString 46 17 28)
20
+
21
+ let test6 _ = assert_equal 50 (longestString 3 24 18)
22
+
23
+ let test7 _ = assert_equal 104 (longestString 17 30 17)
24
+
25
+ let test8 _ = assert_equal 74 (longestString 4 40 28)
26
+
27
+ let test9 _ = assert_equal 68 (longestString 4 35 25)
28
+
29
+ let test10 _ = assert_equal 134 (longestString 34 17 32)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for longestString" >::: [
34
+
35
+ "test1" >:: test1;
36
+ "test2" >:: test2;
37
+ "test3" >:: test3;
38
+ "test4" >:: test4;
39
+ "test5" >:: test5;
40
+ "test6" >:: test6;
41
+ "test7" >:: test7;
42
+ "test8" >:: test8;
43
+ "test9" >:: test9;
44
+ "test10" >:: test10;
45
+ ]
46
+
47
+
48
+ (* Running the tests *)
49
+ let () = run_test_tt_main suite
50
+ end
construct_the_longest_new_string/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.longestString(2,5,1), 12)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.longestString(3,2,2), 14)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.longestString(36,18,13), 100)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.longestString(48,31,5), 136)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.longestString(46,17,28), 126)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.longestString(3,24,18), 50)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.longestString(17,30,17), 104)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.longestString(4,40,28), 74)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.longestString(4,35,25), 68)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.longestString(34,17,32), 134)
42
+ }
43
+
44
+ }
continuous_subarrays/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
continuous_subarrays/java_tests/Main.java ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(8, continuousSubarrays(Arrays.asList(5,4,2,4)));
14
+ }
15
+ @Test
16
+ public void test2() {
17
+ assertEquals(6, continuousSubarrays(Arrays.asList(1,2,3)));
18
+ }
19
+
20
+ }
continuous_subarrays/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
continuous_subarrays/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
continuous_subarrays/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
convert_an_array_into_a_2d_array_with_conditions/.DS_Store ADDED
Binary file (6.15 kB). View file
 
convert_an_array_into_a_2d_array_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 (findMatrix [1,3,4,1,2,3,1])," [[1,3,4,2],[1,3],[1]] (findMatrix [1,3,4,1,2,3,1]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (findMatrix [1,2,3,4])," [[4,3,2,1]] (findMatrix [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
convert_an_array_into_a_2d_array_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(1,3,4,2)),new ArrayList<>(Arrays.asList(1,3)),new ArrayList<>(Arrays.asList(1)))), findMatrix(new ArrayList<>(Arrays.asList(1,3,4,1,2,3,1))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(4,3,2,1)))), findMatrix(new ArrayList<>(Arrays.asList(1,2,3,4))));
19
+ }
20
+
21
+ }
convert_an_array_into_a_2d_array_with_conditions/meta.json ADDED
@@ -0,0 +1,2509 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2724,
3
+ "name": "convert_an_array_into_a_2d_array_with_conditions",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/convert-an-array-into-a-2d-array-with-conditions/",
6
+ "date": "1679788800000",
7
+ "task_description": "You are given an integer array `nums`. You need to create a 2D array from `nums` satisfying the following conditions: The 2D array should contain **only** the elements of the array `nums`. Each row in the 2D array contains **distinct** integers. The number of rows in the 2D array should be **minimal**. Return _the resulting array_. If there are multiple answers, return any of them. **Note** that the 2D array can have a different number of elements on each row. **Example 1:** ``` **Input:** nums = [1,3,4,1,2,3,1] **Output:** [[1,3,4,2],[1,3],[1]] **Explanation:** We can create a 2D array that contains the following rows: - 1,3,4,2 - 1,3 - 1 All elements of nums were used, and each row of the 2D array contains distinct integers, so it is a valid answer. It can be shown that we cannot have less than 3 rows in a valid array. ``` **Example 2:** ``` **Input:** nums = [1,2,3,4] **Output:** [[4,3,2,1]] **Explanation:** All elements of the array are distinct, so we can keep all of them in the first row of the 2D array. ``` **Constraints:** `1 <= nums.length <= 200` `1 <= nums[i] <= nums.length`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums = [1,3,4,1,2,3,1]",
12
+ "output": "[[1,3,4,2],[1,3],[1]] "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums = [1,2,3,4]",
17
+ "output": "[[4,3,2,1]] "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ 9,
24
+ 12,
25
+ 16,
26
+ 14,
27
+ 13,
28
+ 16,
29
+ 3,
30
+ 13,
31
+ 3,
32
+ 16,
33
+ 6,
34
+ 14,
35
+ 9,
36
+ 15,
37
+ 4,
38
+ 3
39
+ ],
40
+ "output": [
41
+ [
42
+ 9,
43
+ 12,
44
+ 16,
45
+ 14,
46
+ 13,
47
+ 3,
48
+ 6,
49
+ 15,
50
+ 4
51
+ ],
52
+ [
53
+ 16,
54
+ 13,
55
+ 3,
56
+ 14,
57
+ 9
58
+ ],
59
+ [
60
+ 16,
61
+ 3
62
+ ]
63
+ ]
64
+ },
65
+ {
66
+ "input": [
67
+ 50,
68
+ 171,
69
+ 12,
70
+ 21,
71
+ 97,
72
+ 73,
73
+ 43,
74
+ 32,
75
+ 130,
76
+ 53,
77
+ 124,
78
+ 178,
79
+ 35,
80
+ 84,
81
+ 150,
82
+ 165,
83
+ 162,
84
+ 104,
85
+ 184,
86
+ 89,
87
+ 46,
88
+ 95,
89
+ 25,
90
+ 95,
91
+ 63,
92
+ 105,
93
+ 111,
94
+ 73,
95
+ 160,
96
+ 32,
97
+ 139,
98
+ 43,
99
+ 117,
100
+ 70,
101
+ 33,
102
+ 115,
103
+ 31,
104
+ 182,
105
+ 151,
106
+ 149,
107
+ 70,
108
+ 150,
109
+ 109,
110
+ 37,
111
+ 128,
112
+ 184,
113
+ 11,
114
+ 105,
115
+ 162,
116
+ 181,
117
+ 3,
118
+ 97,
119
+ 17,
120
+ 96,
121
+ 144,
122
+ 133,
123
+ 3,
124
+ 119,
125
+ 78,
126
+ 198,
127
+ 48,
128
+ 9,
129
+ 5,
130
+ 60,
131
+ 124,
132
+ 138,
133
+ 41,
134
+ 79,
135
+ 88,
136
+ 102,
137
+ 171,
138
+ 129,
139
+ 134,
140
+ 143,
141
+ 117,
142
+ 185,
143
+ 21,
144
+ 191,
145
+ 118,
146
+ 146,
147
+ 142,
148
+ 135,
149
+ 190,
150
+ 177,
151
+ 29,
152
+ 125,
153
+ 104,
154
+ 70,
155
+ 6,
156
+ 25,
157
+ 127,
158
+ 43,
159
+ 13,
160
+ 167,
161
+ 163,
162
+ 193,
163
+ 85,
164
+ 13,
165
+ 83,
166
+ 95,
167
+ 78,
168
+ 140,
169
+ 91,
170
+ 35,
171
+ 67,
172
+ 28,
173
+ 160,
174
+ 143,
175
+ 8,
176
+ 54,
177
+ 81,
178
+ 29,
179
+ 142,
180
+ 167,
181
+ 110,
182
+ 46,
183
+ 188,
184
+ 40,
185
+ 155,
186
+ 141,
187
+ 153,
188
+ 5,
189
+ 164,
190
+ 77,
191
+ 1,
192
+ 7,
193
+ 82,
194
+ 180,
195
+ 80,
196
+ 82,
197
+ 194,
198
+ 135,
199
+ 76,
200
+ 149,
201
+ 21,
202
+ 12,
203
+ 31,
204
+ 181,
205
+ 183,
206
+ 23,
207
+ 71,
208
+ 158,
209
+ 127,
210
+ 157,
211
+ 86,
212
+ 103,
213
+ 88,
214
+ 154,
215
+ 33,
216
+ 172,
217
+ 6,
218
+ 149,
219
+ 50,
220
+ 161,
221
+ 99,
222
+ 88,
223
+ 97,
224
+ 162,
225
+ 72,
226
+ 8,
227
+ 148,
228
+ 122,
229
+ 33,
230
+ 164,
231
+ 135,
232
+ 166,
233
+ 21,
234
+ 14,
235
+ 161,
236
+ 15,
237
+ 30,
238
+ 12,
239
+ 65,
240
+ 196,
241
+ 85,
242
+ 115,
243
+ 164,
244
+ 75,
245
+ 84,
246
+ 93,
247
+ 178,
248
+ 72,
249
+ 102,
250
+ 190,
251
+ 85,
252
+ 63,
253
+ 150,
254
+ 198,
255
+ 49,
256
+ 120,
257
+ 13,
258
+ 71,
259
+ 76,
260
+ 65,
261
+ 70,
262
+ 74,
263
+ 160,
264
+ 6,
265
+ 22
266
+ ],
267
+ "output": [
268
+ [
269
+ 50,
270
+ 171,
271
+ 12,
272
+ 21,
273
+ 97,
274
+ 73,
275
+ 43,
276
+ 32,
277
+ 130,
278
+ 53,
279
+ 124,
280
+ 178,
281
+ 35,
282
+ 84,
283
+ 150,
284
+ 165,
285
+ 162,
286
+ 104,
287
+ 184,
288
+ 89,
289
+ 46,
290
+ 95,
291
+ 25,
292
+ 63,
293
+ 105,
294
+ 111,
295
+ 160,
296
+ 139,
297
+ 117,
298
+ 70,
299
+ 33,
300
+ 115,
301
+ 31,
302
+ 182,
303
+ 151,
304
+ 149,
305
+ 109,
306
+ 37,
307
+ 128,
308
+ 11,
309
+ 181,
310
+ 3,
311
+ 17,
312
+ 96,
313
+ 144,
314
+ 133,
315
+ 119,
316
+ 78,
317
+ 198,
318
+ 48,
319
+ 9,
320
+ 5,
321
+ 60,
322
+ 138,
323
+ 41,
324
+ 79,
325
+ 88,
326
+ 102,
327
+ 129,
328
+ 134,
329
+ 143,
330
+ 185,
331
+ 191,
332
+ 118,
333
+ 146,
334
+ 142,
335
+ 135,
336
+ 190,
337
+ 177,
338
+ 29,
339
+ 125,
340
+ 6,
341
+ 127,
342
+ 13,
343
+ 167,
344
+ 163,
345
+ 193,
346
+ 85,
347
+ 83,
348
+ 140,
349
+ 91,
350
+ 67,
351
+ 28,
352
+ 8,
353
+ 54,
354
+ 81,
355
+ 110,
356
+ 188,
357
+ 40,
358
+ 155,
359
+ 141,
360
+ 153,
361
+ 164,
362
+ 77,
363
+ 1,
364
+ 7,
365
+ 82,
366
+ 180,
367
+ 80,
368
+ 194,
369
+ 76,
370
+ 183,
371
+ 23,
372
+ 71,
373
+ 158,
374
+ 157,
375
+ 86,
376
+ 103,
377
+ 154,
378
+ 172,
379
+ 161,
380
+ 99,
381
+ 72,
382
+ 148,
383
+ 122,
384
+ 166,
385
+ 14,
386
+ 15,
387
+ 30,
388
+ 65,
389
+ 196,
390
+ 75,
391
+ 93,
392
+ 49,
393
+ 120,
394
+ 74,
395
+ 22
396
+ ],
397
+ [
398
+ 95,
399
+ 73,
400
+ 32,
401
+ 43,
402
+ 70,
403
+ 150,
404
+ 184,
405
+ 105,
406
+ 162,
407
+ 97,
408
+ 3,
409
+ 124,
410
+ 171,
411
+ 117,
412
+ 21,
413
+ 104,
414
+ 25,
415
+ 13,
416
+ 78,
417
+ 35,
418
+ 160,
419
+ 143,
420
+ 29,
421
+ 142,
422
+ 167,
423
+ 46,
424
+ 5,
425
+ 82,
426
+ 135,
427
+ 149,
428
+ 12,
429
+ 31,
430
+ 181,
431
+ 127,
432
+ 88,
433
+ 33,
434
+ 6,
435
+ 50,
436
+ 8,
437
+ 164,
438
+ 161,
439
+ 85,
440
+ 115,
441
+ 84,
442
+ 178,
443
+ 72,
444
+ 102,
445
+ 190,
446
+ 63,
447
+ 198,
448
+ 71,
449
+ 76,
450
+ 65
451
+ ],
452
+ [
453
+ 70,
454
+ 43,
455
+ 95,
456
+ 21,
457
+ 149,
458
+ 88,
459
+ 97,
460
+ 162,
461
+ 33,
462
+ 135,
463
+ 12,
464
+ 164,
465
+ 85,
466
+ 150,
467
+ 13,
468
+ 160,
469
+ 6
470
+ ],
471
+ [
472
+ 21,
473
+ 70
474
+ ]
475
+ ]
476
+ },
477
+ {
478
+ "input": [
479
+ 86,
480
+ 6,
481
+ 164,
482
+ 100,
483
+ 131,
484
+ 10,
485
+ 109,
486
+ 115,
487
+ 66,
488
+ 45,
489
+ 155,
490
+ 151,
491
+ 106,
492
+ 90,
493
+ 60,
494
+ 16,
495
+ 115,
496
+ 46,
497
+ 16,
498
+ 25,
499
+ 152,
500
+ 51,
501
+ 26,
502
+ 14,
503
+ 8,
504
+ 22,
505
+ 21,
506
+ 59,
507
+ 49,
508
+ 141,
509
+ 19,
510
+ 118,
511
+ 69,
512
+ 108,
513
+ 81,
514
+ 122,
515
+ 88,
516
+ 34,
517
+ 148,
518
+ 32,
519
+ 115,
520
+ 19,
521
+ 171,
522
+ 147,
523
+ 72,
524
+ 80,
525
+ 133,
526
+ 65,
527
+ 134,
528
+ 28,
529
+ 73,
530
+ 24,
531
+ 79,
532
+ 113,
533
+ 90,
534
+ 55,
535
+ 37,
536
+ 5,
537
+ 84,
538
+ 3,
539
+ 160,
540
+ 53,
541
+ 25,
542
+ 132,
543
+ 109,
544
+ 51,
545
+ 92,
546
+ 63,
547
+ 70,
548
+ 107,
549
+ 84,
550
+ 161,
551
+ 60,
552
+ 36,
553
+ 141,
554
+ 75,
555
+ 61,
556
+ 145,
557
+ 99,
558
+ 15,
559
+ 2,
560
+ 163,
561
+ 13,
562
+ 165,
563
+ 76,
564
+ 77,
565
+ 86,
566
+ 151,
567
+ 112,
568
+ 151,
569
+ 60,
570
+ 22,
571
+ 114,
572
+ 47,
573
+ 69,
574
+ 3,
575
+ 31,
576
+ 142,
577
+ 38,
578
+ 130,
579
+ 174,
580
+ 89,
581
+ 127,
582
+ 68,
583
+ 14,
584
+ 92,
585
+ 62,
586
+ 87,
587
+ 152,
588
+ 22,
589
+ 168,
590
+ 40,
591
+ 87,
592
+ 62,
593
+ 58,
594
+ 168,
595
+ 98,
596
+ 18,
597
+ 75,
598
+ 176,
599
+ 164,
600
+ 141,
601
+ 25,
602
+ 141,
603
+ 52,
604
+ 118,
605
+ 149,
606
+ 8,
607
+ 108,
608
+ 27,
609
+ 85,
610
+ 45,
611
+ 126,
612
+ 56,
613
+ 127,
614
+ 122,
615
+ 99,
616
+ 114,
617
+ 89,
618
+ 1,
619
+ 30,
620
+ 135,
621
+ 47,
622
+ 168,
623
+ 141,
624
+ 117,
625
+ 22,
626
+ 95,
627
+ 139,
628
+ 125,
629
+ 113,
630
+ 129,
631
+ 71,
632
+ 19,
633
+ 157,
634
+ 28,
635
+ 71,
636
+ 161,
637
+ 151,
638
+ 58,
639
+ 173,
640
+ 113,
641
+ 135,
642
+ 146,
643
+ 151,
644
+ 78,
645
+ 112,
646
+ 160,
647
+ 59,
648
+ 89,
649
+ 63,
650
+ 81,
651
+ 23,
652
+ 164,
653
+ 47,
654
+ 110,
655
+ 93
656
+ ],
657
+ "output": [
658
+ [
659
+ 86,
660
+ 6,
661
+ 164,
662
+ 100,
663
+ 131,
664
+ 10,
665
+ 109,
666
+ 115,
667
+ 66,
668
+ 45,
669
+ 155,
670
+ 151,
671
+ 106,
672
+ 90,
673
+ 60,
674
+ 16,
675
+ 46,
676
+ 25,
677
+ 152,
678
+ 51,
679
+ 26,
680
+ 14,
681
+ 8,
682
+ 22,
683
+ 21,
684
+ 59,
685
+ 49,
686
+ 141,
687
+ 19,
688
+ 118,
689
+ 69,
690
+ 108,
691
+ 81,
692
+ 122,
693
+ 88,
694
+ 34,
695
+ 148,
696
+ 32,
697
+ 171,
698
+ 147,
699
+ 72,
700
+ 80,
701
+ 133,
702
+ 65,
703
+ 134,
704
+ 28,
705
+ 73,
706
+ 24,
707
+ 79,
708
+ 113,
709
+ 55,
710
+ 37,
711
+ 5,
712
+ 84,
713
+ 3,
714
+ 160,
715
+ 53,
716
+ 132,
717
+ 92,
718
+ 63,
719
+ 70,
720
+ 107,
721
+ 161,
722
+ 36,
723
+ 75,
724
+ 61,
725
+ 145,
726
+ 99,
727
+ 15,
728
+ 2,
729
+ 163,
730
+ 13,
731
+ 165,
732
+ 76,
733
+ 77,
734
+ 112,
735
+ 114,
736
+ 47,
737
+ 31,
738
+ 142,
739
+ 38,
740
+ 130,
741
+ 174,
742
+ 89,
743
+ 127,
744
+ 68,
745
+ 62,
746
+ 87,
747
+ 168,
748
+ 40,
749
+ 58,
750
+ 98,
751
+ 18,
752
+ 176,
753
+ 52,
754
+ 149,
755
+ 27,
756
+ 85,
757
+ 126,
758
+ 56,
759
+ 1,
760
+ 30,
761
+ 135,
762
+ 117,
763
+ 95,
764
+ 139,
765
+ 125,
766
+ 129,
767
+ 71,
768
+ 157,
769
+ 173,
770
+ 146,
771
+ 78,
772
+ 23,
773
+ 110,
774
+ 93
775
+ ],
776
+ [
777
+ 115,
778
+ 16,
779
+ 19,
780
+ 90,
781
+ 25,
782
+ 109,
783
+ 51,
784
+ 84,
785
+ 60,
786
+ 141,
787
+ 86,
788
+ 151,
789
+ 22,
790
+ 69,
791
+ 3,
792
+ 14,
793
+ 92,
794
+ 152,
795
+ 87,
796
+ 62,
797
+ 168,
798
+ 75,
799
+ 164,
800
+ 118,
801
+ 8,
802
+ 108,
803
+ 45,
804
+ 127,
805
+ 122,
806
+ 99,
807
+ 114,
808
+ 89,
809
+ 47,
810
+ 113,
811
+ 28,
812
+ 71,
813
+ 161,
814
+ 58,
815
+ 135,
816
+ 112,
817
+ 160,
818
+ 59,
819
+ 63,
820
+ 81
821
+ ],
822
+ [
823
+ 115,
824
+ 151,
825
+ 60,
826
+ 22,
827
+ 141,
828
+ 25,
829
+ 168,
830
+ 19,
831
+ 113,
832
+ 89,
833
+ 164,
834
+ 47
835
+ ],
836
+ [
837
+ 141,
838
+ 22,
839
+ 151
840
+ ],
841
+ [
842
+ 141,
843
+ 151
844
+ ]
845
+ ]
846
+ },
847
+ {
848
+ "input": [
849
+ 83,
850
+ 84,
851
+ 61,
852
+ 81,
853
+ 111,
854
+ 33,
855
+ 38,
856
+ 190,
857
+ 69,
858
+ 149,
859
+ 157,
860
+ 147,
861
+ 171,
862
+ 57,
863
+ 46,
864
+ 178,
865
+ 50,
866
+ 115,
867
+ 106,
868
+ 160,
869
+ 33,
870
+ 136,
871
+ 45,
872
+ 46,
873
+ 53,
874
+ 69,
875
+ 94,
876
+ 156,
877
+ 172,
878
+ 94,
879
+ 78,
880
+ 25,
881
+ 10,
882
+ 5,
883
+ 139,
884
+ 65,
885
+ 18,
886
+ 146,
887
+ 53,
888
+ 11,
889
+ 127,
890
+ 14,
891
+ 25,
892
+ 77,
893
+ 100,
894
+ 147,
895
+ 3,
896
+ 168,
897
+ 38,
898
+ 162,
899
+ 4,
900
+ 187,
901
+ 113,
902
+ 176,
903
+ 89,
904
+ 11,
905
+ 100,
906
+ 139,
907
+ 119,
908
+ 2,
909
+ 80,
910
+ 46,
911
+ 168,
912
+ 120,
913
+ 62,
914
+ 120,
915
+ 63,
916
+ 118,
917
+ 17,
918
+ 126,
919
+ 21,
920
+ 85,
921
+ 89,
922
+ 183,
923
+ 132,
924
+ 81,
925
+ 15,
926
+ 165,
927
+ 145,
928
+ 69,
929
+ 86,
930
+ 23,
931
+ 99,
932
+ 74,
933
+ 25,
934
+ 38,
935
+ 169,
936
+ 68,
937
+ 128,
938
+ 128,
939
+ 145,
940
+ 144,
941
+ 78,
942
+ 134,
943
+ 6,
944
+ 150,
945
+ 22,
946
+ 158,
947
+ 174,
948
+ 5,
949
+ 188,
950
+ 67,
951
+ 178,
952
+ 155,
953
+ 6,
954
+ 139,
955
+ 54,
956
+ 25,
957
+ 15,
958
+ 88,
959
+ 139,
960
+ 79,
961
+ 181,
962
+ 159,
963
+ 58,
964
+ 106,
965
+ 78,
966
+ 21,
967
+ 60,
968
+ 35,
969
+ 46,
970
+ 100,
971
+ 124,
972
+ 159,
973
+ 68,
974
+ 120,
975
+ 3,
976
+ 152,
977
+ 8,
978
+ 51,
979
+ 183,
980
+ 141,
981
+ 174,
982
+ 103,
983
+ 25,
984
+ 188,
985
+ 20,
986
+ 17,
987
+ 46,
988
+ 112,
989
+ 25,
990
+ 22,
991
+ 66,
992
+ 32,
993
+ 57,
994
+ 181,
995
+ 5,
996
+ 145,
997
+ 59,
998
+ 34,
999
+ 95,
1000
+ 96,
1001
+ 58,
1002
+ 100,
1003
+ 46,
1004
+ 71,
1005
+ 142,
1006
+ 96,
1007
+ 95,
1008
+ 177,
1009
+ 135,
1010
+ 168,
1011
+ 184,
1012
+ 98,
1013
+ 128,
1014
+ 41,
1015
+ 109,
1016
+ 5,
1017
+ 104,
1018
+ 116,
1019
+ 87,
1020
+ 36,
1021
+ 37,
1022
+ 91,
1023
+ 188,
1024
+ 2,
1025
+ 147,
1026
+ 110,
1027
+ 156,
1028
+ 162,
1029
+ 3,
1030
+ 75,
1031
+ 96,
1032
+ 176,
1033
+ 24,
1034
+ 57,
1035
+ 93,
1036
+ 98,
1037
+ 24,
1038
+ 143
1039
+ ],
1040
+ "output": [
1041
+ [
1042
+ 83,
1043
+ 84,
1044
+ 61,
1045
+ 81,
1046
+ 111,
1047
+ 33,
1048
+ 38,
1049
+ 190,
1050
+ 69,
1051
+ 149,
1052
+ 157,
1053
+ 147,
1054
+ 171,
1055
+ 57,
1056
+ 46,
1057
+ 178,
1058
+ 50,
1059
+ 115,
1060
+ 106,
1061
+ 160,
1062
+ 136,
1063
+ 45,
1064
+ 53,
1065
+ 94,
1066
+ 156,
1067
+ 172,
1068
+ 78,
1069
+ 25,
1070
+ 10,
1071
+ 5,
1072
+ 139,
1073
+ 65,
1074
+ 18,
1075
+ 146,
1076
+ 11,
1077
+ 127,
1078
+ 14,
1079
+ 77,
1080
+ 100,
1081
+ 3,
1082
+ 168,
1083
+ 162,
1084
+ 4,
1085
+ 187,
1086
+ 113,
1087
+ 176,
1088
+ 89,
1089
+ 119,
1090
+ 2,
1091
+ 80,
1092
+ 120,
1093
+ 62,
1094
+ 63,
1095
+ 118,
1096
+ 17,
1097
+ 126,
1098
+ 21,
1099
+ 85,
1100
+ 183,
1101
+ 132,
1102
+ 15,
1103
+ 165,
1104
+ 145,
1105
+ 86,
1106
+ 23,
1107
+ 99,
1108
+ 74,
1109
+ 169,
1110
+ 68,
1111
+ 128,
1112
+ 144,
1113
+ 134,
1114
+ 6,
1115
+ 150,
1116
+ 22,
1117
+ 158,
1118
+ 174,
1119
+ 188,
1120
+ 67,
1121
+ 155,
1122
+ 54,
1123
+ 88,
1124
+ 79,
1125
+ 181,
1126
+ 159,
1127
+ 58,
1128
+ 60,
1129
+ 35,
1130
+ 124,
1131
+ 152,
1132
+ 8,
1133
+ 51,
1134
+ 141,
1135
+ 103,
1136
+ 20,
1137
+ 112,
1138
+ 66,
1139
+ 32,
1140
+ 59,
1141
+ 34,
1142
+ 95,
1143
+ 96,
1144
+ 71,
1145
+ 142,
1146
+ 177,
1147
+ 135,
1148
+ 184,
1149
+ 98,
1150
+ 41,
1151
+ 109,
1152
+ 104,
1153
+ 116,
1154
+ 87,
1155
+ 36,
1156
+ 37,
1157
+ 91,
1158
+ 110,
1159
+ 75,
1160
+ 24,
1161
+ 93,
1162
+ 143
1163
+ ],
1164
+ [
1165
+ 33,
1166
+ 46,
1167
+ 69,
1168
+ 94,
1169
+ 53,
1170
+ 25,
1171
+ 147,
1172
+ 38,
1173
+ 11,
1174
+ 100,
1175
+ 139,
1176
+ 168,
1177
+ 120,
1178
+ 89,
1179
+ 81,
1180
+ 128,
1181
+ 145,
1182
+ 78,
1183
+ 5,
1184
+ 178,
1185
+ 6,
1186
+ 15,
1187
+ 106,
1188
+ 21,
1189
+ 159,
1190
+ 68,
1191
+ 3,
1192
+ 183,
1193
+ 174,
1194
+ 188,
1195
+ 17,
1196
+ 22,
1197
+ 57,
1198
+ 181,
1199
+ 58,
1200
+ 96,
1201
+ 95,
1202
+ 2,
1203
+ 156,
1204
+ 162,
1205
+ 176,
1206
+ 98,
1207
+ 24
1208
+ ],
1209
+ [
1210
+ 46,
1211
+ 69,
1212
+ 25,
1213
+ 38,
1214
+ 139,
1215
+ 78,
1216
+ 100,
1217
+ 120,
1218
+ 5,
1219
+ 145,
1220
+ 168,
1221
+ 128,
1222
+ 188,
1223
+ 147,
1224
+ 3,
1225
+ 96,
1226
+ 57
1227
+ ],
1228
+ [
1229
+ 25,
1230
+ 139,
1231
+ 46,
1232
+ 100,
1233
+ 5
1234
+ ],
1235
+ [
1236
+ 25,
1237
+ 46
1238
+ ],
1239
+ [
1240
+ 25,
1241
+ 46
1242
+ ]
1243
+ ]
1244
+ },
1245
+ {
1246
+ "input": [
1247
+ 72,
1248
+ 34,
1249
+ 31,
1250
+ 75,
1251
+ 38,
1252
+ 65,
1253
+ 77,
1254
+ 95,
1255
+ 77,
1256
+ 9,
1257
+ 93,
1258
+ 3,
1259
+ 59,
1260
+ 22,
1261
+ 73,
1262
+ 7,
1263
+ 35,
1264
+ 45,
1265
+ 91,
1266
+ 56,
1267
+ 22,
1268
+ 28,
1269
+ 69,
1270
+ 23,
1271
+ 86,
1272
+ 98,
1273
+ 78,
1274
+ 3,
1275
+ 103,
1276
+ 39,
1277
+ 95,
1278
+ 21,
1279
+ 99,
1280
+ 3,
1281
+ 83,
1282
+ 5,
1283
+ 18,
1284
+ 26,
1285
+ 83,
1286
+ 89,
1287
+ 96,
1288
+ 89,
1289
+ 16,
1290
+ 3,
1291
+ 65,
1292
+ 30,
1293
+ 62,
1294
+ 43,
1295
+ 44,
1296
+ 43,
1297
+ 41,
1298
+ 92,
1299
+ 74,
1300
+ 74,
1301
+ 81,
1302
+ 5,
1303
+ 30,
1304
+ 66,
1305
+ 87,
1306
+ 83,
1307
+ 20,
1308
+ 44,
1309
+ 31,
1310
+ 43,
1311
+ 42,
1312
+ 44,
1313
+ 100,
1314
+ 26,
1315
+ 99,
1316
+ 34,
1317
+ 48,
1318
+ 6,
1319
+ 18,
1320
+ 46,
1321
+ 70,
1322
+ 23,
1323
+ 47,
1324
+ 28,
1325
+ 99,
1326
+ 49,
1327
+ 75,
1328
+ 20,
1329
+ 85,
1330
+ 37,
1331
+ 14,
1332
+ 74,
1333
+ 4,
1334
+ 4,
1335
+ 12,
1336
+ 64,
1337
+ 88,
1338
+ 76,
1339
+ 34,
1340
+ 89,
1341
+ 86,
1342
+ 91,
1343
+ 48,
1344
+ 23,
1345
+ 15,
1346
+ 5,
1347
+ 33,
1348
+ 29,
1349
+ 29,
1350
+ 18,
1351
+ 60
1352
+ ],
1353
+ "output": [
1354
+ [
1355
+ 72,
1356
+ 34,
1357
+ 31,
1358
+ 75,
1359
+ 38,
1360
+ 65,
1361
+ 77,
1362
+ 95,
1363
+ 9,
1364
+ 93,
1365
+ 3,
1366
+ 59,
1367
+ 22,
1368
+ 73,
1369
+ 7,
1370
+ 35,
1371
+ 45,
1372
+ 91,
1373
+ 56,
1374
+ 28,
1375
+ 69,
1376
+ 23,
1377
+ 86,
1378
+ 98,
1379
+ 78,
1380
+ 103,
1381
+ 39,
1382
+ 21,
1383
+ 99,
1384
+ 83,
1385
+ 5,
1386
+ 18,
1387
+ 26,
1388
+ 89,
1389
+ 96,
1390
+ 16,
1391
+ 30,
1392
+ 62,
1393
+ 43,
1394
+ 44,
1395
+ 41,
1396
+ 92,
1397
+ 74,
1398
+ 81,
1399
+ 66,
1400
+ 87,
1401
+ 20,
1402
+ 42,
1403
+ 100,
1404
+ 48,
1405
+ 6,
1406
+ 46,
1407
+ 70,
1408
+ 47,
1409
+ 49,
1410
+ 85,
1411
+ 37,
1412
+ 14,
1413
+ 4,
1414
+ 12,
1415
+ 64,
1416
+ 88,
1417
+ 76,
1418
+ 15,
1419
+ 33,
1420
+ 29,
1421
+ 60
1422
+ ],
1423
+ [
1424
+ 77,
1425
+ 22,
1426
+ 3,
1427
+ 95,
1428
+ 83,
1429
+ 89,
1430
+ 65,
1431
+ 43,
1432
+ 74,
1433
+ 5,
1434
+ 30,
1435
+ 44,
1436
+ 31,
1437
+ 26,
1438
+ 99,
1439
+ 34,
1440
+ 18,
1441
+ 23,
1442
+ 28,
1443
+ 75,
1444
+ 20,
1445
+ 4,
1446
+ 86,
1447
+ 91,
1448
+ 48,
1449
+ 29
1450
+ ],
1451
+ [
1452
+ 3,
1453
+ 83,
1454
+ 43,
1455
+ 44,
1456
+ 99,
1457
+ 74,
1458
+ 34,
1459
+ 89,
1460
+ 23,
1461
+ 5,
1462
+ 18
1463
+ ],
1464
+ [
1465
+ 3
1466
+ ]
1467
+ ]
1468
+ },
1469
+ {
1470
+ "input": [
1471
+ 150,
1472
+ 72,
1473
+ 67,
1474
+ 64,
1475
+ 173,
1476
+ 164,
1477
+ 132,
1478
+ 158,
1479
+ 137,
1480
+ 85,
1481
+ 171,
1482
+ 170,
1483
+ 142,
1484
+ 76,
1485
+ 28,
1486
+ 121,
1487
+ 24,
1488
+ 23,
1489
+ 1,
1490
+ 125,
1491
+ 100,
1492
+ 105,
1493
+ 14,
1494
+ 27,
1495
+ 57,
1496
+ 155,
1497
+ 73,
1498
+ 168,
1499
+ 124,
1500
+ 63,
1501
+ 66,
1502
+ 97,
1503
+ 58,
1504
+ 6,
1505
+ 62,
1506
+ 109,
1507
+ 55,
1508
+ 113,
1509
+ 143,
1510
+ 18,
1511
+ 88,
1512
+ 53,
1513
+ 153,
1514
+ 92,
1515
+ 86,
1516
+ 170,
1517
+ 177,
1518
+ 23,
1519
+ 137,
1520
+ 60,
1521
+ 175,
1522
+ 130,
1523
+ 83,
1524
+ 158,
1525
+ 30,
1526
+ 143,
1527
+ 182,
1528
+ 20,
1529
+ 135,
1530
+ 102,
1531
+ 107,
1532
+ 129,
1533
+ 175,
1534
+ 91,
1535
+ 32,
1536
+ 164,
1537
+ 149,
1538
+ 40,
1539
+ 100,
1540
+ 126,
1541
+ 87,
1542
+ 154,
1543
+ 165,
1544
+ 115,
1545
+ 93,
1546
+ 85,
1547
+ 64,
1548
+ 102,
1549
+ 47,
1550
+ 43,
1551
+ 156,
1552
+ 94,
1553
+ 1,
1554
+ 13,
1555
+ 117,
1556
+ 2,
1557
+ 55,
1558
+ 45,
1559
+ 41,
1560
+ 180,
1561
+ 7,
1562
+ 118,
1563
+ 12,
1564
+ 97,
1565
+ 3,
1566
+ 2,
1567
+ 49,
1568
+ 33,
1569
+ 45,
1570
+ 112,
1571
+ 141,
1572
+ 41,
1573
+ 54,
1574
+ 77,
1575
+ 50,
1576
+ 95,
1577
+ 167,
1578
+ 72,
1579
+ 148,
1580
+ 66,
1581
+ 91,
1582
+ 127,
1583
+ 46,
1584
+ 159,
1585
+ 13,
1586
+ 42,
1587
+ 70,
1588
+ 79,
1589
+ 45,
1590
+ 161,
1591
+ 79,
1592
+ 48,
1593
+ 159,
1594
+ 53,
1595
+ 180,
1596
+ 68,
1597
+ 61,
1598
+ 55,
1599
+ 91,
1600
+ 29,
1601
+ 114,
1602
+ 26,
1603
+ 29,
1604
+ 155,
1605
+ 155,
1606
+ 155,
1607
+ 48,
1608
+ 88,
1609
+ 141,
1610
+ 74,
1611
+ 90,
1612
+ 163,
1613
+ 105,
1614
+ 181,
1615
+ 95,
1616
+ 144,
1617
+ 107,
1618
+ 173,
1619
+ 123,
1620
+ 116,
1621
+ 47,
1622
+ 163,
1623
+ 13,
1624
+ 114,
1625
+ 70,
1626
+ 164,
1627
+ 28,
1628
+ 161,
1629
+ 152,
1630
+ 108,
1631
+ 44,
1632
+ 175,
1633
+ 22,
1634
+ 132,
1635
+ 120,
1636
+ 99,
1637
+ 12,
1638
+ 143,
1639
+ 123,
1640
+ 129,
1641
+ 132,
1642
+ 16,
1643
+ 164,
1644
+ 147,
1645
+ 181,
1646
+ 100,
1647
+ 131,
1648
+ 168,
1649
+ 41,
1650
+ 30,
1651
+ 137,
1652
+ 28,
1653
+ 40
1654
+ ],
1655
+ "output": [
1656
+ [
1657
+ 150,
1658
+ 72,
1659
+ 67,
1660
+ 64,
1661
+ 173,
1662
+ 164,
1663
+ 132,
1664
+ 158,
1665
+ 137,
1666
+ 85,
1667
+ 171,
1668
+ 170,
1669
+ 142,
1670
+ 76,
1671
+ 28,
1672
+ 121,
1673
+ 24,
1674
+ 23,
1675
+ 1,
1676
+ 125,
1677
+ 100,
1678
+ 105,
1679
+ 14,
1680
+ 27,
1681
+ 57,
1682
+ 155,
1683
+ 73,
1684
+ 168,
1685
+ 124,
1686
+ 63,
1687
+ 66,
1688
+ 97,
1689
+ 58,
1690
+ 6,
1691
+ 62,
1692
+ 109,
1693
+ 55,
1694
+ 113,
1695
+ 143,
1696
+ 18,
1697
+ 88,
1698
+ 53,
1699
+ 153,
1700
+ 92,
1701
+ 86,
1702
+ 177,
1703
+ 60,
1704
+ 175,
1705
+ 130,
1706
+ 83,
1707
+ 30,
1708
+ 182,
1709
+ 20,
1710
+ 135,
1711
+ 102,
1712
+ 107,
1713
+ 129,
1714
+ 91,
1715
+ 32,
1716
+ 149,
1717
+ 40,
1718
+ 126,
1719
+ 87,
1720
+ 154,
1721
+ 165,
1722
+ 115,
1723
+ 93,
1724
+ 47,
1725
+ 43,
1726
+ 156,
1727
+ 94,
1728
+ 13,
1729
+ 117,
1730
+ 2,
1731
+ 45,
1732
+ 41,
1733
+ 180,
1734
+ 7,
1735
+ 118,
1736
+ 12,
1737
+ 3,
1738
+ 49,
1739
+ 33,
1740
+ 112,
1741
+ 141,
1742
+ 54,
1743
+ 77,
1744
+ 50,
1745
+ 95,
1746
+ 167,
1747
+ 148,
1748
+ 127,
1749
+ 46,
1750
+ 159,
1751
+ 42,
1752
+ 70,
1753
+ 79,
1754
+ 161,
1755
+ 48,
1756
+ 68,
1757
+ 61,
1758
+ 29,
1759
+ 114,
1760
+ 26,
1761
+ 74,
1762
+ 90,
1763
+ 163,
1764
+ 181,
1765
+ 144,
1766
+ 123,
1767
+ 116,
1768
+ 152,
1769
+ 108,
1770
+ 44,
1771
+ 22,
1772
+ 120,
1773
+ 99,
1774
+ 16,
1775
+ 147,
1776
+ 131
1777
+ ],
1778
+ [
1779
+ 170,
1780
+ 23,
1781
+ 137,
1782
+ 158,
1783
+ 143,
1784
+ 175,
1785
+ 164,
1786
+ 100,
1787
+ 85,
1788
+ 64,
1789
+ 102,
1790
+ 1,
1791
+ 55,
1792
+ 97,
1793
+ 2,
1794
+ 45,
1795
+ 41,
1796
+ 72,
1797
+ 66,
1798
+ 91,
1799
+ 13,
1800
+ 79,
1801
+ 159,
1802
+ 53,
1803
+ 180,
1804
+ 29,
1805
+ 155,
1806
+ 48,
1807
+ 88,
1808
+ 141,
1809
+ 105,
1810
+ 95,
1811
+ 107,
1812
+ 173,
1813
+ 47,
1814
+ 163,
1815
+ 114,
1816
+ 70,
1817
+ 28,
1818
+ 161,
1819
+ 132,
1820
+ 12,
1821
+ 123,
1822
+ 129,
1823
+ 181,
1824
+ 168,
1825
+ 30,
1826
+ 40
1827
+ ],
1828
+ [
1829
+ 45,
1830
+ 55,
1831
+ 91,
1832
+ 155,
1833
+ 13,
1834
+ 164,
1835
+ 175,
1836
+ 143,
1837
+ 132,
1838
+ 100,
1839
+ 41,
1840
+ 137,
1841
+ 28
1842
+ ],
1843
+ [
1844
+ 155,
1845
+ 164
1846
+ ]
1847
+ ]
1848
+ },
1849
+ {
1850
+ "input": [
1851
+ 4,
1852
+ 16,
1853
+ 14,
1854
+ 9,
1855
+ 19,
1856
+ 20,
1857
+ 19,
1858
+ 14,
1859
+ 25,
1860
+ 24,
1861
+ 12,
1862
+ 11,
1863
+ 12,
1864
+ 11,
1865
+ 3,
1866
+ 6,
1867
+ 21,
1868
+ 11,
1869
+ 11,
1870
+ 21,
1871
+ 17,
1872
+ 22,
1873
+ 2,
1874
+ 10,
1875
+ 2
1876
+ ],
1877
+ "output": [
1878
+ [
1879
+ 4,
1880
+ 16,
1881
+ 14,
1882
+ 9,
1883
+ 19,
1884
+ 20,
1885
+ 25,
1886
+ 24,
1887
+ 12,
1888
+ 11,
1889
+ 3,
1890
+ 6,
1891
+ 21,
1892
+ 17,
1893
+ 22,
1894
+ 2,
1895
+ 10
1896
+ ],
1897
+ [
1898
+ 19,
1899
+ 14,
1900
+ 12,
1901
+ 11,
1902
+ 21,
1903
+ 2
1904
+ ],
1905
+ [
1906
+ 11
1907
+ ],
1908
+ [
1909
+ 11
1910
+ ]
1911
+ ]
1912
+ },
1913
+ {
1914
+ "input": [
1915
+ 105,
1916
+ 77,
1917
+ 46,
1918
+ 80,
1919
+ 80,
1920
+ 72,
1921
+ 23,
1922
+ 1,
1923
+ 31,
1924
+ 76,
1925
+ 86,
1926
+ 100,
1927
+ 20,
1928
+ 89,
1929
+ 113,
1930
+ 42,
1931
+ 114,
1932
+ 34,
1933
+ 29,
1934
+ 50,
1935
+ 94,
1936
+ 36,
1937
+ 65,
1938
+ 102,
1939
+ 35,
1940
+ 2,
1941
+ 116,
1942
+ 33,
1943
+ 65,
1944
+ 46,
1945
+ 12,
1946
+ 108,
1947
+ 23,
1948
+ 106,
1949
+ 66,
1950
+ 6,
1951
+ 10,
1952
+ 94,
1953
+ 55,
1954
+ 43,
1955
+ 51,
1956
+ 83,
1957
+ 12,
1958
+ 110,
1959
+ 42,
1960
+ 38,
1961
+ 50,
1962
+ 54,
1963
+ 51,
1964
+ 5,
1965
+ 116,
1966
+ 49,
1967
+ 53,
1968
+ 35,
1969
+ 47,
1970
+ 10,
1971
+ 35,
1972
+ 87,
1973
+ 47,
1974
+ 98,
1975
+ 55,
1976
+ 30,
1977
+ 51,
1978
+ 66,
1979
+ 2,
1980
+ 73,
1981
+ 111,
1982
+ 50,
1983
+ 62,
1984
+ 101,
1985
+ 89,
1986
+ 111,
1987
+ 47,
1988
+ 62,
1989
+ 88,
1990
+ 96,
1991
+ 14,
1992
+ 72,
1993
+ 15,
1994
+ 112,
1995
+ 54,
1996
+ 115,
1997
+ 91,
1998
+ 96,
1999
+ 101,
2000
+ 2,
2001
+ 46,
2002
+ 101,
2003
+ 87,
2004
+ 19,
2005
+ 84,
2006
+ 39,
2007
+ 110,
2008
+ 98,
2009
+ 84,
2010
+ 46,
2011
+ 23,
2012
+ 65,
2013
+ 91,
2014
+ 39,
2015
+ 52,
2016
+ 77,
2017
+ 52,
2018
+ 82,
2019
+ 92,
2020
+ 111,
2021
+ 106,
2022
+ 97,
2023
+ 24,
2024
+ 29,
2025
+ 8,
2026
+ 75,
2027
+ 97,
2028
+ 42,
2029
+ 4,
2030
+ 116
2031
+ ],
2032
+ "output": [
2033
+ [
2034
+ 105,
2035
+ 77,
2036
+ 46,
2037
+ 80,
2038
+ 72,
2039
+ 23,
2040
+ 1,
2041
+ 31,
2042
+ 76,
2043
+ 86,
2044
+ 100,
2045
+ 20,
2046
+ 89,
2047
+ 113,
2048
+ 42,
2049
+ 114,
2050
+ 34,
2051
+ 29,
2052
+ 50,
2053
+ 94,
2054
+ 36,
2055
+ 65,
2056
+ 102,
2057
+ 35,
2058
+ 2,
2059
+ 116,
2060
+ 33,
2061
+ 12,
2062
+ 108,
2063
+ 106,
2064
+ 66,
2065
+ 6,
2066
+ 10,
2067
+ 55,
2068
+ 43,
2069
+ 51,
2070
+ 83,
2071
+ 110,
2072
+ 38,
2073
+ 54,
2074
+ 5,
2075
+ 49,
2076
+ 53,
2077
+ 47,
2078
+ 87,
2079
+ 98,
2080
+ 30,
2081
+ 73,
2082
+ 111,
2083
+ 62,
2084
+ 101,
2085
+ 88,
2086
+ 96,
2087
+ 14,
2088
+ 15,
2089
+ 112,
2090
+ 115,
2091
+ 91,
2092
+ 19,
2093
+ 84,
2094
+ 39,
2095
+ 52,
2096
+ 82,
2097
+ 92,
2098
+ 97,
2099
+ 24,
2100
+ 8,
2101
+ 75,
2102
+ 4
2103
+ ],
2104
+ [
2105
+ 80,
2106
+ 65,
2107
+ 46,
2108
+ 23,
2109
+ 94,
2110
+ 12,
2111
+ 42,
2112
+ 50,
2113
+ 51,
2114
+ 116,
2115
+ 35,
2116
+ 10,
2117
+ 47,
2118
+ 55,
2119
+ 66,
2120
+ 2,
2121
+ 89,
2122
+ 111,
2123
+ 62,
2124
+ 72,
2125
+ 54,
2126
+ 96,
2127
+ 101,
2128
+ 87,
2129
+ 110,
2130
+ 98,
2131
+ 84,
2132
+ 91,
2133
+ 39,
2134
+ 77,
2135
+ 52,
2136
+ 106,
2137
+ 29,
2138
+ 97
2139
+ ],
2140
+ [
2141
+ 35,
2142
+ 51,
2143
+ 50,
2144
+ 47,
2145
+ 2,
2146
+ 46,
2147
+ 101,
2148
+ 23,
2149
+ 65,
2150
+ 111,
2151
+ 42,
2152
+ 116
2153
+ ],
2154
+ [
2155
+ 46
2156
+ ]
2157
+ ]
2158
+ },
2159
+ {
2160
+ "input": [
2161
+ 100,
2162
+ 3,
2163
+ 86,
2164
+ 59,
2165
+ 53,
2166
+ 40,
2167
+ 17,
2168
+ 31,
2169
+ 1,
2170
+ 136,
2171
+ 79,
2172
+ 134,
2173
+ 93,
2174
+ 12,
2175
+ 28,
2176
+ 67,
2177
+ 32,
2178
+ 95,
2179
+ 94,
2180
+ 85,
2181
+ 53,
2182
+ 16,
2183
+ 15,
2184
+ 59,
2185
+ 56,
2186
+ 37,
2187
+ 129,
2188
+ 63,
2189
+ 75,
2190
+ 74,
2191
+ 66,
2192
+ 84,
2193
+ 25,
2194
+ 102,
2195
+ 113,
2196
+ 51,
2197
+ 57,
2198
+ 52,
2199
+ 33,
2200
+ 38,
2201
+ 65,
2202
+ 28,
2203
+ 133,
2204
+ 99,
2205
+ 21,
2206
+ 96,
2207
+ 89,
2208
+ 111,
2209
+ 85,
2210
+ 6,
2211
+ 53,
2212
+ 113,
2213
+ 132,
2214
+ 20,
2215
+ 5,
2216
+ 36,
2217
+ 48,
2218
+ 86,
2219
+ 42,
2220
+ 39,
2221
+ 99,
2222
+ 31,
2223
+ 35,
2224
+ 138,
2225
+ 41,
2226
+ 19,
2227
+ 73,
2228
+ 94,
2229
+ 129,
2230
+ 12,
2231
+ 19,
2232
+ 133,
2233
+ 141,
2234
+ 81,
2235
+ 56,
2236
+ 41,
2237
+ 70,
2238
+ 107,
2239
+ 114,
2240
+ 108,
2241
+ 37,
2242
+ 98,
2243
+ 76,
2244
+ 22,
2245
+ 71,
2246
+ 124,
2247
+ 51,
2248
+ 129,
2249
+ 103,
2250
+ 48,
2251
+ 138,
2252
+ 13,
2253
+ 67,
2254
+ 117,
2255
+ 126,
2256
+ 82,
2257
+ 102,
2258
+ 120,
2259
+ 105,
2260
+ 117,
2261
+ 10,
2262
+ 34,
2263
+ 20,
2264
+ 136,
2265
+ 124,
2266
+ 132,
2267
+ 48,
2268
+ 43,
2269
+ 30,
2270
+ 116,
2271
+ 138,
2272
+ 124,
2273
+ 77,
2274
+ 141,
2275
+ 108,
2276
+ 123,
2277
+ 110,
2278
+ 116,
2279
+ 117,
2280
+ 35,
2281
+ 125,
2282
+ 38,
2283
+ 16,
2284
+ 77,
2285
+ 56,
2286
+ 92,
2287
+ 23,
2288
+ 103,
2289
+ 110,
2290
+ 15,
2291
+ 105,
2292
+ 53,
2293
+ 58,
2294
+ 87,
2295
+ 67,
2296
+ 72,
2297
+ 62,
2298
+ 134,
2299
+ 42,
2300
+ 41,
2301
+ 56
2302
+ ],
2303
+ "output": [
2304
+ [
2305
+ 100,
2306
+ 3,
2307
+ 86,
2308
+ 59,
2309
+ 53,
2310
+ 40,
2311
+ 17,
2312
+ 31,
2313
+ 1,
2314
+ 136,
2315
+ 79,
2316
+ 134,
2317
+ 93,
2318
+ 12,
2319
+ 28,
2320
+ 67,
2321
+ 32,
2322
+ 95,
2323
+ 94,
2324
+ 85,
2325
+ 16,
2326
+ 15,
2327
+ 56,
2328
+ 37,
2329
+ 129,
2330
+ 63,
2331
+ 75,
2332
+ 74,
2333
+ 66,
2334
+ 84,
2335
+ 25,
2336
+ 102,
2337
+ 113,
2338
+ 51,
2339
+ 57,
2340
+ 52,
2341
+ 33,
2342
+ 38,
2343
+ 65,
2344
+ 133,
2345
+ 99,
2346
+ 21,
2347
+ 96,
2348
+ 89,
2349
+ 111,
2350
+ 6,
2351
+ 132,
2352
+ 20,
2353
+ 5,
2354
+ 36,
2355
+ 48,
2356
+ 42,
2357
+ 39,
2358
+ 35,
2359
+ 138,
2360
+ 41,
2361
+ 19,
2362
+ 73,
2363
+ 141,
2364
+ 81,
2365
+ 70,
2366
+ 107,
2367
+ 114,
2368
+ 108,
2369
+ 98,
2370
+ 76,
2371
+ 22,
2372
+ 71,
2373
+ 124,
2374
+ 103,
2375
+ 13,
2376
+ 117,
2377
+ 126,
2378
+ 82,
2379
+ 120,
2380
+ 105,
2381
+ 10,
2382
+ 34,
2383
+ 43,
2384
+ 30,
2385
+ 116,
2386
+ 77,
2387
+ 123,
2388
+ 110,
2389
+ 125,
2390
+ 92,
2391
+ 23,
2392
+ 58,
2393
+ 87,
2394
+ 72,
2395
+ 62
2396
+ ],
2397
+ [
2398
+ 53,
2399
+ 59,
2400
+ 28,
2401
+ 85,
2402
+ 113,
2403
+ 86,
2404
+ 99,
2405
+ 31,
2406
+ 94,
2407
+ 129,
2408
+ 12,
2409
+ 19,
2410
+ 133,
2411
+ 56,
2412
+ 41,
2413
+ 37,
2414
+ 51,
2415
+ 48,
2416
+ 138,
2417
+ 67,
2418
+ 102,
2419
+ 117,
2420
+ 20,
2421
+ 136,
2422
+ 124,
2423
+ 132,
2424
+ 141,
2425
+ 108,
2426
+ 116,
2427
+ 35,
2428
+ 38,
2429
+ 16,
2430
+ 77,
2431
+ 103,
2432
+ 110,
2433
+ 15,
2434
+ 105,
2435
+ 134,
2436
+ 42
2437
+ ],
2438
+ [
2439
+ 53,
2440
+ 129,
2441
+ 48,
2442
+ 138,
2443
+ 124,
2444
+ 117,
2445
+ 56,
2446
+ 67,
2447
+ 41
2448
+ ],
2449
+ [
2450
+ 53,
2451
+ 56
2452
+ ]
2453
+ ]
2454
+ },
2455
+ {
2456
+ "input": [
2457
+ 12,
2458
+ 1,
2459
+ 2,
2460
+ 8,
2461
+ 11,
2462
+ 17,
2463
+ 12,
2464
+ 6,
2465
+ 10,
2466
+ 6,
2467
+ 14,
2468
+ 17,
2469
+ 4,
2470
+ 11,
2471
+ 10,
2472
+ 2,
2473
+ 10,
2474
+ 11
2475
+ ],
2476
+ "output": [
2477
+ [
2478
+ 12,
2479
+ 1,
2480
+ 2,
2481
+ 8,
2482
+ 11,
2483
+ 17,
2484
+ 6,
2485
+ 10,
2486
+ 14,
2487
+ 4
2488
+ ],
2489
+ [
2490
+ 12,
2491
+ 6,
2492
+ 17,
2493
+ 11,
2494
+ 10,
2495
+ 2
2496
+ ],
2497
+ [
2498
+ 10,
2499
+ 11
2500
+ ]
2501
+ ]
2502
+ }
2503
+ ],
2504
+ "haskell_template": "findMatrix :: [Int] -> [[Int]]\nfindMatrix nums ",
2505
+ "ocaml_template": "let findMatrix (nums: int list) : int list list = ",
2506
+ "scala_template": "def findMatrix(nums: List[Int]): List[List[Int]] = { \n \n}",
2507
+ "java_template": "public static List<List<Integer>> findMatrix(List<Integer> nums) {\n\n}",
2508
+ "python_template": "class Solution(object):\n def findMatrix(self, nums):\n \"\"\"\n :type nums: List[int]\n :rtype: List[List[int]]\n \"\"\"\n "
2509
+ }
convert_an_array_into_a_2d_array_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 [[1;3;4;2];[1;3];[1]] (findMatrix [1;3;4;1;2;3;1])
12
+
13
+ let test2 _ = assert_equal [[4;3;2;1]] (findMatrix [1;2;3;4])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for findMatrix" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
convert_an_array_into_a_2d_array_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.findMatrix(List(1,3,4,1,2,3,1)), List(List(1,3,4,2),List(1,3),List(1)))
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.findMatrix(List(1,2,3,4)), List(List(4,3,2,1)))
10
+ }
11
+
12
+ }