DatasetRepo commited on
Commit
621c2eb
·
verified ·
1 Parent(s): 796c546

50a19bd61a8e7d30d85ac2c2db11e620c1d1b94f685189f815467ae2019aa291

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. find_the_lexicographically_smallest_valid_sequence/java_tests/Main.java +29 -0
  3. find_the_longest_balanced_substring_of_a_binary_string/.DS_Store +0 -0
  4. find_the_longest_balanced_substring_of_a_binary_string/haskell_tests/Main.hs +27 -0
  5. find_the_longest_balanced_substring_of_a_binary_string/java_tests/Main.java +25 -0
  6. find_the_longest_balanced_substring_of_a_binary_string/meta.json +92 -0
  7. find_the_longest_balanced_substring_of_a_binary_string/ocaml_tests/main.ml +29 -0
  8. find_the_longest_balanced_substring_of_a_binary_string/scala_tests/MySuite.scala +16 -0
  9. find_the_longest_equal_subarray/haskell_tests/Main.hs +0 -0
  10. find_the_longest_equal_subarray/java_tests/Main.java +21 -0
  11. find_the_longest_equal_subarray/meta.json +3 -0
  12. find_the_longest_equal_subarray/ocaml_tests/main.ml +0 -0
  13. find_the_longest_equal_subarray/scala_tests/MySuite.scala +0 -0
  14. find_the_longest_semi_repetitive_substring/haskell_tests/Main.hs +47 -0
  15. find_the_longest_semi_repetitive_substring/java_tests/Main.java +24 -0
  16. find_the_longest_semi_repetitive_substring/meta.json +72 -0
  17. find_the_longest_semi_repetitive_substring/ocaml_tests/main.ml +51 -0
  18. find_the_longest_semi_repetitive_substring/scala_tests/MySuite.scala +44 -0
  19. find_the_losers_of_the_circular_game/haskell_tests/Main.hs +45 -0
  20. find_the_losers_of_the_circular_game/java_tests/Main.java +21 -0
  21. find_the_losers_of_the_circular_game/meta.json +285 -0
  22. find_the_losers_of_the_circular_game/ocaml_tests/main.ml +50 -0
  23. find_the_losers_of_the_circular_game/scala_tests/MySuite.scala +44 -0
  24. find_the_maximum_achievable_number/haskell_tests/Main.hs +45 -0
  25. find_the_maximum_achievable_number/java_tests/Main.java +21 -0
  26. find_the_maximum_achievable_number/meta.json +97 -0
  27. find_the_maximum_achievable_number/ocaml_tests/main.ml +50 -0
  28. find_the_maximum_achievable_number/scala_tests/MySuite.scala +44 -0
  29. find_the_maximum_divisibility_score/.DS_Store +0 -0
  30. find_the_maximum_divisibility_score/haskell_tests/Main.hs +27 -0
  31. find_the_maximum_divisibility_score/java_tests/Main.java +25 -0
  32. find_the_maximum_divisibility_score/meta.json +0 -0
  33. find_the_maximum_divisibility_score/ocaml_tests/main.ml +29 -0
  34. find_the_maximum_divisibility_score/scala_tests/MySuite.scala +16 -0
  35. find_the_maximum_length_of_a_good_subsequence_i/haskell_tests/Main.hs +45 -0
  36. find_the_maximum_length_of_a_good_subsequence_i/java_tests/Main.java +21 -0
  37. find_the_maximum_length_of_a_good_subsequence_i/meta.json +2996 -0
  38. find_the_maximum_length_of_a_good_subsequence_i/ocaml_tests/main.ml +50 -0
  39. find_the_maximum_length_of_a_good_subsequence_i/scala_tests/MySuite.scala +44 -0
  40. find_the_maximum_length_of_a_good_subsequence_ii/haskell_tests/Main.hs +0 -0
  41. find_the_maximum_length_of_a_good_subsequence_ii/java_tests/Main.java +21 -0
  42. find_the_maximum_length_of_a_good_subsequence_ii/meta.json +0 -0
  43. find_the_maximum_length_of_a_good_subsequence_ii/ocaml_tests/main.ml +0 -0
  44. find_the_maximum_length_of_a_good_subsequence_ii/scala_tests/MySuite.scala +0 -0
  45. find_the_maximum_length_of_valid_subsequence_i/java_tests/Main.java +25 -0
  46. find_the_maximum_length_of_valid_subsequence_ii/haskell_tests/Main.hs +45 -0
  47. find_the_maximum_length_of_valid_subsequence_ii/java_tests/Main.java +21 -0
  48. find_the_maximum_length_of_valid_subsequence_ii/meta.json +0 -0
  49. find_the_maximum_length_of_valid_subsequence_ii/ocaml_tests/main.ml +50 -0
  50. find_the_maximum_length_of_valid_subsequence_ii/scala_tests/MySuite.scala +44 -0
.gitattributes CHANGED
@@ -123,3 +123,4 @@ find_occurrences_of_an_element_in_an_array/meta.json filter=lfs diff=lfs merge=l
123
  find_subtree_sizes_after_changes/meta.json filter=lfs diff=lfs merge=lfs -text
124
  find_the_first_player_to_win_k_games_in_a_row/meta.json filter=lfs diff=lfs merge=lfs -text
125
  find_the_k_sum_of_an_array/meta.json filter=lfs diff=lfs merge=lfs -text
 
 
123
  find_subtree_sizes_after_changes/meta.json filter=lfs diff=lfs merge=lfs -text
124
  find_the_first_player_to_win_k_games_in_a_row/meta.json filter=lfs diff=lfs merge=lfs -text
125
  find_the_k_sum_of_an_array/meta.json filter=lfs diff=lfs merge=lfs -text
126
+ find_the_longest_equal_subarray/meta.json filter=lfs diff=lfs merge=lfs -text
find_the_lexicographically_smallest_valid_sequence/java_tests/Main.java ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(new ArrayList<>(Arrays.asList(0,1,2)), validSequence("vbcca", "abc"));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(1,2,4)), validSequence("bacdc", "abc"));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals([], validSequence("aaaaaa", "aaabc"));
23
+ }
24
+ @Test
25
+ public void test4() {
26
+ assertEquals([0,1, validSequence("abc", "ab"));
27
+ }
28
+
29
+ }
find_the_longest_balanced_substring_of_a_binary_string/.DS_Store ADDED
Binary file (6.15 kB). View file
 
find_the_longest_balanced_substring_of_a_binary_string/haskell_tests/Main.hs ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (findTheLongestBalancedSubstring \"01000111 \")," 6 (findTheLongestBalancedSubstring "01000111"))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (findTheLongestBalancedSubstring \"00111 \")," 4 (findTheLongestBalancedSubstring "00111"))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (findTheLongestBalancedSubstring \"111 \")," 0 (findTheLongestBalancedSubstring "111"))
19
+
20
+
21
+ -- Grouping test cases
22
+ tests :: Test
23
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2]
24
+
25
+ -- Running the tests
26
+ main :: IO Counts
27
+ main = runTestTT tests
find_the_longest_balanced_substring_of_a_binary_string/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(6, findTheLongestBalancedSubstring("01000111"));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(4, findTheLongestBalancedSubstring("00111"));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(0, findTheLongestBalancedSubstring("111"));
23
+ }
24
+
25
+ }
find_the_longest_balanced_substring_of_a_binary_string/meta.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2723,
3
+ "name": "find_the_longest_balanced_substring_of_a_binary_string",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/find-the-longest-balanced-substring-of-a-binary-string/",
6
+ "date": "1679788800000",
7
+ "task_description": "You are given a binary string `s` consisting only of zeroes and ones. A substring of `s` is considered balanced if** all zeroes are before ones** and the number of zeroes is equal to the number of ones inside the substring. Notice that the empty substring is considered a balanced substring. Return _the length of the longest balanced substring of _`s`. A substring is a contiguous sequence of characters within a string. **Example 1:** ``` **Input:** s = \"01000111\" **Output:** 6 **Explanation:** The longest balanced substring is \"000111\", which has length 6. ``` **Example 2:** ``` **Input:** s = \"00111\" **Output:** 4 **Explanation:** The longest balanced substring is \"0011\", which has length 4. ``` **Example 3:** ``` **Input:** s = \"111\" **Output:** 0 **Explanation:** There is no balanced substring except the empty substring, so the answer is 0. ``` **Constraints:** `1 <= s.length <= 50` `'0' <= s[i] <= '1'`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "s = \"01000111\"",
12
+ "output": "6 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "s = \"00111\"",
17
+ "output": "4 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "s = \"111\"",
22
+ "output": "0 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ "\"00010000101000110\""
29
+ ],
30
+ "output": 4
31
+ },
32
+ {
33
+ "input": [
34
+ "\"000110\""
35
+ ],
36
+ "output": 4
37
+ },
38
+ {
39
+ "input": [
40
+ "\"0001111001101010111010010010101001\""
41
+ ],
42
+ "output": 6
43
+ },
44
+ {
45
+ "input": [
46
+ "\"011101011001111111110\""
47
+ ],
48
+ "output": 4
49
+ },
50
+ {
51
+ "input": [
52
+ "\"00101010010110000110000100001011\""
53
+ ],
54
+ "output": 4
55
+ },
56
+ {
57
+ "input": [
58
+ "\"0110001101110011000100100011001101001\""
59
+ ],
60
+ "output": 4
61
+ },
62
+ {
63
+ "input": [
64
+ "011101010"
65
+ ],
66
+ "output": 2
67
+ },
68
+ {
69
+ "input": [
70
+ "010111011111001101000110110011110"
71
+ ],
72
+ "output": 4
73
+ },
74
+ {
75
+ "input": [
76
+ "101110001011010111011"
77
+ ],
78
+ "output": 2
79
+ },
80
+ {
81
+ "input": [
82
+ "101101101111100000"
83
+ ],
84
+ "output": 2
85
+ }
86
+ ],
87
+ "haskell_template": "findTheLongestBalancedSubstring :: String -> Int\nfindTheLongestBalancedSubstring s ",
88
+ "ocaml_template": "let findTheLongestBalancedSubstring (s: string) : int = ",
89
+ "scala_template": "def findTheLongestBalancedSubstring(s: String): Int = { \n \n}",
90
+ "java_template": "public static int findTheLongestBalancedSubstring(String s) {\n\n}",
91
+ "python_template": "class Solution(object):\n def findTheLongestBalancedSubstring(self, s):\n \"\"\"\n :type s: str\n :rtype: int\n \"\"\"\n "
92
+ }
find_the_longest_balanced_substring_of_a_binary_string/ocaml_tests/main.ml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 6 (findTheLongestBalancedSubstring "01000111")
12
+
13
+ let test2 _ = assert_equal 4 (findTheLongestBalancedSubstring "00111")
14
+
15
+ let test3 _ = assert_equal 0 (findTheLongestBalancedSubstring "111")
16
+
17
+
18
+ (* Grouping test cases *)
19
+ let suite = "Test Suite for findTheLongestBalancedSubstring" >::: [
20
+
21
+ "test1" >:: test1;
22
+ "test2" >:: test2;
23
+ "test3" >:: test3;
24
+ ]
25
+
26
+
27
+ (* Running the tests *)
28
+ let () = run_test_tt_main suite
29
+ end
find_the_longest_balanced_substring_of_a_binary_string/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.findTheLongestBalancedSubstring("01000111"), 6)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.findTheLongestBalancedSubstring("00111"), 4)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.findTheLongestBalancedSubstring("111"), 0)
14
+ }
15
+
16
+ }
find_the_longest_equal_subarray/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
find_the_longest_equal_subarray/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, longestEqualSubarray(new ArrayList<>(Arrays.asList(1,3,2,3,1,3)), 3));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(4, longestEqualSubarray(new ArrayList<>(Arrays.asList(1,1,2,2,1,1)), 2));
19
+ }
20
+
21
+ }
find_the_longest_equal_subarray/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7c38621139f1572e116c84f4f6711e0a692d1498c26c913521931104e0ee273
3
+ size 15149758
find_the_longest_equal_subarray/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
find_the_longest_equal_subarray/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
find_the_longest_semi_repetitive_substring/haskell_tests/Main.hs ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+ longestSemiRepetitiveSubstring :: String -> Int
7
+ longestSemiRepetitiveSubstring s = undefined
8
+
9
+ --Program end
10
+
11
+ -- Test cases
12
+
13
+ test1 :: Test
14
+ test1 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"52233 \")," 4 (longestSemiRepetitiveSubstring "52233"))
15
+
16
+ test2 :: Test
17
+ test2 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"5494 \")," 4 (longestSemiRepetitiveSubstring "5494"))
18
+
19
+ test3 :: Test
20
+ test3 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"1111111 \")," 2 (longestSemiRepetitiveSubstring "1111111"))
21
+
22
+ test4 :: Test
23
+ test4 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"800224406092326904284192442626098218931287187431 \")," 42 (longestSemiRepetitiveSubstring "800224406092326904284192442626098218931287187431"))
24
+
25
+ test5 :: Test
26
+ test5 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"82069083341368866002193339400441 \")," 14 (longestSemiRepetitiveSubstring "82069083341368866002193339400441"))
27
+
28
+ test6 :: Test
29
+ test6 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"5025542296885025828 \")," 12 (longestSemiRepetitiveSubstring "5025542296885025828"))
30
+
31
+ test7 :: Test
32
+ test7 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"4530164565084030141690 \")," 22 (longestSemiRepetitiveSubstring "4530164565084030141690"))
33
+
34
+ test8 :: Test
35
+ test8 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"7192337667651626882611322 \")," 13 (longestSemiRepetitiveSubstring "7192337667651626882611322"))
36
+
37
+ test9 :: Test
38
+ test9 = TestCase (assertEqual "for (longestSemiRepetitiveSubstring \"8027412881409430111445840735378988310 \")," 17 (longestSemiRepetitiveSubstring "8027412881409430111445840735378988310"))
39
+
40
+
41
+ -- Grouping test cases
42
+ tests :: Test
43
+ 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]
44
+
45
+ -- Running the tests
46
+ main :: IO Counts
47
+ main = runTestTT tests
find_the_longest_semi_repetitive_substring/java_tests/Main.java ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ public class Main {
7
+ //Program start
8
+
9
+ //Program end
10
+
11
+ @Test
12
+ public void test1() {
13
+ assertEquals(4, longestSemiRepetitiveSubstring("52233"));
14
+ }
15
+ @Test
16
+ public void test2() {
17
+ assertEquals(4, longestSemiRepetitiveSubstring("5494"));
18
+ }
19
+ @Test
20
+ public void test3() {
21
+ assertEquals(2, longestSemiRepetitiveSubstring("1111111"));
22
+ }
23
+
24
+ }
find_the_longest_semi_repetitive_substring/meta.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2786,
3
+ "name": "find_the_longest_semi_repetitive_substring",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/find-the-longest-semi-repetitive-substring/",
6
+ "date": "2023-05-27 00:00:00",
7
+ "task_description": "You are given a digit string `s` that consists of digits from 0 to 9. A string is called **semi-repetitive** if there is **at most** one adjacent pair of the same digit. For example, `\"0010\"`, `\"002020\"`, `\"0123\"`, `\"2002\"`, and `\"54944\"` are semi-repetitive while the following are not: `\"00101022\"` (adjacent same digit pairs are 00 and 22), and `\"1101234883\"` (adjacent same digit pairs are 11 and 88). Return the length of the **longest semi-repetitive substring** of `s`. **Example 1:** **Input:** s = \"52233\" **Output:** 4 **Explanation:** The longest semi-repetitive substring is \"5223\". Picking the whole string \"52233\" has two adjacent same digit pairs 22 and 33, but at most one is allowed. **Example 2:** **Input:** s = \"5494\" **Output:** 4 **Explanation:** `s` is a semi-repetitive string. **Example 3:** **Input:** s = \"1111111\" **Output:** 2 **Explanation:** The longest semi-repetitive substring is \"11\". Picking the substring \"111\" has two adjacent same digit pairs, but at most one is allowed. **Constraints:** `1 <= s.length <= 50` `'0' <= s[i] <= '9'`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "s = \"52233\"",
12
+ "output": "4 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "s = \"5494\"",
17
+ "output": "4 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "s = \"1111111\"",
22
+ "output": "2 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": "800224406092326904284192442626098218931287187431",
28
+ "output": 42
29
+ },
30
+ {
31
+ "input": "82069083341368866002193339400441",
32
+ "output": 14
33
+ },
34
+ {
35
+ "input": "5025542296885025828",
36
+ "output": 12
37
+ },
38
+ {
39
+ "input": "4530164565084030141690",
40
+ "output": 22
41
+ },
42
+ {
43
+ "input": "7192337667651626882611322",
44
+ "output": 13
45
+ },
46
+ {
47
+ "input": "8027412881409430111445840735378988310",
48
+ "output": 17
49
+ },
50
+ {
51
+ "input": "135433309636053",
52
+ "output": 10
53
+ },
54
+ {
55
+ "input": "378129559558437",
56
+ "output": 10
57
+ },
58
+ {
59
+ "input": "3820",
60
+ "output": 4
61
+ },
62
+ {
63
+ "input": "36873498932897249729768516",
64
+ "output": 26
65
+ }
66
+ ],
67
+ "haskell_template": "longestSemiRepetitiveSubstring :: String -> Int\nlongestSemiRepetitiveSubstring s ",
68
+ "ocaml_template": "let longestSemiRepetitiveSubstring (s: string) : int = ",
69
+ "scala_template": "def longestSemiRepetitiveSubstring(s: String): Int = { \n \n}",
70
+ "java_template": "class Solution {\n public int longestSemiRepetitiveSubstring(String s) {\n \n }\n}",
71
+ "python_template": "class Solution(object):\n def longestSemiRepetitiveSubstring(self, s):\n \"\"\"\n :type s: str\n :rtype: int\n \"\"\"\n "
72
+ }
find_the_longest_semi_repetitive_substring/ocaml_tests/main.ml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+ let longestSemiRepetitiveSubstring (s: string) : int = failwith "Not implemented"
7
+
8
+ (* Program end *)
9
+
10
+ (* Test cases *)
11
+
12
+ let test1 _ = assert_equal 4 (longestSemiRepetitiveSubstring "52233")
13
+
14
+ let test2 _ = assert_equal 4 (longestSemiRepetitiveSubstring "5494")
15
+
16
+ let test3 _ = assert_equal 2 (longestSemiRepetitiveSubstring "1111111")
17
+
18
+ let test4 _ = assert_equal 2 (longestSemiRepetitiveSubstring "800224406092326904284192442626098218931287187431")
19
+
20
+ let test5 _ = assert_equal 2 (longestSemiRepetitiveSubstring "82069083341368866002193339400441")
21
+
22
+ let test6 _ = assert_equal 2 (longestSemiRepetitiveSubstring "5025542296885025828")
23
+
24
+ let test7 _ = assert_equal 2 (longestSemiRepetitiveSubstring "4530164565084030141690")
25
+
26
+ let test8 _ = assert_equal 2 (longestSemiRepetitiveSubstring "7192337667651626882611322")
27
+
28
+ let test9 _ = assert_equal 2 (longestSemiRepetitiveSubstring "8027412881409430111445840735378988310")
29
+
30
+ let test10 _ = assert_equal 2 (longestSemiRepetitiveSubstring "135433309636053")
31
+
32
+
33
+ (* Grouping test cases *)
34
+ let suite = "Test Suite for longestSemiRepetitiveSubstring" >::: [
35
+
36
+ "test1" >:: test1;
37
+ "test2" >:: test2;
38
+ "test3" >:: test3;
39
+ "test4" >:: test4;
40
+ "test5" >:: test5;
41
+ "test6" >:: test6;
42
+ "test7" >:: test7;
43
+ "test8" >:: test8;
44
+ "test9" >:: test9;
45
+ "test10" >:: test10;
46
+ ]
47
+
48
+
49
+ (* Running the tests *)
50
+ let () = run_test_tt_main suite
51
+ end
find_the_longest_semi_repetitive_substring/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.longestSemiRepetitiveSubstring("52233"), 4)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.longestSemiRepetitiveSubstring("5494"), 4)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.longestSemiRepetitiveSubstring("1111111"), 2)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.longestSemiRepetitiveSubstring(",8,0,0,2,2,4,4,0,6,0,9,2,3,2,6,9,0,4,2,8,4,1,9,2,4,4,2,6,2,6,0,9,8,2,1,8,9,3,1,2,8,7,1,8,7,4,3,1,"), 42)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.longestSemiRepetitiveSubstring(",8,2,0,6,9,0,8,3,3,4,1,3,6,8,8,6,6,0,0,2,1,9,3,3,3,9,4,0,0,4,4,1,"), 14)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.longestSemiRepetitiveSubstring(",5,0,2,5,5,4,2,2,9,6,8,8,5,0,2,5,8,2,8,"), 12)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.longestSemiRepetitiveSubstring(",4,5,3,0,1,6,4,5,6,5,0,8,4,0,3,0,1,4,1,6,9,0,"), 22)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.longestSemiRepetitiveSubstring(",7,1,9,2,3,3,7,6,6,7,6,5,1,6,2,6,8,8,2,6,1,1,3,2,2,"), 13)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.longestSemiRepetitiveSubstring(",8,0,2,7,4,1,2,8,8,1,4,0,9,4,3,0,1,1,1,4,4,5,8,4,0,7,3,5,3,7,8,9,8,8,3,1,0,"), 17)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.longestSemiRepetitiveSubstring(",1,3,5,4,3,3,3,0,9,6,3,6,0,5,3,"), 10)
42
+ }
43
+
44
+ }
find_the_losers_of_the_circular_game/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 (circularGameLosers 5 2)," [4,5] (circularGameLosers 5 2))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (circularGameLosers 4 4)," [2,3,4] (circularGameLosers 4 4))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (circularGameLosers 10 1)," [3,5,6,8,9,10] (circularGameLosers 10 1))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (circularGameLosers 42 25)," [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,23,24,27,28,30,31,32,33,35,36,37,38,39,42] (circularGameLosers 42 25))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (circularGameLosers 14 14)," [2,3,4,5,6,7,8,9,10,11,12,13,14] (circularGameLosers 14 14))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (circularGameLosers 34 24)," [2,4,6,7,8,10,11,12,13,14,16,17,18,19,20,22,23,24,26,28,30,31,32,33,34] (circularGameLosers 34 24))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (circularGameLosers 46 46)," [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46] (circularGameLosers 46 46))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (circularGameLosers 4 1)," [] (circularGameLosers 4 1))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (circularGameLosers 5 5)," [2,3,4,5] (circularGameLosers 5 5))
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
find_the_losers_of_the_circular_game/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(4,5)), circularGameLosers(5, 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(2,3,4)), circularGameLosers(4, 4));
19
+ }
20
+
21
+ }
find_the_losers_of_the_circular_game/meta.json ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2791,
3
+ "name": "find_the_losers_of_the_circular_game",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/find-the-losers-of-the-circular-game/",
6
+ "date": "2023-05-07 00:00:00",
7
+ "task_description": "There are `n` friends that are playing a game. The friends are sitting in a circle and are numbered from `1` to `n` in **clockwise order**. More formally, moving clockwise from the `ith` friend brings you to the `(i+1)th` friend for `1 <= i < n`, and moving clockwise from the `nth` friend brings you to the `1st` friend. The rules of the game are as follows: `1st` friend receives the ball. After that, `1st` friend passes it to the friend who is `k` steps away from them in the **clockwise** direction. After that, the friend who receives the ball should pass it to the friend who is `2 * k` steps away from them in the **clockwise** direction. After that, the friend who receives the ball should pass it to the friend who is `3 * k` steps away from them in the **clockwise** direction, and so on and so forth. In other words, on the `ith` turn, the friend holding the ball should pass it to the friend who is `i * k` steps away from them in the **clockwise** direction. The game is finished when some friend receives the ball for the second time. The **losers** of the game are friends who did not receive the ball in the entire game. Given the number of friends, `n`, and an integer `k`, return _the array answer, which contains the losers of the game in the **ascending** order_. **Example 1:** ``` **Input:** n = 5, k = 2 **Output:** [4,5] **Explanation:** The game goes as follows: 1) Start at 1st friend and pass the ball to the friend who is 2 steps away from them - 3rd friend. 2) 3rd friend passes the ball to the friend who is 4 steps away from them - 2nd friend. 3) 2nd friend passes the ball to the friend who is 6 steps away from them - 3rd friend. 4) The game ends as 3rd friend receives the ball for the second time. ``` **Example 2:** ``` **Input:** n = 4, k = 4 **Output:** [2,3,4] **Explanation:** The game goes as follows: 1) Start at the 1st friend and pass the ball to the friend who is 4 steps away from them - 1st friend. 2) The game ends as 1st friend receives the ball for the second time. ``` **Constraints:** `1 <= k <= n <= 50`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "n = 5, k = 2",
12
+ "output": "[4,5] "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "n = 4, k = 4",
17
+ "output": "[2,3,4] "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ 10,
24
+ 1
25
+ ],
26
+ "output": [
27
+ 3,
28
+ 5,
29
+ 6,
30
+ 8,
31
+ 9,
32
+ 10
33
+ ]
34
+ },
35
+ {
36
+ "input": [
37
+ 42,
38
+ 25
39
+ ],
40
+ "output": [
41
+ 2,
42
+ 3,
43
+ 4,
44
+ 5,
45
+ 6,
46
+ 7,
47
+ 8,
48
+ 9,
49
+ 10,
50
+ 11,
51
+ 12,
52
+ 13,
53
+ 14,
54
+ 15,
55
+ 16,
56
+ 17,
57
+ 18,
58
+ 20,
59
+ 21,
60
+ 23,
61
+ 24,
62
+ 27,
63
+ 28,
64
+ 30,
65
+ 31,
66
+ 32,
67
+ 33,
68
+ 35,
69
+ 36,
70
+ 37,
71
+ 38,
72
+ 39,
73
+ 42
74
+ ]
75
+ },
76
+ {
77
+ "input": [
78
+ 14,
79
+ 14
80
+ ],
81
+ "output": [
82
+ 2,
83
+ 3,
84
+ 4,
85
+ 5,
86
+ 6,
87
+ 7,
88
+ 8,
89
+ 9,
90
+ 10,
91
+ 11,
92
+ 12,
93
+ 13,
94
+ 14
95
+ ]
96
+ },
97
+ {
98
+ "input": [
99
+ 34,
100
+ 24
101
+ ],
102
+ "output": [
103
+ 2,
104
+ 4,
105
+ 6,
106
+ 7,
107
+ 8,
108
+ 10,
109
+ 11,
110
+ 12,
111
+ 13,
112
+ 14,
113
+ 16,
114
+ 17,
115
+ 18,
116
+ 19,
117
+ 20,
118
+ 22,
119
+ 23,
120
+ 24,
121
+ 26,
122
+ 28,
123
+ 30,
124
+ 31,
125
+ 32,
126
+ 33,
127
+ 34
128
+ ]
129
+ },
130
+ {
131
+ "input": [
132
+ 46,
133
+ 46
134
+ ],
135
+ "output": [
136
+ 2,
137
+ 3,
138
+ 4,
139
+ 5,
140
+ 6,
141
+ 7,
142
+ 8,
143
+ 9,
144
+ 10,
145
+ 11,
146
+ 12,
147
+ 13,
148
+ 14,
149
+ 15,
150
+ 16,
151
+ 17,
152
+ 18,
153
+ 19,
154
+ 20,
155
+ 21,
156
+ 22,
157
+ 23,
158
+ 24,
159
+ 25,
160
+ 26,
161
+ 27,
162
+ 28,
163
+ 29,
164
+ 30,
165
+ 31,
166
+ 32,
167
+ 33,
168
+ 34,
169
+ 35,
170
+ 36,
171
+ 37,
172
+ 38,
173
+ 39,
174
+ 40,
175
+ 41,
176
+ 42,
177
+ 43,
178
+ 44,
179
+ 45,
180
+ 46
181
+ ]
182
+ },
183
+ {
184
+ "input": [
185
+ 4,
186
+ 1
187
+ ],
188
+ "output": []
189
+ },
190
+ {
191
+ "input": [
192
+ 5,
193
+ 5
194
+ ],
195
+ "output": [
196
+ 2,
197
+ 3,
198
+ 4,
199
+ 5
200
+ ]
201
+ },
202
+ {
203
+ "input": [
204
+ 29,
205
+ 1
206
+ ],
207
+ "output": [
208
+ 3,
209
+ 6,
210
+ 10,
211
+ 12,
212
+ 13,
213
+ 14,
214
+ 15,
215
+ 18,
216
+ 20,
217
+ 23,
218
+ 24,
219
+ 25,
220
+ 26,
221
+ 28
222
+ ]
223
+ },
224
+ {
225
+ "input": [
226
+ 26,
227
+ 19
228
+ ],
229
+ "output": [
230
+ 2,
231
+ 3,
232
+ 4,
233
+ 5,
234
+ 7,
235
+ 8,
236
+ 12,
237
+ 14,
238
+ 15,
239
+ 16,
240
+ 17,
241
+ 18,
242
+ 19,
243
+ 21,
244
+ 22,
245
+ 23,
246
+ 24,
247
+ 25
248
+ ]
249
+ },
250
+ {
251
+ "input": [
252
+ 43,
253
+ 12
254
+ ],
255
+ "output": [
256
+ 4,
257
+ 5,
258
+ 6,
259
+ 7,
260
+ 8,
261
+ 10,
262
+ 11,
263
+ 12,
264
+ 15,
265
+ 17,
266
+ 20,
267
+ 23,
268
+ 24,
269
+ 26,
270
+ 28,
271
+ 29,
272
+ 33,
273
+ 39,
274
+ 40,
275
+ 41,
276
+ 43
277
+ ]
278
+ }
279
+ ],
280
+ "haskell_template": "circularGameLosers :: Int -> Int -> [Int]\ncircularGameLosers n k ",
281
+ "ocaml_template": "let circularGameLosers (n: int) (k: int) : int list = ",
282
+ "scala_template": "def circularGameLosers(n: Int,k: Int): List[Int] = { \n \n}",
283
+ "java_template": "class Solution {\n public int[] circularGameLosers(int n, int k) {\n \n }\n}",
284
+ "python_template": "class Solution(object):\n def circularGameLosers(self, n, k):\n \"\"\"\n :type n: int\n :type k: int\n :rtype: List[int]\n \"\"\"\n "
285
+ }
find_the_losers_of_the_circular_game/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 [4;5] (circularGameLosers 5 2)
12
+
13
+ let test2 _ = assert_equal [2;3;4] (circularGameLosers 4 4)
14
+
15
+ let test3 _ = assert_equal [3;5;6;8;9;10] (circularGameLosers 10 1)
16
+
17
+ let test4 _ = assert_equal [2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;20;21;23;24;27;28;30;31;32;33;35;36;37;38;39;42] (circularGameLosers 42 25)
18
+
19
+ let test5 _ = assert_equal [2;3;4;5;6;7;8;9;10;11;12;13;14] (circularGameLosers 14 14)
20
+
21
+ let test6 _ = assert_equal [2;4;6;7;8;10;11;12;13;14;16;17;18;19;20;22;23;24;26;28;30;31;32;33;34] (circularGameLosers 34 24)
22
+
23
+ let test7 _ = assert_equal [2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46] (circularGameLosers 46 46)
24
+
25
+ let test8 _ = assert_equal [] (circularGameLosers 4 1)
26
+
27
+ let test9 _ = assert_equal [2;3;4;5] (circularGameLosers 5 5)
28
+
29
+ let test10 _ = assert_equal [3;6;10;12;13;14;15;18;20;23;24;25;26;28] (circularGameLosers 29 1)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for circularGameLosers" >::: [
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
find_the_losers_of_the_circular_game/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.circularGameLosers(5,2), List(4,5))
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.circularGameLosers(4,4), List(2,3,4))
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.circularGameLosers(10,1), List(3,5,6,8,9,10))
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.circularGameLosers(42,25), List(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,23,24,27,28,30,31,32,33,35,36,37,38,39,42))
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.circularGameLosers(14,14), List(2,3,4,5,6,7,8,9,10,11,12,13,14))
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.circularGameLosers(34,24), List(2,4,6,7,8,10,11,12,13,14,16,17,18,19,20,22,23,24,26,28,30,31,32,33,34))
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.circularGameLosers(46,46), List(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46))
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.circularGameLosers(4,1), List())
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.circularGameLosers(5,5), List(2,3,4,5))
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.circularGameLosers(29,1), List(3,6,10,12,13,14,15,18,20,23,24,25,26,28))
42
+ }
43
+
44
+ }
find_the_maximum_achievable_number/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 (theMaximumAchievableX 4 1)," 6 (theMaximumAchievableX 4 1))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (theMaximumAchievableX 3 2)," 7 (theMaximumAchievableX 3 2))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (theMaximumAchievableX 47 6)," 59 (theMaximumAchievableX 47 6))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (theMaximumAchievableX 3 45)," 93 (theMaximumAchievableX 3 45))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (theMaximumAchievableX 30 16)," 62 (theMaximumAchievableX 30 16))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (theMaximumAchievableX 39 46)," 131 (theMaximumAchievableX 39 46))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (theMaximumAchievableX 36 28)," 92 (theMaximumAchievableX 36 28))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (theMaximumAchievableX 47 4)," 55 (theMaximumAchievableX 47 4))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (theMaximumAchievableX 8 23)," 54 (theMaximumAchievableX 8 23))
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
find_the_maximum_achievable_number/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(6, theMaximumAchievableX(4, 1));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(7, theMaximumAchievableX(3, 2));
19
+ }
20
+
21
+ }
find_the_maximum_achievable_number/meta.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2812,
3
+ "name": "find_the_maximum_achievable_number",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/find-the-maximum-achievable-number/",
6
+ "date": "2023-07-02 00:00:00",
7
+ "task_description": "Given two integers, `num` and `t`. A **number **`x`** **is** achievable** if it can become equal to `num` after applying the following operation **at most** `t` times: Increase or decrease `x` by `1`, and _simultaneously_ increase or decrease `num` by `1`. Return the **maximum **possible value of `x`. **Example 1:** **Input:** num = 4, t = 1 **Output:** 6 **Explanation:** Apply the following operation once to make the maximum achievable number equal to `num`: Decrease the maximum achievable number by 1, and increase `num` by 1. **Example 2:** **Input:** num = 3, t = 2 **Output:** 7 **Explanation:** Apply the following operation twice to make the maximum achievable number equal to `num`: Decrease the maximum achievable number by 1, and increase `num` by 1. **Constraints:** `1 <= num, t <= 50`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "num = 4, t = 1",
12
+ "output": "6 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "num = 3, t = 2",
17
+ "output": "7 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ 47,
24
+ 6
25
+ ],
26
+ "output": 59
27
+ },
28
+ {
29
+ "input": [
30
+ 3,
31
+ 45
32
+ ],
33
+ "output": 93
34
+ },
35
+ {
36
+ "input": [
37
+ 30,
38
+ 16
39
+ ],
40
+ "output": 62
41
+ },
42
+ {
43
+ "input": [
44
+ 39,
45
+ 46
46
+ ],
47
+ "output": 131
48
+ },
49
+ {
50
+ "input": [
51
+ 36,
52
+ 28
53
+ ],
54
+ "output": 92
55
+ },
56
+ {
57
+ "input": [
58
+ 47,
59
+ 4
60
+ ],
61
+ "output": 55
62
+ },
63
+ {
64
+ "input": [
65
+ 8,
66
+ 23
67
+ ],
68
+ "output": 54
69
+ },
70
+ {
71
+ "input": [
72
+ 3,
73
+ 43
74
+ ],
75
+ "output": 89
76
+ },
77
+ {
78
+ "input": [
79
+ 27,
80
+ 33
81
+ ],
82
+ "output": 93
83
+ },
84
+ {
85
+ "input": [
86
+ 39,
87
+ 32
88
+ ],
89
+ "output": 103
90
+ }
91
+ ],
92
+ "haskell_template": "theMaximumAchievableX :: Int -> Int -> Int\ntheMaximumAchievableX num t ",
93
+ "ocaml_template": "let theMaximumAchievableX (num: int) (t: int) : int = ",
94
+ "scala_template": "def theMaximumAchievableX(num: Int,t: Int): Int = { \n \n}",
95
+ "java_template": "class Solution {\n public int theMaximumAchievableX(int num, int t) {\n \n }\n}",
96
+ "python_template": "class Solution(object):\n def theMaximumAchievableX(self, num, t):\n \"\"\"\n :type num: int\n :type t: int\n :rtype: int\n \"\"\"\n "
97
+ }
find_the_maximum_achievable_number/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 6 (theMaximumAchievableX 4 1)
12
+
13
+ let test2 _ = assert_equal 7 (theMaximumAchievableX 3 2)
14
+
15
+ let test3 _ = assert_equal 59 (theMaximumAchievableX 47 6)
16
+
17
+ let test4 _ = assert_equal 93 (theMaximumAchievableX 3 45)
18
+
19
+ let test5 _ = assert_equal 62 (theMaximumAchievableX 30 16)
20
+
21
+ let test6 _ = assert_equal 131 (theMaximumAchievableX 39 46)
22
+
23
+ let test7 _ = assert_equal 92 (theMaximumAchievableX 36 28)
24
+
25
+ let test8 _ = assert_equal 55 (theMaximumAchievableX 47 4)
26
+
27
+ let test9 _ = assert_equal 54 (theMaximumAchievableX 8 23)
28
+
29
+ let test10 _ = assert_equal 89 (theMaximumAchievableX 3 43)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for theMaximumAchievableX" >::: [
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
find_the_maximum_achievable_number/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.theMaximumAchievableX(4,1), 6)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.theMaximumAchievableX(3,2), 7)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.theMaximumAchievableX(47,6), 59)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.theMaximumAchievableX(3,45), 93)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.theMaximumAchievableX(30,16), 62)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.theMaximumAchievableX(39,46), 131)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.theMaximumAchievableX(36,28), 92)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.theMaximumAchievableX(47,4), 55)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.theMaximumAchievableX(8,23), 54)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.theMaximumAchievableX(3,43), 89)
42
+ }
43
+
44
+ }
find_the_maximum_divisibility_score/.DS_Store ADDED
Binary file (6.15 kB). View file
 
find_the_maximum_divisibility_score/haskell_tests/Main.hs ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (maxDivScore [2,9,15,50] [5,3,7,2])," 2 (maxDivScore [2,9,15,50] [5,3,7,2]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (maxDivScore [4,7,9,3,9] [5,2,3])," 3 (maxDivScore [4,7,9,3,9] [5,2,3]))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (maxDivScore [20,14,21,10] [10,16,20])," 10 (maxDivScore [20,14,21,10] [10,16,20]))
19
+
20
+
21
+ -- Grouping test cases
22
+ tests :: Test
23
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2]
24
+
25
+ -- Running the tests
26
+ main :: IO Counts
27
+ main = runTestTT tests
find_the_maximum_divisibility_score/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(2, maxDivScore(new ArrayList<>(Arrays.asList(2,9,15,50)), new ArrayList<>(Arrays.asList(5,3,7,2))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(3, maxDivScore(new ArrayList<>(Arrays.asList(4,7,9,3,9)), new ArrayList<>(Arrays.asList(5,2,3))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(10, maxDivScore(new ArrayList<>(Arrays.asList(20,14,21,10)), new ArrayList<>(Arrays.asList(10,16,20))));
23
+ }
24
+
25
+ }
find_the_maximum_divisibility_score/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
find_the_maximum_divisibility_score/ocaml_tests/main.ml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 2 (maxDivScore [2;9;15;50] [5;3;7;2])
12
+
13
+ let test2 _ = assert_equal 3 (maxDivScore [4;7;9;3;9] [5;2;3])
14
+
15
+ let test3 _ = assert_equal 10 (maxDivScore [20;14;21;10] [10;16;20])
16
+
17
+
18
+ (* Grouping test cases *)
19
+ let suite = "Test Suite for maxDivScore" >::: [
20
+
21
+ "test1" >:: test1;
22
+ "test2" >:: test2;
23
+ "test3" >:: test3;
24
+ ]
25
+
26
+
27
+ (* Running the tests *)
28
+ let () = run_test_tt_main suite
29
+ end
find_the_maximum_divisibility_score/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.maxDivScore(List(2,9,15,50),List(5,3,7,2)), 2)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.maxDivScore(List(4,7,9,3,9),List(5,2,3)), 3)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.maxDivScore(List(20,14,21,10),List(10,16,20)), 10)
14
+ }
15
+
16
+ }
find_the_maximum_length_of_a_good_subsequence_i/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 (maximumLength [1,2,1,1,3] 2)," 4 (maximumLength [1,2,1,1,3] 2))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (maximumLength [1,2,3,4,5,1] 0)," 2 (maximumLength [1,2,3,4,5,1] 0))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (maximumLength [33487469, 853196700, 508583567, 222097037, 261098452, 188012054, 961540644, 61212932, 15037773, 841097125, 12525542, 698705099, 369973008, 92835030, 468189131, 34148422, 580687421, 570566821, 738952593, 180225171, 919512242, 99783784, 425204860, 869457230, 404469514, 507286517, 185905194, 475848287, 567490953, 276861319, 115618801, 198885023, 78195956, 868047407, 828704823, 277822141, 528152647, 429059504, 198847876, 96584063, 240877916, 901365711, 516446494, 437684656, 765734979, 797685131, 431370848, 938336517, 568041453, 753525892, 977443993, 393213522, 665183860, 341164691, 885173771, 292144240, 362688963, 435157884, 799158529, 992337970, 291377882, 70212125, 740085897, 725729792, 565803853, 312378643, 548373143, 360751039, 451196075, 727176901, 805095909, 872955566, 929350237, 242334546, 214523895, 915147423, 578098350, 930167586, 897761330, 148274586, 367416565, 664847641, 722275601, 419879451, 997547266, 336404135, 699560214, 943663808, 423571499, 617199117, 947330997, 809209468, 798079300, 180475930, 99646714, 804391530, 347455668, 946783223, 914880392, 75100983, 725832068, 158225386, 992157753, 240948618, 947609519, 719608751, 775262320, 536867805, 119714960, 79319150, 792873002, 286087071, 19022943, 328363907, 732538568, 912457144, 975334806, 443207614, 536940420, 109373287, 924182716, 501305908, 85032470, 344350927, 835184090, 201928566, 66998189, 946158698, 881066162, 771616191, 71900078, 242619018, 138756453, 49348893, 553284692, 480485289, 503323713, 469473152, 911729932, 192672881, 315945519, 841821428, 877577124, 118650340, 799021764, 181762663, 391644005, 428532741, 274242895, 521472249, 932515039, 362200761, 643684951, 465953301, 760234216, 688956595, 823790102, 880317891, 720087970, 589862333, 693639300, 310685438, 107433866, 788125014, 623113991, 995926890, 164308186, 695870276, 116547502, 363599749, 108771651, 999020226, 513212465, 459019090, 198641889, 321381216, 197675, 440410330, 550548711, 512695542, 456196651, 212908375, 341285455, 882866009, 855721216, 166776550, 102169125, 634712393, 952280485, 814900567, 168724223, 667018749, 529617768, 709275051, 669667562, 100129221, 177210779, 428138415, 42907194, 166376059, 105392153, 139613470, 559725870, 521014552, 198477863, 711092633, 293926168, 153515338, 940899181, 545362491, 677734161, 5697569, 131349649, 524707944, 781502588, 979858072, 68950361, 805348411, 466231031, 435112989, 783476999, 254764697, 853396350, 929243358, 468382183, 663529870, 849437120, 561130145, 548588197, 676136929, 330928976, 885846542, 164388235, 967958142, 38247037, 463953934, 347360076, 995050699, 743574862, 683210867, 918944006, 970459141, 127854995, 988662628, 840629843, 112062233, 335501492, 912608621, 926468029, 545144992, 307778362, 767981405, 947513417, 281025337, 839230833, 795215533, 262480577, 538515965, 564432683, 101892992, 946834501, 448603415, 35287181, 668530827, 533095130, 16669636, 437967928, 31609116, 481480060, 960746244, 122751744, 124100679, 539213806, 366896015, 744434752, 629313621, 457167645, 275701834, 585755798, 129481485, 309735642, 646484951, 53708602, 651248907, 708064996, 112736000, 274006791, 594154331, 51446599, 519253736, 17702088, 744157317, 319575662, 848133481, 649938608, 930137559, 569860301, 323200898, 711859209, 241182967, 234054345, 882840128, 99742283, 335636269, 26185291, 910583828, 165643009, 533325241, 404037313, 829637648, 21547628, 72795736, 876953683, 468673893, 622650379, 533615749, 342343878, 651184748, 455998415, 990023260, 709242020, 148845447, 590094939, 549908446, 713848415, 554513168, 985056785, 606819211, 54145594, 87339142, 615328163, 302076645, 283071573, 272634690, 557009091, 114845885, 992191057, 524218932, 881413971, 944836739, 147344544, 373503446, 372904757, 727364693, 392538095, 220238128, 382685773, 533191650, 339399728, 686877685, 939274906, 73989668, 139028258, 657370317, 584871020, 5684839, 178541263, 195131290, 552754672, 596872011, 532769740, 354354765, 306588671, 542632927, 616890468, 84630307, 684256585, 266958682, 359174232, 170591596, 901103102, 940625309, 685913267, 339792519, 339471136, 125049040, 561697226, 695007544, 34492279, 498603652, 915994047, 646471502, 505889051, 142953890, 945443929, 126223611, 433889431, 466854560, 10320689, 533328459, 538754638, 773200198, 584450813, 34495612, 10320873, 290695904, 99406833, 364239123, 536695973, 346881538, 38096901, 837486993, 738761524, 116884667, 843859643, 180154682, 245936609, 897197094, 630949789, 153247778, 159250724, 919184705, 523682287, 414807889, 168669427, 828244050, 400082520, 60411377, 641318340, 759312668, 946509056, 593211437, 206895703, 816982160, 132939201, 411365896, 916204740, 184498912, 552085651, 760105753] 15)," 16 (maximumLength [33487469, 853196700, 508583567, 222097037, 261098452, 188012054, 961540644, 61212932, 15037773, 841097125, 12525542, 698705099, 369973008, 92835030, 468189131, 34148422, 580687421, 570566821, 738952593, 180225171, 919512242, 99783784, 425204860, 869457230, 404469514, 507286517, 185905194, 475848287, 567490953, 276861319, 115618801, 198885023, 78195956, 868047407, 828704823, 277822141, 528152647, 429059504, 198847876, 96584063, 240877916, 901365711, 516446494, 437684656, 765734979, 797685131, 431370848, 938336517, 568041453, 753525892, 977443993, 393213522, 665183860, 341164691, 885173771, 292144240, 362688963, 435157884, 799158529, 992337970, 291377882, 70212125, 740085897, 725729792, 565803853, 312378643, 548373143, 360751039, 451196075, 727176901, 805095909, 872955566, 929350237, 242334546, 214523895, 915147423, 578098350, 930167586, 897761330, 148274586, 367416565, 664847641, 722275601, 419879451, 997547266, 336404135, 699560214, 943663808, 423571499, 617199117, 947330997, 809209468, 798079300, 180475930, 99646714, 804391530, 347455668, 946783223, 914880392, 75100983, 725832068, 158225386, 992157753, 240948618, 947609519, 719608751, 775262320, 536867805, 119714960, 79319150, 792873002, 286087071, 19022943, 328363907, 732538568, 912457144, 975334806, 443207614, 536940420, 109373287, 924182716, 501305908, 85032470, 344350927, 835184090, 201928566, 66998189, 946158698, 881066162, 771616191, 71900078, 242619018, 138756453, 49348893, 553284692, 480485289, 503323713, 469473152, 911729932, 192672881, 315945519, 841821428, 877577124, 118650340, 799021764, 181762663, 391644005, 428532741, 274242895, 521472249, 932515039, 362200761, 643684951, 465953301, 760234216, 688956595, 823790102, 880317891, 720087970, 589862333, 693639300, 310685438, 107433866, 788125014, 623113991, 995926890, 164308186, 695870276, 116547502, 363599749, 108771651, 999020226, 513212465, 459019090, 198641889, 321381216, 197675, 440410330, 550548711, 512695542, 456196651, 212908375, 341285455, 882866009, 855721216, 166776550, 102169125, 634712393, 952280485, 814900567, 168724223, 667018749, 529617768, 709275051, 669667562, 100129221, 177210779, 428138415, 42907194, 166376059, 105392153, 139613470, 559725870, 521014552, 198477863, 711092633, 293926168, 153515338, 940899181, 545362491, 677734161, 5697569, 131349649, 524707944, 781502588, 979858072, 68950361, 805348411, 466231031, 435112989, 783476999, 254764697, 853396350, 929243358, 468382183, 663529870, 849437120, 561130145, 548588197, 676136929, 330928976, 885846542, 164388235, 967958142, 38247037, 463953934, 347360076, 995050699, 743574862, 683210867, 918944006, 970459141, 127854995, 988662628, 840629843, 112062233, 335501492, 912608621, 926468029, 545144992, 307778362, 767981405, 947513417, 281025337, 839230833, 795215533, 262480577, 538515965, 564432683, 101892992, 946834501, 448603415, 35287181, 668530827, 533095130, 16669636, 437967928, 31609116, 481480060, 960746244, 122751744, 124100679, 539213806, 366896015, 744434752, 629313621, 457167645, 275701834, 585755798, 129481485, 309735642, 646484951, 53708602, 651248907, 708064996, 112736000, 274006791, 594154331, 51446599, 519253736, 17702088, 744157317, 319575662, 848133481, 649938608, 930137559, 569860301, 323200898, 711859209, 241182967, 234054345, 882840128, 99742283, 335636269, 26185291, 910583828, 165643009, 533325241, 404037313, 829637648, 21547628, 72795736, 876953683, 468673893, 622650379, 533615749, 342343878, 651184748, 455998415, 990023260, 709242020, 148845447, 590094939, 549908446, 713848415, 554513168, 985056785, 606819211, 54145594, 87339142, 615328163, 302076645, 283071573, 272634690, 557009091, 114845885, 992191057, 524218932, 881413971, 944836739, 147344544, 373503446, 372904757, 727364693, 392538095, 220238128, 382685773, 533191650, 339399728, 686877685, 939274906, 73989668, 139028258, 657370317, 584871020, 5684839, 178541263, 195131290, 552754672, 596872011, 532769740, 354354765, 306588671, 542632927, 616890468, 84630307, 684256585, 266958682, 359174232, 170591596, 901103102, 940625309, 685913267, 339792519, 339471136, 125049040, 561697226, 695007544, 34492279, 498603652, 915994047, 646471502, 505889051, 142953890, 945443929, 126223611, 433889431, 466854560, 10320689, 533328459, 538754638, 773200198, 584450813, 34495612, 10320873, 290695904, 99406833, 364239123, 536695973, 346881538, 38096901, 837486993, 738761524, 116884667, 843859643, 180154682, 245936609, 897197094, 630949789, 153247778, 159250724, 919184705, 523682287, 414807889, 168669427, 828244050, 400082520, 60411377, 641318340, 759312668, 946509056, 593211437, 206895703, 816982160, 132939201, 411365896, 916204740, 184498912, 552085651, 760105753] 15))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (maximumLength [327533889, 516247971, 577104323, 102780451, 579472496, 369364708, 431811091, 851858081, 389227997, 223952808, 988636711, 83830649, 524947406, 296624356, 794995672, 30494355, 154348533, 476239988, 547576365, 263612981, 485307754, 747671126, 64210544, 376097964, 462275031, 535805711, 332753982, 213719903, 155924079, 248700945, 118826282, 706339812, 68349277, 991342323, 920746401, 960198240, 813243613, 188071477, 670184207, 532896855, 602914215, 239111400, 129822243, 141229165, 534580815, 897265516, 614935521, 939532753, 39963074, 740212020, 143222965, 941682425, 239582504, 35023687, 618015486, 959550922, 687895424, 625377189, 364408867, 809797648, 491284157, 453083882, 898959256, 481212322, 29091746, 138006074, 963762698, 270676830, 747466877, 113357505, 982113766, 495275050, 744041226, 718203434, 700072245, 787953956, 436075447, 864825218, 360097180, 311162304, 816051078, 948790181, 139380119, 462149183, 169921147, 526798940, 116044069, 79653034, 954140644, 293213000, 608576999, 230353388, 567365557, 705459268, 531247042, 35399870, 963947762, 136182401, 461889635, 951439775, 71938909, 887693320, 757989888, 26504625, 846479912, 577482890, 220016904, 233976519, 308152721, 4884715, 355167603, 92431841, 59412077, 498429636, 579318280, 91688022, 727082443, 71084239, 908856330, 22091108, 405709610, 715395797, 115454620, 271477677, 196837563, 429623851, 806161676, 289091831, 696564972, 775018977, 239704135, 54133936, 119278128, 742601516, 162977700, 259855912, 274770239, 252037593, 695813277, 614725042, 298612459, 792677903, 589370084, 912528150, 164707278, 386684390, 452820769, 79739724, 66572280, 824873930, 978713135, 881349725, 699001664, 327221414, 764367180, 533880754, 264285724, 857663714, 226843218, 933229505, 836864949, 540927216, 630071486, 2122958, 815381840, 874377121, 492304758, 200048732, 76507927, 700101808, 162237741, 674935054, 335425981, 406307331, 594448382, 758768471, 288734876, 312664328, 540664454, 779494011, 764656558, 861823605, 118903129, 398326761, 375758584, 380806694, 794475795, 646547293, 145051162, 609252633, 760356685, 958660571, 435366240, 356814873, 95319712, 631444407, 596253847, 268340190, 211984765, 454532514, 459526641, 805932389, 448184761, 13543944, 894437555, 45432878, 442552418, 108165329, 487415069, 783710264, 695486933, 699450570, 293298646, 479220412, 684599590, 192970243, 840691084, 4532748, 741328011, 746395579, 966633259, 903804640, 465102945, 280361450, 321069891, 624057962, 239172920, 197561644, 380049568, 90222551, 625174874, 490379701, 173468021, 953184329, 301825571, 941534385, 995509963, 868449315, 557544885, 880302873, 872609724, 875626162, 370323425, 275468447, 882014552, 846735184, 120912352, 813721801, 862942875, 515699969, 683462384, 980903474, 546493687, 402300014, 319569533, 797130956, 387682284, 214646902, 719014383, 102095725, 196771211, 828165396, 672834365, 531011470, 880466295, 608158345, 338180323, 180965136, 73119784, 64083527, 955870955, 771887888, 139237899, 455198447, 6562309, 561603040, 799283563, 59075477, 858737286, 68016326, 634664588, 300951668, 452080386, 383475146, 603177201, 872135189, 261574971, 229884149, 858212769, 499701451, 910896731, 223956027, 432733575, 770157887, 773985892, 558621158, 560393168, 777160405, 961201142, 807882491, 124052476, 196881320, 324835681, 838853707, 43693124, 239058684, 334495096, 381139239, 96627701, 613545592, 633996771, 836870001, 768428858, 382469643, 986155908, 159381817, 97105863, 299264759, 594461108, 233236917, 540594617, 244787518, 482372949, 785387674, 380905759, 731791714, 994233002, 334093235, 778405573, 775330947, 232523002, 521892918, 8131144, 541091974, 18857695, 587779058, 250293641, 178083084, 86423929, 365187708, 964149610, 328603078, 112878336, 606064134, 568564713, 493936941, 187197854, 459298315, 656369139, 64328277, 910946197, 926708213, 458972942, 824338453, 74535004, 55485192, 776358670, 564155594, 801557247, 772983724, 484332312, 686814423, 479037180, 783501754, 602973511, 1190250, 671618996, 917218081, 727705466, 176448034, 410775860, 885939324, 615546497, 580229143, 491004073, 499090756, 93700586, 705077451, 356461710, 516001005, 464491977, 57107526, 224642742, 842112461, 523735846, 529283361, 854603821, 560169857, 328288389, 465414672, 603244321, 786147965, 90727648, 64912665, 849588797, 812698537, 318123651, 265457973, 885015284, 418024424, 731171952, 65881220, 944209527, 720974551, 630329426, 866558959, 983335744, 938155014, 731092367, 676946857, 97835678, 16879027, 438367860, 766950135, 959068162, 583347354, 295765171, 696414369, 333608526, 935312521, 470896333, 29352159, 435560878, 273366907, 880512691, 240984504, 844227469, 938755111, 478250003, 589565129, 669659749, 247563708, 465743085, 895565695, 285953710, 650504736, 909051770, 815902950, 302329404, 791140664, 445181926, 52880689, 390293386, 959655793, 7572577, 122794695, 668019901, 214190852, 289117876, 809299851, 263551854, 952412334, 104283184, 486898252, 757064092, 196239301, 792657494, 828373266, 201020664, 655715614, 526849548, 837378542, 902331101, 150169615, 755972704, 296301055, 708488534, 127290172, 713800725, 81776692, 938518356, 873893602, 140005476, 590412500, 398918946, 217348199, 914936754, 642424855, 609632831, 387869323, 123138584, 970088426, 445751710, 181422250, 39153244, 480323004, 707798403, 915125244, 715274485, 363189310, 290275849, 865152853, 559410316, 387501362, 753415746, 457757665] 21)," 22 (maximumLength [327533889, 516247971, 577104323, 102780451, 579472496, 369364708, 431811091, 851858081, 389227997, 223952808, 988636711, 83830649, 524947406, 296624356, 794995672, 30494355, 154348533, 476239988, 547576365, 263612981, 485307754, 747671126, 64210544, 376097964, 462275031, 535805711, 332753982, 213719903, 155924079, 248700945, 118826282, 706339812, 68349277, 991342323, 920746401, 960198240, 813243613, 188071477, 670184207, 532896855, 602914215, 239111400, 129822243, 141229165, 534580815, 897265516, 614935521, 939532753, 39963074, 740212020, 143222965, 941682425, 239582504, 35023687, 618015486, 959550922, 687895424, 625377189, 364408867, 809797648, 491284157, 453083882, 898959256, 481212322, 29091746, 138006074, 963762698, 270676830, 747466877, 113357505, 982113766, 495275050, 744041226, 718203434, 700072245, 787953956, 436075447, 864825218, 360097180, 311162304, 816051078, 948790181, 139380119, 462149183, 169921147, 526798940, 116044069, 79653034, 954140644, 293213000, 608576999, 230353388, 567365557, 705459268, 531247042, 35399870, 963947762, 136182401, 461889635, 951439775, 71938909, 887693320, 757989888, 26504625, 846479912, 577482890, 220016904, 233976519, 308152721, 4884715, 355167603, 92431841, 59412077, 498429636, 579318280, 91688022, 727082443, 71084239, 908856330, 22091108, 405709610, 715395797, 115454620, 271477677, 196837563, 429623851, 806161676, 289091831, 696564972, 775018977, 239704135, 54133936, 119278128, 742601516, 162977700, 259855912, 274770239, 252037593, 695813277, 614725042, 298612459, 792677903, 589370084, 912528150, 164707278, 386684390, 452820769, 79739724, 66572280, 824873930, 978713135, 881349725, 699001664, 327221414, 764367180, 533880754, 264285724, 857663714, 226843218, 933229505, 836864949, 540927216, 630071486, 2122958, 815381840, 874377121, 492304758, 200048732, 76507927, 700101808, 162237741, 674935054, 335425981, 406307331, 594448382, 758768471, 288734876, 312664328, 540664454, 779494011, 764656558, 861823605, 118903129, 398326761, 375758584, 380806694, 794475795, 646547293, 145051162, 609252633, 760356685, 958660571, 435366240, 356814873, 95319712, 631444407, 596253847, 268340190, 211984765, 454532514, 459526641, 805932389, 448184761, 13543944, 894437555, 45432878, 442552418, 108165329, 487415069, 783710264, 695486933, 699450570, 293298646, 479220412, 684599590, 192970243, 840691084, 4532748, 741328011, 746395579, 966633259, 903804640, 465102945, 280361450, 321069891, 624057962, 239172920, 197561644, 380049568, 90222551, 625174874, 490379701, 173468021, 953184329, 301825571, 941534385, 995509963, 868449315, 557544885, 880302873, 872609724, 875626162, 370323425, 275468447, 882014552, 846735184, 120912352, 813721801, 862942875, 515699969, 683462384, 980903474, 546493687, 402300014, 319569533, 797130956, 387682284, 214646902, 719014383, 102095725, 196771211, 828165396, 672834365, 531011470, 880466295, 608158345, 338180323, 180965136, 73119784, 64083527, 955870955, 771887888, 139237899, 455198447, 6562309, 561603040, 799283563, 59075477, 858737286, 68016326, 634664588, 300951668, 452080386, 383475146, 603177201, 872135189, 261574971, 229884149, 858212769, 499701451, 910896731, 223956027, 432733575, 770157887, 773985892, 558621158, 560393168, 777160405, 961201142, 807882491, 124052476, 196881320, 324835681, 838853707, 43693124, 239058684, 334495096, 381139239, 96627701, 613545592, 633996771, 836870001, 768428858, 382469643, 986155908, 159381817, 97105863, 299264759, 594461108, 233236917, 540594617, 244787518, 482372949, 785387674, 380905759, 731791714, 994233002, 334093235, 778405573, 775330947, 232523002, 521892918, 8131144, 541091974, 18857695, 587779058, 250293641, 178083084, 86423929, 365187708, 964149610, 328603078, 112878336, 606064134, 568564713, 493936941, 187197854, 459298315, 656369139, 64328277, 910946197, 926708213, 458972942, 824338453, 74535004, 55485192, 776358670, 564155594, 801557247, 772983724, 484332312, 686814423, 479037180, 783501754, 602973511, 1190250, 671618996, 917218081, 727705466, 176448034, 410775860, 885939324, 615546497, 580229143, 491004073, 499090756, 93700586, 705077451, 356461710, 516001005, 464491977, 57107526, 224642742, 842112461, 523735846, 529283361, 854603821, 560169857, 328288389, 465414672, 603244321, 786147965, 90727648, 64912665, 849588797, 812698537, 318123651, 265457973, 885015284, 418024424, 731171952, 65881220, 944209527, 720974551, 630329426, 866558959, 983335744, 938155014, 731092367, 676946857, 97835678, 16879027, 438367860, 766950135, 959068162, 583347354, 295765171, 696414369, 333608526, 935312521, 470896333, 29352159, 435560878, 273366907, 880512691, 240984504, 844227469, 938755111, 478250003, 589565129, 669659749, 247563708, 465743085, 895565695, 285953710, 650504736, 909051770, 815902950, 302329404, 791140664, 445181926, 52880689, 390293386, 959655793, 7572577, 122794695, 668019901, 214190852, 289117876, 809299851, 263551854, 952412334, 104283184, 486898252, 757064092, 196239301, 792657494, 828373266, 201020664, 655715614, 526849548, 837378542, 902331101, 150169615, 755972704, 296301055, 708488534, 127290172, 713800725, 81776692, 938518356, 873893602, 140005476, 590412500, 398918946, 217348199, 914936754, 642424855, 609632831, 387869323, 123138584, 970088426, 445751710, 181422250, 39153244, 480323004, 707798403, 915125244, 715274485, 363189310, 290275849, 865152853, 559410316, 387501362, 753415746, 457757665] 21))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (maximumLength [63065717, 310925130, 123681352, 418252036, 455925266, 848331954, 514920504, 926116127, 823866862, 745104358, 494800415, 972017751, 943666958, 458806, 227938603, 735223100, 688717024, 297682752, 71206098, 461866773, 612194775, 993980417, 118835691, 451667832, 53172588, 746247127, 990607879, 814031965, 467657654, 636665607, 981988704, 605396523, 202477330, 8406074, 74274772, 116003553, 102603765, 757367360, 292685632, 189891137, 653612534, 188352455, 806624900, 828176150, 159925719, 263424213, 694677233, 522612245, 198065972, 421243891, 789302712, 58198278, 575078912, 658376585, 891432173, 44671546, 941616686, 292875520, 876927014, 682858550, 942528013, 416491423, 4653487, 676555761, 2489297, 361846701, 686443358, 879875769, 91184601, 15439416, 558237173, 404140841, 631359651, 403414487, 103393750, 741274684, 546207955, 507600399, 562826389, 625457670, 477181692, 513302253, 876454335, 962370786, 465430109, 875410393, 681523014, 508882993, 734251846, 692760603, 376787886, 161882526, 658718628, 32642757, 317488330, 313581086, 624876775, 449477112, 612805515, 709078704, 376014080, 354660003, 676736234, 730047290, 10562672, 148014836, 760768774, 528567488, 869217498, 355676915, 122054706, 280415765, 712488264, 590404130, 21069838, 551110603, 313856070, 944892718, 728632982, 894098138, 939770583, 604837319, 924587415, 130286973, 489446560, 30407051, 396022255, 842936539, 322414686, 314582707, 226797374, 337026559, 309543384, 816976996, 956297634, 198350080, 556047734, 815917387, 14728176, 63749114, 345225320, 131354830, 61997083, 470355874, 859786431, 420649752, 656834306, 823363088, 854484404, 9346700, 597157723, 313812358, 119832585, 964021929, 105834742, 238318936, 966031671, 789654534, 389540161, 338015970, 164729724, 510634493, 68811418, 187593532, 934824704, 443021193, 832773862, 926839522, 376916994] 1)," 2 (maximumLength [63065717, 310925130, 123681352, 418252036, 455925266, 848331954, 514920504, 926116127, 823866862, 745104358, 494800415, 972017751, 943666958, 458806, 227938603, 735223100, 688717024, 297682752, 71206098, 461866773, 612194775, 993980417, 118835691, 451667832, 53172588, 746247127, 990607879, 814031965, 467657654, 636665607, 981988704, 605396523, 202477330, 8406074, 74274772, 116003553, 102603765, 757367360, 292685632, 189891137, 653612534, 188352455, 806624900, 828176150, 159925719, 263424213, 694677233, 522612245, 198065972, 421243891, 789302712, 58198278, 575078912, 658376585, 891432173, 44671546, 941616686, 292875520, 876927014, 682858550, 942528013, 416491423, 4653487, 676555761, 2489297, 361846701, 686443358, 879875769, 91184601, 15439416, 558237173, 404140841, 631359651, 403414487, 103393750, 741274684, 546207955, 507600399, 562826389, 625457670, 477181692, 513302253, 876454335, 962370786, 465430109, 875410393, 681523014, 508882993, 734251846, 692760603, 376787886, 161882526, 658718628, 32642757, 317488330, 313581086, 624876775, 449477112, 612805515, 709078704, 376014080, 354660003, 676736234, 730047290, 10562672, 148014836, 760768774, 528567488, 869217498, 355676915, 122054706, 280415765, 712488264, 590404130, 21069838, 551110603, 313856070, 944892718, 728632982, 894098138, 939770583, 604837319, 924587415, 130286973, 489446560, 30407051, 396022255, 842936539, 322414686, 314582707, 226797374, 337026559, 309543384, 816976996, 956297634, 198350080, 556047734, 815917387, 14728176, 63749114, 345225320, 131354830, 61997083, 470355874, 859786431, 420649752, 656834306, 823363088, 854484404, 9346700, 597157723, 313812358, 119832585, 964021929, 105834742, 238318936, 966031671, 789654534, 389540161, 338015970, 164729724, 510634493, 68811418, 187593532, 934824704, 443021193, 832773862, 926839522, 376916994] 1))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (maximumLength [756941236, 336028848, 626893475, 550698001, 971854899, 428738084, 85777754, 548985841, 91144920, 725266015, 957553852, 443913306, 851311890, 375149909, 954308523] 9)," 10 (maximumLength [756941236, 336028848, 626893475, 550698001, 971854899, 428738084, 85777754, 548985841, 91144920, 725266015, 957553852, 443913306, 851311890, 375149909, 954308523] 9))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (maximumLength [766550818, 906436068, 842322495, 227281452, 546244193, 189773691, 795345716, 511453600, 428630063, 961418767, 909775809, 518142035, 142534445, 226680739, 14413192, 684910958, 350747094, 389127842, 551048695, 793657350, 514009257, 453239520, 297339715, 440177720, 549564290, 424329874, 721028462, 606713685, 405675142, 987741638, 666065731, 151310381, 822718111, 379985957, 411154058, 96501175, 310975, 587251167, 362674533, 748464264, 293080142, 861078168, 151734041, 806969690, 190231325, 475906098, 889477668, 796745292, 918246299, 399060393, 308556458, 54469566, 163681224, 672154960, 285832376, 620610142, 19763462, 780109108, 879360573, 958960913, 319521755, 623380309, 850421875, 339734364, 997159471, 935970929, 600635208, 147745386, 476089764, 928409354, 535786394, 421126660, 111274516, 432185353, 951792615, 561316429, 97037209, 510429606, 525877163, 884159304, 994069797, 311633424, 809248713] 2)," 3 (maximumLength [766550818, 906436068, 842322495, 227281452, 546244193, 189773691, 795345716, 511453600, 428630063, 961418767, 909775809, 518142035, 142534445, 226680739, 14413192, 684910958, 350747094, 389127842, 551048695, 793657350, 514009257, 453239520, 297339715, 440177720, 549564290, 424329874, 721028462, 606713685, 405675142, 987741638, 666065731, 151310381, 822718111, 379985957, 411154058, 96501175, 310975, 587251167, 362674533, 748464264, 293080142, 861078168, 151734041, 806969690, 190231325, 475906098, 889477668, 796745292, 918246299, 399060393, 308556458, 54469566, 163681224, 672154960, 285832376, 620610142, 19763462, 780109108, 879360573, 958960913, 319521755, 623380309, 850421875, 339734364, 997159471, 935970929, 600635208, 147745386, 476089764, 928409354, 535786394, 421126660, 111274516, 432185353, 951792615, 561316429, 97037209, 510429606, 525877163, 884159304, 994069797, 311633424, 809248713] 2))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (maximumLength [952490193, 622824133, 405928692, 969859413, 684428934, 527325455, 702570155, 337574627, 262974955, 972088729, 760493400, 208402756, 804884365, 883811047, 202766874, 680462324, 197117370, 897661386, 964763892, 975624339, 190022513, 41623483, 881489084, 926446355, 937111479, 516549005, 943095584, 45071193, 941508674, 335830493, 672332714, 518202143, 344728266, 853173293, 654481635, 883186794, 182111010, 874779317, 259809566, 350500171, 21996490, 138172886, 33149981, 905939030, 880967170, 162631082, 690779254, 171705177, 60148845, 153349346, 231016524, 669854204, 990078914, 379547527, 225427609, 461733862, 950792765, 306844286, 838916862, 617619634, 113366257, 195139529, 178644292, 854626497, 813735119, 524831767, 987868428, 792158694, 215680803, 168326668, 266561687, 246337990, 850244976, 652963813, 551020658, 675151284, 287302927, 682223775, 166706773, 566852251, 870051567, 88649934, 27519439, 519872645, 604054227, 310761100, 895873308, 578176877, 841544488, 258382968, 529172209, 424840686, 776103022, 323771211, 812742172, 308777308, 816213377, 407441213, 659592279, 310723900, 148014994, 20538730, 347707113, 170627081, 174926814, 842764296, 842386439, 412289806, 656100529, 197657843, 65857197, 586281132, 299689428, 661496050, 105000136, 239112305, 741548195, 704117291, 582966355, 684316056, 421686477, 119749685, 818309916, 699931190, 204994751, 766688195, 501775473, 615870358, 278650568, 446224512, 286942104, 855451447, 436139024, 872066703, 281870388, 366134906, 326541827, 607697848, 91130137, 660226268, 386913644, 75261165, 447760221, 261876585, 430727981, 681608670, 209357432, 989718616, 254988008, 884267480, 170065820, 338193746, 657070222, 685710733, 604201755, 382647977, 405175889, 937286704, 719345831, 187746316, 432355951, 568682509, 768302292, 165254732, 317884011, 38705733, 158660679, 408464567, 706771625, 858558360, 857163329, 797128416, 335766767, 278690069, 642520218, 418103867, 947746893, 250383291, 303035276, 310504389, 653633116, 326452166, 869124008, 925886240, 606391113, 760226974, 364371596, 158674119, 991781019, 796930501, 2139061, 90881255, 581287506, 902007074, 234182494, 888690703, 374714881, 679248921, 291475262, 616486558, 876071114, 157497006, 616706784, 411985771, 770235817, 106016028, 142470056, 139870812, 559088009, 648754817, 288118115, 243289585, 929249213, 306472304, 556731590, 347185806, 124190710, 304809826, 942762975, 510726184, 578242639, 383719183, 205491035, 355234742, 981412363, 26629208, 823200445, 614848017, 492563982, 261348499, 411888102, 503595423, 687938954, 677425261, 199880165, 846656760, 400868850, 99655429, 476737261, 437481507, 663227830, 25406021, 419704593, 547192406, 651124877, 855495187, 743523172, 998216275, 96450354, 24427597, 53692975, 764580717, 683743595, 70135174, 860598696, 859326828, 594914209, 36855796, 591571002, 464736610, 129965077, 701568663, 846779480, 38900117, 126314493, 568276570, 401923199, 839766771, 287786203, 131958805, 557972122, 503621532, 16387294, 465006687, 533629310, 441575190, 760494056, 282865241, 625005456, 945830662, 709943732, 292221151, 179873840, 216336531, 536660633, 47776097, 793220905, 57487697, 173539575, 16443039, 221055679, 337504932, 11385936, 265110318, 819315490, 160577936, 186620220, 481355694, 410634094, 800948523, 348843218, 912895882, 43059167, 923562124, 831749585, 438843040, 157341496, 176461655, 943396961, 470460673, 309297065, 380421178, 352330482, 285531427, 756774034, 125517542, 920012345, 93108971] 1)," 2 (maximumLength [952490193, 622824133, 405928692, 969859413, 684428934, 527325455, 702570155, 337574627, 262974955, 972088729, 760493400, 208402756, 804884365, 883811047, 202766874, 680462324, 197117370, 897661386, 964763892, 975624339, 190022513, 41623483, 881489084, 926446355, 937111479, 516549005, 943095584, 45071193, 941508674, 335830493, 672332714, 518202143, 344728266, 853173293, 654481635, 883186794, 182111010, 874779317, 259809566, 350500171, 21996490, 138172886, 33149981, 905939030, 880967170, 162631082, 690779254, 171705177, 60148845, 153349346, 231016524, 669854204, 990078914, 379547527, 225427609, 461733862, 950792765, 306844286, 838916862, 617619634, 113366257, 195139529, 178644292, 854626497, 813735119, 524831767, 987868428, 792158694, 215680803, 168326668, 266561687, 246337990, 850244976, 652963813, 551020658, 675151284, 287302927, 682223775, 166706773, 566852251, 870051567, 88649934, 27519439, 519872645, 604054227, 310761100, 895873308, 578176877, 841544488, 258382968, 529172209, 424840686, 776103022, 323771211, 812742172, 308777308, 816213377, 407441213, 659592279, 310723900, 148014994, 20538730, 347707113, 170627081, 174926814, 842764296, 842386439, 412289806, 656100529, 197657843, 65857197, 586281132, 299689428, 661496050, 105000136, 239112305, 741548195, 704117291, 582966355, 684316056, 421686477, 119749685, 818309916, 699931190, 204994751, 766688195, 501775473, 615870358, 278650568, 446224512, 286942104, 855451447, 436139024, 872066703, 281870388, 366134906, 326541827, 607697848, 91130137, 660226268, 386913644, 75261165, 447760221, 261876585, 430727981, 681608670, 209357432, 989718616, 254988008, 884267480, 170065820, 338193746, 657070222, 685710733, 604201755, 382647977, 405175889, 937286704, 719345831, 187746316, 432355951, 568682509, 768302292, 165254732, 317884011, 38705733, 158660679, 408464567, 706771625, 858558360, 857163329, 797128416, 335766767, 278690069, 642520218, 418103867, 947746893, 250383291, 303035276, 310504389, 653633116, 326452166, 869124008, 925886240, 606391113, 760226974, 364371596, 158674119, 991781019, 796930501, 2139061, 90881255, 581287506, 902007074, 234182494, 888690703, 374714881, 679248921, 291475262, 616486558, 876071114, 157497006, 616706784, 411985771, 770235817, 106016028, 142470056, 139870812, 559088009, 648754817, 288118115, 243289585, 929249213, 306472304, 556731590, 347185806, 124190710, 304809826, 942762975, 510726184, 578242639, 383719183, 205491035, 355234742, 981412363, 26629208, 823200445, 614848017, 492563982, 261348499, 411888102, 503595423, 687938954, 677425261, 199880165, 846656760, 400868850, 99655429, 476737261, 437481507, 663227830, 25406021, 419704593, 547192406, 651124877, 855495187, 743523172, 998216275, 96450354, 24427597, 53692975, 764580717, 683743595, 70135174, 860598696, 859326828, 594914209, 36855796, 591571002, 464736610, 129965077, 701568663, 846779480, 38900117, 126314493, 568276570, 401923199, 839766771, 287786203, 131958805, 557972122, 503621532, 16387294, 465006687, 533629310, 441575190, 760494056, 282865241, 625005456, 945830662, 709943732, 292221151, 179873840, 216336531, 536660633, 47776097, 793220905, 57487697, 173539575, 16443039, 221055679, 337504932, 11385936, 265110318, 819315490, 160577936, 186620220, 481355694, 410634094, 800948523, 348843218, 912895882, 43059167, 923562124, 831749585, 438843040, 157341496, 176461655, 943396961, 470460673, 309297065, 380421178, 352330482, 285531427, 756774034, 125517542, 920012345, 93108971] 1))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (maximumLength [166136514, 121501069, 819268421, 996909151, 666575839, 541443609, 7706451, 89798190, 975854495, 614031739, 789100479, 766517129, 943463720, 515084327, 163189379, 299070968, 245046802, 568034583, 268509159, 65891607, 354398193, 337134547, 974949739, 420157853, 110734465, 584545525, 514621850, 58185804, 830790963, 638219138, 82116660, 400356349, 498820256, 753164558, 579431294, 828544930, 256711179, 610891435, 367244257, 685012844, 153075263, 538925394, 151492281, 710294327, 946494292, 553565834, 31085508, 126512892, 644412249, 990248268, 737915622, 276941384, 191702591, 347433388, 767424495, 286791323, 688214920, 198524829, 102207523, 490530977, 661413988, 844298633, 640323442, 645885918, 369474665, 947582676, 811528952, 560202399, 201335332, 255442212, 918206560, 155086256, 461260585, 794465266, 294977082, 72359748, 434821860, 658021083, 133006978, 927209129, 268765584, 509281534, 822799342, 75194648, 925599283, 360458811, 756438750, 623837200, 881244020, 756356446, 968138490, 369084318, 134761876, 661448279, 565063531, 404410547, 610392398, 604820171, 935286640, 920067740, 444678795, 167417564, 258321288, 997296436, 220987238, 279059743, 187367765, 859448591, 564039123, 803408975, 150042322, 307671736, 696614477, 773298090, 181979755, 914018993, 198946164, 11556104, 257168447, 526341545, 341262481, 235727325, 838260040, 272657750, 977373789, 668955751, 650533716, 190754684, 871925241, 877718267, 565264642, 824672096, 626516766, 691952762, 921668768, 963325328, 315535461, 355893231, 143284008, 606082896, 510934338, 777389586, 753382270, 589212639, 462838388, 242968002, 109712214, 704028498, 573432950, 560850912, 341558848, 416310414, 246570536, 303323128, 292033142, 563160363, 923212087, 794937067, 14238289, 816347668, 437582650, 154506393, 916642905, 597771193, 947233003, 907165070, 628268892, 649413096, 457463638, 634737676, 2787027, 136051403, 60721945, 87802610, 778465317, 945642013, 482146092, 120346448, 268405150, 680779877, 949626043, 885795442, 369203304, 614790065, 686675444, 721147079, 404931489, 325608038, 799763530, 812514111, 322334029, 41960004, 98737859, 774491986, 473161838, 854817714, 55564799, 610759827, 473579724, 532921739, 144772207, 524367636, 885161046, 93978226, 442554162, 378694701, 399039972, 363891492, 59618362, 7873541, 987083408, 373052832, 735047065, 409398354, 719466302, 577059175, 546373803, 641895803, 812909458, 620410379, 208944493, 911380041, 737495506, 459237783, 267886235, 880440379, 751500176, 930875517, 588330440, 156948160, 75636017, 150470645, 356421639, 184913391, 381612864, 793878014, 537692251, 99687736, 808407828, 173644552, 492032091, 498857009, 763689568, 310749126, 541021190, 207145878, 350333428, 448732359, 349757320, 304075276, 542327546, 703546016, 66637224, 979504700, 671484019, 244339711, 930245090, 371323099, 338985100, 402958680, 372362155, 43760086, 165246680, 908901097, 716569252, 831389622, 448012015, 999259741, 230392983, 942018588, 781749220, 603187886, 124113316, 976540496, 768526445, 314799244, 812189464, 848042097, 562988395, 552631348, 116343573, 311047215, 802477476, 25783868, 64758483, 762917256, 250783758, 349671753, 554733767, 822715501, 900225346, 993082454, 514054420, 93504178, 84785904, 885832003, 145504473, 14400156, 972462806, 810591134, 568145125, 503794692, 939394406, 505714897, 18161315, 878436240, 473028339, 715541534, 975710752, 326260536, 50535073, 717069971, 167846524, 337841543, 100105267, 128371237, 949255911, 541698001, 570915335, 994888439, 888608531, 225067188, 485253240, 845071026, 889345603, 148535663, 923640144, 490807026, 998127812, 668018654, 876737264, 856070707, 966640000, 795372492, 730738997, 665884011, 639572103, 479425357, 30264519, 14925560, 731607145, 555132512, 177762943, 867419666, 598267225, 82695330, 765158109, 852209747, 59531094, 383478657, 963053183, 486942850, 880301481, 990343091, 713165975, 979571552, 527767876, 494375359, 199999618, 497690433, 919511247, 219064159, 54727708, 953021243, 504913329, 148395691, 840027895, 171471158, 243503127, 74473955, 443917113, 965775598, 709361068, 904814778, 648747792, 578243609, 680863160, 118153912, 700015204, 408876381, 138818429, 945013685, 611303397, 910824155, 317464717, 775019256, 725922803, 805356655, 32843994, 296785762, 322565856, 553444737, 554023185, 921946658, 655494293, 620103803, 61503902, 193096132, 148945455, 111163159, 484521864, 508885384, 486583549, 59757825, 979514899, 210731982, 130298360, 293533965, 326488262, 590399197, 292468128, 717267658, 360219071, 465181876, 765442431, 439752474, 162929690, 379128370, 278202430, 24279301, 350194618, 737572087, 584283061, 518603933, 82904376, 995452992, 395601185, 11320160, 29970360, 20311332, 50070865, 440709407, 18290907, 946070021, 152942281, 20921611, 689354440, 950701007, 456558546, 55135046, 909387311, 863846994, 561247584, 305014499, 404176119, 290598320, 234715431, 525227679, 980417944, 299917218, 619987345, 918661705, 590221155, 739336537, 167855991, 65662443, 131542406, 968720310, 245793016, 797203815, 720707468, 538861745, 805627716, 410229618, 558947018, 991033192, 743393960, 921778093, 677451165, 100542022, 777580921, 985399292] 14)," 15 (maximumLength [166136514, 121501069, 819268421, 996909151, 666575839, 541443609, 7706451, 89798190, 975854495, 614031739, 789100479, 766517129, 943463720, 515084327, 163189379, 299070968, 245046802, 568034583, 268509159, 65891607, 354398193, 337134547, 974949739, 420157853, 110734465, 584545525, 514621850, 58185804, 830790963, 638219138, 82116660, 400356349, 498820256, 753164558, 579431294, 828544930, 256711179, 610891435, 367244257, 685012844, 153075263, 538925394, 151492281, 710294327, 946494292, 553565834, 31085508, 126512892, 644412249, 990248268, 737915622, 276941384, 191702591, 347433388, 767424495, 286791323, 688214920, 198524829, 102207523, 490530977, 661413988, 844298633, 640323442, 645885918, 369474665, 947582676, 811528952, 560202399, 201335332, 255442212, 918206560, 155086256, 461260585, 794465266, 294977082, 72359748, 434821860, 658021083, 133006978, 927209129, 268765584, 509281534, 822799342, 75194648, 925599283, 360458811, 756438750, 623837200, 881244020, 756356446, 968138490, 369084318, 134761876, 661448279, 565063531, 404410547, 610392398, 604820171, 935286640, 920067740, 444678795, 167417564, 258321288, 997296436, 220987238, 279059743, 187367765, 859448591, 564039123, 803408975, 150042322, 307671736, 696614477, 773298090, 181979755, 914018993, 198946164, 11556104, 257168447, 526341545, 341262481, 235727325, 838260040, 272657750, 977373789, 668955751, 650533716, 190754684, 871925241, 877718267, 565264642, 824672096, 626516766, 691952762, 921668768, 963325328, 315535461, 355893231, 143284008, 606082896, 510934338, 777389586, 753382270, 589212639, 462838388, 242968002, 109712214, 704028498, 573432950, 560850912, 341558848, 416310414, 246570536, 303323128, 292033142, 563160363, 923212087, 794937067, 14238289, 816347668, 437582650, 154506393, 916642905, 597771193, 947233003, 907165070, 628268892, 649413096, 457463638, 634737676, 2787027, 136051403, 60721945, 87802610, 778465317, 945642013, 482146092, 120346448, 268405150, 680779877, 949626043, 885795442, 369203304, 614790065, 686675444, 721147079, 404931489, 325608038, 799763530, 812514111, 322334029, 41960004, 98737859, 774491986, 473161838, 854817714, 55564799, 610759827, 473579724, 532921739, 144772207, 524367636, 885161046, 93978226, 442554162, 378694701, 399039972, 363891492, 59618362, 7873541, 987083408, 373052832, 735047065, 409398354, 719466302, 577059175, 546373803, 641895803, 812909458, 620410379, 208944493, 911380041, 737495506, 459237783, 267886235, 880440379, 751500176, 930875517, 588330440, 156948160, 75636017, 150470645, 356421639, 184913391, 381612864, 793878014, 537692251, 99687736, 808407828, 173644552, 492032091, 498857009, 763689568, 310749126, 541021190, 207145878, 350333428, 448732359, 349757320, 304075276, 542327546, 703546016, 66637224, 979504700, 671484019, 244339711, 930245090, 371323099, 338985100, 402958680, 372362155, 43760086, 165246680, 908901097, 716569252, 831389622, 448012015, 999259741, 230392983, 942018588, 781749220, 603187886, 124113316, 976540496, 768526445, 314799244, 812189464, 848042097, 562988395, 552631348, 116343573, 311047215, 802477476, 25783868, 64758483, 762917256, 250783758, 349671753, 554733767, 822715501, 900225346, 993082454, 514054420, 93504178, 84785904, 885832003, 145504473, 14400156, 972462806, 810591134, 568145125, 503794692, 939394406, 505714897, 18161315, 878436240, 473028339, 715541534, 975710752, 326260536, 50535073, 717069971, 167846524, 337841543, 100105267, 128371237, 949255911, 541698001, 570915335, 994888439, 888608531, 225067188, 485253240, 845071026, 889345603, 148535663, 923640144, 490807026, 998127812, 668018654, 876737264, 856070707, 966640000, 795372492, 730738997, 665884011, 639572103, 479425357, 30264519, 14925560, 731607145, 555132512, 177762943, 867419666, 598267225, 82695330, 765158109, 852209747, 59531094, 383478657, 963053183, 486942850, 880301481, 990343091, 713165975, 979571552, 527767876, 494375359, 199999618, 497690433, 919511247, 219064159, 54727708, 953021243, 504913329, 148395691, 840027895, 171471158, 243503127, 74473955, 443917113, 965775598, 709361068, 904814778, 648747792, 578243609, 680863160, 118153912, 700015204, 408876381, 138818429, 945013685, 611303397, 910824155, 317464717, 775019256, 725922803, 805356655, 32843994, 296785762, 322565856, 553444737, 554023185, 921946658, 655494293, 620103803, 61503902, 193096132, 148945455, 111163159, 484521864, 508885384, 486583549, 59757825, 979514899, 210731982, 130298360, 293533965, 326488262, 590399197, 292468128, 717267658, 360219071, 465181876, 765442431, 439752474, 162929690, 379128370, 278202430, 24279301, 350194618, 737572087, 584283061, 518603933, 82904376, 995452992, 395601185, 11320160, 29970360, 20311332, 50070865, 440709407, 18290907, 946070021, 152942281, 20921611, 689354440, 950701007, 456558546, 55135046, 909387311, 863846994, 561247584, 305014499, 404176119, 290598320, 234715431, 525227679, 980417944, 299917218, 619987345, 918661705, 590221155, 739336537, 167855991, 65662443, 131542406, 968720310, 245793016, 797203815, 720707468, 538861745, 805627716, 410229618, 558947018, 991033192, 743393960, 921778093, 677451165, 100542022, 777580921, 985399292] 14))
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
find_the_maximum_length_of_a_good_subsequence_i/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(4, maximumLength(new ArrayList<>(Arrays.asList(1,2,1,1,3)), 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(2, maximumLength(new ArrayList<>(Arrays.asList(1,2,3,4,5,1)), 0));
19
+ }
20
+
21
+ }
find_the_maximum_length_of_a_good_subsequence_i/meta.json ADDED
@@ -0,0 +1,2996 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3456,
3
+ "name": "find_the_maximum_length_of_a_good_subsequence_i",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/find-the-maximum-length-of-a-good-subsequence-i/",
6
+ "date": "2024-05-25 00:00:00",
7
+ "task_description": "You are given an integer array `nums` and a **non-negative** integer `k`. A sequence of integers `seq` is called **good** if there are **at most** `k` indices `i` in the range `[0, seq.length - 2]` such that `seq[i] != seq[i + 1]`. Return the **maximum** possible length of a **good** subsequence of `nums`. **Example 1:** **Input:** nums = [1,2,1,1,3], k = 2 **Output:** 4 **Explanation:** The maximum length subsequence is `[1,2,1,1,3]`. **Example 2:** **Input:** nums = [1,2,3,4,5,1], k = 0 **Output:** 2 **Explanation:** The maximum length subsequence is `[1,2,3,4,5,1]`. **Constraints:** `1 <= nums.length <= 500` `1 <= nums[i] <= 109` `0 <= k <= min(nums.length, 25)`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums = [1,2,1,1,3], k = 2",
12
+ "output": "4 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums = [1,2,3,4,5,1], k = 0",
17
+ "output": "2 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ [
24
+ 33487469,
25
+ 853196700,
26
+ 508583567,
27
+ 222097037,
28
+ 261098452,
29
+ 188012054,
30
+ 961540644,
31
+ 61212932,
32
+ 15037773,
33
+ 841097125,
34
+ 12525542,
35
+ 698705099,
36
+ 369973008,
37
+ 92835030,
38
+ 468189131,
39
+ 34148422,
40
+ 580687421,
41
+ 570566821,
42
+ 738952593,
43
+ 180225171,
44
+ 919512242,
45
+ 99783784,
46
+ 425204860,
47
+ 869457230,
48
+ 404469514,
49
+ 507286517,
50
+ 185905194,
51
+ 475848287,
52
+ 567490953,
53
+ 276861319,
54
+ 115618801,
55
+ 198885023,
56
+ 78195956,
57
+ 868047407,
58
+ 828704823,
59
+ 277822141,
60
+ 528152647,
61
+ 429059504,
62
+ 198847876,
63
+ 96584063,
64
+ 240877916,
65
+ 901365711,
66
+ 516446494,
67
+ 437684656,
68
+ 765734979,
69
+ 797685131,
70
+ 431370848,
71
+ 938336517,
72
+ 568041453,
73
+ 753525892,
74
+ 977443993,
75
+ 393213522,
76
+ 665183860,
77
+ 341164691,
78
+ 885173771,
79
+ 292144240,
80
+ 362688963,
81
+ 435157884,
82
+ 799158529,
83
+ 992337970,
84
+ 291377882,
85
+ 70212125,
86
+ 740085897,
87
+ 725729792,
88
+ 565803853,
89
+ 312378643,
90
+ 548373143,
91
+ 360751039,
92
+ 451196075,
93
+ 727176901,
94
+ 805095909,
95
+ 872955566,
96
+ 929350237,
97
+ 242334546,
98
+ 214523895,
99
+ 915147423,
100
+ 578098350,
101
+ 930167586,
102
+ 897761330,
103
+ 148274586,
104
+ 367416565,
105
+ 664847641,
106
+ 722275601,
107
+ 419879451,
108
+ 997547266,
109
+ 336404135,
110
+ 699560214,
111
+ 943663808,
112
+ 423571499,
113
+ 617199117,
114
+ 947330997,
115
+ 809209468,
116
+ 798079300,
117
+ 180475930,
118
+ 99646714,
119
+ 804391530,
120
+ 347455668,
121
+ 946783223,
122
+ 914880392,
123
+ 75100983,
124
+ 725832068,
125
+ 158225386,
126
+ 992157753,
127
+ 240948618,
128
+ 947609519,
129
+ 719608751,
130
+ 775262320,
131
+ 536867805,
132
+ 119714960,
133
+ 79319150,
134
+ 792873002,
135
+ 286087071,
136
+ 19022943,
137
+ 328363907,
138
+ 732538568,
139
+ 912457144,
140
+ 975334806,
141
+ 443207614,
142
+ 536940420,
143
+ 109373287,
144
+ 924182716,
145
+ 501305908,
146
+ 85032470,
147
+ 344350927,
148
+ 835184090,
149
+ 201928566,
150
+ 66998189,
151
+ 946158698,
152
+ 881066162,
153
+ 771616191,
154
+ 71900078,
155
+ 242619018,
156
+ 138756453,
157
+ 49348893,
158
+ 553284692,
159
+ 480485289,
160
+ 503323713,
161
+ 469473152,
162
+ 911729932,
163
+ 192672881,
164
+ 315945519,
165
+ 841821428,
166
+ 877577124,
167
+ 118650340,
168
+ 799021764,
169
+ 181762663,
170
+ 391644005,
171
+ 428532741,
172
+ 274242895,
173
+ 521472249,
174
+ 932515039,
175
+ 362200761,
176
+ 643684951,
177
+ 465953301,
178
+ 760234216,
179
+ 688956595,
180
+ 823790102,
181
+ 880317891,
182
+ 720087970,
183
+ 589862333,
184
+ 693639300,
185
+ 310685438,
186
+ 107433866,
187
+ 788125014,
188
+ 623113991,
189
+ 995926890,
190
+ 164308186,
191
+ 695870276,
192
+ 116547502,
193
+ 363599749,
194
+ 108771651,
195
+ 999020226,
196
+ 513212465,
197
+ 459019090,
198
+ 198641889,
199
+ 321381216,
200
+ 197675,
201
+ 440410330,
202
+ 550548711,
203
+ 512695542,
204
+ 456196651,
205
+ 212908375,
206
+ 341285455,
207
+ 882866009,
208
+ 855721216,
209
+ 166776550,
210
+ 102169125,
211
+ 634712393,
212
+ 952280485,
213
+ 814900567,
214
+ 168724223,
215
+ 667018749,
216
+ 529617768,
217
+ 709275051,
218
+ 669667562,
219
+ 100129221,
220
+ 177210779,
221
+ 428138415,
222
+ 42907194,
223
+ 166376059,
224
+ 105392153,
225
+ 139613470,
226
+ 559725870,
227
+ 521014552,
228
+ 198477863,
229
+ 711092633,
230
+ 293926168,
231
+ 153515338,
232
+ 940899181,
233
+ 545362491,
234
+ 677734161,
235
+ 5697569,
236
+ 131349649,
237
+ 524707944,
238
+ 781502588,
239
+ 979858072,
240
+ 68950361,
241
+ 805348411,
242
+ 466231031,
243
+ 435112989,
244
+ 783476999,
245
+ 254764697,
246
+ 853396350,
247
+ 929243358,
248
+ 468382183,
249
+ 663529870,
250
+ 849437120,
251
+ 561130145,
252
+ 548588197,
253
+ 676136929,
254
+ 330928976,
255
+ 885846542,
256
+ 164388235,
257
+ 967958142,
258
+ 38247037,
259
+ 463953934,
260
+ 347360076,
261
+ 995050699,
262
+ 743574862,
263
+ 683210867,
264
+ 918944006,
265
+ 970459141,
266
+ 127854995,
267
+ 988662628,
268
+ 840629843,
269
+ 112062233,
270
+ 335501492,
271
+ 912608621,
272
+ 926468029,
273
+ 545144992,
274
+ 307778362,
275
+ 767981405,
276
+ 947513417,
277
+ 281025337,
278
+ 839230833,
279
+ 795215533,
280
+ 262480577,
281
+ 538515965,
282
+ 564432683,
283
+ 101892992,
284
+ 946834501,
285
+ 448603415,
286
+ 35287181,
287
+ 668530827,
288
+ 533095130,
289
+ 16669636,
290
+ 437967928,
291
+ 31609116,
292
+ 481480060,
293
+ 960746244,
294
+ 122751744,
295
+ 124100679,
296
+ 539213806,
297
+ 366896015,
298
+ 744434752,
299
+ 629313621,
300
+ 457167645,
301
+ 275701834,
302
+ 585755798,
303
+ 129481485,
304
+ 309735642,
305
+ 646484951,
306
+ 53708602,
307
+ 651248907,
308
+ 708064996,
309
+ 112736000,
310
+ 274006791,
311
+ 594154331,
312
+ 51446599,
313
+ 519253736,
314
+ 17702088,
315
+ 744157317,
316
+ 319575662,
317
+ 848133481,
318
+ 649938608,
319
+ 930137559,
320
+ 569860301,
321
+ 323200898,
322
+ 711859209,
323
+ 241182967,
324
+ 234054345,
325
+ 882840128,
326
+ 99742283,
327
+ 335636269,
328
+ 26185291,
329
+ 910583828,
330
+ 165643009,
331
+ 533325241,
332
+ 404037313,
333
+ 829637648,
334
+ 21547628,
335
+ 72795736,
336
+ 876953683,
337
+ 468673893,
338
+ 622650379,
339
+ 533615749,
340
+ 342343878,
341
+ 651184748,
342
+ 455998415,
343
+ 990023260,
344
+ 709242020,
345
+ 148845447,
346
+ 590094939,
347
+ 549908446,
348
+ 713848415,
349
+ 554513168,
350
+ 985056785,
351
+ 606819211,
352
+ 54145594,
353
+ 87339142,
354
+ 615328163,
355
+ 302076645,
356
+ 283071573,
357
+ 272634690,
358
+ 557009091,
359
+ 114845885,
360
+ 992191057,
361
+ 524218932,
362
+ 881413971,
363
+ 944836739,
364
+ 147344544,
365
+ 373503446,
366
+ 372904757,
367
+ 727364693,
368
+ 392538095,
369
+ 220238128,
370
+ 382685773,
371
+ 533191650,
372
+ 339399728,
373
+ 686877685,
374
+ 939274906,
375
+ 73989668,
376
+ 139028258,
377
+ 657370317,
378
+ 584871020,
379
+ 5684839,
380
+ 178541263,
381
+ 195131290,
382
+ 552754672,
383
+ 596872011,
384
+ 532769740,
385
+ 354354765,
386
+ 306588671,
387
+ 542632927,
388
+ 616890468,
389
+ 84630307,
390
+ 684256585,
391
+ 266958682,
392
+ 359174232,
393
+ 170591596,
394
+ 901103102,
395
+ 940625309,
396
+ 685913267,
397
+ 339792519,
398
+ 339471136,
399
+ 125049040,
400
+ 561697226,
401
+ 695007544,
402
+ 34492279,
403
+ 498603652,
404
+ 915994047,
405
+ 646471502,
406
+ 505889051,
407
+ 142953890,
408
+ 945443929,
409
+ 126223611,
410
+ 433889431,
411
+ 466854560,
412
+ 10320689,
413
+ 533328459,
414
+ 538754638,
415
+ 773200198,
416
+ 584450813,
417
+ 34495612,
418
+ 10320873,
419
+ 290695904,
420
+ 99406833,
421
+ 364239123,
422
+ 536695973,
423
+ 346881538,
424
+ 38096901,
425
+ 837486993,
426
+ 738761524,
427
+ 116884667,
428
+ 843859643,
429
+ 180154682,
430
+ 245936609,
431
+ 897197094,
432
+ 630949789,
433
+ 153247778,
434
+ 159250724,
435
+ 919184705,
436
+ 523682287,
437
+ 414807889,
438
+ 168669427,
439
+ 828244050,
440
+ 400082520,
441
+ 60411377,
442
+ 641318340,
443
+ 759312668,
444
+ 946509056,
445
+ 593211437,
446
+ 206895703,
447
+ 816982160,
448
+ 132939201,
449
+ 411365896,
450
+ 916204740,
451
+ 184498912,
452
+ 552085651,
453
+ 760105753
454
+ ],
455
+ 15
456
+ ],
457
+ "output": 16
458
+ },
459
+ {
460
+ "input": [
461
+ [
462
+ 327533889,
463
+ 516247971,
464
+ 577104323,
465
+ 102780451,
466
+ 579472496,
467
+ 369364708,
468
+ 431811091,
469
+ 851858081,
470
+ 389227997,
471
+ 223952808,
472
+ 988636711,
473
+ 83830649,
474
+ 524947406,
475
+ 296624356,
476
+ 794995672,
477
+ 30494355,
478
+ 154348533,
479
+ 476239988,
480
+ 547576365,
481
+ 263612981,
482
+ 485307754,
483
+ 747671126,
484
+ 64210544,
485
+ 376097964,
486
+ 462275031,
487
+ 535805711,
488
+ 332753982,
489
+ 213719903,
490
+ 155924079,
491
+ 248700945,
492
+ 118826282,
493
+ 706339812,
494
+ 68349277,
495
+ 991342323,
496
+ 920746401,
497
+ 960198240,
498
+ 813243613,
499
+ 188071477,
500
+ 670184207,
501
+ 532896855,
502
+ 602914215,
503
+ 239111400,
504
+ 129822243,
505
+ 141229165,
506
+ 534580815,
507
+ 897265516,
508
+ 614935521,
509
+ 939532753,
510
+ 39963074,
511
+ 740212020,
512
+ 143222965,
513
+ 941682425,
514
+ 239582504,
515
+ 35023687,
516
+ 618015486,
517
+ 959550922,
518
+ 687895424,
519
+ 625377189,
520
+ 364408867,
521
+ 809797648,
522
+ 491284157,
523
+ 453083882,
524
+ 898959256,
525
+ 481212322,
526
+ 29091746,
527
+ 138006074,
528
+ 963762698,
529
+ 270676830,
530
+ 747466877,
531
+ 113357505,
532
+ 982113766,
533
+ 495275050,
534
+ 744041226,
535
+ 718203434,
536
+ 700072245,
537
+ 787953956,
538
+ 436075447,
539
+ 864825218,
540
+ 360097180,
541
+ 311162304,
542
+ 816051078,
543
+ 948790181,
544
+ 139380119,
545
+ 462149183,
546
+ 169921147,
547
+ 526798940,
548
+ 116044069,
549
+ 79653034,
550
+ 954140644,
551
+ 293213000,
552
+ 608576999,
553
+ 230353388,
554
+ 567365557,
555
+ 705459268,
556
+ 531247042,
557
+ 35399870,
558
+ 963947762,
559
+ 136182401,
560
+ 461889635,
561
+ 951439775,
562
+ 71938909,
563
+ 887693320,
564
+ 757989888,
565
+ 26504625,
566
+ 846479912,
567
+ 577482890,
568
+ 220016904,
569
+ 233976519,
570
+ 308152721,
571
+ 4884715,
572
+ 355167603,
573
+ 92431841,
574
+ 59412077,
575
+ 498429636,
576
+ 579318280,
577
+ 91688022,
578
+ 727082443,
579
+ 71084239,
580
+ 908856330,
581
+ 22091108,
582
+ 405709610,
583
+ 715395797,
584
+ 115454620,
585
+ 271477677,
586
+ 196837563,
587
+ 429623851,
588
+ 806161676,
589
+ 289091831,
590
+ 696564972,
591
+ 775018977,
592
+ 239704135,
593
+ 54133936,
594
+ 119278128,
595
+ 742601516,
596
+ 162977700,
597
+ 259855912,
598
+ 274770239,
599
+ 252037593,
600
+ 695813277,
601
+ 614725042,
602
+ 298612459,
603
+ 792677903,
604
+ 589370084,
605
+ 912528150,
606
+ 164707278,
607
+ 386684390,
608
+ 452820769,
609
+ 79739724,
610
+ 66572280,
611
+ 824873930,
612
+ 978713135,
613
+ 881349725,
614
+ 699001664,
615
+ 327221414,
616
+ 764367180,
617
+ 533880754,
618
+ 264285724,
619
+ 857663714,
620
+ 226843218,
621
+ 933229505,
622
+ 836864949,
623
+ 540927216,
624
+ 630071486,
625
+ 2122958,
626
+ 815381840,
627
+ 874377121,
628
+ 492304758,
629
+ 200048732,
630
+ 76507927,
631
+ 700101808,
632
+ 162237741,
633
+ 674935054,
634
+ 335425981,
635
+ 406307331,
636
+ 594448382,
637
+ 758768471,
638
+ 288734876,
639
+ 312664328,
640
+ 540664454,
641
+ 779494011,
642
+ 764656558,
643
+ 861823605,
644
+ 118903129,
645
+ 398326761,
646
+ 375758584,
647
+ 380806694,
648
+ 794475795,
649
+ 646547293,
650
+ 145051162,
651
+ 609252633,
652
+ 760356685,
653
+ 958660571,
654
+ 435366240,
655
+ 356814873,
656
+ 95319712,
657
+ 631444407,
658
+ 596253847,
659
+ 268340190,
660
+ 211984765,
661
+ 454532514,
662
+ 459526641,
663
+ 805932389,
664
+ 448184761,
665
+ 13543944,
666
+ 894437555,
667
+ 45432878,
668
+ 442552418,
669
+ 108165329,
670
+ 487415069,
671
+ 783710264,
672
+ 695486933,
673
+ 699450570,
674
+ 293298646,
675
+ 479220412,
676
+ 684599590,
677
+ 192970243,
678
+ 840691084,
679
+ 4532748,
680
+ 741328011,
681
+ 746395579,
682
+ 966633259,
683
+ 903804640,
684
+ 465102945,
685
+ 280361450,
686
+ 321069891,
687
+ 624057962,
688
+ 239172920,
689
+ 197561644,
690
+ 380049568,
691
+ 90222551,
692
+ 625174874,
693
+ 490379701,
694
+ 173468021,
695
+ 953184329,
696
+ 301825571,
697
+ 941534385,
698
+ 995509963,
699
+ 868449315,
700
+ 557544885,
701
+ 880302873,
702
+ 872609724,
703
+ 875626162,
704
+ 370323425,
705
+ 275468447,
706
+ 882014552,
707
+ 846735184,
708
+ 120912352,
709
+ 813721801,
710
+ 862942875,
711
+ 515699969,
712
+ 683462384,
713
+ 980903474,
714
+ 546493687,
715
+ 402300014,
716
+ 319569533,
717
+ 797130956,
718
+ 387682284,
719
+ 214646902,
720
+ 719014383,
721
+ 102095725,
722
+ 196771211,
723
+ 828165396,
724
+ 672834365,
725
+ 531011470,
726
+ 880466295,
727
+ 608158345,
728
+ 338180323,
729
+ 180965136,
730
+ 73119784,
731
+ 64083527,
732
+ 955870955,
733
+ 771887888,
734
+ 139237899,
735
+ 455198447,
736
+ 6562309,
737
+ 561603040,
738
+ 799283563,
739
+ 59075477,
740
+ 858737286,
741
+ 68016326,
742
+ 634664588,
743
+ 300951668,
744
+ 452080386,
745
+ 383475146,
746
+ 603177201,
747
+ 872135189,
748
+ 261574971,
749
+ 229884149,
750
+ 858212769,
751
+ 499701451,
752
+ 910896731,
753
+ 223956027,
754
+ 432733575,
755
+ 770157887,
756
+ 773985892,
757
+ 558621158,
758
+ 560393168,
759
+ 777160405,
760
+ 961201142,
761
+ 807882491,
762
+ 124052476,
763
+ 196881320,
764
+ 324835681,
765
+ 838853707,
766
+ 43693124,
767
+ 239058684,
768
+ 334495096,
769
+ 381139239,
770
+ 96627701,
771
+ 613545592,
772
+ 633996771,
773
+ 836870001,
774
+ 768428858,
775
+ 382469643,
776
+ 986155908,
777
+ 159381817,
778
+ 97105863,
779
+ 299264759,
780
+ 594461108,
781
+ 233236917,
782
+ 540594617,
783
+ 244787518,
784
+ 482372949,
785
+ 785387674,
786
+ 380905759,
787
+ 731791714,
788
+ 994233002,
789
+ 334093235,
790
+ 778405573,
791
+ 775330947,
792
+ 232523002,
793
+ 521892918,
794
+ 8131144,
795
+ 541091974,
796
+ 18857695,
797
+ 587779058,
798
+ 250293641,
799
+ 178083084,
800
+ 86423929,
801
+ 365187708,
802
+ 964149610,
803
+ 328603078,
804
+ 112878336,
805
+ 606064134,
806
+ 568564713,
807
+ 493936941,
808
+ 187197854,
809
+ 459298315,
810
+ 656369139,
811
+ 64328277,
812
+ 910946197,
813
+ 926708213,
814
+ 458972942,
815
+ 824338453,
816
+ 74535004,
817
+ 55485192,
818
+ 776358670,
819
+ 564155594,
820
+ 801557247,
821
+ 772983724,
822
+ 484332312,
823
+ 686814423,
824
+ 479037180,
825
+ 783501754,
826
+ 602973511,
827
+ 1190250,
828
+ 671618996,
829
+ 917218081,
830
+ 727705466,
831
+ 176448034,
832
+ 410775860,
833
+ 885939324,
834
+ 615546497,
835
+ 580229143,
836
+ 491004073,
837
+ 499090756,
838
+ 93700586,
839
+ 705077451,
840
+ 356461710,
841
+ 516001005,
842
+ 464491977,
843
+ 57107526,
844
+ 224642742,
845
+ 842112461,
846
+ 523735846,
847
+ 529283361,
848
+ 854603821,
849
+ 560169857,
850
+ 328288389,
851
+ 465414672,
852
+ 603244321,
853
+ 786147965,
854
+ 90727648,
855
+ 64912665,
856
+ 849588797,
857
+ 812698537,
858
+ 318123651,
859
+ 265457973,
860
+ 885015284,
861
+ 418024424,
862
+ 731171952,
863
+ 65881220,
864
+ 944209527,
865
+ 720974551,
866
+ 630329426,
867
+ 866558959,
868
+ 983335744,
869
+ 938155014,
870
+ 731092367,
871
+ 676946857,
872
+ 97835678,
873
+ 16879027,
874
+ 438367860,
875
+ 766950135,
876
+ 959068162,
877
+ 583347354,
878
+ 295765171,
879
+ 696414369,
880
+ 333608526,
881
+ 935312521,
882
+ 470896333,
883
+ 29352159,
884
+ 435560878,
885
+ 273366907,
886
+ 880512691,
887
+ 240984504,
888
+ 844227469,
889
+ 938755111,
890
+ 478250003,
891
+ 589565129,
892
+ 669659749,
893
+ 247563708,
894
+ 465743085,
895
+ 895565695,
896
+ 285953710,
897
+ 650504736,
898
+ 909051770,
899
+ 815902950,
900
+ 302329404,
901
+ 791140664,
902
+ 445181926,
903
+ 52880689,
904
+ 390293386,
905
+ 959655793,
906
+ 7572577,
907
+ 122794695,
908
+ 668019901,
909
+ 214190852,
910
+ 289117876,
911
+ 809299851,
912
+ 263551854,
913
+ 952412334,
914
+ 104283184,
915
+ 486898252,
916
+ 757064092,
917
+ 196239301,
918
+ 792657494,
919
+ 828373266,
920
+ 201020664,
921
+ 655715614,
922
+ 526849548,
923
+ 837378542,
924
+ 902331101,
925
+ 150169615,
926
+ 755972704,
927
+ 296301055,
928
+ 708488534,
929
+ 127290172,
930
+ 713800725,
931
+ 81776692,
932
+ 938518356,
933
+ 873893602,
934
+ 140005476,
935
+ 590412500,
936
+ 398918946,
937
+ 217348199,
938
+ 914936754,
939
+ 642424855,
940
+ 609632831,
941
+ 387869323,
942
+ 123138584,
943
+ 970088426,
944
+ 445751710,
945
+ 181422250,
946
+ 39153244,
947
+ 480323004,
948
+ 707798403,
949
+ 915125244,
950
+ 715274485,
951
+ 363189310,
952
+ 290275849,
953
+ 865152853,
954
+ 559410316,
955
+ 387501362,
956
+ 753415746,
957
+ 457757665
958
+ ],
959
+ 21
960
+ ],
961
+ "output": 22
962
+ },
963
+ {
964
+ "input": [
965
+ [
966
+ 63065717,
967
+ 310925130,
968
+ 123681352,
969
+ 418252036,
970
+ 455925266,
971
+ 848331954,
972
+ 514920504,
973
+ 926116127,
974
+ 823866862,
975
+ 745104358,
976
+ 494800415,
977
+ 972017751,
978
+ 943666958,
979
+ 458806,
980
+ 227938603,
981
+ 735223100,
982
+ 688717024,
983
+ 297682752,
984
+ 71206098,
985
+ 461866773,
986
+ 612194775,
987
+ 993980417,
988
+ 118835691,
989
+ 451667832,
990
+ 53172588,
991
+ 746247127,
992
+ 990607879,
993
+ 814031965,
994
+ 467657654,
995
+ 636665607,
996
+ 981988704,
997
+ 605396523,
998
+ 202477330,
999
+ 8406074,
1000
+ 74274772,
1001
+ 116003553,
1002
+ 102603765,
1003
+ 757367360,
1004
+ 292685632,
1005
+ 189891137,
1006
+ 653612534,
1007
+ 188352455,
1008
+ 806624900,
1009
+ 828176150,
1010
+ 159925719,
1011
+ 263424213,
1012
+ 694677233,
1013
+ 522612245,
1014
+ 198065972,
1015
+ 421243891,
1016
+ 789302712,
1017
+ 58198278,
1018
+ 575078912,
1019
+ 658376585,
1020
+ 891432173,
1021
+ 44671546,
1022
+ 941616686,
1023
+ 292875520,
1024
+ 876927014,
1025
+ 682858550,
1026
+ 942528013,
1027
+ 416491423,
1028
+ 4653487,
1029
+ 676555761,
1030
+ 2489297,
1031
+ 361846701,
1032
+ 686443358,
1033
+ 879875769,
1034
+ 91184601,
1035
+ 15439416,
1036
+ 558237173,
1037
+ 404140841,
1038
+ 631359651,
1039
+ 403414487,
1040
+ 103393750,
1041
+ 741274684,
1042
+ 546207955,
1043
+ 507600399,
1044
+ 562826389,
1045
+ 625457670,
1046
+ 477181692,
1047
+ 513302253,
1048
+ 876454335,
1049
+ 962370786,
1050
+ 465430109,
1051
+ 875410393,
1052
+ 681523014,
1053
+ 508882993,
1054
+ 734251846,
1055
+ 692760603,
1056
+ 376787886,
1057
+ 161882526,
1058
+ 658718628,
1059
+ 32642757,
1060
+ 317488330,
1061
+ 313581086,
1062
+ 624876775,
1063
+ 449477112,
1064
+ 612805515,
1065
+ 709078704,
1066
+ 376014080,
1067
+ 354660003,
1068
+ 676736234,
1069
+ 730047290,
1070
+ 10562672,
1071
+ 148014836,
1072
+ 760768774,
1073
+ 528567488,
1074
+ 869217498,
1075
+ 355676915,
1076
+ 122054706,
1077
+ 280415765,
1078
+ 712488264,
1079
+ 590404130,
1080
+ 21069838,
1081
+ 551110603,
1082
+ 313856070,
1083
+ 944892718,
1084
+ 728632982,
1085
+ 894098138,
1086
+ 939770583,
1087
+ 604837319,
1088
+ 924587415,
1089
+ 130286973,
1090
+ 489446560,
1091
+ 30407051,
1092
+ 396022255,
1093
+ 842936539,
1094
+ 322414686,
1095
+ 314582707,
1096
+ 226797374,
1097
+ 337026559,
1098
+ 309543384,
1099
+ 816976996,
1100
+ 956297634,
1101
+ 198350080,
1102
+ 556047734,
1103
+ 815917387,
1104
+ 14728176,
1105
+ 63749114,
1106
+ 345225320,
1107
+ 131354830,
1108
+ 61997083,
1109
+ 470355874,
1110
+ 859786431,
1111
+ 420649752,
1112
+ 656834306,
1113
+ 823363088,
1114
+ 854484404,
1115
+ 9346700,
1116
+ 597157723,
1117
+ 313812358,
1118
+ 119832585,
1119
+ 964021929,
1120
+ 105834742,
1121
+ 238318936,
1122
+ 966031671,
1123
+ 789654534,
1124
+ 389540161,
1125
+ 338015970,
1126
+ 164729724,
1127
+ 510634493,
1128
+ 68811418,
1129
+ 187593532,
1130
+ 934824704,
1131
+ 443021193,
1132
+ 832773862,
1133
+ 926839522,
1134
+ 376916994
1135
+ ],
1136
+ 1
1137
+ ],
1138
+ "output": 2
1139
+ },
1140
+ {
1141
+ "input": [
1142
+ [
1143
+ 756941236,
1144
+ 336028848,
1145
+ 626893475,
1146
+ 550698001,
1147
+ 971854899,
1148
+ 428738084,
1149
+ 85777754,
1150
+ 548985841,
1151
+ 91144920,
1152
+ 725266015,
1153
+ 957553852,
1154
+ 443913306,
1155
+ 851311890,
1156
+ 375149909,
1157
+ 954308523
1158
+ ],
1159
+ 9
1160
+ ],
1161
+ "output": 10
1162
+ },
1163
+ {
1164
+ "input": [
1165
+ [
1166
+ 766550818,
1167
+ 906436068,
1168
+ 842322495,
1169
+ 227281452,
1170
+ 546244193,
1171
+ 189773691,
1172
+ 795345716,
1173
+ 511453600,
1174
+ 428630063,
1175
+ 961418767,
1176
+ 909775809,
1177
+ 518142035,
1178
+ 142534445,
1179
+ 226680739,
1180
+ 14413192,
1181
+ 684910958,
1182
+ 350747094,
1183
+ 389127842,
1184
+ 551048695,
1185
+ 793657350,
1186
+ 514009257,
1187
+ 453239520,
1188
+ 297339715,
1189
+ 440177720,
1190
+ 549564290,
1191
+ 424329874,
1192
+ 721028462,
1193
+ 606713685,
1194
+ 405675142,
1195
+ 987741638,
1196
+ 666065731,
1197
+ 151310381,
1198
+ 822718111,
1199
+ 379985957,
1200
+ 411154058,
1201
+ 96501175,
1202
+ 310975,
1203
+ 587251167,
1204
+ 362674533,
1205
+ 748464264,
1206
+ 293080142,
1207
+ 861078168,
1208
+ 151734041,
1209
+ 806969690,
1210
+ 190231325,
1211
+ 475906098,
1212
+ 889477668,
1213
+ 796745292,
1214
+ 918246299,
1215
+ 399060393,
1216
+ 308556458,
1217
+ 54469566,
1218
+ 163681224,
1219
+ 672154960,
1220
+ 285832376,
1221
+ 620610142,
1222
+ 19763462,
1223
+ 780109108,
1224
+ 879360573,
1225
+ 958960913,
1226
+ 319521755,
1227
+ 623380309,
1228
+ 850421875,
1229
+ 339734364,
1230
+ 997159471,
1231
+ 935970929,
1232
+ 600635208,
1233
+ 147745386,
1234
+ 476089764,
1235
+ 928409354,
1236
+ 535786394,
1237
+ 421126660,
1238
+ 111274516,
1239
+ 432185353,
1240
+ 951792615,
1241
+ 561316429,
1242
+ 97037209,
1243
+ 510429606,
1244
+ 525877163,
1245
+ 884159304,
1246
+ 994069797,
1247
+ 311633424,
1248
+ 809248713
1249
+ ],
1250
+ 2
1251
+ ],
1252
+ "output": 3
1253
+ },
1254
+ {
1255
+ "input": [
1256
+ [
1257
+ 952490193,
1258
+ 622824133,
1259
+ 405928692,
1260
+ 969859413,
1261
+ 684428934,
1262
+ 527325455,
1263
+ 702570155,
1264
+ 337574627,
1265
+ 262974955,
1266
+ 972088729,
1267
+ 760493400,
1268
+ 208402756,
1269
+ 804884365,
1270
+ 883811047,
1271
+ 202766874,
1272
+ 680462324,
1273
+ 197117370,
1274
+ 897661386,
1275
+ 964763892,
1276
+ 975624339,
1277
+ 190022513,
1278
+ 41623483,
1279
+ 881489084,
1280
+ 926446355,
1281
+ 937111479,
1282
+ 516549005,
1283
+ 943095584,
1284
+ 45071193,
1285
+ 941508674,
1286
+ 335830493,
1287
+ 672332714,
1288
+ 518202143,
1289
+ 344728266,
1290
+ 853173293,
1291
+ 654481635,
1292
+ 883186794,
1293
+ 182111010,
1294
+ 874779317,
1295
+ 259809566,
1296
+ 350500171,
1297
+ 21996490,
1298
+ 138172886,
1299
+ 33149981,
1300
+ 905939030,
1301
+ 880967170,
1302
+ 162631082,
1303
+ 690779254,
1304
+ 171705177,
1305
+ 60148845,
1306
+ 153349346,
1307
+ 231016524,
1308
+ 669854204,
1309
+ 990078914,
1310
+ 379547527,
1311
+ 225427609,
1312
+ 461733862,
1313
+ 950792765,
1314
+ 306844286,
1315
+ 838916862,
1316
+ 617619634,
1317
+ 113366257,
1318
+ 195139529,
1319
+ 178644292,
1320
+ 854626497,
1321
+ 813735119,
1322
+ 524831767,
1323
+ 987868428,
1324
+ 792158694,
1325
+ 215680803,
1326
+ 168326668,
1327
+ 266561687,
1328
+ 246337990,
1329
+ 850244976,
1330
+ 652963813,
1331
+ 551020658,
1332
+ 675151284,
1333
+ 287302927,
1334
+ 682223775,
1335
+ 166706773,
1336
+ 566852251,
1337
+ 870051567,
1338
+ 88649934,
1339
+ 27519439,
1340
+ 519872645,
1341
+ 604054227,
1342
+ 310761100,
1343
+ 895873308,
1344
+ 578176877,
1345
+ 841544488,
1346
+ 258382968,
1347
+ 529172209,
1348
+ 424840686,
1349
+ 776103022,
1350
+ 323771211,
1351
+ 812742172,
1352
+ 308777308,
1353
+ 816213377,
1354
+ 407441213,
1355
+ 659592279,
1356
+ 310723900,
1357
+ 148014994,
1358
+ 20538730,
1359
+ 347707113,
1360
+ 170627081,
1361
+ 174926814,
1362
+ 842764296,
1363
+ 842386439,
1364
+ 412289806,
1365
+ 656100529,
1366
+ 197657843,
1367
+ 65857197,
1368
+ 586281132,
1369
+ 299689428,
1370
+ 661496050,
1371
+ 105000136,
1372
+ 239112305,
1373
+ 741548195,
1374
+ 704117291,
1375
+ 582966355,
1376
+ 684316056,
1377
+ 421686477,
1378
+ 119749685,
1379
+ 818309916,
1380
+ 699931190,
1381
+ 204994751,
1382
+ 766688195,
1383
+ 501775473,
1384
+ 615870358,
1385
+ 278650568,
1386
+ 446224512,
1387
+ 286942104,
1388
+ 855451447,
1389
+ 436139024,
1390
+ 872066703,
1391
+ 281870388,
1392
+ 366134906,
1393
+ 326541827,
1394
+ 607697848,
1395
+ 91130137,
1396
+ 660226268,
1397
+ 386913644,
1398
+ 75261165,
1399
+ 447760221,
1400
+ 261876585,
1401
+ 430727981,
1402
+ 681608670,
1403
+ 209357432,
1404
+ 989718616,
1405
+ 254988008,
1406
+ 884267480,
1407
+ 170065820,
1408
+ 338193746,
1409
+ 657070222,
1410
+ 685710733,
1411
+ 604201755,
1412
+ 382647977,
1413
+ 405175889,
1414
+ 937286704,
1415
+ 719345831,
1416
+ 187746316,
1417
+ 432355951,
1418
+ 568682509,
1419
+ 768302292,
1420
+ 165254732,
1421
+ 317884011,
1422
+ 38705733,
1423
+ 158660679,
1424
+ 408464567,
1425
+ 706771625,
1426
+ 858558360,
1427
+ 857163329,
1428
+ 797128416,
1429
+ 335766767,
1430
+ 278690069,
1431
+ 642520218,
1432
+ 418103867,
1433
+ 947746893,
1434
+ 250383291,
1435
+ 303035276,
1436
+ 310504389,
1437
+ 653633116,
1438
+ 326452166,
1439
+ 869124008,
1440
+ 925886240,
1441
+ 606391113,
1442
+ 760226974,
1443
+ 364371596,
1444
+ 158674119,
1445
+ 991781019,
1446
+ 796930501,
1447
+ 2139061,
1448
+ 90881255,
1449
+ 581287506,
1450
+ 902007074,
1451
+ 234182494,
1452
+ 888690703,
1453
+ 374714881,
1454
+ 679248921,
1455
+ 291475262,
1456
+ 616486558,
1457
+ 876071114,
1458
+ 157497006,
1459
+ 616706784,
1460
+ 411985771,
1461
+ 770235817,
1462
+ 106016028,
1463
+ 142470056,
1464
+ 139870812,
1465
+ 559088009,
1466
+ 648754817,
1467
+ 288118115,
1468
+ 243289585,
1469
+ 929249213,
1470
+ 306472304,
1471
+ 556731590,
1472
+ 347185806,
1473
+ 124190710,
1474
+ 304809826,
1475
+ 942762975,
1476
+ 510726184,
1477
+ 578242639,
1478
+ 383719183,
1479
+ 205491035,
1480
+ 355234742,
1481
+ 981412363,
1482
+ 26629208,
1483
+ 823200445,
1484
+ 614848017,
1485
+ 492563982,
1486
+ 261348499,
1487
+ 411888102,
1488
+ 503595423,
1489
+ 687938954,
1490
+ 677425261,
1491
+ 199880165,
1492
+ 846656760,
1493
+ 400868850,
1494
+ 99655429,
1495
+ 476737261,
1496
+ 437481507,
1497
+ 663227830,
1498
+ 25406021,
1499
+ 419704593,
1500
+ 547192406,
1501
+ 651124877,
1502
+ 855495187,
1503
+ 743523172,
1504
+ 998216275,
1505
+ 96450354,
1506
+ 24427597,
1507
+ 53692975,
1508
+ 764580717,
1509
+ 683743595,
1510
+ 70135174,
1511
+ 860598696,
1512
+ 859326828,
1513
+ 594914209,
1514
+ 36855796,
1515
+ 591571002,
1516
+ 464736610,
1517
+ 129965077,
1518
+ 701568663,
1519
+ 846779480,
1520
+ 38900117,
1521
+ 126314493,
1522
+ 568276570,
1523
+ 401923199,
1524
+ 839766771,
1525
+ 287786203,
1526
+ 131958805,
1527
+ 557972122,
1528
+ 503621532,
1529
+ 16387294,
1530
+ 465006687,
1531
+ 533629310,
1532
+ 441575190,
1533
+ 760494056,
1534
+ 282865241,
1535
+ 625005456,
1536
+ 945830662,
1537
+ 709943732,
1538
+ 292221151,
1539
+ 179873840,
1540
+ 216336531,
1541
+ 536660633,
1542
+ 47776097,
1543
+ 793220905,
1544
+ 57487697,
1545
+ 173539575,
1546
+ 16443039,
1547
+ 221055679,
1548
+ 337504932,
1549
+ 11385936,
1550
+ 265110318,
1551
+ 819315490,
1552
+ 160577936,
1553
+ 186620220,
1554
+ 481355694,
1555
+ 410634094,
1556
+ 800948523,
1557
+ 348843218,
1558
+ 912895882,
1559
+ 43059167,
1560
+ 923562124,
1561
+ 831749585,
1562
+ 438843040,
1563
+ 157341496,
1564
+ 176461655,
1565
+ 943396961,
1566
+ 470460673,
1567
+ 309297065,
1568
+ 380421178,
1569
+ 352330482,
1570
+ 285531427,
1571
+ 756774034,
1572
+ 125517542,
1573
+ 920012345,
1574
+ 93108971
1575
+ ],
1576
+ 1
1577
+ ],
1578
+ "output": 2
1579
+ },
1580
+ {
1581
+ "input": [
1582
+ [
1583
+ 166136514,
1584
+ 121501069,
1585
+ 819268421,
1586
+ 996909151,
1587
+ 666575839,
1588
+ 541443609,
1589
+ 7706451,
1590
+ 89798190,
1591
+ 975854495,
1592
+ 614031739,
1593
+ 789100479,
1594
+ 766517129,
1595
+ 943463720,
1596
+ 515084327,
1597
+ 163189379,
1598
+ 299070968,
1599
+ 245046802,
1600
+ 568034583,
1601
+ 268509159,
1602
+ 65891607,
1603
+ 354398193,
1604
+ 337134547,
1605
+ 974949739,
1606
+ 420157853,
1607
+ 110734465,
1608
+ 584545525,
1609
+ 514621850,
1610
+ 58185804,
1611
+ 830790963,
1612
+ 638219138,
1613
+ 82116660,
1614
+ 400356349,
1615
+ 498820256,
1616
+ 753164558,
1617
+ 579431294,
1618
+ 828544930,
1619
+ 256711179,
1620
+ 610891435,
1621
+ 367244257,
1622
+ 685012844,
1623
+ 153075263,
1624
+ 538925394,
1625
+ 151492281,
1626
+ 710294327,
1627
+ 946494292,
1628
+ 553565834,
1629
+ 31085508,
1630
+ 126512892,
1631
+ 644412249,
1632
+ 990248268,
1633
+ 737915622,
1634
+ 276941384,
1635
+ 191702591,
1636
+ 347433388,
1637
+ 767424495,
1638
+ 286791323,
1639
+ 688214920,
1640
+ 198524829,
1641
+ 102207523,
1642
+ 490530977,
1643
+ 661413988,
1644
+ 844298633,
1645
+ 640323442,
1646
+ 645885918,
1647
+ 369474665,
1648
+ 947582676,
1649
+ 811528952,
1650
+ 560202399,
1651
+ 201335332,
1652
+ 255442212,
1653
+ 918206560,
1654
+ 155086256,
1655
+ 461260585,
1656
+ 794465266,
1657
+ 294977082,
1658
+ 72359748,
1659
+ 434821860,
1660
+ 658021083,
1661
+ 133006978,
1662
+ 927209129,
1663
+ 268765584,
1664
+ 509281534,
1665
+ 822799342,
1666
+ 75194648,
1667
+ 925599283,
1668
+ 360458811,
1669
+ 756438750,
1670
+ 623837200,
1671
+ 881244020,
1672
+ 756356446,
1673
+ 968138490,
1674
+ 369084318,
1675
+ 134761876,
1676
+ 661448279,
1677
+ 565063531,
1678
+ 404410547,
1679
+ 610392398,
1680
+ 604820171,
1681
+ 935286640,
1682
+ 920067740,
1683
+ 444678795,
1684
+ 167417564,
1685
+ 258321288,
1686
+ 997296436,
1687
+ 220987238,
1688
+ 279059743,
1689
+ 187367765,
1690
+ 859448591,
1691
+ 564039123,
1692
+ 803408975,
1693
+ 150042322,
1694
+ 307671736,
1695
+ 696614477,
1696
+ 773298090,
1697
+ 181979755,
1698
+ 914018993,
1699
+ 198946164,
1700
+ 11556104,
1701
+ 257168447,
1702
+ 526341545,
1703
+ 341262481,
1704
+ 235727325,
1705
+ 838260040,
1706
+ 272657750,
1707
+ 977373789,
1708
+ 668955751,
1709
+ 650533716,
1710
+ 190754684,
1711
+ 871925241,
1712
+ 877718267,
1713
+ 565264642,
1714
+ 824672096,
1715
+ 626516766,
1716
+ 691952762,
1717
+ 921668768,
1718
+ 963325328,
1719
+ 315535461,
1720
+ 355893231,
1721
+ 143284008,
1722
+ 606082896,
1723
+ 510934338,
1724
+ 777389586,
1725
+ 753382270,
1726
+ 589212639,
1727
+ 462838388,
1728
+ 242968002,
1729
+ 109712214,
1730
+ 704028498,
1731
+ 573432950,
1732
+ 560850912,
1733
+ 341558848,
1734
+ 416310414,
1735
+ 246570536,
1736
+ 303323128,
1737
+ 292033142,
1738
+ 563160363,
1739
+ 923212087,
1740
+ 794937067,
1741
+ 14238289,
1742
+ 816347668,
1743
+ 437582650,
1744
+ 154506393,
1745
+ 916642905,
1746
+ 597771193,
1747
+ 947233003,
1748
+ 907165070,
1749
+ 628268892,
1750
+ 649413096,
1751
+ 457463638,
1752
+ 634737676,
1753
+ 2787027,
1754
+ 136051403,
1755
+ 60721945,
1756
+ 87802610,
1757
+ 778465317,
1758
+ 945642013,
1759
+ 482146092,
1760
+ 120346448,
1761
+ 268405150,
1762
+ 680779877,
1763
+ 949626043,
1764
+ 885795442,
1765
+ 369203304,
1766
+ 614790065,
1767
+ 686675444,
1768
+ 721147079,
1769
+ 404931489,
1770
+ 325608038,
1771
+ 799763530,
1772
+ 812514111,
1773
+ 322334029,
1774
+ 41960004,
1775
+ 98737859,
1776
+ 774491986,
1777
+ 473161838,
1778
+ 854817714,
1779
+ 55564799,
1780
+ 610759827,
1781
+ 473579724,
1782
+ 532921739,
1783
+ 144772207,
1784
+ 524367636,
1785
+ 885161046,
1786
+ 93978226,
1787
+ 442554162,
1788
+ 378694701,
1789
+ 399039972,
1790
+ 363891492,
1791
+ 59618362,
1792
+ 7873541,
1793
+ 987083408,
1794
+ 373052832,
1795
+ 735047065,
1796
+ 409398354,
1797
+ 719466302,
1798
+ 577059175,
1799
+ 546373803,
1800
+ 641895803,
1801
+ 812909458,
1802
+ 620410379,
1803
+ 208944493,
1804
+ 911380041,
1805
+ 737495506,
1806
+ 459237783,
1807
+ 267886235,
1808
+ 880440379,
1809
+ 751500176,
1810
+ 930875517,
1811
+ 588330440,
1812
+ 156948160,
1813
+ 75636017,
1814
+ 150470645,
1815
+ 356421639,
1816
+ 184913391,
1817
+ 381612864,
1818
+ 793878014,
1819
+ 537692251,
1820
+ 99687736,
1821
+ 808407828,
1822
+ 173644552,
1823
+ 492032091,
1824
+ 498857009,
1825
+ 763689568,
1826
+ 310749126,
1827
+ 541021190,
1828
+ 207145878,
1829
+ 350333428,
1830
+ 448732359,
1831
+ 349757320,
1832
+ 304075276,
1833
+ 542327546,
1834
+ 703546016,
1835
+ 66637224,
1836
+ 979504700,
1837
+ 671484019,
1838
+ 244339711,
1839
+ 930245090,
1840
+ 371323099,
1841
+ 338985100,
1842
+ 402958680,
1843
+ 372362155,
1844
+ 43760086,
1845
+ 165246680,
1846
+ 908901097,
1847
+ 716569252,
1848
+ 831389622,
1849
+ 448012015,
1850
+ 999259741,
1851
+ 230392983,
1852
+ 942018588,
1853
+ 781749220,
1854
+ 603187886,
1855
+ 124113316,
1856
+ 976540496,
1857
+ 768526445,
1858
+ 314799244,
1859
+ 812189464,
1860
+ 848042097,
1861
+ 562988395,
1862
+ 552631348,
1863
+ 116343573,
1864
+ 311047215,
1865
+ 802477476,
1866
+ 25783868,
1867
+ 64758483,
1868
+ 762917256,
1869
+ 250783758,
1870
+ 349671753,
1871
+ 554733767,
1872
+ 822715501,
1873
+ 900225346,
1874
+ 993082454,
1875
+ 514054420,
1876
+ 93504178,
1877
+ 84785904,
1878
+ 885832003,
1879
+ 145504473,
1880
+ 14400156,
1881
+ 972462806,
1882
+ 810591134,
1883
+ 568145125,
1884
+ 503794692,
1885
+ 939394406,
1886
+ 505714897,
1887
+ 18161315,
1888
+ 878436240,
1889
+ 473028339,
1890
+ 715541534,
1891
+ 975710752,
1892
+ 326260536,
1893
+ 50535073,
1894
+ 717069971,
1895
+ 167846524,
1896
+ 337841543,
1897
+ 100105267,
1898
+ 128371237,
1899
+ 949255911,
1900
+ 541698001,
1901
+ 570915335,
1902
+ 994888439,
1903
+ 888608531,
1904
+ 225067188,
1905
+ 485253240,
1906
+ 845071026,
1907
+ 889345603,
1908
+ 148535663,
1909
+ 923640144,
1910
+ 490807026,
1911
+ 998127812,
1912
+ 668018654,
1913
+ 876737264,
1914
+ 856070707,
1915
+ 966640000,
1916
+ 795372492,
1917
+ 730738997,
1918
+ 665884011,
1919
+ 639572103,
1920
+ 479425357,
1921
+ 30264519,
1922
+ 14925560,
1923
+ 731607145,
1924
+ 555132512,
1925
+ 177762943,
1926
+ 867419666,
1927
+ 598267225,
1928
+ 82695330,
1929
+ 765158109,
1930
+ 852209747,
1931
+ 59531094,
1932
+ 383478657,
1933
+ 963053183,
1934
+ 486942850,
1935
+ 880301481,
1936
+ 990343091,
1937
+ 713165975,
1938
+ 979571552,
1939
+ 527767876,
1940
+ 494375359,
1941
+ 199999618,
1942
+ 497690433,
1943
+ 919511247,
1944
+ 219064159,
1945
+ 54727708,
1946
+ 953021243,
1947
+ 504913329,
1948
+ 148395691,
1949
+ 840027895,
1950
+ 171471158,
1951
+ 243503127,
1952
+ 74473955,
1953
+ 443917113,
1954
+ 965775598,
1955
+ 709361068,
1956
+ 904814778,
1957
+ 648747792,
1958
+ 578243609,
1959
+ 680863160,
1960
+ 118153912,
1961
+ 700015204,
1962
+ 408876381,
1963
+ 138818429,
1964
+ 945013685,
1965
+ 611303397,
1966
+ 910824155,
1967
+ 317464717,
1968
+ 775019256,
1969
+ 725922803,
1970
+ 805356655,
1971
+ 32843994,
1972
+ 296785762,
1973
+ 322565856,
1974
+ 553444737,
1975
+ 554023185,
1976
+ 921946658,
1977
+ 655494293,
1978
+ 620103803,
1979
+ 61503902,
1980
+ 193096132,
1981
+ 148945455,
1982
+ 111163159,
1983
+ 484521864,
1984
+ 508885384,
1985
+ 486583549,
1986
+ 59757825,
1987
+ 979514899,
1988
+ 210731982,
1989
+ 130298360,
1990
+ 293533965,
1991
+ 326488262,
1992
+ 590399197,
1993
+ 292468128,
1994
+ 717267658,
1995
+ 360219071,
1996
+ 465181876,
1997
+ 765442431,
1998
+ 439752474,
1999
+ 162929690,
2000
+ 379128370,
2001
+ 278202430,
2002
+ 24279301,
2003
+ 350194618,
2004
+ 737572087,
2005
+ 584283061,
2006
+ 518603933,
2007
+ 82904376,
2008
+ 995452992,
2009
+ 395601185,
2010
+ 11320160,
2011
+ 29970360,
2012
+ 20311332,
2013
+ 50070865,
2014
+ 440709407,
2015
+ 18290907,
2016
+ 946070021,
2017
+ 152942281,
2018
+ 20921611,
2019
+ 689354440,
2020
+ 950701007,
2021
+ 456558546,
2022
+ 55135046,
2023
+ 909387311,
2024
+ 863846994,
2025
+ 561247584,
2026
+ 305014499,
2027
+ 404176119,
2028
+ 290598320,
2029
+ 234715431,
2030
+ 525227679,
2031
+ 980417944,
2032
+ 299917218,
2033
+ 619987345,
2034
+ 918661705,
2035
+ 590221155,
2036
+ 739336537,
2037
+ 167855991,
2038
+ 65662443,
2039
+ 131542406,
2040
+ 968720310,
2041
+ 245793016,
2042
+ 797203815,
2043
+ 720707468,
2044
+ 538861745,
2045
+ 805627716,
2046
+ 410229618,
2047
+ 558947018,
2048
+ 991033192,
2049
+ 743393960,
2050
+ 921778093,
2051
+ 677451165,
2052
+ 100542022,
2053
+ 777580921,
2054
+ 985399292
2055
+ ],
2056
+ 14
2057
+ ],
2058
+ "output": 15
2059
+ },
2060
+ {
2061
+ "input": [
2062
+ [
2063
+ 30310731,
2064
+ 713612867,
2065
+ 377747666,
2066
+ 745879384,
2067
+ 182506266,
2068
+ 318141417,
2069
+ 37837900,
2070
+ 801226303,
2071
+ 855556813,
2072
+ 4927315,
2073
+ 635491766,
2074
+ 857422516,
2075
+ 690396008,
2076
+ 962861064,
2077
+ 668626744,
2078
+ 508554135,
2079
+ 413867870,
2080
+ 135019314,
2081
+ 999918996,
2082
+ 972125262,
2083
+ 516652617,
2084
+ 495099313,
2085
+ 544227835,
2086
+ 263082687,
2087
+ 980869025,
2088
+ 580089395,
2089
+ 822230466,
2090
+ 904782190,
2091
+ 823942453,
2092
+ 880978999,
2093
+ 955039523,
2094
+ 425383754,
2095
+ 325949086,
2096
+ 334999290,
2097
+ 334481199,
2098
+ 852176791,
2099
+ 923281576,
2100
+ 694305249,
2101
+ 572087466,
2102
+ 456414537,
2103
+ 154302218,
2104
+ 599633727,
2105
+ 486799911,
2106
+ 332162113,
2107
+ 709404001,
2108
+ 781471246,
2109
+ 339609892,
2110
+ 846136376,
2111
+ 387515946,
2112
+ 107651676,
2113
+ 533996716,
2114
+ 204060655,
2115
+ 608482726,
2116
+ 918349728,
2117
+ 813657314,
2118
+ 691210287,
2119
+ 742270208,
2120
+ 759695303,
2121
+ 703778237,
2122
+ 366313361,
2123
+ 665441481,
2124
+ 721347784,
2125
+ 957354016,
2126
+ 433201191,
2127
+ 882353859,
2128
+ 681491491,
2129
+ 543894849,
2130
+ 560864533,
2131
+ 620320519,
2132
+ 623229139,
2133
+ 849428926,
2134
+ 183018741,
2135
+ 835197617,
2136
+ 363068219,
2137
+ 930223264,
2138
+ 291017879,
2139
+ 174101651,
2140
+ 197027393,
2141
+ 820053026,
2142
+ 364405798,
2143
+ 305215607,
2144
+ 940458809,
2145
+ 354441620,
2146
+ 908966611,
2147
+ 502446253,
2148
+ 424429293,
2149
+ 646937354,
2150
+ 405235545,
2151
+ 176914745,
2152
+ 138577940,
2153
+ 324369884,
2154
+ 36946315,
2155
+ 771373605,
2156
+ 939913372,
2157
+ 317345340,
2158
+ 252971576,
2159
+ 600227813,
2160
+ 803994040,
2161
+ 701143084,
2162
+ 908412005,
2163
+ 157342957,
2164
+ 83695239,
2165
+ 330843377,
2166
+ 799876964,
2167
+ 63977929,
2168
+ 97108637,
2169
+ 126437390,
2170
+ 631806605,
2171
+ 943838335,
2172
+ 865109124,
2173
+ 981520873,
2174
+ 642162653,
2175
+ 394690926,
2176
+ 379081376,
2177
+ 254772807,
2178
+ 140019709,
2179
+ 269867764,
2180
+ 219956490,
2181
+ 707603227,
2182
+ 964556025,
2183
+ 486195895,
2184
+ 74669466,
2185
+ 73344017,
2186
+ 923856509,
2187
+ 706308363,
2188
+ 147992516,
2189
+ 933681054,
2190
+ 492774540,
2191
+ 575808791,
2192
+ 718209373,
2193
+ 173178416,
2194
+ 467981827,
2195
+ 377037689,
2196
+ 832845297,
2197
+ 276557833,
2198
+ 803802475,
2199
+ 536029433,
2200
+ 463762736,
2201
+ 875907990,
2202
+ 468478773,
2203
+ 40420857,
2204
+ 436144401,
2205
+ 645398414,
2206
+ 902095243,
2207
+ 151093072,
2208
+ 382376308,
2209
+ 761092460,
2210
+ 26730769,
2211
+ 996269670,
2212
+ 329408068,
2213
+ 185550436,
2214
+ 370154312,
2215
+ 293819145,
2216
+ 324953751,
2217
+ 609720083,
2218
+ 796837707,
2219
+ 876921434,
2220
+ 117838082,
2221
+ 32752533,
2222
+ 985334976,
2223
+ 515543594,
2224
+ 377109066,
2225
+ 527391286,
2226
+ 224483199,
2227
+ 227808831,
2228
+ 202712397,
2229
+ 538810786,
2230
+ 835809215,
2231
+ 73933764,
2232
+ 313434375,
2233
+ 976275969,
2234
+ 992064022,
2235
+ 288799941,
2236
+ 357580426,
2237
+ 683988312,
2238
+ 891477669,
2239
+ 990124706,
2240
+ 42946152,
2241
+ 662816846,
2242
+ 653484060,
2243
+ 422761316,
2244
+ 38137427,
2245
+ 188520676,
2246
+ 763956232,
2247
+ 164429968,
2248
+ 136904867,
2249
+ 115165709,
2250
+ 154164868,
2251
+ 845094887,
2252
+ 210119921,
2253
+ 851561948,
2254
+ 633061037,
2255
+ 225717836,
2256
+ 336734478,
2257
+ 947043829,
2258
+ 431779686,
2259
+ 985140790,
2260
+ 617061558,
2261
+ 249555367,
2262
+ 176082010,
2263
+ 468484135,
2264
+ 56667027,
2265
+ 898049945,
2266
+ 225934464,
2267
+ 306761842,
2268
+ 207271240,
2269
+ 263952892,
2270
+ 421993216,
2271
+ 729280233,
2272
+ 883563042,
2273
+ 996151535,
2274
+ 465482987,
2275
+ 936345627,
2276
+ 391848911,
2277
+ 381548038,
2278
+ 618583148,
2279
+ 628021097,
2280
+ 74821880,
2281
+ 221342892,
2282
+ 716554145,
2283
+ 603469436,
2284
+ 648463335,
2285
+ 968533421,
2286
+ 488878722,
2287
+ 419851889,
2288
+ 877457547,
2289
+ 121647117,
2290
+ 225276066,
2291
+ 884182236,
2292
+ 41817514,
2293
+ 916422921,
2294
+ 749288713,
2295
+ 653316339,
2296
+ 579461058,
2297
+ 603562496,
2298
+ 606709642,
2299
+ 364830954,
2300
+ 520232531,
2301
+ 588289871,
2302
+ 609278403,
2303
+ 656817591,
2304
+ 134603403,
2305
+ 749295702,
2306
+ 978501583,
2307
+ 949531900,
2308
+ 361899311,
2309
+ 217068122,
2310
+ 360060442,
2311
+ 33534711,
2312
+ 90728890,
2313
+ 460273308,
2314
+ 402852973,
2315
+ 72740453,
2316
+ 455372706,
2317
+ 808899887,
2318
+ 145039818,
2319
+ 868574733,
2320
+ 544226874,
2321
+ 908265708,
2322
+ 738314108,
2323
+ 430319568,
2324
+ 660675206,
2325
+ 373244984,
2326
+ 754828918,
2327
+ 396496049,
2328
+ 791800505,
2329
+ 257213806,
2330
+ 695543719,
2331
+ 703244793,
2332
+ 737036153,
2333
+ 381172765,
2334
+ 540869006,
2335
+ 439264303,
2336
+ 412564036,
2337
+ 753087057,
2338
+ 615617451,
2339
+ 1901523,
2340
+ 915204691,
2341
+ 147176573,
2342
+ 601484374,
2343
+ 854728566,
2344
+ 386392,
2345
+ 433180051,
2346
+ 232638998,
2347
+ 857903548,
2348
+ 171941405,
2349
+ 282766922,
2350
+ 973925304,
2351
+ 320143503,
2352
+ 126521460,
2353
+ 339240249,
2354
+ 503430570,
2355
+ 18579376,
2356
+ 629462089,
2357
+ 996229297,
2358
+ 285771534,
2359
+ 359199209,
2360
+ 468760989,
2361
+ 280869853,
2362
+ 602796936,
2363
+ 160084886,
2364
+ 350905658,
2365
+ 712303483,
2366
+ 294227919,
2367
+ 856169258,
2368
+ 349735444,
2369
+ 370337070,
2370
+ 810847894,
2371
+ 745696013,
2372
+ 813138404,
2373
+ 57137201,
2374
+ 614442379,
2375
+ 167207929,
2376
+ 329954140,
2377
+ 169335122,
2378
+ 366631254,
2379
+ 139723747,
2380
+ 896527678,
2381
+ 845880260,
2382
+ 549760715,
2383
+ 289588245,
2384
+ 231205843,
2385
+ 729739438,
2386
+ 736655510,
2387
+ 146608293,
2388
+ 554456678,
2389
+ 762746669,
2390
+ 939613908,
2391
+ 450798013,
2392
+ 878449248,
2393
+ 155536213,
2394
+ 555907989,
2395
+ 828305323,
2396
+ 840940690,
2397
+ 536351912,
2398
+ 477391789,
2399
+ 856302574,
2400
+ 371376071,
2401
+ 663062492,
2402
+ 717171600,
2403
+ 798437082,
2404
+ 248064267,
2405
+ 687223252,
2406
+ 226894234,
2407
+ 936857843,
2408
+ 145181801,
2409
+ 707240158,
2410
+ 460288033,
2411
+ 633322032,
2412
+ 584941253,
2413
+ 753400503,
2414
+ 341643191,
2415
+ 640361978,
2416
+ 414135457,
2417
+ 745170801,
2418
+ 241474003,
2419
+ 846492138,
2420
+ 348887201,
2421
+ 380579023,
2422
+ 552088853,
2423
+ 65321988,
2424
+ 281501713,
2425
+ 395863216,
2426
+ 292341550,
2427
+ 499979820,
2428
+ 237014420,
2429
+ 30442967,
2430
+ 601694725,
2431
+ 56791210,
2432
+ 960687845,
2433
+ 88682241,
2434
+ 442226289,
2435
+ 452972848,
2436
+ 234841349,
2437
+ 938942289,
2438
+ 748068098,
2439
+ 201946953,
2440
+ 748625423,
2441
+ 978179532,
2442
+ 897862142,
2443
+ 573602243,
2444
+ 630907441,
2445
+ 184504872,
2446
+ 877474379,
2447
+ 553294196,
2448
+ 86833872,
2449
+ 693488158,
2450
+ 70463941,
2451
+ 943530484,
2452
+ 948579994,
2453
+ 862814135,
2454
+ 246368500,
2455
+ 873270958,
2456
+ 338057830,
2457
+ 983903368,
2458
+ 59855896,
2459
+ 732486271,
2460
+ 663161834,
2461
+ 661549632,
2462
+ 177814245,
2463
+ 626640660,
2464
+ 345092871,
2465
+ 124263576,
2466
+ 373533270,
2467
+ 352176523,
2468
+ 998412288,
2469
+ 878367251,
2470
+ 598936226,
2471
+ 701959086,
2472
+ 400145508,
2473
+ 108114596,
2474
+ 164270870,
2475
+ 900938666,
2476
+ 677851751,
2477
+ 637324581,
2478
+ 130274326,
2479
+ 64750070,
2480
+ 808508753,
2481
+ 198239841,
2482
+ 423872388,
2483
+ 706671863,
2484
+ 740168813,
2485
+ 581292595,
2486
+ 474388770,
2487
+ 586876673,
2488
+ 910163756,
2489
+ 281249654,
2490
+ 291830158,
2491
+ 264636044,
2492
+ 884493730,
2493
+ 775236934,
2494
+ 338878579,
2495
+ 74271597,
2496
+ 651988856,
2497
+ 652734110,
2498
+ 468664633,
2499
+ 167413426,
2500
+ 418342003,
2501
+ 461082020,
2502
+ 556390393,
2503
+ 569901540,
2504
+ 299278021,
2505
+ 223198118,
2506
+ 631487018,
2507
+ 622383043,
2508
+ 280220107,
2509
+ 68431263,
2510
+ 932537776,
2511
+ 660154830,
2512
+ 361360455,
2513
+ 678137717,
2514
+ 626818251,
2515
+ 618585792,
2516
+ 9145884,
2517
+ 374503156,
2518
+ 220763172,
2519
+ 891811671,
2520
+ 645510829,
2521
+ 386360502,
2522
+ 777618158,
2523
+ 206911033,
2524
+ 814442829,
2525
+ 941766602,
2526
+ 10306076,
2527
+ 492632233,
2528
+ 662948696,
2529
+ 964641886,
2530
+ 353516876,
2531
+ 449058781,
2532
+ 251692496,
2533
+ 163784672,
2534
+ 851101539,
2535
+ 518174049,
2536
+ 369388051,
2537
+ 740930222,
2538
+ 663907765,
2539
+ 466069173,
2540
+ 91728049,
2541
+ 117096284,
2542
+ 324752241,
2543
+ 239103320,
2544
+ 278942449,
2545
+ 129857746,
2546
+ 972200598,
2547
+ 535422884,
2548
+ 345675182,
2549
+ 867547456,
2550
+ 980177106
2551
+ ],
2552
+ 10
2553
+ ],
2554
+ "output": 11
2555
+ },
2556
+ {
2557
+ "input": [
2558
+ [
2559
+ 27194438,
2560
+ 837057019,
2561
+ 947069417,
2562
+ 901066811,
2563
+ 786823658,
2564
+ 815506907,
2565
+ 832413738,
2566
+ 789686633,
2567
+ 705782851,
2568
+ 949255871,
2569
+ 574124171,
2570
+ 802011026,
2571
+ 987849809,
2572
+ 647903336,
2573
+ 791435091,
2574
+ 804283775,
2575
+ 368077953,
2576
+ 862810112,
2577
+ 821875097,
2578
+ 346322755,
2579
+ 363315695,
2580
+ 153103593,
2581
+ 844926640,
2582
+ 448430031,
2583
+ 622014002,
2584
+ 209543008,
2585
+ 988545281,
2586
+ 921171338,
2587
+ 679538490,
2588
+ 752325832,
2589
+ 224823068,
2590
+ 873610105,
2591
+ 367040427,
2592
+ 701694934,
2593
+ 4376280,
2594
+ 275979164,
2595
+ 323410978,
2596
+ 187711916,
2597
+ 181315682,
2598
+ 914672133,
2599
+ 606362941,
2600
+ 716973877,
2601
+ 621318206,
2602
+ 124201093,
2603
+ 838283031,
2604
+ 113268948,
2605
+ 179115478,
2606
+ 901418581,
2607
+ 313915722,
2608
+ 125616624,
2609
+ 329501582,
2610
+ 10727009,
2611
+ 518552612,
2612
+ 639134297,
2613
+ 958796265,
2614
+ 590132624,
2615
+ 862974568,
2616
+ 846495233,
2617
+ 676167690,
2618
+ 601454439,
2619
+ 897286069,
2620
+ 676036087,
2621
+ 689524559,
2622
+ 322553600,
2623
+ 378902615,
2624
+ 179777309,
2625
+ 407182835,
2626
+ 581303305,
2627
+ 552077634,
2628
+ 49897878,
2629
+ 587466010,
2630
+ 144435423,
2631
+ 835336030,
2632
+ 176502535,
2633
+ 470426275,
2634
+ 776834805,
2635
+ 175711147,
2636
+ 395001422,
2637
+ 371179743,
2638
+ 508309309,
2639
+ 488807633,
2640
+ 386021538,
2641
+ 54549947,
2642
+ 618338662,
2643
+ 176366700,
2644
+ 675105059,
2645
+ 343854666,
2646
+ 472531166,
2647
+ 203242373,
2648
+ 461049604,
2649
+ 330525109,
2650
+ 416571039,
2651
+ 794566695,
2652
+ 353854606,
2653
+ 766309366,
2654
+ 291048102,
2655
+ 751106521,
2656
+ 149001686,
2657
+ 881037558,
2658
+ 990733871,
2659
+ 271316054,
2660
+ 124829976,
2661
+ 642433347,
2662
+ 414235326,
2663
+ 141408915,
2664
+ 570944208,
2665
+ 337320854,
2666
+ 241578865,
2667
+ 401712510,
2668
+ 133357276,
2669
+ 365407301,
2670
+ 859963408,
2671
+ 646628703,
2672
+ 877959885,
2673
+ 696540550,
2674
+ 73183141,
2675
+ 231467381,
2676
+ 578540537,
2677
+ 309686589,
2678
+ 789672718,
2679
+ 291498289,
2680
+ 569674462,
2681
+ 486431494,
2682
+ 722405611,
2683
+ 506296660,
2684
+ 287818822,
2685
+ 931150498,
2686
+ 29256188,
2687
+ 282592027,
2688
+ 901890517,
2689
+ 733077895,
2690
+ 561259572,
2691
+ 71006059,
2692
+ 248692770,
2693
+ 900011012,
2694
+ 805113035,
2695
+ 933106981,
2696
+ 926489268,
2697
+ 624482740,
2698
+ 686730643,
2699
+ 923017967,
2700
+ 401271676,
2701
+ 271014975,
2702
+ 236448419,
2703
+ 839712741,
2704
+ 601919702,
2705
+ 248739563,
2706
+ 138340558,
2707
+ 480998234,
2708
+ 922601756,
2709
+ 851891391,
2710
+ 190451211,
2711
+ 4018827,
2712
+ 878064401,
2713
+ 372366669,
2714
+ 52095803,
2715
+ 16918038,
2716
+ 689282919,
2717
+ 349830781,
2718
+ 705235269,
2719
+ 310599627,
2720
+ 511046960,
2721
+ 309886858,
2722
+ 960222142,
2723
+ 745512739,
2724
+ 678636648,
2725
+ 571712846,
2726
+ 350232077,
2727
+ 852093986,
2728
+ 561166263,
2729
+ 808191865,
2730
+ 412192685,
2731
+ 448021148,
2732
+ 427377190,
2733
+ 818151612,
2734
+ 47048758,
2735
+ 423108545,
2736
+ 753599843,
2737
+ 994313272,
2738
+ 759198721,
2739
+ 771116242,
2740
+ 563127033,
2741
+ 77918078,
2742
+ 928156755,
2743
+ 503542173,
2744
+ 204767850,
2745
+ 524147187,
2746
+ 537282536,
2747
+ 316471587,
2748
+ 393286157,
2749
+ 940921399,
2750
+ 722640026,
2751
+ 413451838,
2752
+ 615666747,
2753
+ 437087056,
2754
+ 747893740,
2755
+ 946880542,
2756
+ 754479191,
2757
+ 397483,
2758
+ 738102318,
2759
+ 214291667,
2760
+ 380780949,
2761
+ 527101609,
2762
+ 762161701,
2763
+ 531358997,
2764
+ 41746648,
2765
+ 918055058,
2766
+ 754265754,
2767
+ 254796166,
2768
+ 704352185,
2769
+ 901907113,
2770
+ 645561371,
2771
+ 750003836,
2772
+ 599236657,
2773
+ 17526865,
2774
+ 102423069,
2775
+ 172279308,
2776
+ 535511621,
2777
+ 318917816,
2778
+ 526220739,
2779
+ 748600488,
2780
+ 326365990,
2781
+ 961123489,
2782
+ 688635919,
2783
+ 155795483,
2784
+ 341456164,
2785
+ 447406634,
2786
+ 489825771,
2787
+ 122410072,
2788
+ 8572639,
2789
+ 65133667,
2790
+ 725524054,
2791
+ 268264995,
2792
+ 877169301,
2793
+ 275086614,
2794
+ 499346765,
2795
+ 578478820,
2796
+ 5352644,
2797
+ 640052987,
2798
+ 362344335,
2799
+ 340089917,
2800
+ 414986455,
2801
+ 817070335,
2802
+ 962734552,
2803
+ 895326985,
2804
+ 532461383,
2805
+ 144653763,
2806
+ 201188313,
2807
+ 726695688,
2808
+ 651165603,
2809
+ 21214470,
2810
+ 273784175,
2811
+ 569179284,
2812
+ 907067362,
2813
+ 991910158,
2814
+ 548656884,
2815
+ 147145523,
2816
+ 577661986,
2817
+ 64241638,
2818
+ 599395324,
2819
+ 350097293,
2820
+ 923500385,
2821
+ 951973415,
2822
+ 846210009,
2823
+ 581687155,
2824
+ 305145757,
2825
+ 655267683,
2826
+ 606389740,
2827
+ 771909788,
2828
+ 471272666,
2829
+ 7969155,
2830
+ 589098271,
2831
+ 761282555,
2832
+ 978099413,
2833
+ 822789810,
2834
+ 221699007,
2835
+ 179284175,
2836
+ 347650225,
2837
+ 392813170,
2838
+ 246982266,
2839
+ 216092241,
2840
+ 439428094,
2841
+ 168770641,
2842
+ 800392960,
2843
+ 577472805,
2844
+ 680851987
2845
+ ],
2846
+ 13
2847
+ ],
2848
+ "output": 14
2849
+ },
2850
+ {
2851
+ "input": [
2852
+ [
2853
+ 355768603,
2854
+ 749625544,
2855
+ 270232785,
2856
+ 531205926,
2857
+ 404357467,
2858
+ 666286170,
2859
+ 364862641,
2860
+ 166151293,
2861
+ 498877839,
2862
+ 844914287,
2863
+ 135159978,
2864
+ 212622033,
2865
+ 475960312,
2866
+ 843273881,
2867
+ 356761591,
2868
+ 271529584,
2869
+ 600366130,
2870
+ 560953482,
2871
+ 452129874,
2872
+ 832308535,
2873
+ 411666050,
2874
+ 269042444,
2875
+ 96763347,
2876
+ 765104585,
2877
+ 902368953,
2878
+ 439163204,
2879
+ 402096002,
2880
+ 292388309,
2881
+ 483912159,
2882
+ 279242654,
2883
+ 456581482,
2884
+ 859780169,
2885
+ 58008771,
2886
+ 207239014,
2887
+ 170377628,
2888
+ 137409033,
2889
+ 955434084,
2890
+ 582525351,
2891
+ 186161334,
2892
+ 99469581,
2893
+ 81657412,
2894
+ 152876094,
2895
+ 694978223,
2896
+ 515860349,
2897
+ 600715035,
2898
+ 804912253,
2899
+ 857883288,
2900
+ 105859495,
2901
+ 837126966,
2902
+ 733293631,
2903
+ 751270627,
2904
+ 595624698,
2905
+ 539071535,
2906
+ 603176635,
2907
+ 470779441,
2908
+ 607882058,
2909
+ 703100625,
2910
+ 547219829,
2911
+ 886672567,
2912
+ 437580429,
2913
+ 537986644,
2914
+ 610104665,
2915
+ 417795560,
2916
+ 515825887,
2917
+ 727958932,
2918
+ 910162049,
2919
+ 666750796,
2920
+ 379042766,
2921
+ 817261968,
2922
+ 702583720,
2923
+ 377305929,
2924
+ 531393940,
2925
+ 876598520,
2926
+ 161029175,
2927
+ 603146914,
2928
+ 659945667,
2929
+ 105581161,
2930
+ 232390406,
2931
+ 168587965,
2932
+ 566084514,
2933
+ 566160640,
2934
+ 480863347,
2935
+ 176640622,
2936
+ 645033996,
2937
+ 530895368,
2938
+ 113825086,
2939
+ 49469754,
2940
+ 864345996,
2941
+ 139395021,
2942
+ 127514311,
2943
+ 586377036,
2944
+ 252387297,
2945
+ 277717281,
2946
+ 620855307,
2947
+ 694092209,
2948
+ 774030679,
2949
+ 196662952,
2950
+ 72013294,
2951
+ 398254530,
2952
+ 301015242,
2953
+ 828052859,
2954
+ 452762784,
2955
+ 766400768,
2956
+ 288568360,
2957
+ 55930251,
2958
+ 603929670,
2959
+ 855148210,
2960
+ 935598452,
2961
+ 706828727,
2962
+ 829985610,
2963
+ 42356353,
2964
+ 819421286,
2965
+ 858417870,
2966
+ 954836038,
2967
+ 151256685,
2968
+ 884247013,
2969
+ 30593949,
2970
+ 480862932,
2971
+ 930563885,
2972
+ 435034058,
2973
+ 221932336,
2974
+ 659155314,
2975
+ 763591803,
2976
+ 824617299,
2977
+ 661407800,
2978
+ 304818377,
2979
+ 586231090,
2980
+ 4959152,
2981
+ 366416247,
2982
+ 709725660,
2983
+ 382637649,
2984
+ 497173302
2985
+ ],
2986
+ 17
2987
+ ],
2988
+ "output": 18
2989
+ }
2990
+ ],
2991
+ "haskell_template": "maximumLength :: [Int] -> Int -> Int\nmaximumLength nums k ",
2992
+ "ocaml_template": "let maximumLength (nums: int list) (k: int) : int = ",
2993
+ "scala_template": "def maximumLength(nums: List[Int],k: Int): Int = { \n \n}",
2994
+ "java_template": "class Solution {\n public int maximumLength(int[] nums, int k) {\n \n }\n}",
2995
+ "python_template": "class Solution(object):\n def maximumLength(self, nums, k):\n \"\"\"\n :type nums: List[int]\n :type k: int\n :rtype: int\n \"\"\"\n "
2996
+ }
find_the_maximum_length_of_a_good_subsequence_i/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 4 (maximumLength [1;2;1;1;3] 2)
12
+
13
+ let test2 _ = assert_equal 2 (maximumLength [1;2;3;4;5;1] 0)
14
+
15
+ let test3 _ = assert_equal 16 (maximumLength [33487469; 853196700; 508583567; 222097037; 261098452; 188012054; 961540644; 61212932; 15037773; 841097125; 12525542; 698705099; 369973008; 92835030; 468189131; 34148422; 580687421; 570566821; 738952593; 180225171; 919512242; 99783784; 425204860; 869457230; 404469514; 507286517; 185905194; 475848287; 567490953; 276861319; 115618801; 198885023; 78195956; 868047407; 828704823; 277822141; 528152647; 429059504; 198847876; 96584063; 240877916; 901365711; 516446494; 437684656; 765734979; 797685131; 431370848; 938336517; 568041453; 753525892; 977443993; 393213522; 665183860; 341164691; 885173771; 292144240; 362688963; 435157884; 799158529; 992337970; 291377882; 70212125; 740085897; 725729792; 565803853; 312378643; 548373143; 360751039; 451196075; 727176901; 805095909; 872955566; 929350237; 242334546; 214523895; 915147423; 578098350; 930167586; 897761330; 148274586; 367416565; 664847641; 722275601; 419879451; 997547266; 336404135; 699560214; 943663808; 423571499; 617199117; 947330997; 809209468; 798079300; 180475930; 99646714; 804391530; 347455668; 946783223; 914880392; 75100983; 725832068; 158225386; 992157753; 240948618; 947609519; 719608751; 775262320; 536867805; 119714960; 79319150; 792873002; 286087071; 19022943; 328363907; 732538568; 912457144; 975334806; 443207614; 536940420; 109373287; 924182716; 501305908; 85032470; 344350927; 835184090; 201928566; 66998189; 946158698; 881066162; 771616191; 71900078; 242619018; 138756453; 49348893; 553284692; 480485289; 503323713; 469473152; 911729932; 192672881; 315945519; 841821428; 877577124; 118650340; 799021764; 181762663; 391644005; 428532741; 274242895; 521472249; 932515039; 362200761; 643684951; 465953301; 760234216; 688956595; 823790102; 880317891; 720087970; 589862333; 693639300; 310685438; 107433866; 788125014; 623113991; 995926890; 164308186; 695870276; 116547502; 363599749; 108771651; 999020226; 513212465; 459019090; 198641889; 321381216; 197675; 440410330; 550548711; 512695542; 456196651; 212908375; 341285455; 882866009; 855721216; 166776550; 102169125; 634712393; 952280485; 814900567; 168724223; 667018749; 529617768; 709275051; 669667562; 100129221; 177210779; 428138415; 42907194; 166376059; 105392153; 139613470; 559725870; 521014552; 198477863; 711092633; 293926168; 153515338; 940899181; 545362491; 677734161; 5697569; 131349649; 524707944; 781502588; 979858072; 68950361; 805348411; 466231031; 435112989; 783476999; 254764697; 853396350; 929243358; 468382183; 663529870; 849437120; 561130145; 548588197; 676136929; 330928976; 885846542; 164388235; 967958142; 38247037; 463953934; 347360076; 995050699; 743574862; 683210867; 918944006; 970459141; 127854995; 988662628; 840629843; 112062233; 335501492; 912608621; 926468029; 545144992; 307778362; 767981405; 947513417; 281025337; 839230833; 795215533; 262480577; 538515965; 564432683; 101892992; 946834501; 448603415; 35287181; 668530827; 533095130; 16669636; 437967928; 31609116; 481480060; 960746244; 122751744; 124100679; 539213806; 366896015; 744434752; 629313621; 457167645; 275701834; 585755798; 129481485; 309735642; 646484951; 53708602; 651248907; 708064996; 112736000; 274006791; 594154331; 51446599; 519253736; 17702088; 744157317; 319575662; 848133481; 649938608; 930137559; 569860301; 323200898; 711859209; 241182967; 234054345; 882840128; 99742283; 335636269; 26185291; 910583828; 165643009; 533325241; 404037313; 829637648; 21547628; 72795736; 876953683; 468673893; 622650379; 533615749; 342343878; 651184748; 455998415; 990023260; 709242020; 148845447; 590094939; 549908446; 713848415; 554513168; 985056785; 606819211; 54145594; 87339142; 615328163; 302076645; 283071573; 272634690; 557009091; 114845885; 992191057; 524218932; 881413971; 944836739; 147344544; 373503446; 372904757; 727364693; 392538095; 220238128; 382685773; 533191650; 339399728; 686877685; 939274906; 73989668; 139028258; 657370317; 584871020; 5684839; 178541263; 195131290; 552754672; 596872011; 532769740; 354354765; 306588671; 542632927; 616890468; 84630307; 684256585; 266958682; 359174232; 170591596; 901103102; 940625309; 685913267; 339792519; 339471136; 125049040; 561697226; 695007544; 34492279; 498603652; 915994047; 646471502; 505889051; 142953890; 945443929; 126223611; 433889431; 466854560; 10320689; 533328459; 538754638; 773200198; 584450813; 34495612; 10320873; 290695904; 99406833; 364239123; 536695973; 346881538; 38096901; 837486993; 738761524; 116884667; 843859643; 180154682; 245936609; 897197094; 630949789; 153247778; 159250724; 919184705; 523682287; 414807889; 168669427; 828244050; 400082520; 60411377; 641318340; 759312668; 946509056; 593211437; 206895703; 816982160; 132939201; 411365896; 916204740; 184498912; 552085651; 760105753] 15)
16
+
17
+ let test4 _ = assert_equal 22 (maximumLength [327533889; 516247971; 577104323; 102780451; 579472496; 369364708; 431811091; 851858081; 389227997; 223952808; 988636711; 83830649; 524947406; 296624356; 794995672; 30494355; 154348533; 476239988; 547576365; 263612981; 485307754; 747671126; 64210544; 376097964; 462275031; 535805711; 332753982; 213719903; 155924079; 248700945; 118826282; 706339812; 68349277; 991342323; 920746401; 960198240; 813243613; 188071477; 670184207; 532896855; 602914215; 239111400; 129822243; 141229165; 534580815; 897265516; 614935521; 939532753; 39963074; 740212020; 143222965; 941682425; 239582504; 35023687; 618015486; 959550922; 687895424; 625377189; 364408867; 809797648; 491284157; 453083882; 898959256; 481212322; 29091746; 138006074; 963762698; 270676830; 747466877; 113357505; 982113766; 495275050; 744041226; 718203434; 700072245; 787953956; 436075447; 864825218; 360097180; 311162304; 816051078; 948790181; 139380119; 462149183; 169921147; 526798940; 116044069; 79653034; 954140644; 293213000; 608576999; 230353388; 567365557; 705459268; 531247042; 35399870; 963947762; 136182401; 461889635; 951439775; 71938909; 887693320; 757989888; 26504625; 846479912; 577482890; 220016904; 233976519; 308152721; 4884715; 355167603; 92431841; 59412077; 498429636; 579318280; 91688022; 727082443; 71084239; 908856330; 22091108; 405709610; 715395797; 115454620; 271477677; 196837563; 429623851; 806161676; 289091831; 696564972; 775018977; 239704135; 54133936; 119278128; 742601516; 162977700; 259855912; 274770239; 252037593; 695813277; 614725042; 298612459; 792677903; 589370084; 912528150; 164707278; 386684390; 452820769; 79739724; 66572280; 824873930; 978713135; 881349725; 699001664; 327221414; 764367180; 533880754; 264285724; 857663714; 226843218; 933229505; 836864949; 540927216; 630071486; 2122958; 815381840; 874377121; 492304758; 200048732; 76507927; 700101808; 162237741; 674935054; 335425981; 406307331; 594448382; 758768471; 288734876; 312664328; 540664454; 779494011; 764656558; 861823605; 118903129; 398326761; 375758584; 380806694; 794475795; 646547293; 145051162; 609252633; 760356685; 958660571; 435366240; 356814873; 95319712; 631444407; 596253847; 268340190; 211984765; 454532514; 459526641; 805932389; 448184761; 13543944; 894437555; 45432878; 442552418; 108165329; 487415069; 783710264; 695486933; 699450570; 293298646; 479220412; 684599590; 192970243; 840691084; 4532748; 741328011; 746395579; 966633259; 903804640; 465102945; 280361450; 321069891; 624057962; 239172920; 197561644; 380049568; 90222551; 625174874; 490379701; 173468021; 953184329; 301825571; 941534385; 995509963; 868449315; 557544885; 880302873; 872609724; 875626162; 370323425; 275468447; 882014552; 846735184; 120912352; 813721801; 862942875; 515699969; 683462384; 980903474; 546493687; 402300014; 319569533; 797130956; 387682284; 214646902; 719014383; 102095725; 196771211; 828165396; 672834365; 531011470; 880466295; 608158345; 338180323; 180965136; 73119784; 64083527; 955870955; 771887888; 139237899; 455198447; 6562309; 561603040; 799283563; 59075477; 858737286; 68016326; 634664588; 300951668; 452080386; 383475146; 603177201; 872135189; 261574971; 229884149; 858212769; 499701451; 910896731; 223956027; 432733575; 770157887; 773985892; 558621158; 560393168; 777160405; 961201142; 807882491; 124052476; 196881320; 324835681; 838853707; 43693124; 239058684; 334495096; 381139239; 96627701; 613545592; 633996771; 836870001; 768428858; 382469643; 986155908; 159381817; 97105863; 299264759; 594461108; 233236917; 540594617; 244787518; 482372949; 785387674; 380905759; 731791714; 994233002; 334093235; 778405573; 775330947; 232523002; 521892918; 8131144; 541091974; 18857695; 587779058; 250293641; 178083084; 86423929; 365187708; 964149610; 328603078; 112878336; 606064134; 568564713; 493936941; 187197854; 459298315; 656369139; 64328277; 910946197; 926708213; 458972942; 824338453; 74535004; 55485192; 776358670; 564155594; 801557247; 772983724; 484332312; 686814423; 479037180; 783501754; 602973511; 1190250; 671618996; 917218081; 727705466; 176448034; 410775860; 885939324; 615546497; 580229143; 491004073; 499090756; 93700586; 705077451; 356461710; 516001005; 464491977; 57107526; 224642742; 842112461; 523735846; 529283361; 854603821; 560169857; 328288389; 465414672; 603244321; 786147965; 90727648; 64912665; 849588797; 812698537; 318123651; 265457973; 885015284; 418024424; 731171952; 65881220; 944209527; 720974551; 630329426; 866558959; 983335744; 938155014; 731092367; 676946857; 97835678; 16879027; 438367860; 766950135; 959068162; 583347354; 295765171; 696414369; 333608526; 935312521; 470896333; 29352159; 435560878; 273366907; 880512691; 240984504; 844227469; 938755111; 478250003; 589565129; 669659749; 247563708; 465743085; 895565695; 285953710; 650504736; 909051770; 815902950; 302329404; 791140664; 445181926; 52880689; 390293386; 959655793; 7572577; 122794695; 668019901; 214190852; 289117876; 809299851; 263551854; 952412334; 104283184; 486898252; 757064092; 196239301; 792657494; 828373266; 201020664; 655715614; 526849548; 837378542; 902331101; 150169615; 755972704; 296301055; 708488534; 127290172; 713800725; 81776692; 938518356; 873893602; 140005476; 590412500; 398918946; 217348199; 914936754; 642424855; 609632831; 387869323; 123138584; 970088426; 445751710; 181422250; 39153244; 480323004; 707798403; 915125244; 715274485; 363189310; 290275849; 865152853; 559410316; 387501362; 753415746; 457757665] 21)
18
+
19
+ let test5 _ = assert_equal 2 (maximumLength [63065717; 310925130; 123681352; 418252036; 455925266; 848331954; 514920504; 926116127; 823866862; 745104358; 494800415; 972017751; 943666958; 458806; 227938603; 735223100; 688717024; 297682752; 71206098; 461866773; 612194775; 993980417; 118835691; 451667832; 53172588; 746247127; 990607879; 814031965; 467657654; 636665607; 981988704; 605396523; 202477330; 8406074; 74274772; 116003553; 102603765; 757367360; 292685632; 189891137; 653612534; 188352455; 806624900; 828176150; 159925719; 263424213; 694677233; 522612245; 198065972; 421243891; 789302712; 58198278; 575078912; 658376585; 891432173; 44671546; 941616686; 292875520; 876927014; 682858550; 942528013; 416491423; 4653487; 676555761; 2489297; 361846701; 686443358; 879875769; 91184601; 15439416; 558237173; 404140841; 631359651; 403414487; 103393750; 741274684; 546207955; 507600399; 562826389; 625457670; 477181692; 513302253; 876454335; 962370786; 465430109; 875410393; 681523014; 508882993; 734251846; 692760603; 376787886; 161882526; 658718628; 32642757; 317488330; 313581086; 624876775; 449477112; 612805515; 709078704; 376014080; 354660003; 676736234; 730047290; 10562672; 148014836; 760768774; 528567488; 869217498; 355676915; 122054706; 280415765; 712488264; 590404130; 21069838; 551110603; 313856070; 944892718; 728632982; 894098138; 939770583; 604837319; 924587415; 130286973; 489446560; 30407051; 396022255; 842936539; 322414686; 314582707; 226797374; 337026559; 309543384; 816976996; 956297634; 198350080; 556047734; 815917387; 14728176; 63749114; 345225320; 131354830; 61997083; 470355874; 859786431; 420649752; 656834306; 823363088; 854484404; 9346700; 597157723; 313812358; 119832585; 964021929; 105834742; 238318936; 966031671; 789654534; 389540161; 338015970; 164729724; 510634493; 68811418; 187593532; 934824704; 443021193; 832773862; 926839522; 376916994] 1)
20
+
21
+ let test6 _ = assert_equal 10 (maximumLength [756941236; 336028848; 626893475; 550698001; 971854899; 428738084; 85777754; 548985841; 91144920; 725266015; 957553852; 443913306; 851311890; 375149909; 954308523] 9)
22
+
23
+ let test7 _ = assert_equal 3 (maximumLength [766550818; 906436068; 842322495; 227281452; 546244193; 189773691; 795345716; 511453600; 428630063; 961418767; 909775809; 518142035; 142534445; 226680739; 14413192; 684910958; 350747094; 389127842; 551048695; 793657350; 514009257; 453239520; 297339715; 440177720; 549564290; 424329874; 721028462; 606713685; 405675142; 987741638; 666065731; 151310381; 822718111; 379985957; 411154058; 96501175; 310975; 587251167; 362674533; 748464264; 293080142; 861078168; 151734041; 806969690; 190231325; 475906098; 889477668; 796745292; 918246299; 399060393; 308556458; 54469566; 163681224; 672154960; 285832376; 620610142; 19763462; 780109108; 879360573; 958960913; 319521755; 623380309; 850421875; 339734364; 997159471; 935970929; 600635208; 147745386; 476089764; 928409354; 535786394; 421126660; 111274516; 432185353; 951792615; 561316429; 97037209; 510429606; 525877163; 884159304; 994069797; 311633424; 809248713] 2)
24
+
25
+ let test8 _ = assert_equal 2 (maximumLength [952490193; 622824133; 405928692; 969859413; 684428934; 527325455; 702570155; 337574627; 262974955; 972088729; 760493400; 208402756; 804884365; 883811047; 202766874; 680462324; 197117370; 897661386; 964763892; 975624339; 190022513; 41623483; 881489084; 926446355; 937111479; 516549005; 943095584; 45071193; 941508674; 335830493; 672332714; 518202143; 344728266; 853173293; 654481635; 883186794; 182111010; 874779317; 259809566; 350500171; 21996490; 138172886; 33149981; 905939030; 880967170; 162631082; 690779254; 171705177; 60148845; 153349346; 231016524; 669854204; 990078914; 379547527; 225427609; 461733862; 950792765; 306844286; 838916862; 617619634; 113366257; 195139529; 178644292; 854626497; 813735119; 524831767; 987868428; 792158694; 215680803; 168326668; 266561687; 246337990; 850244976; 652963813; 551020658; 675151284; 287302927; 682223775; 166706773; 566852251; 870051567; 88649934; 27519439; 519872645; 604054227; 310761100; 895873308; 578176877; 841544488; 258382968; 529172209; 424840686; 776103022; 323771211; 812742172; 308777308; 816213377; 407441213; 659592279; 310723900; 148014994; 20538730; 347707113; 170627081; 174926814; 842764296; 842386439; 412289806; 656100529; 197657843; 65857197; 586281132; 299689428; 661496050; 105000136; 239112305; 741548195; 704117291; 582966355; 684316056; 421686477; 119749685; 818309916; 699931190; 204994751; 766688195; 501775473; 615870358; 278650568; 446224512; 286942104; 855451447; 436139024; 872066703; 281870388; 366134906; 326541827; 607697848; 91130137; 660226268; 386913644; 75261165; 447760221; 261876585; 430727981; 681608670; 209357432; 989718616; 254988008; 884267480; 170065820; 338193746; 657070222; 685710733; 604201755; 382647977; 405175889; 937286704; 719345831; 187746316; 432355951; 568682509; 768302292; 165254732; 317884011; 38705733; 158660679; 408464567; 706771625; 858558360; 857163329; 797128416; 335766767; 278690069; 642520218; 418103867; 947746893; 250383291; 303035276; 310504389; 653633116; 326452166; 869124008; 925886240; 606391113; 760226974; 364371596; 158674119; 991781019; 796930501; 2139061; 90881255; 581287506; 902007074; 234182494; 888690703; 374714881; 679248921; 291475262; 616486558; 876071114; 157497006; 616706784; 411985771; 770235817; 106016028; 142470056; 139870812; 559088009; 648754817; 288118115; 243289585; 929249213; 306472304; 556731590; 347185806; 124190710; 304809826; 942762975; 510726184; 578242639; 383719183; 205491035; 355234742; 981412363; 26629208; 823200445; 614848017; 492563982; 261348499; 411888102; 503595423; 687938954; 677425261; 199880165; 846656760; 400868850; 99655429; 476737261; 437481507; 663227830; 25406021; 419704593; 547192406; 651124877; 855495187; 743523172; 998216275; 96450354; 24427597; 53692975; 764580717; 683743595; 70135174; 860598696; 859326828; 594914209; 36855796; 591571002; 464736610; 129965077; 701568663; 846779480; 38900117; 126314493; 568276570; 401923199; 839766771; 287786203; 131958805; 557972122; 503621532; 16387294; 465006687; 533629310; 441575190; 760494056; 282865241; 625005456; 945830662; 709943732; 292221151; 179873840; 216336531; 536660633; 47776097; 793220905; 57487697; 173539575; 16443039; 221055679; 337504932; 11385936; 265110318; 819315490; 160577936; 186620220; 481355694; 410634094; 800948523; 348843218; 912895882; 43059167; 923562124; 831749585; 438843040; 157341496; 176461655; 943396961; 470460673; 309297065; 380421178; 352330482; 285531427; 756774034; 125517542; 920012345; 93108971] 1)
26
+
27
+ let test9 _ = assert_equal 15 (maximumLength [166136514; 121501069; 819268421; 996909151; 666575839; 541443609; 7706451; 89798190; 975854495; 614031739; 789100479; 766517129; 943463720; 515084327; 163189379; 299070968; 245046802; 568034583; 268509159; 65891607; 354398193; 337134547; 974949739; 420157853; 110734465; 584545525; 514621850; 58185804; 830790963; 638219138; 82116660; 400356349; 498820256; 753164558; 579431294; 828544930; 256711179; 610891435; 367244257; 685012844; 153075263; 538925394; 151492281; 710294327; 946494292; 553565834; 31085508; 126512892; 644412249; 990248268; 737915622; 276941384; 191702591; 347433388; 767424495; 286791323; 688214920; 198524829; 102207523; 490530977; 661413988; 844298633; 640323442; 645885918; 369474665; 947582676; 811528952; 560202399; 201335332; 255442212; 918206560; 155086256; 461260585; 794465266; 294977082; 72359748; 434821860; 658021083; 133006978; 927209129; 268765584; 509281534; 822799342; 75194648; 925599283; 360458811; 756438750; 623837200; 881244020; 756356446; 968138490; 369084318; 134761876; 661448279; 565063531; 404410547; 610392398; 604820171; 935286640; 920067740; 444678795; 167417564; 258321288; 997296436; 220987238; 279059743; 187367765; 859448591; 564039123; 803408975; 150042322; 307671736; 696614477; 773298090; 181979755; 914018993; 198946164; 11556104; 257168447; 526341545; 341262481; 235727325; 838260040; 272657750; 977373789; 668955751; 650533716; 190754684; 871925241; 877718267; 565264642; 824672096; 626516766; 691952762; 921668768; 963325328; 315535461; 355893231; 143284008; 606082896; 510934338; 777389586; 753382270; 589212639; 462838388; 242968002; 109712214; 704028498; 573432950; 560850912; 341558848; 416310414; 246570536; 303323128; 292033142; 563160363; 923212087; 794937067; 14238289; 816347668; 437582650; 154506393; 916642905; 597771193; 947233003; 907165070; 628268892; 649413096; 457463638; 634737676; 2787027; 136051403; 60721945; 87802610; 778465317; 945642013; 482146092; 120346448; 268405150; 680779877; 949626043; 885795442; 369203304; 614790065; 686675444; 721147079; 404931489; 325608038; 799763530; 812514111; 322334029; 41960004; 98737859; 774491986; 473161838; 854817714; 55564799; 610759827; 473579724; 532921739; 144772207; 524367636; 885161046; 93978226; 442554162; 378694701; 399039972; 363891492; 59618362; 7873541; 987083408; 373052832; 735047065; 409398354; 719466302; 577059175; 546373803; 641895803; 812909458; 620410379; 208944493; 911380041; 737495506; 459237783; 267886235; 880440379; 751500176; 930875517; 588330440; 156948160; 75636017; 150470645; 356421639; 184913391; 381612864; 793878014; 537692251; 99687736; 808407828; 173644552; 492032091; 498857009; 763689568; 310749126; 541021190; 207145878; 350333428; 448732359; 349757320; 304075276; 542327546; 703546016; 66637224; 979504700; 671484019; 244339711; 930245090; 371323099; 338985100; 402958680; 372362155; 43760086; 165246680; 908901097; 716569252; 831389622; 448012015; 999259741; 230392983; 942018588; 781749220; 603187886; 124113316; 976540496; 768526445; 314799244; 812189464; 848042097; 562988395; 552631348; 116343573; 311047215; 802477476; 25783868; 64758483; 762917256; 250783758; 349671753; 554733767; 822715501; 900225346; 993082454; 514054420; 93504178; 84785904; 885832003; 145504473; 14400156; 972462806; 810591134; 568145125; 503794692; 939394406; 505714897; 18161315; 878436240; 473028339; 715541534; 975710752; 326260536; 50535073; 717069971; 167846524; 337841543; 100105267; 128371237; 949255911; 541698001; 570915335; 994888439; 888608531; 225067188; 485253240; 845071026; 889345603; 148535663; 923640144; 490807026; 998127812; 668018654; 876737264; 856070707; 966640000; 795372492; 730738997; 665884011; 639572103; 479425357; 30264519; 14925560; 731607145; 555132512; 177762943; 867419666; 598267225; 82695330; 765158109; 852209747; 59531094; 383478657; 963053183; 486942850; 880301481; 990343091; 713165975; 979571552; 527767876; 494375359; 199999618; 497690433; 919511247; 219064159; 54727708; 953021243; 504913329; 148395691; 840027895; 171471158; 243503127; 74473955; 443917113; 965775598; 709361068; 904814778; 648747792; 578243609; 680863160; 118153912; 700015204; 408876381; 138818429; 945013685; 611303397; 910824155; 317464717; 775019256; 725922803; 805356655; 32843994; 296785762; 322565856; 553444737; 554023185; 921946658; 655494293; 620103803; 61503902; 193096132; 148945455; 111163159; 484521864; 508885384; 486583549; 59757825; 979514899; 210731982; 130298360; 293533965; 326488262; 590399197; 292468128; 717267658; 360219071; 465181876; 765442431; 439752474; 162929690; 379128370; 278202430; 24279301; 350194618; 737572087; 584283061; 518603933; 82904376; 995452992; 395601185; 11320160; 29970360; 20311332; 50070865; 440709407; 18290907; 946070021; 152942281; 20921611; 689354440; 950701007; 456558546; 55135046; 909387311; 863846994; 561247584; 305014499; 404176119; 290598320; 234715431; 525227679; 980417944; 299917218; 619987345; 918661705; 590221155; 739336537; 167855991; 65662443; 131542406; 968720310; 245793016; 797203815; 720707468; 538861745; 805627716; 410229618; 558947018; 991033192; 743393960; 921778093; 677451165; 100542022; 777580921; 985399292] 14)
28
+
29
+ let test10 _ = assert_equal 11 (maximumLength [30310731; 713612867; 377747666; 745879384; 182506266; 318141417; 37837900; 801226303; 855556813; 4927315; 635491766; 857422516; 690396008; 962861064; 668626744; 508554135; 413867870; 135019314; 999918996; 972125262; 516652617; 495099313; 544227835; 263082687; 980869025; 580089395; 822230466; 904782190; 823942453; 880978999; 955039523; 425383754; 325949086; 334999290; 334481199; 852176791; 923281576; 694305249; 572087466; 456414537; 154302218; 599633727; 486799911; 332162113; 709404001; 781471246; 339609892; 846136376; 387515946; 107651676; 533996716; 204060655; 608482726; 918349728; 813657314; 691210287; 742270208; 759695303; 703778237; 366313361; 665441481; 721347784; 957354016; 433201191; 882353859; 681491491; 543894849; 560864533; 620320519; 623229139; 849428926; 183018741; 835197617; 363068219; 930223264; 291017879; 174101651; 197027393; 820053026; 364405798; 305215607; 940458809; 354441620; 908966611; 502446253; 424429293; 646937354; 405235545; 176914745; 138577940; 324369884; 36946315; 771373605; 939913372; 317345340; 252971576; 600227813; 803994040; 701143084; 908412005; 157342957; 83695239; 330843377; 799876964; 63977929; 97108637; 126437390; 631806605; 943838335; 865109124; 981520873; 642162653; 394690926; 379081376; 254772807; 140019709; 269867764; 219956490; 707603227; 964556025; 486195895; 74669466; 73344017; 923856509; 706308363; 147992516; 933681054; 492774540; 575808791; 718209373; 173178416; 467981827; 377037689; 832845297; 276557833; 803802475; 536029433; 463762736; 875907990; 468478773; 40420857; 436144401; 645398414; 902095243; 151093072; 382376308; 761092460; 26730769; 996269670; 329408068; 185550436; 370154312; 293819145; 324953751; 609720083; 796837707; 876921434; 117838082; 32752533; 985334976; 515543594; 377109066; 527391286; 224483199; 227808831; 202712397; 538810786; 835809215; 73933764; 313434375; 976275969; 992064022; 288799941; 357580426; 683988312; 891477669; 990124706; 42946152; 662816846; 653484060; 422761316; 38137427; 188520676; 763956232; 164429968; 136904867; 115165709; 154164868; 845094887; 210119921; 851561948; 633061037; 225717836; 336734478; 947043829; 431779686; 985140790; 617061558; 249555367; 176082010; 468484135; 56667027; 898049945; 225934464; 306761842; 207271240; 263952892; 421993216; 729280233; 883563042; 996151535; 465482987; 936345627; 391848911; 381548038; 618583148; 628021097; 74821880; 221342892; 716554145; 603469436; 648463335; 968533421; 488878722; 419851889; 877457547; 121647117; 225276066; 884182236; 41817514; 916422921; 749288713; 653316339; 579461058; 603562496; 606709642; 364830954; 520232531; 588289871; 609278403; 656817591; 134603403; 749295702; 978501583; 949531900; 361899311; 217068122; 360060442; 33534711; 90728890; 460273308; 402852973; 72740453; 455372706; 808899887; 145039818; 868574733; 544226874; 908265708; 738314108; 430319568; 660675206; 373244984; 754828918; 396496049; 791800505; 257213806; 695543719; 703244793; 737036153; 381172765; 540869006; 439264303; 412564036; 753087057; 615617451; 1901523; 915204691; 147176573; 601484374; 854728566; 386392; 433180051; 232638998; 857903548; 171941405; 282766922; 973925304; 320143503; 126521460; 339240249; 503430570; 18579376; 629462089; 996229297; 285771534; 359199209; 468760989; 280869853; 602796936; 160084886; 350905658; 712303483; 294227919; 856169258; 349735444; 370337070; 810847894; 745696013; 813138404; 57137201; 614442379; 167207929; 329954140; 169335122; 366631254; 139723747; 896527678; 845880260; 549760715; 289588245; 231205843; 729739438; 736655510; 146608293; 554456678; 762746669; 939613908; 450798013; 878449248; 155536213; 555907989; 828305323; 840940690; 536351912; 477391789; 856302574; 371376071; 663062492; 717171600; 798437082; 248064267; 687223252; 226894234; 936857843; 145181801; 707240158; 460288033; 633322032; 584941253; 753400503; 341643191; 640361978; 414135457; 745170801; 241474003; 846492138; 348887201; 380579023; 552088853; 65321988; 281501713; 395863216; 292341550; 499979820; 237014420; 30442967; 601694725; 56791210; 960687845; 88682241; 442226289; 452972848; 234841349; 938942289; 748068098; 201946953; 748625423; 978179532; 897862142; 573602243; 630907441; 184504872; 877474379; 553294196; 86833872; 693488158; 70463941; 943530484; 948579994; 862814135; 246368500; 873270958; 338057830; 983903368; 59855896; 732486271; 663161834; 661549632; 177814245; 626640660; 345092871; 124263576; 373533270; 352176523; 998412288; 878367251; 598936226; 701959086; 400145508; 108114596; 164270870; 900938666; 677851751; 637324581; 130274326; 64750070; 808508753; 198239841; 423872388; 706671863; 740168813; 581292595; 474388770; 586876673; 910163756; 281249654; 291830158; 264636044; 884493730; 775236934; 338878579; 74271597; 651988856; 652734110; 468664633; 167413426; 418342003; 461082020; 556390393; 569901540; 299278021; 223198118; 631487018; 622383043; 280220107; 68431263; 932537776; 660154830; 361360455; 678137717; 626818251; 618585792; 9145884; 374503156; 220763172; 891811671; 645510829; 386360502; 777618158; 206911033; 814442829; 941766602; 10306076; 492632233; 662948696; 964641886; 353516876; 449058781; 251692496; 163784672; 851101539; 518174049; 369388051; 740930222; 663907765; 466069173; 91728049; 117096284; 324752241; 239103320; 278942449; 129857746; 972200598; 535422884; 345675182; 867547456; 980177106] 10)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for maximumLength" >::: [
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
find_the_maximum_length_of_a_good_subsequence_i/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.maximumLength(List(1,2,1,1,3),2), 4)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.maximumLength(List(1,2,3,4,5,1),0), 2)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.maximumLength(List(33487469, 853196700, 508583567, 222097037, 261098452, 188012054, 961540644, 61212932, 15037773, 841097125, 12525542, 698705099, 369973008, 92835030, 468189131, 34148422, 580687421, 570566821, 738952593, 180225171, 919512242, 99783784, 425204860, 869457230, 404469514, 507286517, 185905194, 475848287, 567490953, 276861319, 115618801, 198885023, 78195956, 868047407, 828704823, 277822141, 528152647, 429059504, 198847876, 96584063, 240877916, 901365711, 516446494, 437684656, 765734979, 797685131, 431370848, 938336517, 568041453, 753525892, 977443993, 393213522, 665183860, 341164691, 885173771, 292144240, 362688963, 435157884, 799158529, 992337970, 291377882, 70212125, 740085897, 725729792, 565803853, 312378643, 548373143, 360751039, 451196075, 727176901, 805095909, 872955566, 929350237, 242334546, 214523895, 915147423, 578098350, 930167586, 897761330, 148274586, 367416565, 664847641, 722275601, 419879451, 997547266, 336404135, 699560214, 943663808, 423571499, 617199117, 947330997, 809209468, 798079300, 180475930, 99646714, 804391530, 347455668, 946783223, 914880392, 75100983, 725832068, 158225386, 992157753, 240948618, 947609519, 719608751, 775262320, 536867805, 119714960, 79319150, 792873002, 286087071, 19022943, 328363907, 732538568, 912457144, 975334806, 443207614, 536940420, 109373287, 924182716, 501305908, 85032470, 344350927, 835184090, 201928566, 66998189, 946158698, 881066162, 771616191, 71900078, 242619018, 138756453, 49348893, 553284692, 480485289, 503323713, 469473152, 911729932, 192672881, 315945519, 841821428, 877577124, 118650340, 799021764, 181762663, 391644005, 428532741, 274242895, 521472249, 932515039, 362200761, 643684951, 465953301, 760234216, 688956595, 823790102, 880317891, 720087970, 589862333, 693639300, 310685438, 107433866, 788125014, 623113991, 995926890, 164308186, 695870276, 116547502, 363599749, 108771651, 999020226, 513212465, 459019090, 198641889, 321381216, 197675, 440410330, 550548711, 512695542, 456196651, 212908375, 341285455, 882866009, 855721216, 166776550, 102169125, 634712393, 952280485, 814900567, 168724223, 667018749, 529617768, 709275051, 669667562, 100129221, 177210779, 428138415, 42907194, 166376059, 105392153, 139613470, 559725870, 521014552, 198477863, 711092633, 293926168, 153515338, 940899181, 545362491, 677734161, 5697569, 131349649, 524707944, 781502588, 979858072, 68950361, 805348411, 466231031, 435112989, 783476999, 254764697, 853396350, 929243358, 468382183, 663529870, 849437120, 561130145, 548588197, 676136929, 330928976, 885846542, 164388235, 967958142, 38247037, 463953934, 347360076, 995050699, 743574862, 683210867, 918944006, 970459141, 127854995, 988662628, 840629843, 112062233, 335501492, 912608621, 926468029, 545144992, 307778362, 767981405, 947513417, 281025337, 839230833, 795215533, 262480577, 538515965, 564432683, 101892992, 946834501, 448603415, 35287181, 668530827, 533095130, 16669636, 437967928, 31609116, 481480060, 960746244, 122751744, 124100679, 539213806, 366896015, 744434752, 629313621, 457167645, 275701834, 585755798, 129481485, 309735642, 646484951, 53708602, 651248907, 708064996, 112736000, 274006791, 594154331, 51446599, 519253736, 17702088, 744157317, 319575662, 848133481, 649938608, 930137559, 569860301, 323200898, 711859209, 241182967, 234054345, 882840128, 99742283, 335636269, 26185291, 910583828, 165643009, 533325241, 404037313, 829637648, 21547628, 72795736, 876953683, 468673893, 622650379, 533615749, 342343878, 651184748, 455998415, 990023260, 709242020, 148845447, 590094939, 549908446, 713848415, 554513168, 985056785, 606819211, 54145594, 87339142, 615328163, 302076645, 283071573, 272634690, 557009091, 114845885, 992191057, 524218932, 881413971, 944836739, 147344544, 373503446, 372904757, 727364693, 392538095, 220238128, 382685773, 533191650, 339399728, 686877685, 939274906, 73989668, 139028258, 657370317, 584871020, 5684839, 178541263, 195131290, 552754672, 596872011, 532769740, 354354765, 306588671, 542632927, 616890468, 84630307, 684256585, 266958682, 359174232, 170591596, 901103102, 940625309, 685913267, 339792519, 339471136, 125049040, 561697226, 695007544, 34492279, 498603652, 915994047, 646471502, 505889051, 142953890, 945443929, 126223611, 433889431, 466854560, 10320689, 533328459, 538754638, 773200198, 584450813, 34495612, 10320873, 290695904, 99406833, 364239123, 536695973, 346881538, 38096901, 837486993, 738761524, 116884667, 843859643, 180154682, 245936609, 897197094, 630949789, 153247778, 159250724, 919184705, 523682287, 414807889, 168669427, 828244050, 400082520, 60411377, 641318340, 759312668, 946509056, 593211437, 206895703, 816982160, 132939201, 411365896, 916204740, 184498912, 552085651, 760105753),15), 16)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.maximumLength(List(327533889, 516247971, 577104323, 102780451, 579472496, 369364708, 431811091, 851858081, 389227997, 223952808, 988636711, 83830649, 524947406, 296624356, 794995672, 30494355, 154348533, 476239988, 547576365, 263612981, 485307754, 747671126, 64210544, 376097964, 462275031, 535805711, 332753982, 213719903, 155924079, 248700945, 118826282, 706339812, 68349277, 991342323, 920746401, 960198240, 813243613, 188071477, 670184207, 532896855, 602914215, 239111400, 129822243, 141229165, 534580815, 897265516, 614935521, 939532753, 39963074, 740212020, 143222965, 941682425, 239582504, 35023687, 618015486, 959550922, 687895424, 625377189, 364408867, 809797648, 491284157, 453083882, 898959256, 481212322, 29091746, 138006074, 963762698, 270676830, 747466877, 113357505, 982113766, 495275050, 744041226, 718203434, 700072245, 787953956, 436075447, 864825218, 360097180, 311162304, 816051078, 948790181, 139380119, 462149183, 169921147, 526798940, 116044069, 79653034, 954140644, 293213000, 608576999, 230353388, 567365557, 705459268, 531247042, 35399870, 963947762, 136182401, 461889635, 951439775, 71938909, 887693320, 757989888, 26504625, 846479912, 577482890, 220016904, 233976519, 308152721, 4884715, 355167603, 92431841, 59412077, 498429636, 579318280, 91688022, 727082443, 71084239, 908856330, 22091108, 405709610, 715395797, 115454620, 271477677, 196837563, 429623851, 806161676, 289091831, 696564972, 775018977, 239704135, 54133936, 119278128, 742601516, 162977700, 259855912, 274770239, 252037593, 695813277, 614725042, 298612459, 792677903, 589370084, 912528150, 164707278, 386684390, 452820769, 79739724, 66572280, 824873930, 978713135, 881349725, 699001664, 327221414, 764367180, 533880754, 264285724, 857663714, 226843218, 933229505, 836864949, 540927216, 630071486, 2122958, 815381840, 874377121, 492304758, 200048732, 76507927, 700101808, 162237741, 674935054, 335425981, 406307331, 594448382, 758768471, 288734876, 312664328, 540664454, 779494011, 764656558, 861823605, 118903129, 398326761, 375758584, 380806694, 794475795, 646547293, 145051162, 609252633, 760356685, 958660571, 435366240, 356814873, 95319712, 631444407, 596253847, 268340190, 211984765, 454532514, 459526641, 805932389, 448184761, 13543944, 894437555, 45432878, 442552418, 108165329, 487415069, 783710264, 695486933, 699450570, 293298646, 479220412, 684599590, 192970243, 840691084, 4532748, 741328011, 746395579, 966633259, 903804640, 465102945, 280361450, 321069891, 624057962, 239172920, 197561644, 380049568, 90222551, 625174874, 490379701, 173468021, 953184329, 301825571, 941534385, 995509963, 868449315, 557544885, 880302873, 872609724, 875626162, 370323425, 275468447, 882014552, 846735184, 120912352, 813721801, 862942875, 515699969, 683462384, 980903474, 546493687, 402300014, 319569533, 797130956, 387682284, 214646902, 719014383, 102095725, 196771211, 828165396, 672834365, 531011470, 880466295, 608158345, 338180323, 180965136, 73119784, 64083527, 955870955, 771887888, 139237899, 455198447, 6562309, 561603040, 799283563, 59075477, 858737286, 68016326, 634664588, 300951668, 452080386, 383475146, 603177201, 872135189, 261574971, 229884149, 858212769, 499701451, 910896731, 223956027, 432733575, 770157887, 773985892, 558621158, 560393168, 777160405, 961201142, 807882491, 124052476, 196881320, 324835681, 838853707, 43693124, 239058684, 334495096, 381139239, 96627701, 613545592, 633996771, 836870001, 768428858, 382469643, 986155908, 159381817, 97105863, 299264759, 594461108, 233236917, 540594617, 244787518, 482372949, 785387674, 380905759, 731791714, 994233002, 334093235, 778405573, 775330947, 232523002, 521892918, 8131144, 541091974, 18857695, 587779058, 250293641, 178083084, 86423929, 365187708, 964149610, 328603078, 112878336, 606064134, 568564713, 493936941, 187197854, 459298315, 656369139, 64328277, 910946197, 926708213, 458972942, 824338453, 74535004, 55485192, 776358670, 564155594, 801557247, 772983724, 484332312, 686814423, 479037180, 783501754, 602973511, 1190250, 671618996, 917218081, 727705466, 176448034, 410775860, 885939324, 615546497, 580229143, 491004073, 499090756, 93700586, 705077451, 356461710, 516001005, 464491977, 57107526, 224642742, 842112461, 523735846, 529283361, 854603821, 560169857, 328288389, 465414672, 603244321, 786147965, 90727648, 64912665, 849588797, 812698537, 318123651, 265457973, 885015284, 418024424, 731171952, 65881220, 944209527, 720974551, 630329426, 866558959, 983335744, 938155014, 731092367, 676946857, 97835678, 16879027, 438367860, 766950135, 959068162, 583347354, 295765171, 696414369, 333608526, 935312521, 470896333, 29352159, 435560878, 273366907, 880512691, 240984504, 844227469, 938755111, 478250003, 589565129, 669659749, 247563708, 465743085, 895565695, 285953710, 650504736, 909051770, 815902950, 302329404, 791140664, 445181926, 52880689, 390293386, 959655793, 7572577, 122794695, 668019901, 214190852, 289117876, 809299851, 263551854, 952412334, 104283184, 486898252, 757064092, 196239301, 792657494, 828373266, 201020664, 655715614, 526849548, 837378542, 902331101, 150169615, 755972704, 296301055, 708488534, 127290172, 713800725, 81776692, 938518356, 873893602, 140005476, 590412500, 398918946, 217348199, 914936754, 642424855, 609632831, 387869323, 123138584, 970088426, 445751710, 181422250, 39153244, 480323004, 707798403, 915125244, 715274485, 363189310, 290275849, 865152853, 559410316, 387501362, 753415746, 457757665),21), 22)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.maximumLength(List(63065717, 310925130, 123681352, 418252036, 455925266, 848331954, 514920504, 926116127, 823866862, 745104358, 494800415, 972017751, 943666958, 458806, 227938603, 735223100, 688717024, 297682752, 71206098, 461866773, 612194775, 993980417, 118835691, 451667832, 53172588, 746247127, 990607879, 814031965, 467657654, 636665607, 981988704, 605396523, 202477330, 8406074, 74274772, 116003553, 102603765, 757367360, 292685632, 189891137, 653612534, 188352455, 806624900, 828176150, 159925719, 263424213, 694677233, 522612245, 198065972, 421243891, 789302712, 58198278, 575078912, 658376585, 891432173, 44671546, 941616686, 292875520, 876927014, 682858550, 942528013, 416491423, 4653487, 676555761, 2489297, 361846701, 686443358, 879875769, 91184601, 15439416, 558237173, 404140841, 631359651, 403414487, 103393750, 741274684, 546207955, 507600399, 562826389, 625457670, 477181692, 513302253, 876454335, 962370786, 465430109, 875410393, 681523014, 508882993, 734251846, 692760603, 376787886, 161882526, 658718628, 32642757, 317488330, 313581086, 624876775, 449477112, 612805515, 709078704, 376014080, 354660003, 676736234, 730047290, 10562672, 148014836, 760768774, 528567488, 869217498, 355676915, 122054706, 280415765, 712488264, 590404130, 21069838, 551110603, 313856070, 944892718, 728632982, 894098138, 939770583, 604837319, 924587415, 130286973, 489446560, 30407051, 396022255, 842936539, 322414686, 314582707, 226797374, 337026559, 309543384, 816976996, 956297634, 198350080, 556047734, 815917387, 14728176, 63749114, 345225320, 131354830, 61997083, 470355874, 859786431, 420649752, 656834306, 823363088, 854484404, 9346700, 597157723, 313812358, 119832585, 964021929, 105834742, 238318936, 966031671, 789654534, 389540161, 338015970, 164729724, 510634493, 68811418, 187593532, 934824704, 443021193, 832773862, 926839522, 376916994),1), 2)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.maximumLength(List(756941236, 336028848, 626893475, 550698001, 971854899, 428738084, 85777754, 548985841, 91144920, 725266015, 957553852, 443913306, 851311890, 375149909, 954308523),9), 10)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.maximumLength(List(766550818, 906436068, 842322495, 227281452, 546244193, 189773691, 795345716, 511453600, 428630063, 961418767, 909775809, 518142035, 142534445, 226680739, 14413192, 684910958, 350747094, 389127842, 551048695, 793657350, 514009257, 453239520, 297339715, 440177720, 549564290, 424329874, 721028462, 606713685, 405675142, 987741638, 666065731, 151310381, 822718111, 379985957, 411154058, 96501175, 310975, 587251167, 362674533, 748464264, 293080142, 861078168, 151734041, 806969690, 190231325, 475906098, 889477668, 796745292, 918246299, 399060393, 308556458, 54469566, 163681224, 672154960, 285832376, 620610142, 19763462, 780109108, 879360573, 958960913, 319521755, 623380309, 850421875, 339734364, 997159471, 935970929, 600635208, 147745386, 476089764, 928409354, 535786394, 421126660, 111274516, 432185353, 951792615, 561316429, 97037209, 510429606, 525877163, 884159304, 994069797, 311633424, 809248713),2), 3)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.maximumLength(List(952490193, 622824133, 405928692, 969859413, 684428934, 527325455, 702570155, 337574627, 262974955, 972088729, 760493400, 208402756, 804884365, 883811047, 202766874, 680462324, 197117370, 897661386, 964763892, 975624339, 190022513, 41623483, 881489084, 926446355, 937111479, 516549005, 943095584, 45071193, 941508674, 335830493, 672332714, 518202143, 344728266, 853173293, 654481635, 883186794, 182111010, 874779317, 259809566, 350500171, 21996490, 138172886, 33149981, 905939030, 880967170, 162631082, 690779254, 171705177, 60148845, 153349346, 231016524, 669854204, 990078914, 379547527, 225427609, 461733862, 950792765, 306844286, 838916862, 617619634, 113366257, 195139529, 178644292, 854626497, 813735119, 524831767, 987868428, 792158694, 215680803, 168326668, 266561687, 246337990, 850244976, 652963813, 551020658, 675151284, 287302927, 682223775, 166706773, 566852251, 870051567, 88649934, 27519439, 519872645, 604054227, 310761100, 895873308, 578176877, 841544488, 258382968, 529172209, 424840686, 776103022, 323771211, 812742172, 308777308, 816213377, 407441213, 659592279, 310723900, 148014994, 20538730, 347707113, 170627081, 174926814, 842764296, 842386439, 412289806, 656100529, 197657843, 65857197, 586281132, 299689428, 661496050, 105000136, 239112305, 741548195, 704117291, 582966355, 684316056, 421686477, 119749685, 818309916, 699931190, 204994751, 766688195, 501775473, 615870358, 278650568, 446224512, 286942104, 855451447, 436139024, 872066703, 281870388, 366134906, 326541827, 607697848, 91130137, 660226268, 386913644, 75261165, 447760221, 261876585, 430727981, 681608670, 209357432, 989718616, 254988008, 884267480, 170065820, 338193746, 657070222, 685710733, 604201755, 382647977, 405175889, 937286704, 719345831, 187746316, 432355951, 568682509, 768302292, 165254732, 317884011, 38705733, 158660679, 408464567, 706771625, 858558360, 857163329, 797128416, 335766767, 278690069, 642520218, 418103867, 947746893, 250383291, 303035276, 310504389, 653633116, 326452166, 869124008, 925886240, 606391113, 760226974, 364371596, 158674119, 991781019, 796930501, 2139061, 90881255, 581287506, 902007074, 234182494, 888690703, 374714881, 679248921, 291475262, 616486558, 876071114, 157497006, 616706784, 411985771, 770235817, 106016028, 142470056, 139870812, 559088009, 648754817, 288118115, 243289585, 929249213, 306472304, 556731590, 347185806, 124190710, 304809826, 942762975, 510726184, 578242639, 383719183, 205491035, 355234742, 981412363, 26629208, 823200445, 614848017, 492563982, 261348499, 411888102, 503595423, 687938954, 677425261, 199880165, 846656760, 400868850, 99655429, 476737261, 437481507, 663227830, 25406021, 419704593, 547192406, 651124877, 855495187, 743523172, 998216275, 96450354, 24427597, 53692975, 764580717, 683743595, 70135174, 860598696, 859326828, 594914209, 36855796, 591571002, 464736610, 129965077, 701568663, 846779480, 38900117, 126314493, 568276570, 401923199, 839766771, 287786203, 131958805, 557972122, 503621532, 16387294, 465006687, 533629310, 441575190, 760494056, 282865241, 625005456, 945830662, 709943732, 292221151, 179873840, 216336531, 536660633, 47776097, 793220905, 57487697, 173539575, 16443039, 221055679, 337504932, 11385936, 265110318, 819315490, 160577936, 186620220, 481355694, 410634094, 800948523, 348843218, 912895882, 43059167, 923562124, 831749585, 438843040, 157341496, 176461655, 943396961, 470460673, 309297065, 380421178, 352330482, 285531427, 756774034, 125517542, 920012345, 93108971),1), 2)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.maximumLength(List(166136514, 121501069, 819268421, 996909151, 666575839, 541443609, 7706451, 89798190, 975854495, 614031739, 789100479, 766517129, 943463720, 515084327, 163189379, 299070968, 245046802, 568034583, 268509159, 65891607, 354398193, 337134547, 974949739, 420157853, 110734465, 584545525, 514621850, 58185804, 830790963, 638219138, 82116660, 400356349, 498820256, 753164558, 579431294, 828544930, 256711179, 610891435, 367244257, 685012844, 153075263, 538925394, 151492281, 710294327, 946494292, 553565834, 31085508, 126512892, 644412249, 990248268, 737915622, 276941384, 191702591, 347433388, 767424495, 286791323, 688214920, 198524829, 102207523, 490530977, 661413988, 844298633, 640323442, 645885918, 369474665, 947582676, 811528952, 560202399, 201335332, 255442212, 918206560, 155086256, 461260585, 794465266, 294977082, 72359748, 434821860, 658021083, 133006978, 927209129, 268765584, 509281534, 822799342, 75194648, 925599283, 360458811, 756438750, 623837200, 881244020, 756356446, 968138490, 369084318, 134761876, 661448279, 565063531, 404410547, 610392398, 604820171, 935286640, 920067740, 444678795, 167417564, 258321288, 997296436, 220987238, 279059743, 187367765, 859448591, 564039123, 803408975, 150042322, 307671736, 696614477, 773298090, 181979755, 914018993, 198946164, 11556104, 257168447, 526341545, 341262481, 235727325, 838260040, 272657750, 977373789, 668955751, 650533716, 190754684, 871925241, 877718267, 565264642, 824672096, 626516766, 691952762, 921668768, 963325328, 315535461, 355893231, 143284008, 606082896, 510934338, 777389586, 753382270, 589212639, 462838388, 242968002, 109712214, 704028498, 573432950, 560850912, 341558848, 416310414, 246570536, 303323128, 292033142, 563160363, 923212087, 794937067, 14238289, 816347668, 437582650, 154506393, 916642905, 597771193, 947233003, 907165070, 628268892, 649413096, 457463638, 634737676, 2787027, 136051403, 60721945, 87802610, 778465317, 945642013, 482146092, 120346448, 268405150, 680779877, 949626043, 885795442, 369203304, 614790065, 686675444, 721147079, 404931489, 325608038, 799763530, 812514111, 322334029, 41960004, 98737859, 774491986, 473161838, 854817714, 55564799, 610759827, 473579724, 532921739, 144772207, 524367636, 885161046, 93978226, 442554162, 378694701, 399039972, 363891492, 59618362, 7873541, 987083408, 373052832, 735047065, 409398354, 719466302, 577059175, 546373803, 641895803, 812909458, 620410379, 208944493, 911380041, 737495506, 459237783, 267886235, 880440379, 751500176, 930875517, 588330440, 156948160, 75636017, 150470645, 356421639, 184913391, 381612864, 793878014, 537692251, 99687736, 808407828, 173644552, 492032091, 498857009, 763689568, 310749126, 541021190, 207145878, 350333428, 448732359, 349757320, 304075276, 542327546, 703546016, 66637224, 979504700, 671484019, 244339711, 930245090, 371323099, 338985100, 402958680, 372362155, 43760086, 165246680, 908901097, 716569252, 831389622, 448012015, 999259741, 230392983, 942018588, 781749220, 603187886, 124113316, 976540496, 768526445, 314799244, 812189464, 848042097, 562988395, 552631348, 116343573, 311047215, 802477476, 25783868, 64758483, 762917256, 250783758, 349671753, 554733767, 822715501, 900225346, 993082454, 514054420, 93504178, 84785904, 885832003, 145504473, 14400156, 972462806, 810591134, 568145125, 503794692, 939394406, 505714897, 18161315, 878436240, 473028339, 715541534, 975710752, 326260536, 50535073, 717069971, 167846524, 337841543, 100105267, 128371237, 949255911, 541698001, 570915335, 994888439, 888608531, 225067188, 485253240, 845071026, 889345603, 148535663, 923640144, 490807026, 998127812, 668018654, 876737264, 856070707, 966640000, 795372492, 730738997, 665884011, 639572103, 479425357, 30264519, 14925560, 731607145, 555132512, 177762943, 867419666, 598267225, 82695330, 765158109, 852209747, 59531094, 383478657, 963053183, 486942850, 880301481, 990343091, 713165975, 979571552, 527767876, 494375359, 199999618, 497690433, 919511247, 219064159, 54727708, 953021243, 504913329, 148395691, 840027895, 171471158, 243503127, 74473955, 443917113, 965775598, 709361068, 904814778, 648747792, 578243609, 680863160, 118153912, 700015204, 408876381, 138818429, 945013685, 611303397, 910824155, 317464717, 775019256, 725922803, 805356655, 32843994, 296785762, 322565856, 553444737, 554023185, 921946658, 655494293, 620103803, 61503902, 193096132, 148945455, 111163159, 484521864, 508885384, 486583549, 59757825, 979514899, 210731982, 130298360, 293533965, 326488262, 590399197, 292468128, 717267658, 360219071, 465181876, 765442431, 439752474, 162929690, 379128370, 278202430, 24279301, 350194618, 737572087, 584283061, 518603933, 82904376, 995452992, 395601185, 11320160, 29970360, 20311332, 50070865, 440709407, 18290907, 946070021, 152942281, 20921611, 689354440, 950701007, 456558546, 55135046, 909387311, 863846994, 561247584, 305014499, 404176119, 290598320, 234715431, 525227679, 980417944, 299917218, 619987345, 918661705, 590221155, 739336537, 167855991, 65662443, 131542406, 968720310, 245793016, 797203815, 720707468, 538861745, 805627716, 410229618, 558947018, 991033192, 743393960, 921778093, 677451165, 100542022, 777580921, 985399292),14), 15)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.maximumLength(List(30310731, 713612867, 377747666, 745879384, 182506266, 318141417, 37837900, 801226303, 855556813, 4927315, 635491766, 857422516, 690396008, 962861064, 668626744, 508554135, 413867870, 135019314, 999918996, 972125262, 516652617, 495099313, 544227835, 263082687, 980869025, 580089395, 822230466, 904782190, 823942453, 880978999, 955039523, 425383754, 325949086, 334999290, 334481199, 852176791, 923281576, 694305249, 572087466, 456414537, 154302218, 599633727, 486799911, 332162113, 709404001, 781471246, 339609892, 846136376, 387515946, 107651676, 533996716, 204060655, 608482726, 918349728, 813657314, 691210287, 742270208, 759695303, 703778237, 366313361, 665441481, 721347784, 957354016, 433201191, 882353859, 681491491, 543894849, 560864533, 620320519, 623229139, 849428926, 183018741, 835197617, 363068219, 930223264, 291017879, 174101651, 197027393, 820053026, 364405798, 305215607, 940458809, 354441620, 908966611, 502446253, 424429293, 646937354, 405235545, 176914745, 138577940, 324369884, 36946315, 771373605, 939913372, 317345340, 252971576, 600227813, 803994040, 701143084, 908412005, 157342957, 83695239, 330843377, 799876964, 63977929, 97108637, 126437390, 631806605, 943838335, 865109124, 981520873, 642162653, 394690926, 379081376, 254772807, 140019709, 269867764, 219956490, 707603227, 964556025, 486195895, 74669466, 73344017, 923856509, 706308363, 147992516, 933681054, 492774540, 575808791, 718209373, 173178416, 467981827, 377037689, 832845297, 276557833, 803802475, 536029433, 463762736, 875907990, 468478773, 40420857, 436144401, 645398414, 902095243, 151093072, 382376308, 761092460, 26730769, 996269670, 329408068, 185550436, 370154312, 293819145, 324953751, 609720083, 796837707, 876921434, 117838082, 32752533, 985334976, 515543594, 377109066, 527391286, 224483199, 227808831, 202712397, 538810786, 835809215, 73933764, 313434375, 976275969, 992064022, 288799941, 357580426, 683988312, 891477669, 990124706, 42946152, 662816846, 653484060, 422761316, 38137427, 188520676, 763956232, 164429968, 136904867, 115165709, 154164868, 845094887, 210119921, 851561948, 633061037, 225717836, 336734478, 947043829, 431779686, 985140790, 617061558, 249555367, 176082010, 468484135, 56667027, 898049945, 225934464, 306761842, 207271240, 263952892, 421993216, 729280233, 883563042, 996151535, 465482987, 936345627, 391848911, 381548038, 618583148, 628021097, 74821880, 221342892, 716554145, 603469436, 648463335, 968533421, 488878722, 419851889, 877457547, 121647117, 225276066, 884182236, 41817514, 916422921, 749288713, 653316339, 579461058, 603562496, 606709642, 364830954, 520232531, 588289871, 609278403, 656817591, 134603403, 749295702, 978501583, 949531900, 361899311, 217068122, 360060442, 33534711, 90728890, 460273308, 402852973, 72740453, 455372706, 808899887, 145039818, 868574733, 544226874, 908265708, 738314108, 430319568, 660675206, 373244984, 754828918, 396496049, 791800505, 257213806, 695543719, 703244793, 737036153, 381172765, 540869006, 439264303, 412564036, 753087057, 615617451, 1901523, 915204691, 147176573, 601484374, 854728566, 386392, 433180051, 232638998, 857903548, 171941405, 282766922, 973925304, 320143503, 126521460, 339240249, 503430570, 18579376, 629462089, 996229297, 285771534, 359199209, 468760989, 280869853, 602796936, 160084886, 350905658, 712303483, 294227919, 856169258, 349735444, 370337070, 810847894, 745696013, 813138404, 57137201, 614442379, 167207929, 329954140, 169335122, 366631254, 139723747, 896527678, 845880260, 549760715, 289588245, 231205843, 729739438, 736655510, 146608293, 554456678, 762746669, 939613908, 450798013, 878449248, 155536213, 555907989, 828305323, 840940690, 536351912, 477391789, 856302574, 371376071, 663062492, 717171600, 798437082, 248064267, 687223252, 226894234, 936857843, 145181801, 707240158, 460288033, 633322032, 584941253, 753400503, 341643191, 640361978, 414135457, 745170801, 241474003, 846492138, 348887201, 380579023, 552088853, 65321988, 281501713, 395863216, 292341550, 499979820, 237014420, 30442967, 601694725, 56791210, 960687845, 88682241, 442226289, 452972848, 234841349, 938942289, 748068098, 201946953, 748625423, 978179532, 897862142, 573602243, 630907441, 184504872, 877474379, 553294196, 86833872, 693488158, 70463941, 943530484, 948579994, 862814135, 246368500, 873270958, 338057830, 983903368, 59855896, 732486271, 663161834, 661549632, 177814245, 626640660, 345092871, 124263576, 373533270, 352176523, 998412288, 878367251, 598936226, 701959086, 400145508, 108114596, 164270870, 900938666, 677851751, 637324581, 130274326, 64750070, 808508753, 198239841, 423872388, 706671863, 740168813, 581292595, 474388770, 586876673, 910163756, 281249654, 291830158, 264636044, 884493730, 775236934, 338878579, 74271597, 651988856, 652734110, 468664633, 167413426, 418342003, 461082020, 556390393, 569901540, 299278021, 223198118, 631487018, 622383043, 280220107, 68431263, 932537776, 660154830, 361360455, 678137717, 626818251, 618585792, 9145884, 374503156, 220763172, 891811671, 645510829, 386360502, 777618158, 206911033, 814442829, 941766602, 10306076, 492632233, 662948696, 964641886, 353516876, 449058781, 251692496, 163784672, 851101539, 518174049, 369388051, 740930222, 663907765, 466069173, 91728049, 117096284, 324752241, 239103320, 278942449, 129857746, 972200598, 535422884, 345675182, 867547456, 980177106),10), 11)
42
+ }
43
+
44
+ }
find_the_maximum_length_of_a_good_subsequence_ii/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
find_the_maximum_length_of_a_good_subsequence_ii/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(4, maximumLength(new ArrayList<>(Arrays.asList(1,2,1,1,3)), 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(2, maximumLength(new ArrayList<>(Arrays.asList(1,2,3,4,5,1)), 0));
19
+ }
20
+
21
+ }
find_the_maximum_length_of_a_good_subsequence_ii/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
find_the_maximum_length_of_a_good_subsequence_ii/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
find_the_maximum_length_of_a_good_subsequence_ii/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
find_the_maximum_length_of_valid_subsequence_i/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(4, maximumLength(new ArrayList<>(Arrays.asList(1,2,3,4))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(6, maximumLength(new ArrayList<>(Arrays.asList(1,2,1,1,2,1,2))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(2, maximumLength(new ArrayList<>(Arrays.asList(1,3))));
23
+ }
24
+
25
+ }
find_the_maximum_length_of_valid_subsequence_ii/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 (maximumLength [1,2,3,4,5] 2)," 5 (maximumLength [1,2,3,4,5] 2))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (maximumLength [1,4,2,3,1,4] 3)," 4 (maximumLength [1,4,2,3,1,4] 3))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (maximumLength [5666738, 5833160, 3076685, 8180120, 5929886, 4983393, 1613148, 2983138, 54000, 7931452, 2079819, 7055417, 7914923, 24008, 5985317, 9332595, 5512226, 1445954, 7539029, 3710155] 696)," 3 (maximumLength [5666738, 5833160, 3076685, 8180120, 5929886, 4983393, 1613148, 2983138, 54000, 7931452, 2079819, 7055417, 7914923, 24008, 5985317, 9332595, 5512226, 1445954, 7539029, 3710155] 696))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (maximumLength [6047072, 98741, 8984146, 5536188, 6016195, 1310400, 2625558, 9493761, 7873055, 8630685, 8717909, 147966, 5272047, 9801390, 2615060, 4521233, 3716897, 7519860, 2429393, 2156534, 2992707, 3406565, 8135288, 5284825, 3817989, 5021454, 7762994, 4253820, 2715970, 6031495, 9866044, 3485773, 3090258, 8955762, 2894077, 4555263, 4170494, 9363773, 8961764, 1631505, 4991868, 8027767, 9244952, 9846545, 9079928, 9539985, 4192893, 6175164, 3464062, 2349941, 4735432, 9566407, 1987972, 5736784, 8630030, 7248817, 8503380, 1841055, 1020608, 7023782, 99125, 9042958, 4683875, 263884, 2140670, 1877196, 9972966, 7741247, 4103831, 9657721, 9088642, 5879802, 1293213, 9735453, 9927402, 6964158, 5428760, 7915977, 4398892, 8970197, 5798169, 2739972, 2711593, 7338980, 5483798, 493782, 9063843, 3535274, 8363706, 9333858, 7338766, 9399042, 7668315, 9243080, 302292, 4340976, 5155158, 2252850, 5218166, 2390239, 9993534, 7518932, 1260722, 3223733, 7078122, 554640, 6882224, 3990171, 2254840, 711951, 5227962, 4341906, 8265561, 3990738, 8370730, 9439723, 5280672, 3404340, 7006735, 4412792, 4311056, 1387266, 2061091, 4724236, 5394193, 1718039, 6263375, 9010112, 6774047, 6226055, 6739726, 8713637, 6493305, 3034292, 3658274, 8903418, 2149313, 2495482, 6400151, 649911, 4701644, 5182968, 9135541, 520529, 3491980, 2617850, 5344666, 546982, 855459, 9047307, 4337507, 5850068, 2429508, 5060912, 2281840, 3729530, 4159283, 5462973, 406369, 2149500, 435990, 5104488, 3411179, 7523837, 6777136, 5422689, 5320577, 1623256, 5307336, 1565039, 6061996, 9649175, 9652269, 1694104, 7166144, 121304, 8286885, 5006223, 1084728, 4595993, 2291651, 8567221, 9374616, 2150095, 2868264, 7283466, 5395194, 6340601, 811720, 3707968, 7375340, 5009678, 7632237, 3250095, 9535561, 7931767, 1783182, 4262378, 6036083, 9912783, 190190, 559433, 5634006, 7298847, 2058448, 5283556, 6986613, 7394596, 5172011, 4619271, 4271092, 316760, 2399238, 7589843, 2414019, 3620607, 69921, 1189775, 7589277, 7620540, 1325718, 7077110, 265303, 9485528, 6663530, 883621, 1925883, 5507639, 8547856, 689729, 5296827, 3808248, 7096824, 9755556, 9603604, 1353469, 3329211, 4156234, 5816295, 6436996, 442526, 4479626, 9400866, 373182, 5222046, 2948706, 8885283, 9891258, 5289888, 7568504, 3819942, 2406814, 1913699, 3182309, 3286823, 49532, 9744747, 1816820, 6849994, 1597622, 6057667, 4722912, 6997268, 8073871, 8880753, 8270843, 6242433, 7625459, 6563938, 4876276, 5483193, 6719547, 9850866, 2415529, 3427322, 7543811, 5867236, 3397942, 5418789, 2122390, 3111369, 434087, 1338008, 6964209, 6890216, 7824140, 5816813, 5077407, 8277312, 8055094, 592390, 5618549, 374779, 2368545, 6410866, 5793767, 7714735, 7437483, 2322221, 327799, 359573, 2148943, 5703958, 1612899, 981071, 9316951, 4127189, 4842565, 2156153, 9382809, 5089585, 2947818, 4722358, 2983076, 6340398, 7926500, 2974778, 8578782, 5942676, 730240, 1814032, 3216539, 6179830, 1264409, 5986885, 9645675, 4443777, 1827562, 2284857, 957776, 2245377, 3240211, 1603808, 7490811, 1545097, 1911338, 9255535, 8524190, 4275383, 7227022, 7083403, 5102173, 2003887, 2131606, 3869027, 6436898, 7099328, 5148207, 629296, 9903936, 3148804, 9782862, 823441, 6875933, 4370514, 8340993, 3491666, 2795889, 1786809, 3885657, 674211, 3215848, 9239906, 1320840, 4197400, 8437731, 1629069, 8900889, 2605355, 4471206, 3964019, 8687346] 564)," 6 (maximumLength [6047072, 98741, 8984146, 5536188, 6016195, 1310400, 2625558, 9493761, 7873055, 8630685, 8717909, 147966, 5272047, 9801390, 2615060, 4521233, 3716897, 7519860, 2429393, 2156534, 2992707, 3406565, 8135288, 5284825, 3817989, 5021454, 7762994, 4253820, 2715970, 6031495, 9866044, 3485773, 3090258, 8955762, 2894077, 4555263, 4170494, 9363773, 8961764, 1631505, 4991868, 8027767, 9244952, 9846545, 9079928, 9539985, 4192893, 6175164, 3464062, 2349941, 4735432, 9566407, 1987972, 5736784, 8630030, 7248817, 8503380, 1841055, 1020608, 7023782, 99125, 9042958, 4683875, 263884, 2140670, 1877196, 9972966, 7741247, 4103831, 9657721, 9088642, 5879802, 1293213, 9735453, 9927402, 6964158, 5428760, 7915977, 4398892, 8970197, 5798169, 2739972, 2711593, 7338980, 5483798, 493782, 9063843, 3535274, 8363706, 9333858, 7338766, 9399042, 7668315, 9243080, 302292, 4340976, 5155158, 2252850, 5218166, 2390239, 9993534, 7518932, 1260722, 3223733, 7078122, 554640, 6882224, 3990171, 2254840, 711951, 5227962, 4341906, 8265561, 3990738, 8370730, 9439723, 5280672, 3404340, 7006735, 4412792, 4311056, 1387266, 2061091, 4724236, 5394193, 1718039, 6263375, 9010112, 6774047, 6226055, 6739726, 8713637, 6493305, 3034292, 3658274, 8903418, 2149313, 2495482, 6400151, 649911, 4701644, 5182968, 9135541, 520529, 3491980, 2617850, 5344666, 546982, 855459, 9047307, 4337507, 5850068, 2429508, 5060912, 2281840, 3729530, 4159283, 5462973, 406369, 2149500, 435990, 5104488, 3411179, 7523837, 6777136, 5422689, 5320577, 1623256, 5307336, 1565039, 6061996, 9649175, 9652269, 1694104, 7166144, 121304, 8286885, 5006223, 1084728, 4595993, 2291651, 8567221, 9374616, 2150095, 2868264, 7283466, 5395194, 6340601, 811720, 3707968, 7375340, 5009678, 7632237, 3250095, 9535561, 7931767, 1783182, 4262378, 6036083, 9912783, 190190, 559433, 5634006, 7298847, 2058448, 5283556, 6986613, 7394596, 5172011, 4619271, 4271092, 316760, 2399238, 7589843, 2414019, 3620607, 69921, 1189775, 7589277, 7620540, 1325718, 7077110, 265303, 9485528, 6663530, 883621, 1925883, 5507639, 8547856, 689729, 5296827, 3808248, 7096824, 9755556, 9603604, 1353469, 3329211, 4156234, 5816295, 6436996, 442526, 4479626, 9400866, 373182, 5222046, 2948706, 8885283, 9891258, 5289888, 7568504, 3819942, 2406814, 1913699, 3182309, 3286823, 49532, 9744747, 1816820, 6849994, 1597622, 6057667, 4722912, 6997268, 8073871, 8880753, 8270843, 6242433, 7625459, 6563938, 4876276, 5483193, 6719547, 9850866, 2415529, 3427322, 7543811, 5867236, 3397942, 5418789, 2122390, 3111369, 434087, 1338008, 6964209, 6890216, 7824140, 5816813, 5077407, 8277312, 8055094, 592390, 5618549, 374779, 2368545, 6410866, 5793767, 7714735, 7437483, 2322221, 327799, 359573, 2148943, 5703958, 1612899, 981071, 9316951, 4127189, 4842565, 2156153, 9382809, 5089585, 2947818, 4722358, 2983076, 6340398, 7926500, 2974778, 8578782, 5942676, 730240, 1814032, 3216539, 6179830, 1264409, 5986885, 9645675, 4443777, 1827562, 2284857, 957776, 2245377, 3240211, 1603808, 7490811, 1545097, 1911338, 9255535, 8524190, 4275383, 7227022, 7083403, 5102173, 2003887, 2131606, 3869027, 6436898, 7099328, 5148207, 629296, 9903936, 3148804, 9782862, 823441, 6875933, 4370514, 8340993, 3491666, 2795889, 1786809, 3885657, 674211, 3215848, 9239906, 1320840, 4197400, 8437731, 1629069, 8900889, 2605355, 4471206, 3964019, 8687346] 564))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (maximumLength [521419, 4724126, 2319089, 5152298, 4398845, 5355104, 3436896, 9131500, 4716913, 4778303, 541725, 6369024, 1147692, 2907150, 6730845, 973592, 868082, 788461, 8046938, 1329259, 7751076, 1928531, 743446, 4136510, 1493143, 7895147, 3178694, 9326993, 456922, 739351, 9874393, 4683289, 1342004, 8448246, 4290803, 4215446, 9391933, 1870897, 6075113, 4181833, 6757828, 9110268, 1977611, 3873075, 3117410, 7436528, 9406601, 3136485, 7863939, 5706249, 5280495, 7308478, 9428065, 4944625, 4479170, 3945928, 7343336, 5146704, 2880213, 3668073, 3981866, 8893537, 4811317, 2893951, 3856884, 8249663, 7480352, 4276569, 920591, 4959695, 6103693, 3659192, 1687582, 2150300, 1622418, 5837247, 403494, 5161334, 2412302, 5513664, 133347, 4540293, 333892, 3729368, 1526907, 4869168, 2666494, 2635582, 6374107, 4189521, 9772154, 5467844, 2333963, 1046336, 6276799, 8805989, 2138492, 8939289, 4912190, 3541951, 9912452, 542693, 6605063, 6084501, 5726126, 7294586, 383237, 6574327, 3025578, 8723168, 2283908, 9043048, 7595583, 877235, 3833274, 3502303, 7784408, 7956154, 536567, 5841025, 861460, 502188, 7412108, 9979034, 8878316, 9140356, 7342859, 7298729, 1404717, 2311500, 2748498, 6614627, 6949444, 2209840, 9738261, 9427623, 2353605, 325764, 1263026, 2708663, 5849094, 4209937, 2471438, 7629853, 6682812, 1021662, 1062298, 4943862, 8456821, 8561025, 9543409, 2244916, 9612052, 3368765, 6963075, 6758800, 3403828, 2207842, 5835809, 4591383, 3372528, 7802409, 2537901, 7692983, 455731, 8822404, 2653340, 1889773, 4808027, 6826495, 1728424, 3391832, 911410, 4125807, 9365809, 3813871, 9405929, 1028290, 3183035, 7361029, 459190, 8330601, 9294912, 7016171, 7808454, 204091, 9770150, 9173344, 130300, 6614262, 6326916, 689161, 5960014, 774415, 2865417, 9265348, 3423492, 9046872, 3318872, 9814738, 6471935, 7417437, 2279155, 6770773, 1301612, 7349538, 2827325, 3490743, 3999657, 2173659, 1413044, 7980078, 7552335, 9981412, 1864276, 6800608, 5978473, 8147836, 7181442, 1560735, 7518240, 533956, 5317213, 8936411, 7675214, 113927, 1592905, 4200248, 5901938, 1885265, 7128106, 9272719, 8093598, 3147407, 2431169, 399647, 9580733, 5451219, 2203110, 3446692, 8497490, 8678770, 9403114, 2307292, 3990574, 2628821, 2926104, 9989554, 7019949, 1536789, 4499270, 4951565, 5929628, 1978377, 2376820, 6333842, 7005918, 6581390, 6440500, 5070245, 1752709, 9557529, 2067018, 1457761, 4624774, 7998799, 1999516, 7818143, 5071268, 809062, 3165834, 9983060, 9553059, 2413038, 5688754, 8441919, 6158057, 5417205, 7353564, 8127658, 3066170, 3718768, 2040905, 9405205, 8185241, 6696292, 8527488, 2754475, 3254102, 2214870, 886742, 3526595, 962223, 9009880, 9900964, 3782329, 2657928, 569849, 5026641, 2489928, 3160429, 7117508, 5784893, 9485100, 8808766, 4292046, 4942010, 2770884, 8218341, 4815917, 9602311, 7224738, 746664, 9581196, 5046124, 690829, 9750273, 9027964, 599075, 3430962, 4376704, 8022487, 2611004, 4380904, 9755458, 6480704, 1031427, 8847017, 5206666, 3803008, 6961472, 5999880, 63543] 287)," 7 (maximumLength [521419, 4724126, 2319089, 5152298, 4398845, 5355104, 3436896, 9131500, 4716913, 4778303, 541725, 6369024, 1147692, 2907150, 6730845, 973592, 868082, 788461, 8046938, 1329259, 7751076, 1928531, 743446, 4136510, 1493143, 7895147, 3178694, 9326993, 456922, 739351, 9874393, 4683289, 1342004, 8448246, 4290803, 4215446, 9391933, 1870897, 6075113, 4181833, 6757828, 9110268, 1977611, 3873075, 3117410, 7436528, 9406601, 3136485, 7863939, 5706249, 5280495, 7308478, 9428065, 4944625, 4479170, 3945928, 7343336, 5146704, 2880213, 3668073, 3981866, 8893537, 4811317, 2893951, 3856884, 8249663, 7480352, 4276569, 920591, 4959695, 6103693, 3659192, 1687582, 2150300, 1622418, 5837247, 403494, 5161334, 2412302, 5513664, 133347, 4540293, 333892, 3729368, 1526907, 4869168, 2666494, 2635582, 6374107, 4189521, 9772154, 5467844, 2333963, 1046336, 6276799, 8805989, 2138492, 8939289, 4912190, 3541951, 9912452, 542693, 6605063, 6084501, 5726126, 7294586, 383237, 6574327, 3025578, 8723168, 2283908, 9043048, 7595583, 877235, 3833274, 3502303, 7784408, 7956154, 536567, 5841025, 861460, 502188, 7412108, 9979034, 8878316, 9140356, 7342859, 7298729, 1404717, 2311500, 2748498, 6614627, 6949444, 2209840, 9738261, 9427623, 2353605, 325764, 1263026, 2708663, 5849094, 4209937, 2471438, 7629853, 6682812, 1021662, 1062298, 4943862, 8456821, 8561025, 9543409, 2244916, 9612052, 3368765, 6963075, 6758800, 3403828, 2207842, 5835809, 4591383, 3372528, 7802409, 2537901, 7692983, 455731, 8822404, 2653340, 1889773, 4808027, 6826495, 1728424, 3391832, 911410, 4125807, 9365809, 3813871, 9405929, 1028290, 3183035, 7361029, 459190, 8330601, 9294912, 7016171, 7808454, 204091, 9770150, 9173344, 130300, 6614262, 6326916, 689161, 5960014, 774415, 2865417, 9265348, 3423492, 9046872, 3318872, 9814738, 6471935, 7417437, 2279155, 6770773, 1301612, 7349538, 2827325, 3490743, 3999657, 2173659, 1413044, 7980078, 7552335, 9981412, 1864276, 6800608, 5978473, 8147836, 7181442, 1560735, 7518240, 533956, 5317213, 8936411, 7675214, 113927, 1592905, 4200248, 5901938, 1885265, 7128106, 9272719, 8093598, 3147407, 2431169, 399647, 9580733, 5451219, 2203110, 3446692, 8497490, 8678770, 9403114, 2307292, 3990574, 2628821, 2926104, 9989554, 7019949, 1536789, 4499270, 4951565, 5929628, 1978377, 2376820, 6333842, 7005918, 6581390, 6440500, 5070245, 1752709, 9557529, 2067018, 1457761, 4624774, 7998799, 1999516, 7818143, 5071268, 809062, 3165834, 9983060, 9553059, 2413038, 5688754, 8441919, 6158057, 5417205, 7353564, 8127658, 3066170, 3718768, 2040905, 9405205, 8185241, 6696292, 8527488, 2754475, 3254102, 2214870, 886742, 3526595, 962223, 9009880, 9900964, 3782329, 2657928, 569849, 5026641, 2489928, 3160429, 7117508, 5784893, 9485100, 8808766, 4292046, 4942010, 2770884, 8218341, 4815917, 9602311, 7224738, 746664, 9581196, 5046124, 690829, 9750273, 9027964, 599075, 3430962, 4376704, 8022487, 2611004, 4380904, 9755458, 6480704, 1031427, 8847017, 5206666, 3803008, 6961472, 5999880, 63543] 287))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (maximumLength [7915949, 1022332, 3765020, 7134429, 4939013, 5606624, 8369811, 4045493, 5402808, 5098903, 5018127, 6400570, 8564015, 9571054, 5204721, 8279325, 8116467, 7678487, 1201352, 2620279, 4443193, 8514009, 1322191, 4626213, 4676628, 4415277, 5606432, 8575850, 9856571, 6272689, 5567345, 325104, 3131488, 4277154, 7276167, 2408294, 6324996, 9063813, 218769, 4253226, 8480489, 4365605, 7309748, 4678698, 8567311, 8167161, 1823637, 5477093, 8917720, 5929539, 5406721, 4901312, 5521462, 6281001, 3234391, 3230702, 8572462, 7343212, 3622740, 4982491, 4625493, 8869515, 5944811, 7057570, 5063514, 4327448, 2660517, 1752759, 4286722, 5666776, 7485968, 5598413, 2155412, 2453027, 9860204, 3057631, 2608145, 9784707, 8700969, 6727131, 565341, 6507764, 5937986, 2481540, 4087833, 6802849, 1796691, 3166824, 8560914, 8661512, 6577318, 6634578, 1047714, 4509571, 1019511, 6987034, 5169909, 4677532, 1342838, 8109243, 8108682, 4311267, 7885046, 8666486, 9032615, 2444428, 8795894, 5147554, 4148694, 1302403, 6741041, 1619943, 9384041, 4345082, 2616183, 3917891, 7830114, 3351657, 6550146, 4111711, 2286283, 1823957, 7907925, 5269974, 1125903, 1420045, 2043872, 3417820, 9391392, 4039445, 1411976, 3626094, 4676219, 4964054, 9519230, 4374267, 8696770, 7178941, 1496062, 1473786, 1420427, 5100875, 1514145, 7902486, 9603019, 6989583, 9187262, 5841351, 7610592, 5432536, 3576294, 4287562, 3241147, 2661809, 2940350, 1639408, 4080857, 2327710, 4713352, 486401, 3820650, 2881971, 5228754, 326219, 5032371, 1744081, 8626561, 9850290, 5015201, 2863899, 1026326, 7826260, 7323357, 4984230, 7119762, 348631, 257044, 9805336, 8637674, 2775590, 1338834, 8045551, 1205039, 4426530, 3259954, 7704524, 2190859, 8076065, 6965872, 371836, 5462208, 3282264, 4096340, 6291453, 6657029, 5274437, 3817026, 8517669, 2323411, 6201596, 3422564, 2979963, 2568219, 1311210, 1288453, 7517743, 8647754, 9671625, 5660313, 5245530, 7115516, 4522110, 9162550, 7748709, 7577754, 8998683, 6565267, 6888265, 5387873, 9997953, 2010477, 4374087, 9222488, 7534022, 1325499, 5289822, 8700941, 5915531, 5249700, 7072433, 9792347, 4532846, 7912906, 1039534, 4168982, 6853010, 1357417, 5126361, 7540084, 9695497, 7180550, 9410891, 7530609, 5384124, 4510241, 3925032, 5468938, 5276335, 3207198, 538726, 6900227, 4598688, 452221, 4933923, 13427, 3035004, 15234, 1670059, 9168754, 2235153, 4092614, 6106470, 7649823, 9015469, 3361025, 7174708, 8854628, 7432016, 3359259, 4525190, 8107442, 6298215, 772026, 3858262, 3217437, 5241079, 7786987, 7883141, 2353943, 1567658, 6890297, 1874658, 2436660, 2086779, 1893785, 4983255, 7283345, 1021215, 2105612, 6969603, 3804199, 1594154, 7675831, 3331281, 3409536, 7962299, 7535841, 9530738, 1093826, 3439511, 7926518, 8217089, 9393979, 1009464, 5321964, 2434417, 3250551, 1476750, 250405, 5336579, 7378430, 5647567, 3137697, 614103, 3051315, 2990285, 3541382, 9883804, 3431077, 7360940, 3781496, 6325587, 4096126, 5561001, 9099845, 4924693, 9022491, 4782787, 6483408, 9945947, 9963374, 4881092, 4986237, 7433922, 4681216, 3574479, 7404854, 831004, 9330202, 8190403, 8313653, 7293578, 7864580, 3371977, 8034220, 4701750, 6480609, 6107917, 3951531, 2083675, 9504846, 2134023, 2564331, 6582858, 238015, 8118236, 522939, 1191507, 6977201, 2756219, 9503164, 1392037, 1787334, 543370, 1041480, 2195134, 5546747, 3987370, 9805200, 3915026, 1396111, 1050404, 2458575, 9574050, 86132, 4153175, 8125660, 3835919, 4378615, 4434320, 1254407, 2145569, 1401802, 6668286, 2816259, 9944955, 5506766, 6026304, 6008247, 5621322, 5951795, 2209188, 3536887, 3541357, 2579049, 328821, 1626819, 2015132, 6117084, 8757695, 1373409, 2069090, 1529117, 8675136, 5647857, 5239600, 2679165, 790251, 9952109, 6609020, 1582517, 4508075, 1263875, 2025165, 9281237, 2130776, 9663438, 9023715, 758815, 152554, 952749, 5677420, 2019777, 3313549, 4380549, 4651545, 7648702, 1349148, 5110748, 6569695, 8068904, 9525921, 3831514, 3623992, 721053, 429809, 4683548, 8714938, 7045600, 1967494, 8462531, 6219951, 3786155, 9199945, 6147085, 9233656, 9032005, 5216395, 9587000, 1216520, 8379822, 174213, 1148104, 1642094, 8350399, 4000453, 1138531, 9408084, 6229680, 9386046, 4405142, 3092686, 4227932, 2832622, 1429319, 7149056, 7243087, 9350746, 7031418, 402861, 1383314, 5881216, 2767469, 8277970, 5400880, 2977427, 2174745, 8761500, 6708186, 5008365, 7248940, 4832596, 1836455, 812461, 7849433, 3198788, 4755679, 7788387, 1370265, 7142429, 6181252, 7839773, 4971665, 6381699, 3565035, 5395776, 8533719, 8510178, 6797611, 5481141, 8197118, 7204458, 1430186, 2144318, 6109812, 1709679, 2828450, 1285444, 2639754, 9278895, 7580536, 2454928, 9604074, 2940641, 7915747, 72301, 7605277, 3590865, 9432284, 8864501, 4454150, 4832035, 8913008, 3871185, 8203014, 7302609, 8940990, 4743851, 4053870, 8916639, 4498866, 2551100, 962928, 9142984, 4930506, 4094894, 7980172, 55685, 380534, 317566, 6935114, 408044, 2925897, 2333839, 7740909, 7350618, 474628, 5403085, 923150, 9411161, 5835459, 7783663, 6312087, 3114975, 7693928, 5692771, 7915138, 5680115, 8859382, 5513213, 8677152, 8552967, 1890828, 9128588, 1474473, 4000712, 5273223, 9776410, 3895586, 219326, 3375230, 5457101, 3515766, 7762810, 6731124, 812700, 757313, 1507718, 9321133, 5532052, 2632952, 6054809, 6341312, 6079019, 4657391, 3055086, 9680991, 7132221, 9518553, 8610907, 8258056, 5234329, 5321196, 6258978, 8703881, 5080072, 804610, 8370208, 3976935, 3489478, 130260, 4208566, 2202032, 9295930, 5465694, 4375167, 1319964, 5793078, 792076, 6840314, 274901, 8185087, 1160258, 7830932, 9606386, 6507481, 5840196, 8065882, 4663986, 8734133, 9805401, 3832519, 2393623, 629082, 1207599, 2449122, 6348368, 3930978, 7331484, 1548572, 3249845, 801931, 4671, 3993152, 6534296, 7954618, 4580563, 4057786, 8411645, 6106669, 7163370, 1249618, 6032016, 9302430, 98305, 4283173, 1773030, 4642798, 2480639, 902778, 7248981, 1028519, 8122999, 9120271, 1920288, 5486962, 7455828, 2241088, 8354533, 763566, 5440348, 8168887, 4116525, 1863303, 5454569, 1603654, 7431100, 4576951, 6899427, 2425430, 1899226, 3687921, 1814945, 22267, 9651632, 756503, 932249, 9002189, 8424282, 6444139, 5591633, 1772667, 2536911, 7985536, 3706723, 2020876, 5797426, 3606275, 2187101, 27665, 5898988, 1860532, 5294031, 6717874, 2390377, 9897601, 7911078, 6491609, 126271, 9763739, 4001666, 9791, 9949007, 272529, 5918115, 8987068, 8730477] 672)," 8 (maximumLength [7915949, 1022332, 3765020, 7134429, 4939013, 5606624, 8369811, 4045493, 5402808, 5098903, 5018127, 6400570, 8564015, 9571054, 5204721, 8279325, 8116467, 7678487, 1201352, 2620279, 4443193, 8514009, 1322191, 4626213, 4676628, 4415277, 5606432, 8575850, 9856571, 6272689, 5567345, 325104, 3131488, 4277154, 7276167, 2408294, 6324996, 9063813, 218769, 4253226, 8480489, 4365605, 7309748, 4678698, 8567311, 8167161, 1823637, 5477093, 8917720, 5929539, 5406721, 4901312, 5521462, 6281001, 3234391, 3230702, 8572462, 7343212, 3622740, 4982491, 4625493, 8869515, 5944811, 7057570, 5063514, 4327448, 2660517, 1752759, 4286722, 5666776, 7485968, 5598413, 2155412, 2453027, 9860204, 3057631, 2608145, 9784707, 8700969, 6727131, 565341, 6507764, 5937986, 2481540, 4087833, 6802849, 1796691, 3166824, 8560914, 8661512, 6577318, 6634578, 1047714, 4509571, 1019511, 6987034, 5169909, 4677532, 1342838, 8109243, 8108682, 4311267, 7885046, 8666486, 9032615, 2444428, 8795894, 5147554, 4148694, 1302403, 6741041, 1619943, 9384041, 4345082, 2616183, 3917891, 7830114, 3351657, 6550146, 4111711, 2286283, 1823957, 7907925, 5269974, 1125903, 1420045, 2043872, 3417820, 9391392, 4039445, 1411976, 3626094, 4676219, 4964054, 9519230, 4374267, 8696770, 7178941, 1496062, 1473786, 1420427, 5100875, 1514145, 7902486, 9603019, 6989583, 9187262, 5841351, 7610592, 5432536, 3576294, 4287562, 3241147, 2661809, 2940350, 1639408, 4080857, 2327710, 4713352, 486401, 3820650, 2881971, 5228754, 326219, 5032371, 1744081, 8626561, 9850290, 5015201, 2863899, 1026326, 7826260, 7323357, 4984230, 7119762, 348631, 257044, 9805336, 8637674, 2775590, 1338834, 8045551, 1205039, 4426530, 3259954, 7704524, 2190859, 8076065, 6965872, 371836, 5462208, 3282264, 4096340, 6291453, 6657029, 5274437, 3817026, 8517669, 2323411, 6201596, 3422564, 2979963, 2568219, 1311210, 1288453, 7517743, 8647754, 9671625, 5660313, 5245530, 7115516, 4522110, 9162550, 7748709, 7577754, 8998683, 6565267, 6888265, 5387873, 9997953, 2010477, 4374087, 9222488, 7534022, 1325499, 5289822, 8700941, 5915531, 5249700, 7072433, 9792347, 4532846, 7912906, 1039534, 4168982, 6853010, 1357417, 5126361, 7540084, 9695497, 7180550, 9410891, 7530609, 5384124, 4510241, 3925032, 5468938, 5276335, 3207198, 538726, 6900227, 4598688, 452221, 4933923, 13427, 3035004, 15234, 1670059, 9168754, 2235153, 4092614, 6106470, 7649823, 9015469, 3361025, 7174708, 8854628, 7432016, 3359259, 4525190, 8107442, 6298215, 772026, 3858262, 3217437, 5241079, 7786987, 7883141, 2353943, 1567658, 6890297, 1874658, 2436660, 2086779, 1893785, 4983255, 7283345, 1021215, 2105612, 6969603, 3804199, 1594154, 7675831, 3331281, 3409536, 7962299, 7535841, 9530738, 1093826, 3439511, 7926518, 8217089, 9393979, 1009464, 5321964, 2434417, 3250551, 1476750, 250405, 5336579, 7378430, 5647567, 3137697, 614103, 3051315, 2990285, 3541382, 9883804, 3431077, 7360940, 3781496, 6325587, 4096126, 5561001, 9099845, 4924693, 9022491, 4782787, 6483408, 9945947, 9963374, 4881092, 4986237, 7433922, 4681216, 3574479, 7404854, 831004, 9330202, 8190403, 8313653, 7293578, 7864580, 3371977, 8034220, 4701750, 6480609, 6107917, 3951531, 2083675, 9504846, 2134023, 2564331, 6582858, 238015, 8118236, 522939, 1191507, 6977201, 2756219, 9503164, 1392037, 1787334, 543370, 1041480, 2195134, 5546747, 3987370, 9805200, 3915026, 1396111, 1050404, 2458575, 9574050, 86132, 4153175, 8125660, 3835919, 4378615, 4434320, 1254407, 2145569, 1401802, 6668286, 2816259, 9944955, 5506766, 6026304, 6008247, 5621322, 5951795, 2209188, 3536887, 3541357, 2579049, 328821, 1626819, 2015132, 6117084, 8757695, 1373409, 2069090, 1529117, 8675136, 5647857, 5239600, 2679165, 790251, 9952109, 6609020, 1582517, 4508075, 1263875, 2025165, 9281237, 2130776, 9663438, 9023715, 758815, 152554, 952749, 5677420, 2019777, 3313549, 4380549, 4651545, 7648702, 1349148, 5110748, 6569695, 8068904, 9525921, 3831514, 3623992, 721053, 429809, 4683548, 8714938, 7045600, 1967494, 8462531, 6219951, 3786155, 9199945, 6147085, 9233656, 9032005, 5216395, 9587000, 1216520, 8379822, 174213, 1148104, 1642094, 8350399, 4000453, 1138531, 9408084, 6229680, 9386046, 4405142, 3092686, 4227932, 2832622, 1429319, 7149056, 7243087, 9350746, 7031418, 402861, 1383314, 5881216, 2767469, 8277970, 5400880, 2977427, 2174745, 8761500, 6708186, 5008365, 7248940, 4832596, 1836455, 812461, 7849433, 3198788, 4755679, 7788387, 1370265, 7142429, 6181252, 7839773, 4971665, 6381699, 3565035, 5395776, 8533719, 8510178, 6797611, 5481141, 8197118, 7204458, 1430186, 2144318, 6109812, 1709679, 2828450, 1285444, 2639754, 9278895, 7580536, 2454928, 9604074, 2940641, 7915747, 72301, 7605277, 3590865, 9432284, 8864501, 4454150, 4832035, 8913008, 3871185, 8203014, 7302609, 8940990, 4743851, 4053870, 8916639, 4498866, 2551100, 962928, 9142984, 4930506, 4094894, 7980172, 55685, 380534, 317566, 6935114, 408044, 2925897, 2333839, 7740909, 7350618, 474628, 5403085, 923150, 9411161, 5835459, 7783663, 6312087, 3114975, 7693928, 5692771, 7915138, 5680115, 8859382, 5513213, 8677152, 8552967, 1890828, 9128588, 1474473, 4000712, 5273223, 9776410, 3895586, 219326, 3375230, 5457101, 3515766, 7762810, 6731124, 812700, 757313, 1507718, 9321133, 5532052, 2632952, 6054809, 6341312, 6079019, 4657391, 3055086, 9680991, 7132221, 9518553, 8610907, 8258056, 5234329, 5321196, 6258978, 8703881, 5080072, 804610, 8370208, 3976935, 3489478, 130260, 4208566, 2202032, 9295930, 5465694, 4375167, 1319964, 5793078, 792076, 6840314, 274901, 8185087, 1160258, 7830932, 9606386, 6507481, 5840196, 8065882, 4663986, 8734133, 9805401, 3832519, 2393623, 629082, 1207599, 2449122, 6348368, 3930978, 7331484, 1548572, 3249845, 801931, 4671, 3993152, 6534296, 7954618, 4580563, 4057786, 8411645, 6106669, 7163370, 1249618, 6032016, 9302430, 98305, 4283173, 1773030, 4642798, 2480639, 902778, 7248981, 1028519, 8122999, 9120271, 1920288, 5486962, 7455828, 2241088, 8354533, 763566, 5440348, 8168887, 4116525, 1863303, 5454569, 1603654, 7431100, 4576951, 6899427, 2425430, 1899226, 3687921, 1814945, 22267, 9651632, 756503, 932249, 9002189, 8424282, 6444139, 5591633, 1772667, 2536911, 7985536, 3706723, 2020876, 5797426, 3606275, 2187101, 27665, 5898988, 1860532, 5294031, 6717874, 2390377, 9897601, 7911078, 6491609, 126271, 9763739, 4001666, 9791, 9949007, 272529, 5918115, 8987068, 8730477] 672))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (maximumLength [3923315, 655315, 3026545, 5836948, 6588206, 2815311, 5475867, 9068934, 7861468, 2453761, 8839711, 5327527, 2149460, 5241347, 8901652, 5247869, 2331353, 1626885, 2008561, 5702260, 4182350, 2139201, 101038, 3147600, 5573617, 7967604, 8653644, 9963836, 240235, 5691827, 5986158, 4053687, 7019150, 5990041, 2077228, 6656728, 5692503, 8106720, 6529398, 2876136, 5299214, 5532889, 5251714, 9183989, 9361715, 663557, 8393460, 2406041, 7953722, 8854619, 1759211, 5769738, 8764277, 6629875, 7156367, 5881963, 4286030, 8980435, 6556374, 9633898, 6389470, 5019092, 9901845, 7632312, 1404300, 3522223, 671772] 395)," 4 (maximumLength [3923315, 655315, 3026545, 5836948, 6588206, 2815311, 5475867, 9068934, 7861468, 2453761, 8839711, 5327527, 2149460, 5241347, 8901652, 5247869, 2331353, 1626885, 2008561, 5702260, 4182350, 2139201, 101038, 3147600, 5573617, 7967604, 8653644, 9963836, 240235, 5691827, 5986158, 4053687, 7019150, 5990041, 2077228, 6656728, 5692503, 8106720, 6529398, 2876136, 5299214, 5532889, 5251714, 9183989, 9361715, 663557, 8393460, 2406041, 7953722, 8854619, 1759211, 5769738, 8764277, 6629875, 7156367, 5881963, 4286030, 8980435, 6556374, 9633898, 6389470, 5019092, 9901845, 7632312, 1404300, 3522223, 671772] 395))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (maximumLength [3667457, 457901, 5487200, 8356554, 2651168, 6194358, 4234193, 392948, 4219742, 523839, 6259716, 241868, 1480404, 5768961, 9551907, 5608147, 419918, 8640266, 2461226, 203876, 8351682, 5879327, 1323810, 5204584, 6847305, 6981556, 6354276, 8329559, 4993026, 527176, 5960561, 8289947, 3548286, 5919075, 29649, 1707398, 2289587, 5599929, 699155, 1703925, 9630014, 778669, 3023493, 5744701, 6106473, 9781967, 3602607, 9637550, 3042238, 8256315, 354959, 3136129, 972646, 3080800, 1136552, 9245581, 1421673, 6621775, 3799365, 4905572, 6651029, 899037, 8050887, 7805073, 2336253, 2649628, 8034568, 7320613, 594344, 3906624, 1803202, 4057961, 7987119, 6033926, 2896316, 7968484, 6197072, 6929222, 5202378, 7450007, 4891860, 7892459, 185738, 7021335, 3117992, 6194544, 571923, 5593193, 9631290, 6513953, 8288178, 136328, 9972551, 1732339, 7373626, 2271079, 1433051, 6359389, 9161781, 8984482, 7589441, 6387712, 2500944, 7883226, 7198102, 5085745, 3628276, 3632793, 5352320, 6452062, 6320526, 736923, 1634674, 1377581, 2650764, 4580526, 1913989, 1761093, 6289494, 6634867, 9512247, 236251, 3970148, 9453667, 5799106, 471000, 3326108, 3293354, 9751793, 601032, 4977857, 8143761, 6742396, 631859, 3932328, 6826561, 6145488, 2172986, 5225673, 4242354, 4483085, 2439760, 3361913, 6043913, 4421622, 54281, 3299734, 6765820, 8133441, 8913415, 1509453, 7148582, 5655572, 8488791, 2636768, 6761256, 4059960, 7758868, 4685163, 6833484, 9567870, 9318983, 3718786, 2918167, 8292629, 6806261, 7163105, 9425478, 5960844, 1823145, 2618162, 1263051, 2043899, 1824206, 3969777, 3166818, 4278552, 9230096, 8197644, 8647631, 4422138, 7284003, 7229713, 6040805, 3252837, 8515023, 3740773, 3455897, 6707179, 3199292, 4323014, 6589488, 1526014, 3962710, 1221032, 4596236, 2830758, 6520429, 385319, 6067506, 6283212, 8071870, 9761556, 8667644, 9455272, 2706658, 1065216, 8256722, 5698204, 8905620, 1804875, 693746, 2939420, 1486326, 6858798, 5503682, 4742903, 5314900, 5800696, 9284324, 1584263, 2313869, 8279541, 3626053, 59462, 6045670, 9914020, 9863563, 98129, 8088685, 6415066, 1282377, 9525808, 5305863, 2460583, 559762, 5793634, 2259448, 8159853, 4104679, 7149885, 3293718, 9556696, 7754483, 5677058, 631352, 7267280, 3795343, 4441394, 5311124, 1629215, 2527096, 6771607, 3671153, 6907031, 6677164, 7041724, 6043634, 4526234, 4689985, 871836, 7100348, 5763768, 5812750, 8076789, 3019661, 3307190, 5154586, 8602611, 3535364, 3408958, 4853484, 1100893, 2512640] 925)," 5 (maximumLength [3667457, 457901, 5487200, 8356554, 2651168, 6194358, 4234193, 392948, 4219742, 523839, 6259716, 241868, 1480404, 5768961, 9551907, 5608147, 419918, 8640266, 2461226, 203876, 8351682, 5879327, 1323810, 5204584, 6847305, 6981556, 6354276, 8329559, 4993026, 527176, 5960561, 8289947, 3548286, 5919075, 29649, 1707398, 2289587, 5599929, 699155, 1703925, 9630014, 778669, 3023493, 5744701, 6106473, 9781967, 3602607, 9637550, 3042238, 8256315, 354959, 3136129, 972646, 3080800, 1136552, 9245581, 1421673, 6621775, 3799365, 4905572, 6651029, 899037, 8050887, 7805073, 2336253, 2649628, 8034568, 7320613, 594344, 3906624, 1803202, 4057961, 7987119, 6033926, 2896316, 7968484, 6197072, 6929222, 5202378, 7450007, 4891860, 7892459, 185738, 7021335, 3117992, 6194544, 571923, 5593193, 9631290, 6513953, 8288178, 136328, 9972551, 1732339, 7373626, 2271079, 1433051, 6359389, 9161781, 8984482, 7589441, 6387712, 2500944, 7883226, 7198102, 5085745, 3628276, 3632793, 5352320, 6452062, 6320526, 736923, 1634674, 1377581, 2650764, 4580526, 1913989, 1761093, 6289494, 6634867, 9512247, 236251, 3970148, 9453667, 5799106, 471000, 3326108, 3293354, 9751793, 601032, 4977857, 8143761, 6742396, 631859, 3932328, 6826561, 6145488, 2172986, 5225673, 4242354, 4483085, 2439760, 3361913, 6043913, 4421622, 54281, 3299734, 6765820, 8133441, 8913415, 1509453, 7148582, 5655572, 8488791, 2636768, 6761256, 4059960, 7758868, 4685163, 6833484, 9567870, 9318983, 3718786, 2918167, 8292629, 6806261, 7163105, 9425478, 5960844, 1823145, 2618162, 1263051, 2043899, 1824206, 3969777, 3166818, 4278552, 9230096, 8197644, 8647631, 4422138, 7284003, 7229713, 6040805, 3252837, 8515023, 3740773, 3455897, 6707179, 3199292, 4323014, 6589488, 1526014, 3962710, 1221032, 4596236, 2830758, 6520429, 385319, 6067506, 6283212, 8071870, 9761556, 8667644, 9455272, 2706658, 1065216, 8256722, 5698204, 8905620, 1804875, 693746, 2939420, 1486326, 6858798, 5503682, 4742903, 5314900, 5800696, 9284324, 1584263, 2313869, 8279541, 3626053, 59462, 6045670, 9914020, 9863563, 98129, 8088685, 6415066, 1282377, 9525808, 5305863, 2460583, 559762, 5793634, 2259448, 8159853, 4104679, 7149885, 3293718, 9556696, 7754483, 5677058, 631352, 7267280, 3795343, 4441394, 5311124, 1629215, 2527096, 6771607, 3671153, 6907031, 6677164, 7041724, 6043634, 4526234, 4689985, 871836, 7100348, 5763768, 5812750, 8076789, 3019661, 3307190, 5154586, 8602611, 3535364, 3408958, 4853484, 1100893, 2512640] 925))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (maximumLength [1608698, 597159, 1860777, 1854067, 8731126, 2728129, 3538328, 8098830, 5654737, 9773627, 7531389, 7337223, 8689125, 463077, 1681161, 1613389, 1844165, 9625060, 7376295, 9311636, 1631975, 2730294, 1292510, 1757084, 3177948, 906302, 4232122, 1475456, 9647903, 8940944, 7625594, 9519055, 9999733, 6201007, 7990088, 6281304, 2612437, 5782281, 9717014, 383260, 2346438, 8014529, 5085816, 507585, 4945370, 1590682, 5655709, 4593744, 2346279, 5976913, 675006, 3401244, 7340105, 2708039, 8401197, 7040778, 8226547, 2292463, 1665152, 9933068, 5788884, 1247690, 1761166, 7445796, 4969453, 3308964, 8795620, 7885584, 3382335, 7792574, 7489385, 9709608, 1626098, 6376403, 1379708, 4684642, 8008931, 5014800, 3736110, 717193, 3072181, 9740144, 708299, 1052672, 5943695, 2648850, 683975, 5466214, 9455437, 8396142, 575713, 7521214, 4105229, 8229078, 2955451, 3537251, 8908243, 4998375, 9541586, 5179535, 6514125, 1042498, 8583702, 4823299, 7565473, 6593173, 9477479, 6025885, 7730302, 4045900, 3300740, 6038089, 4839978, 3099194, 26493, 5312770, 9540080, 425197, 7791210] 9)," 20 (maximumLength [1608698, 597159, 1860777, 1854067, 8731126, 2728129, 3538328, 8098830, 5654737, 9773627, 7531389, 7337223, 8689125, 463077, 1681161, 1613389, 1844165, 9625060, 7376295, 9311636, 1631975, 2730294, 1292510, 1757084, 3177948, 906302, 4232122, 1475456, 9647903, 8940944, 7625594, 9519055, 9999733, 6201007, 7990088, 6281304, 2612437, 5782281, 9717014, 383260, 2346438, 8014529, 5085816, 507585, 4945370, 1590682, 5655709, 4593744, 2346279, 5976913, 675006, 3401244, 7340105, 2708039, 8401197, 7040778, 8226547, 2292463, 1665152, 9933068, 5788884, 1247690, 1761166, 7445796, 4969453, 3308964, 8795620, 7885584, 3382335, 7792574, 7489385, 9709608, 1626098, 6376403, 1379708, 4684642, 8008931, 5014800, 3736110, 717193, 3072181, 9740144, 708299, 1052672, 5943695, 2648850, 683975, 5466214, 9455437, 8396142, 575713, 7521214, 4105229, 8229078, 2955451, 3537251, 8908243, 4998375, 9541586, 5179535, 6514125, 1042498, 8583702, 4823299, 7565473, 6593173, 9477479, 6025885, 7730302, 4045900, 3300740, 6038089, 4839978, 3099194, 26493, 5312770, 9540080, 425197, 7791210] 9))
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
find_the_maximum_length_of_valid_subsequence_ii/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(5, maximumLength(new ArrayList<>(Arrays.asList(1,2,3,4,5)), 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(4, maximumLength(new ArrayList<>(Arrays.asList(1,4,2,3,1,4)), 3));
19
+ }
20
+
21
+ }
find_the_maximum_length_of_valid_subsequence_ii/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
find_the_maximum_length_of_valid_subsequence_ii/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 5 (maximumLength [1;2;3;4;5] 2)
12
+
13
+ let test2 _ = assert_equal 4 (maximumLength [1;4;2;3;1;4] 3)
14
+
15
+ let test3 _ = assert_equal 3 (maximumLength [5666738; 5833160; 3076685; 8180120; 5929886; 4983393; 1613148; 2983138; 54000; 7931452; 2079819; 7055417; 7914923; 24008; 5985317; 9332595; 5512226; 1445954; 7539029; 3710155] 696)
16
+
17
+ let test4 _ = assert_equal 6 (maximumLength [6047072; 98741; 8984146; 5536188; 6016195; 1310400; 2625558; 9493761; 7873055; 8630685; 8717909; 147966; 5272047; 9801390; 2615060; 4521233; 3716897; 7519860; 2429393; 2156534; 2992707; 3406565; 8135288; 5284825; 3817989; 5021454; 7762994; 4253820; 2715970; 6031495; 9866044; 3485773; 3090258; 8955762; 2894077; 4555263; 4170494; 9363773; 8961764; 1631505; 4991868; 8027767; 9244952; 9846545; 9079928; 9539985; 4192893; 6175164; 3464062; 2349941; 4735432; 9566407; 1987972; 5736784; 8630030; 7248817; 8503380; 1841055; 1020608; 7023782; 99125; 9042958; 4683875; 263884; 2140670; 1877196; 9972966; 7741247; 4103831; 9657721; 9088642; 5879802; 1293213; 9735453; 9927402; 6964158; 5428760; 7915977; 4398892; 8970197; 5798169; 2739972; 2711593; 7338980; 5483798; 493782; 9063843; 3535274; 8363706; 9333858; 7338766; 9399042; 7668315; 9243080; 302292; 4340976; 5155158; 2252850; 5218166; 2390239; 9993534; 7518932; 1260722; 3223733; 7078122; 554640; 6882224; 3990171; 2254840; 711951; 5227962; 4341906; 8265561; 3990738; 8370730; 9439723; 5280672; 3404340; 7006735; 4412792; 4311056; 1387266; 2061091; 4724236; 5394193; 1718039; 6263375; 9010112; 6774047; 6226055; 6739726; 8713637; 6493305; 3034292; 3658274; 8903418; 2149313; 2495482; 6400151; 649911; 4701644; 5182968; 9135541; 520529; 3491980; 2617850; 5344666; 546982; 855459; 9047307; 4337507; 5850068; 2429508; 5060912; 2281840; 3729530; 4159283; 5462973; 406369; 2149500; 435990; 5104488; 3411179; 7523837; 6777136; 5422689; 5320577; 1623256; 5307336; 1565039; 6061996; 9649175; 9652269; 1694104; 7166144; 121304; 8286885; 5006223; 1084728; 4595993; 2291651; 8567221; 9374616; 2150095; 2868264; 7283466; 5395194; 6340601; 811720; 3707968; 7375340; 5009678; 7632237; 3250095; 9535561; 7931767; 1783182; 4262378; 6036083; 9912783; 190190; 559433; 5634006; 7298847; 2058448; 5283556; 6986613; 7394596; 5172011; 4619271; 4271092; 316760; 2399238; 7589843; 2414019; 3620607; 69921; 1189775; 7589277; 7620540; 1325718; 7077110; 265303; 9485528; 6663530; 883621; 1925883; 5507639; 8547856; 689729; 5296827; 3808248; 7096824; 9755556; 9603604; 1353469; 3329211; 4156234; 5816295; 6436996; 442526; 4479626; 9400866; 373182; 5222046; 2948706; 8885283; 9891258; 5289888; 7568504; 3819942; 2406814; 1913699; 3182309; 3286823; 49532; 9744747; 1816820; 6849994; 1597622; 6057667; 4722912; 6997268; 8073871; 8880753; 8270843; 6242433; 7625459; 6563938; 4876276; 5483193; 6719547; 9850866; 2415529; 3427322; 7543811; 5867236; 3397942; 5418789; 2122390; 3111369; 434087; 1338008; 6964209; 6890216; 7824140; 5816813; 5077407; 8277312; 8055094; 592390; 5618549; 374779; 2368545; 6410866; 5793767; 7714735; 7437483; 2322221; 327799; 359573; 2148943; 5703958; 1612899; 981071; 9316951; 4127189; 4842565; 2156153; 9382809; 5089585; 2947818; 4722358; 2983076; 6340398; 7926500; 2974778; 8578782; 5942676; 730240; 1814032; 3216539; 6179830; 1264409; 5986885; 9645675; 4443777; 1827562; 2284857; 957776; 2245377; 3240211; 1603808; 7490811; 1545097; 1911338; 9255535; 8524190; 4275383; 7227022; 7083403; 5102173; 2003887; 2131606; 3869027; 6436898; 7099328; 5148207; 629296; 9903936; 3148804; 9782862; 823441; 6875933; 4370514; 8340993; 3491666; 2795889; 1786809; 3885657; 674211; 3215848; 9239906; 1320840; 4197400; 8437731; 1629069; 8900889; 2605355; 4471206; 3964019; 8687346] 564)
18
+
19
+ let test5 _ = assert_equal 7 (maximumLength [521419; 4724126; 2319089; 5152298; 4398845; 5355104; 3436896; 9131500; 4716913; 4778303; 541725; 6369024; 1147692; 2907150; 6730845; 973592; 868082; 788461; 8046938; 1329259; 7751076; 1928531; 743446; 4136510; 1493143; 7895147; 3178694; 9326993; 456922; 739351; 9874393; 4683289; 1342004; 8448246; 4290803; 4215446; 9391933; 1870897; 6075113; 4181833; 6757828; 9110268; 1977611; 3873075; 3117410; 7436528; 9406601; 3136485; 7863939; 5706249; 5280495; 7308478; 9428065; 4944625; 4479170; 3945928; 7343336; 5146704; 2880213; 3668073; 3981866; 8893537; 4811317; 2893951; 3856884; 8249663; 7480352; 4276569; 920591; 4959695; 6103693; 3659192; 1687582; 2150300; 1622418; 5837247; 403494; 5161334; 2412302; 5513664; 133347; 4540293; 333892; 3729368; 1526907; 4869168; 2666494; 2635582; 6374107; 4189521; 9772154; 5467844; 2333963; 1046336; 6276799; 8805989; 2138492; 8939289; 4912190; 3541951; 9912452; 542693; 6605063; 6084501; 5726126; 7294586; 383237; 6574327; 3025578; 8723168; 2283908; 9043048; 7595583; 877235; 3833274; 3502303; 7784408; 7956154; 536567; 5841025; 861460; 502188; 7412108; 9979034; 8878316; 9140356; 7342859; 7298729; 1404717; 2311500; 2748498; 6614627; 6949444; 2209840; 9738261; 9427623; 2353605; 325764; 1263026; 2708663; 5849094; 4209937; 2471438; 7629853; 6682812; 1021662; 1062298; 4943862; 8456821; 8561025; 9543409; 2244916; 9612052; 3368765; 6963075; 6758800; 3403828; 2207842; 5835809; 4591383; 3372528; 7802409; 2537901; 7692983; 455731; 8822404; 2653340; 1889773; 4808027; 6826495; 1728424; 3391832; 911410; 4125807; 9365809; 3813871; 9405929; 1028290; 3183035; 7361029; 459190; 8330601; 9294912; 7016171; 7808454; 204091; 9770150; 9173344; 130300; 6614262; 6326916; 689161; 5960014; 774415; 2865417; 9265348; 3423492; 9046872; 3318872; 9814738; 6471935; 7417437; 2279155; 6770773; 1301612; 7349538; 2827325; 3490743; 3999657; 2173659; 1413044; 7980078; 7552335; 9981412; 1864276; 6800608; 5978473; 8147836; 7181442; 1560735; 7518240; 533956; 5317213; 8936411; 7675214; 113927; 1592905; 4200248; 5901938; 1885265; 7128106; 9272719; 8093598; 3147407; 2431169; 399647; 9580733; 5451219; 2203110; 3446692; 8497490; 8678770; 9403114; 2307292; 3990574; 2628821; 2926104; 9989554; 7019949; 1536789; 4499270; 4951565; 5929628; 1978377; 2376820; 6333842; 7005918; 6581390; 6440500; 5070245; 1752709; 9557529; 2067018; 1457761; 4624774; 7998799; 1999516; 7818143; 5071268; 809062; 3165834; 9983060; 9553059; 2413038; 5688754; 8441919; 6158057; 5417205; 7353564; 8127658; 3066170; 3718768; 2040905; 9405205; 8185241; 6696292; 8527488; 2754475; 3254102; 2214870; 886742; 3526595; 962223; 9009880; 9900964; 3782329; 2657928; 569849; 5026641; 2489928; 3160429; 7117508; 5784893; 9485100; 8808766; 4292046; 4942010; 2770884; 8218341; 4815917; 9602311; 7224738; 746664; 9581196; 5046124; 690829; 9750273; 9027964; 599075; 3430962; 4376704; 8022487; 2611004; 4380904; 9755458; 6480704; 1031427; 8847017; 5206666; 3803008; 6961472; 5999880; 63543] 287)
20
+
21
+ let test6 _ = assert_equal 8 (maximumLength [7915949; 1022332; 3765020; 7134429; 4939013; 5606624; 8369811; 4045493; 5402808; 5098903; 5018127; 6400570; 8564015; 9571054; 5204721; 8279325; 8116467; 7678487; 1201352; 2620279; 4443193; 8514009; 1322191; 4626213; 4676628; 4415277; 5606432; 8575850; 9856571; 6272689; 5567345; 325104; 3131488; 4277154; 7276167; 2408294; 6324996; 9063813; 218769; 4253226; 8480489; 4365605; 7309748; 4678698; 8567311; 8167161; 1823637; 5477093; 8917720; 5929539; 5406721; 4901312; 5521462; 6281001; 3234391; 3230702; 8572462; 7343212; 3622740; 4982491; 4625493; 8869515; 5944811; 7057570; 5063514; 4327448; 2660517; 1752759; 4286722; 5666776; 7485968; 5598413; 2155412; 2453027; 9860204; 3057631; 2608145; 9784707; 8700969; 6727131; 565341; 6507764; 5937986; 2481540; 4087833; 6802849; 1796691; 3166824; 8560914; 8661512; 6577318; 6634578; 1047714; 4509571; 1019511; 6987034; 5169909; 4677532; 1342838; 8109243; 8108682; 4311267; 7885046; 8666486; 9032615; 2444428; 8795894; 5147554; 4148694; 1302403; 6741041; 1619943; 9384041; 4345082; 2616183; 3917891; 7830114; 3351657; 6550146; 4111711; 2286283; 1823957; 7907925; 5269974; 1125903; 1420045; 2043872; 3417820; 9391392; 4039445; 1411976; 3626094; 4676219; 4964054; 9519230; 4374267; 8696770; 7178941; 1496062; 1473786; 1420427; 5100875; 1514145; 7902486; 9603019; 6989583; 9187262; 5841351; 7610592; 5432536; 3576294; 4287562; 3241147; 2661809; 2940350; 1639408; 4080857; 2327710; 4713352; 486401; 3820650; 2881971; 5228754; 326219; 5032371; 1744081; 8626561; 9850290; 5015201; 2863899; 1026326; 7826260; 7323357; 4984230; 7119762; 348631; 257044; 9805336; 8637674; 2775590; 1338834; 8045551; 1205039; 4426530; 3259954; 7704524; 2190859; 8076065; 6965872; 371836; 5462208; 3282264; 4096340; 6291453; 6657029; 5274437; 3817026; 8517669; 2323411; 6201596; 3422564; 2979963; 2568219; 1311210; 1288453; 7517743; 8647754; 9671625; 5660313; 5245530; 7115516; 4522110; 9162550; 7748709; 7577754; 8998683; 6565267; 6888265; 5387873; 9997953; 2010477; 4374087; 9222488; 7534022; 1325499; 5289822; 8700941; 5915531; 5249700; 7072433; 9792347; 4532846; 7912906; 1039534; 4168982; 6853010; 1357417; 5126361; 7540084; 9695497; 7180550; 9410891; 7530609; 5384124; 4510241; 3925032; 5468938; 5276335; 3207198; 538726; 6900227; 4598688; 452221; 4933923; 13427; 3035004; 15234; 1670059; 9168754; 2235153; 4092614; 6106470; 7649823; 9015469; 3361025; 7174708; 8854628; 7432016; 3359259; 4525190; 8107442; 6298215; 772026; 3858262; 3217437; 5241079; 7786987; 7883141; 2353943; 1567658; 6890297; 1874658; 2436660; 2086779; 1893785; 4983255; 7283345; 1021215; 2105612; 6969603; 3804199; 1594154; 7675831; 3331281; 3409536; 7962299; 7535841; 9530738; 1093826; 3439511; 7926518; 8217089; 9393979; 1009464; 5321964; 2434417; 3250551; 1476750; 250405; 5336579; 7378430; 5647567; 3137697; 614103; 3051315; 2990285; 3541382; 9883804; 3431077; 7360940; 3781496; 6325587; 4096126; 5561001; 9099845; 4924693; 9022491; 4782787; 6483408; 9945947; 9963374; 4881092; 4986237; 7433922; 4681216; 3574479; 7404854; 831004; 9330202; 8190403; 8313653; 7293578; 7864580; 3371977; 8034220; 4701750; 6480609; 6107917; 3951531; 2083675; 9504846; 2134023; 2564331; 6582858; 238015; 8118236; 522939; 1191507; 6977201; 2756219; 9503164; 1392037; 1787334; 543370; 1041480; 2195134; 5546747; 3987370; 9805200; 3915026; 1396111; 1050404; 2458575; 9574050; 86132; 4153175; 8125660; 3835919; 4378615; 4434320; 1254407; 2145569; 1401802; 6668286; 2816259; 9944955; 5506766; 6026304; 6008247; 5621322; 5951795; 2209188; 3536887; 3541357; 2579049; 328821; 1626819; 2015132; 6117084; 8757695; 1373409; 2069090; 1529117; 8675136; 5647857; 5239600; 2679165; 790251; 9952109; 6609020; 1582517; 4508075; 1263875; 2025165; 9281237; 2130776; 9663438; 9023715; 758815; 152554; 952749; 5677420; 2019777; 3313549; 4380549; 4651545; 7648702; 1349148; 5110748; 6569695; 8068904; 9525921; 3831514; 3623992; 721053; 429809; 4683548; 8714938; 7045600; 1967494; 8462531; 6219951; 3786155; 9199945; 6147085; 9233656; 9032005; 5216395; 9587000; 1216520; 8379822; 174213; 1148104; 1642094; 8350399; 4000453; 1138531; 9408084; 6229680; 9386046; 4405142; 3092686; 4227932; 2832622; 1429319; 7149056; 7243087; 9350746; 7031418; 402861; 1383314; 5881216; 2767469; 8277970; 5400880; 2977427; 2174745; 8761500; 6708186; 5008365; 7248940; 4832596; 1836455; 812461; 7849433; 3198788; 4755679; 7788387; 1370265; 7142429; 6181252; 7839773; 4971665; 6381699; 3565035; 5395776; 8533719; 8510178; 6797611; 5481141; 8197118; 7204458; 1430186; 2144318; 6109812; 1709679; 2828450; 1285444; 2639754; 9278895; 7580536; 2454928; 9604074; 2940641; 7915747; 72301; 7605277; 3590865; 9432284; 8864501; 4454150; 4832035; 8913008; 3871185; 8203014; 7302609; 8940990; 4743851; 4053870; 8916639; 4498866; 2551100; 962928; 9142984; 4930506; 4094894; 7980172; 55685; 380534; 317566; 6935114; 408044; 2925897; 2333839; 7740909; 7350618; 474628; 5403085; 923150; 9411161; 5835459; 7783663; 6312087; 3114975; 7693928; 5692771; 7915138; 5680115; 8859382; 5513213; 8677152; 8552967; 1890828; 9128588; 1474473; 4000712; 5273223; 9776410; 3895586; 219326; 3375230; 5457101; 3515766; 7762810; 6731124; 812700; 757313; 1507718; 9321133; 5532052; 2632952; 6054809; 6341312; 6079019; 4657391; 3055086; 9680991; 7132221; 9518553; 8610907; 8258056; 5234329; 5321196; 6258978; 8703881; 5080072; 804610; 8370208; 3976935; 3489478; 130260; 4208566; 2202032; 9295930; 5465694; 4375167; 1319964; 5793078; 792076; 6840314; 274901; 8185087; 1160258; 7830932; 9606386; 6507481; 5840196; 8065882; 4663986; 8734133; 9805401; 3832519; 2393623; 629082; 1207599; 2449122; 6348368; 3930978; 7331484; 1548572; 3249845; 801931; 4671; 3993152; 6534296; 7954618; 4580563; 4057786; 8411645; 6106669; 7163370; 1249618; 6032016; 9302430; 98305; 4283173; 1773030; 4642798; 2480639; 902778; 7248981; 1028519; 8122999; 9120271; 1920288; 5486962; 7455828; 2241088; 8354533; 763566; 5440348; 8168887; 4116525; 1863303; 5454569; 1603654; 7431100; 4576951; 6899427; 2425430; 1899226; 3687921; 1814945; 22267; 9651632; 756503; 932249; 9002189; 8424282; 6444139; 5591633; 1772667; 2536911; 7985536; 3706723; 2020876; 5797426; 3606275; 2187101; 27665; 5898988; 1860532; 5294031; 6717874; 2390377; 9897601; 7911078; 6491609; 126271; 9763739; 4001666; 9791; 9949007; 272529; 5918115; 8987068; 8730477] 672)
22
+
23
+ let test7 _ = assert_equal 4 (maximumLength [3923315; 655315; 3026545; 5836948; 6588206; 2815311; 5475867; 9068934; 7861468; 2453761; 8839711; 5327527; 2149460; 5241347; 8901652; 5247869; 2331353; 1626885; 2008561; 5702260; 4182350; 2139201; 101038; 3147600; 5573617; 7967604; 8653644; 9963836; 240235; 5691827; 5986158; 4053687; 7019150; 5990041; 2077228; 6656728; 5692503; 8106720; 6529398; 2876136; 5299214; 5532889; 5251714; 9183989; 9361715; 663557; 8393460; 2406041; 7953722; 8854619; 1759211; 5769738; 8764277; 6629875; 7156367; 5881963; 4286030; 8980435; 6556374; 9633898; 6389470; 5019092; 9901845; 7632312; 1404300; 3522223; 671772] 395)
24
+
25
+ let test8 _ = assert_equal 5 (maximumLength [3667457; 457901; 5487200; 8356554; 2651168; 6194358; 4234193; 392948; 4219742; 523839; 6259716; 241868; 1480404; 5768961; 9551907; 5608147; 419918; 8640266; 2461226; 203876; 8351682; 5879327; 1323810; 5204584; 6847305; 6981556; 6354276; 8329559; 4993026; 527176; 5960561; 8289947; 3548286; 5919075; 29649; 1707398; 2289587; 5599929; 699155; 1703925; 9630014; 778669; 3023493; 5744701; 6106473; 9781967; 3602607; 9637550; 3042238; 8256315; 354959; 3136129; 972646; 3080800; 1136552; 9245581; 1421673; 6621775; 3799365; 4905572; 6651029; 899037; 8050887; 7805073; 2336253; 2649628; 8034568; 7320613; 594344; 3906624; 1803202; 4057961; 7987119; 6033926; 2896316; 7968484; 6197072; 6929222; 5202378; 7450007; 4891860; 7892459; 185738; 7021335; 3117992; 6194544; 571923; 5593193; 9631290; 6513953; 8288178; 136328; 9972551; 1732339; 7373626; 2271079; 1433051; 6359389; 9161781; 8984482; 7589441; 6387712; 2500944; 7883226; 7198102; 5085745; 3628276; 3632793; 5352320; 6452062; 6320526; 736923; 1634674; 1377581; 2650764; 4580526; 1913989; 1761093; 6289494; 6634867; 9512247; 236251; 3970148; 9453667; 5799106; 471000; 3326108; 3293354; 9751793; 601032; 4977857; 8143761; 6742396; 631859; 3932328; 6826561; 6145488; 2172986; 5225673; 4242354; 4483085; 2439760; 3361913; 6043913; 4421622; 54281; 3299734; 6765820; 8133441; 8913415; 1509453; 7148582; 5655572; 8488791; 2636768; 6761256; 4059960; 7758868; 4685163; 6833484; 9567870; 9318983; 3718786; 2918167; 8292629; 6806261; 7163105; 9425478; 5960844; 1823145; 2618162; 1263051; 2043899; 1824206; 3969777; 3166818; 4278552; 9230096; 8197644; 8647631; 4422138; 7284003; 7229713; 6040805; 3252837; 8515023; 3740773; 3455897; 6707179; 3199292; 4323014; 6589488; 1526014; 3962710; 1221032; 4596236; 2830758; 6520429; 385319; 6067506; 6283212; 8071870; 9761556; 8667644; 9455272; 2706658; 1065216; 8256722; 5698204; 8905620; 1804875; 693746; 2939420; 1486326; 6858798; 5503682; 4742903; 5314900; 5800696; 9284324; 1584263; 2313869; 8279541; 3626053; 59462; 6045670; 9914020; 9863563; 98129; 8088685; 6415066; 1282377; 9525808; 5305863; 2460583; 559762; 5793634; 2259448; 8159853; 4104679; 7149885; 3293718; 9556696; 7754483; 5677058; 631352; 7267280; 3795343; 4441394; 5311124; 1629215; 2527096; 6771607; 3671153; 6907031; 6677164; 7041724; 6043634; 4526234; 4689985; 871836; 7100348; 5763768; 5812750; 8076789; 3019661; 3307190; 5154586; 8602611; 3535364; 3408958; 4853484; 1100893; 2512640] 925)
26
+
27
+ let test9 _ = assert_equal 20 (maximumLength [1608698; 597159; 1860777; 1854067; 8731126; 2728129; 3538328; 8098830; 5654737; 9773627; 7531389; 7337223; 8689125; 463077; 1681161; 1613389; 1844165; 9625060; 7376295; 9311636; 1631975; 2730294; 1292510; 1757084; 3177948; 906302; 4232122; 1475456; 9647903; 8940944; 7625594; 9519055; 9999733; 6201007; 7990088; 6281304; 2612437; 5782281; 9717014; 383260; 2346438; 8014529; 5085816; 507585; 4945370; 1590682; 5655709; 4593744; 2346279; 5976913; 675006; 3401244; 7340105; 2708039; 8401197; 7040778; 8226547; 2292463; 1665152; 9933068; 5788884; 1247690; 1761166; 7445796; 4969453; 3308964; 8795620; 7885584; 3382335; 7792574; 7489385; 9709608; 1626098; 6376403; 1379708; 4684642; 8008931; 5014800; 3736110; 717193; 3072181; 9740144; 708299; 1052672; 5943695; 2648850; 683975; 5466214; 9455437; 8396142; 575713; 7521214; 4105229; 8229078; 2955451; 3537251; 8908243; 4998375; 9541586; 5179535; 6514125; 1042498; 8583702; 4823299; 7565473; 6593173; 9477479; 6025885; 7730302; 4045900; 3300740; 6038089; 4839978; 3099194; 26493; 5312770; 9540080; 425197; 7791210] 9)
28
+
29
+ let test10 _ = assert_equal 11 (maximumLength [8041098; 5646447; 9493175; 9444602; 2324381; 8828340; 4263939; 8141072; 5752540; 9874456; 2708035; 7763626; 486352; 1646010; 8963719; 2124576; 1360254; 7491753; 798282; 7700708; 1914852; 7105947; 2841075; 2792564; 4594234; 1783367; 8513655; 8520532; 6931558; 8042976; 8263465; 3801380; 2970576; 7560746; 4373670; 4973846; 703893; 8414909; 8931855; 2386620; 4177362; 5217054; 6100706; 9711158; 8416795; 7669684; 4286902; 2349805; 7574286; 1694314; 2577312; 9050670; 8433847; 1864429; 5651388; 9814996; 9823327; 4303102; 7670976; 9716466; 4350859; 7377391; 431246; 533114; 5564950; 6073326; 3842952; 9956163; 3945690; 1381686; 5532055; 7839476; 8990053; 8906297; 6241662; 5133997; 870674; 1140433; 9591589; 8110202; 731013; 8126537; 50094; 5523317; 7501259; 9485484; 5636868; 290632; 6217640; 8686524; 476542; 654427; 8893050; 3331479; 9211577; 2121489; 2364713; 5617474; 5601255; 4284850; 4545593; 3830011; 8066824; 6006295; 8554643; 5287826; 2861752; 3636408; 7307197; 4833071; 5153611; 6384031; 6831113; 8225712; 7180019; 9197675; 2297581; 9852330; 68475; 1804872; 7287074; 1653932; 2599301; 9963122; 7669980; 7160877; 4373257; 2680100; 4708513; 9733407; 6767741; 7227108; 5281985; 1848647; 7067965; 5453221; 1257797; 1960892; 7447670; 5639598; 3233499; 1771673; 5711637; 1169935; 4463255; 3272357; 675336; 4520681; 653900; 8711516; 597605; 8572347; 8393899; 1832286; 7089754; 2898094; 3797598; 9840682; 331882; 6915611; 4899021; 5324356; 5613778; 3515791; 6816739; 9659667; 9907274; 2433244; 9445760; 2101661; 2434403; 7019539; 7188598; 8911776; 417102; 1735409; 7235577; 115499; 7115129; 8208128; 2773372; 8652493; 2132879; 9078071; 1410443; 5659892; 3513163; 2291963; 1746874; 4633838; 8679057; 3209519; 3240317; 744878; 3715906; 6019322; 7668580; 5348626; 5130421; 4621716; 8832551; 1741672; 7889223; 1035838; 1902605; 8649966; 3800223; 3313548; 4037330; 7062566; 9604200; 1030747; 6538617; 404287; 8796080; 3226373; 3026786; 9171862; 697788; 8470806; 3346403; 4339767; 5023662; 6398709; 3027483; 770881; 209520; 1840012; 7233066; 4630277; 2363808; 7702142; 8229973; 6597327; 1023406; 749572; 6265374; 5441975; 3060186; 7005950; 3033712; 5823736; 3847250; 4465670; 9353498; 9444316; 3001300; 4591070; 9126995; 4649102; 212854; 4436278; 6083090; 6660255; 8472050; 5173402; 8276659; 4878677; 4504708; 9935953; 402530; 4767180; 3082989; 8570553; 1283293; 4918489; 6971528; 5412525; 9635257; 8101028; 3498003; 959719; 6850930; 4136430; 4280311; 3076934; 4381228; 1550966; 1694794; 6343537; 9451634; 5019140; 6712186; 7152979; 7266145; 798489; 663789; 6109619; 6748510; 1963059; 9123419; 4574574; 2349215; 6299692; 5509001; 3837979; 8854637; 6873903; 6237377; 1205890; 3961540; 92455; 1067335; 4734781; 7889854; 30434; 89654; 6867864; 331848; 4563253; 3813207; 5726428; 5901391; 3463054; 3508153; 3289068; 3420918; 3816683; 2433151; 3872317; 1171727; 1298912; 532139; 9663158; 8579322; 3127854; 4678200; 9852536; 2630594; 4340898; 5034391; 3601053; 8022483; 1445743; 7120693; 7935900; 3336025; 7570738; 1305255; 747576; 319016; 8752559; 9748208; 9708220; 3725252; 6378615; 8403959; 9384186; 2227123; 7424; 6467110; 7011212; 7554705; 1933505; 8771706; 7535328; 828749; 6338993; 2818428; 7737290; 1850147; 7697876; 505808; 6420901; 2112050; 1245106; 494853; 5761411; 2707540; 8868106; 3011161; 7114211; 3245139; 3564243; 7228613; 1945983; 9669509; 2902357; 2991391; 8714470; 6652391; 1073009; 2227227; 2365305; 5900958; 8046092; 9559809; 3143813; 1400341; 2555788; 1514876; 238925; 1912494; 2828790; 9921539; 8093724; 9059720; 2273147; 406200; 5179191; 8524846; 6626925; 3894407; 5806081; 7369856; 3617205; 6608532; 6353307; 8034817; 3232883; 9420357; 7633124; 1932562; 5140868; 9035562; 8320704; 6697681; 6630297; 4165787; 1184691; 8362300; 9464738; 3637463; 6020268; 3974372; 2411821; 8627347; 7487287; 5967599; 9710825; 2058485; 1924920; 6179004; 484908; 3131215; 2090627; 8008225; 7602419; 9365229; 1845687; 1491958; 1890614; 635450; 1257442; 4425184; 2237316; 8076550; 1157496; 6113809; 2080462; 8801841; 5445774; 3916178; 9646430; 7288539; 3113312; 2259082; 4732395; 559204; 7633763; 603867; 2034133; 2163787; 4488857; 2510371; 6781124; 5280302; 7987517; 9715900; 8362428; 6796109; 5773443; 819383; 1036279; 1173048; 4384237; 2162901; 2179607; 4159504; 3427268; 1348756; 5409731; 4631008; 6306157; 6075272; 9303350; 579513; 8258755; 8018787; 8510392; 9728239; 6259271; 6004612; 9190121; 5726601; 6092971; 2214298; 7111071; 4049025; 836435; 8752448; 6792866; 7695800; 1528742; 5360945; 7864186; 796726; 2343261; 5089398; 1512994; 6151580; 9119311; 5145379; 6160110; 5125772; 3238527; 3912519; 2795215; 7128408; 4700097; 8837566; 6653405; 8988487; 8617618; 303636; 444680; 8283585; 6233017; 8065604; 2548259; 7623200; 9944801; 1885741; 8587249; 318421; 9863054; 2806568; 5719917; 450740; 1385444; 7657517; 8853882; 2973076; 6869632; 352441; 6479457; 6299721; 9809482; 5318382; 8618163; 6736408; 4451365; 2359811; 4932775; 8951082; 8085886; 4041514; 6132805; 1751179; 5068495; 3734119; 5587355; 3589140; 4102002; 1430564; 2132892; 3494123; 1744595; 1338414; 549220; 9051050; 731569; 1269349; 9826642; 6247503; 7818187; 4776205; 5998147; 4754492; 4486845; 5060881; 2304124; 2790152; 7243079; 5289284; 6467418; 9951070; 9752437; 362341; 9737030; 741290; 388377; 5383089; 6052922; 7173224; 7476280; 8758489; 8042129; 8404471; 1999786; 8704228; 8245228; 640936; 9079089; 7627672; 1681234; 2394053; 8910000; 9250740; 1555142; 863796; 3747668; 7889358; 6492568; 9496825; 1204400; 705999; 9269561; 555453; 2647906; 6955866; 3671916; 1977544; 526011; 5667956; 6545874; 5546512; 3856055; 6430935; 6932272; 1134158; 9117709; 7106760; 6620403; 4115093; 748959; 7469027; 5748637; 131026; 8362064; 158816; 7961754; 8669273; 4961767; 220757; 1589475; 7193561; 2745289; 9979412; 1334244; 8333179; 5939596; 9721609; 2110175; 9836156; 7192819; 5669883; 2319450; 1839825; 5917678; 9504534; 2576401; 9562624; 852102; 2546372; 4808819; 1846685; 768103; 9794926; 9822110; 5885528; 621221; 2594215; 2114031; 5022959; 3323594; 3317715; 7418041; 6866844; 5719488; 3257650; 8928833; 719042; 2040750; 2038912; 5732142; 8591701; 588642; 498363; 4921086; 269420; 8945049; 1374582; 3266726; 4605088; 7617802; 3342628; 9241395; 1216960; 6771075; 1084257; 3010866; 6293405; 1657131; 4405833; 9685567; 9289107; 3754583; 3889445; 5324107; 4090660; 8475780; 5572172; 3785738; 2406877; 5298268; 6744139; 6794473; 9904669; 404498; 9345628; 1505666; 8055577; 3752513; 4074278; 6157580; 9922983; 4729647; 7877399; 2526017; 3247595; 724640; 267178; 2588408; 7038502; 4811319; 2615403; 9014807; 5501180; 5528533; 914522; 855861; 1330353; 74322; 6763154; 8875257; 4324606; 7767154; 5170540; 2528522; 1868393; 5367855; 7086505; 6696617; 350085; 9570545; 523880; 1504460; 2288534; 3508833; 5369103; 1633783; 6656673; 5990846; 7797892; 9366146; 9528666; 5382819; 3142196; 2701750; 3771845; 8203406; 982719; 3183927; 3942619; 9429660; 1341748; 1653178; 7597273; 1873824; 5155694; 4509652; 7743866; 7083824; 671105; 5639055; 6080997; 6856376; 6449936; 9434224; 4995628; 3258289; 551403; 1430132; 480743; 9865766; 4536628; 1694740; 5437861; 9746206; 4381627; 2523101; 7716783; 8176256; 9566510; 2096564; 1349920; 6358331; 4316682; 7422181; 1896415; 6589647; 6169564; 7563372; 3862914; 1845710; 3661981; 5885629; 5390677; 168052; 4473211; 2833023; 2042024; 7937137; 4602560; 3795131; 8807585; 6465776; 4577846; 2356789; 1085069; 7446293; 1556861; 9400877; 9392523; 4883816; 8542686; 8519479; 7297141; 9742373; 937832; 889990; 3022052; 4852896; 722783; 7713666; 4143371; 195949; 3163099; 6231973; 120670; 6922905] 417)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for maximumLength" >::: [
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
find_the_maximum_length_of_valid_subsequence_ii/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.maximumLength(List(1,2,3,4,5),2), 5)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.maximumLength(List(1,4,2,3,1,4),3), 4)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.maximumLength(List(5666738, 5833160, 3076685, 8180120, 5929886, 4983393, 1613148, 2983138, 54000, 7931452, 2079819, 7055417, 7914923, 24008, 5985317, 9332595, 5512226, 1445954, 7539029, 3710155),696), 3)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.maximumLength(List(6047072, 98741, 8984146, 5536188, 6016195, 1310400, 2625558, 9493761, 7873055, 8630685, 8717909, 147966, 5272047, 9801390, 2615060, 4521233, 3716897, 7519860, 2429393, 2156534, 2992707, 3406565, 8135288, 5284825, 3817989, 5021454, 7762994, 4253820, 2715970, 6031495, 9866044, 3485773, 3090258, 8955762, 2894077, 4555263, 4170494, 9363773, 8961764, 1631505, 4991868, 8027767, 9244952, 9846545, 9079928, 9539985, 4192893, 6175164, 3464062, 2349941, 4735432, 9566407, 1987972, 5736784, 8630030, 7248817, 8503380, 1841055, 1020608, 7023782, 99125, 9042958, 4683875, 263884, 2140670, 1877196, 9972966, 7741247, 4103831, 9657721, 9088642, 5879802, 1293213, 9735453, 9927402, 6964158, 5428760, 7915977, 4398892, 8970197, 5798169, 2739972, 2711593, 7338980, 5483798, 493782, 9063843, 3535274, 8363706, 9333858, 7338766, 9399042, 7668315, 9243080, 302292, 4340976, 5155158, 2252850, 5218166, 2390239, 9993534, 7518932, 1260722, 3223733, 7078122, 554640, 6882224, 3990171, 2254840, 711951, 5227962, 4341906, 8265561, 3990738, 8370730, 9439723, 5280672, 3404340, 7006735, 4412792, 4311056, 1387266, 2061091, 4724236, 5394193, 1718039, 6263375, 9010112, 6774047, 6226055, 6739726, 8713637, 6493305, 3034292, 3658274, 8903418, 2149313, 2495482, 6400151, 649911, 4701644, 5182968, 9135541, 520529, 3491980, 2617850, 5344666, 546982, 855459, 9047307, 4337507, 5850068, 2429508, 5060912, 2281840, 3729530, 4159283, 5462973, 406369, 2149500, 435990, 5104488, 3411179, 7523837, 6777136, 5422689, 5320577, 1623256, 5307336, 1565039, 6061996, 9649175, 9652269, 1694104, 7166144, 121304, 8286885, 5006223, 1084728, 4595993, 2291651, 8567221, 9374616, 2150095, 2868264, 7283466, 5395194, 6340601, 811720, 3707968, 7375340, 5009678, 7632237, 3250095, 9535561, 7931767, 1783182, 4262378, 6036083, 9912783, 190190, 559433, 5634006, 7298847, 2058448, 5283556, 6986613, 7394596, 5172011, 4619271, 4271092, 316760, 2399238, 7589843, 2414019, 3620607, 69921, 1189775, 7589277, 7620540, 1325718, 7077110, 265303, 9485528, 6663530, 883621, 1925883, 5507639, 8547856, 689729, 5296827, 3808248, 7096824, 9755556, 9603604, 1353469, 3329211, 4156234, 5816295, 6436996, 442526, 4479626, 9400866, 373182, 5222046, 2948706, 8885283, 9891258, 5289888, 7568504, 3819942, 2406814, 1913699, 3182309, 3286823, 49532, 9744747, 1816820, 6849994, 1597622, 6057667, 4722912, 6997268, 8073871, 8880753, 8270843, 6242433, 7625459, 6563938, 4876276, 5483193, 6719547, 9850866, 2415529, 3427322, 7543811, 5867236, 3397942, 5418789, 2122390, 3111369, 434087, 1338008, 6964209, 6890216, 7824140, 5816813, 5077407, 8277312, 8055094, 592390, 5618549, 374779, 2368545, 6410866, 5793767, 7714735, 7437483, 2322221, 327799, 359573, 2148943, 5703958, 1612899, 981071, 9316951, 4127189, 4842565, 2156153, 9382809, 5089585, 2947818, 4722358, 2983076, 6340398, 7926500, 2974778, 8578782, 5942676, 730240, 1814032, 3216539, 6179830, 1264409, 5986885, 9645675, 4443777, 1827562, 2284857, 957776, 2245377, 3240211, 1603808, 7490811, 1545097, 1911338, 9255535, 8524190, 4275383, 7227022, 7083403, 5102173, 2003887, 2131606, 3869027, 6436898, 7099328, 5148207, 629296, 9903936, 3148804, 9782862, 823441, 6875933, 4370514, 8340993, 3491666, 2795889, 1786809, 3885657, 674211, 3215848, 9239906, 1320840, 4197400, 8437731, 1629069, 8900889, 2605355, 4471206, 3964019, 8687346),564), 6)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.maximumLength(List(521419, 4724126, 2319089, 5152298, 4398845, 5355104, 3436896, 9131500, 4716913, 4778303, 541725, 6369024, 1147692, 2907150, 6730845, 973592, 868082, 788461, 8046938, 1329259, 7751076, 1928531, 743446, 4136510, 1493143, 7895147, 3178694, 9326993, 456922, 739351, 9874393, 4683289, 1342004, 8448246, 4290803, 4215446, 9391933, 1870897, 6075113, 4181833, 6757828, 9110268, 1977611, 3873075, 3117410, 7436528, 9406601, 3136485, 7863939, 5706249, 5280495, 7308478, 9428065, 4944625, 4479170, 3945928, 7343336, 5146704, 2880213, 3668073, 3981866, 8893537, 4811317, 2893951, 3856884, 8249663, 7480352, 4276569, 920591, 4959695, 6103693, 3659192, 1687582, 2150300, 1622418, 5837247, 403494, 5161334, 2412302, 5513664, 133347, 4540293, 333892, 3729368, 1526907, 4869168, 2666494, 2635582, 6374107, 4189521, 9772154, 5467844, 2333963, 1046336, 6276799, 8805989, 2138492, 8939289, 4912190, 3541951, 9912452, 542693, 6605063, 6084501, 5726126, 7294586, 383237, 6574327, 3025578, 8723168, 2283908, 9043048, 7595583, 877235, 3833274, 3502303, 7784408, 7956154, 536567, 5841025, 861460, 502188, 7412108, 9979034, 8878316, 9140356, 7342859, 7298729, 1404717, 2311500, 2748498, 6614627, 6949444, 2209840, 9738261, 9427623, 2353605, 325764, 1263026, 2708663, 5849094, 4209937, 2471438, 7629853, 6682812, 1021662, 1062298, 4943862, 8456821, 8561025, 9543409, 2244916, 9612052, 3368765, 6963075, 6758800, 3403828, 2207842, 5835809, 4591383, 3372528, 7802409, 2537901, 7692983, 455731, 8822404, 2653340, 1889773, 4808027, 6826495, 1728424, 3391832, 911410, 4125807, 9365809, 3813871, 9405929, 1028290, 3183035, 7361029, 459190, 8330601, 9294912, 7016171, 7808454, 204091, 9770150, 9173344, 130300, 6614262, 6326916, 689161, 5960014, 774415, 2865417, 9265348, 3423492, 9046872, 3318872, 9814738, 6471935, 7417437, 2279155, 6770773, 1301612, 7349538, 2827325, 3490743, 3999657, 2173659, 1413044, 7980078, 7552335, 9981412, 1864276, 6800608, 5978473, 8147836, 7181442, 1560735, 7518240, 533956, 5317213, 8936411, 7675214, 113927, 1592905, 4200248, 5901938, 1885265, 7128106, 9272719, 8093598, 3147407, 2431169, 399647, 9580733, 5451219, 2203110, 3446692, 8497490, 8678770, 9403114, 2307292, 3990574, 2628821, 2926104, 9989554, 7019949, 1536789, 4499270, 4951565, 5929628, 1978377, 2376820, 6333842, 7005918, 6581390, 6440500, 5070245, 1752709, 9557529, 2067018, 1457761, 4624774, 7998799, 1999516, 7818143, 5071268, 809062, 3165834, 9983060, 9553059, 2413038, 5688754, 8441919, 6158057, 5417205, 7353564, 8127658, 3066170, 3718768, 2040905, 9405205, 8185241, 6696292, 8527488, 2754475, 3254102, 2214870, 886742, 3526595, 962223, 9009880, 9900964, 3782329, 2657928, 569849, 5026641, 2489928, 3160429, 7117508, 5784893, 9485100, 8808766, 4292046, 4942010, 2770884, 8218341, 4815917, 9602311, 7224738, 746664, 9581196, 5046124, 690829, 9750273, 9027964, 599075, 3430962, 4376704, 8022487, 2611004, 4380904, 9755458, 6480704, 1031427, 8847017, 5206666, 3803008, 6961472, 5999880, 63543),287), 7)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.maximumLength(List(7915949, 1022332, 3765020, 7134429, 4939013, 5606624, 8369811, 4045493, 5402808, 5098903, 5018127, 6400570, 8564015, 9571054, 5204721, 8279325, 8116467, 7678487, 1201352, 2620279, 4443193, 8514009, 1322191, 4626213, 4676628, 4415277, 5606432, 8575850, 9856571, 6272689, 5567345, 325104, 3131488, 4277154, 7276167, 2408294, 6324996, 9063813, 218769, 4253226, 8480489, 4365605, 7309748, 4678698, 8567311, 8167161, 1823637, 5477093, 8917720, 5929539, 5406721, 4901312, 5521462, 6281001, 3234391, 3230702, 8572462, 7343212, 3622740, 4982491, 4625493, 8869515, 5944811, 7057570, 5063514, 4327448, 2660517, 1752759, 4286722, 5666776, 7485968, 5598413, 2155412, 2453027, 9860204, 3057631, 2608145, 9784707, 8700969, 6727131, 565341, 6507764, 5937986, 2481540, 4087833, 6802849, 1796691, 3166824, 8560914, 8661512, 6577318, 6634578, 1047714, 4509571, 1019511, 6987034, 5169909, 4677532, 1342838, 8109243, 8108682, 4311267, 7885046, 8666486, 9032615, 2444428, 8795894, 5147554, 4148694, 1302403, 6741041, 1619943, 9384041, 4345082, 2616183, 3917891, 7830114, 3351657, 6550146, 4111711, 2286283, 1823957, 7907925, 5269974, 1125903, 1420045, 2043872, 3417820, 9391392, 4039445, 1411976, 3626094, 4676219, 4964054, 9519230, 4374267, 8696770, 7178941, 1496062, 1473786, 1420427, 5100875, 1514145, 7902486, 9603019, 6989583, 9187262, 5841351, 7610592, 5432536, 3576294, 4287562, 3241147, 2661809, 2940350, 1639408, 4080857, 2327710, 4713352, 486401, 3820650, 2881971, 5228754, 326219, 5032371, 1744081, 8626561, 9850290, 5015201, 2863899, 1026326, 7826260, 7323357, 4984230, 7119762, 348631, 257044, 9805336, 8637674, 2775590, 1338834, 8045551, 1205039, 4426530, 3259954, 7704524, 2190859, 8076065, 6965872, 371836, 5462208, 3282264, 4096340, 6291453, 6657029, 5274437, 3817026, 8517669, 2323411, 6201596, 3422564, 2979963, 2568219, 1311210, 1288453, 7517743, 8647754, 9671625, 5660313, 5245530, 7115516, 4522110, 9162550, 7748709, 7577754, 8998683, 6565267, 6888265, 5387873, 9997953, 2010477, 4374087, 9222488, 7534022, 1325499, 5289822, 8700941, 5915531, 5249700, 7072433, 9792347, 4532846, 7912906, 1039534, 4168982, 6853010, 1357417, 5126361, 7540084, 9695497, 7180550, 9410891, 7530609, 5384124, 4510241, 3925032, 5468938, 5276335, 3207198, 538726, 6900227, 4598688, 452221, 4933923, 13427, 3035004, 15234, 1670059, 9168754, 2235153, 4092614, 6106470, 7649823, 9015469, 3361025, 7174708, 8854628, 7432016, 3359259, 4525190, 8107442, 6298215, 772026, 3858262, 3217437, 5241079, 7786987, 7883141, 2353943, 1567658, 6890297, 1874658, 2436660, 2086779, 1893785, 4983255, 7283345, 1021215, 2105612, 6969603, 3804199, 1594154, 7675831, 3331281, 3409536, 7962299, 7535841, 9530738, 1093826, 3439511, 7926518, 8217089, 9393979, 1009464, 5321964, 2434417, 3250551, 1476750, 250405, 5336579, 7378430, 5647567, 3137697, 614103, 3051315, 2990285, 3541382, 9883804, 3431077, 7360940, 3781496, 6325587, 4096126, 5561001, 9099845, 4924693, 9022491, 4782787, 6483408, 9945947, 9963374, 4881092, 4986237, 7433922, 4681216, 3574479, 7404854, 831004, 9330202, 8190403, 8313653, 7293578, 7864580, 3371977, 8034220, 4701750, 6480609, 6107917, 3951531, 2083675, 9504846, 2134023, 2564331, 6582858, 238015, 8118236, 522939, 1191507, 6977201, 2756219, 9503164, 1392037, 1787334, 543370, 1041480, 2195134, 5546747, 3987370, 9805200, 3915026, 1396111, 1050404, 2458575, 9574050, 86132, 4153175, 8125660, 3835919, 4378615, 4434320, 1254407, 2145569, 1401802, 6668286, 2816259, 9944955, 5506766, 6026304, 6008247, 5621322, 5951795, 2209188, 3536887, 3541357, 2579049, 328821, 1626819, 2015132, 6117084, 8757695, 1373409, 2069090, 1529117, 8675136, 5647857, 5239600, 2679165, 790251, 9952109, 6609020, 1582517, 4508075, 1263875, 2025165, 9281237, 2130776, 9663438, 9023715, 758815, 152554, 952749, 5677420, 2019777, 3313549, 4380549, 4651545, 7648702, 1349148, 5110748, 6569695, 8068904, 9525921, 3831514, 3623992, 721053, 429809, 4683548, 8714938, 7045600, 1967494, 8462531, 6219951, 3786155, 9199945, 6147085, 9233656, 9032005, 5216395, 9587000, 1216520, 8379822, 174213, 1148104, 1642094, 8350399, 4000453, 1138531, 9408084, 6229680, 9386046, 4405142, 3092686, 4227932, 2832622, 1429319, 7149056, 7243087, 9350746, 7031418, 402861, 1383314, 5881216, 2767469, 8277970, 5400880, 2977427, 2174745, 8761500, 6708186, 5008365, 7248940, 4832596, 1836455, 812461, 7849433, 3198788, 4755679, 7788387, 1370265, 7142429, 6181252, 7839773, 4971665, 6381699, 3565035, 5395776, 8533719, 8510178, 6797611, 5481141, 8197118, 7204458, 1430186, 2144318, 6109812, 1709679, 2828450, 1285444, 2639754, 9278895, 7580536, 2454928, 9604074, 2940641, 7915747, 72301, 7605277, 3590865, 9432284, 8864501, 4454150, 4832035, 8913008, 3871185, 8203014, 7302609, 8940990, 4743851, 4053870, 8916639, 4498866, 2551100, 962928, 9142984, 4930506, 4094894, 7980172, 55685, 380534, 317566, 6935114, 408044, 2925897, 2333839, 7740909, 7350618, 474628, 5403085, 923150, 9411161, 5835459, 7783663, 6312087, 3114975, 7693928, 5692771, 7915138, 5680115, 8859382, 5513213, 8677152, 8552967, 1890828, 9128588, 1474473, 4000712, 5273223, 9776410, 3895586, 219326, 3375230, 5457101, 3515766, 7762810, 6731124, 812700, 757313, 1507718, 9321133, 5532052, 2632952, 6054809, 6341312, 6079019, 4657391, 3055086, 9680991, 7132221, 9518553, 8610907, 8258056, 5234329, 5321196, 6258978, 8703881, 5080072, 804610, 8370208, 3976935, 3489478, 130260, 4208566, 2202032, 9295930, 5465694, 4375167, 1319964, 5793078, 792076, 6840314, 274901, 8185087, 1160258, 7830932, 9606386, 6507481, 5840196, 8065882, 4663986, 8734133, 9805401, 3832519, 2393623, 629082, 1207599, 2449122, 6348368, 3930978, 7331484, 1548572, 3249845, 801931, 4671, 3993152, 6534296, 7954618, 4580563, 4057786, 8411645, 6106669, 7163370, 1249618, 6032016, 9302430, 98305, 4283173, 1773030, 4642798, 2480639, 902778, 7248981, 1028519, 8122999, 9120271, 1920288, 5486962, 7455828, 2241088, 8354533, 763566, 5440348, 8168887, 4116525, 1863303, 5454569, 1603654, 7431100, 4576951, 6899427, 2425430, 1899226, 3687921, 1814945, 22267, 9651632, 756503, 932249, 9002189, 8424282, 6444139, 5591633, 1772667, 2536911, 7985536, 3706723, 2020876, 5797426, 3606275, 2187101, 27665, 5898988, 1860532, 5294031, 6717874, 2390377, 9897601, 7911078, 6491609, 126271, 9763739, 4001666, 9791, 9949007, 272529, 5918115, 8987068, 8730477),672), 8)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.maximumLength(List(3923315, 655315, 3026545, 5836948, 6588206, 2815311, 5475867, 9068934, 7861468, 2453761, 8839711, 5327527, 2149460, 5241347, 8901652, 5247869, 2331353, 1626885, 2008561, 5702260, 4182350, 2139201, 101038, 3147600, 5573617, 7967604, 8653644, 9963836, 240235, 5691827, 5986158, 4053687, 7019150, 5990041, 2077228, 6656728, 5692503, 8106720, 6529398, 2876136, 5299214, 5532889, 5251714, 9183989, 9361715, 663557, 8393460, 2406041, 7953722, 8854619, 1759211, 5769738, 8764277, 6629875, 7156367, 5881963, 4286030, 8980435, 6556374, 9633898, 6389470, 5019092, 9901845, 7632312, 1404300, 3522223, 671772),395), 4)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.maximumLength(List(3667457, 457901, 5487200, 8356554, 2651168, 6194358, 4234193, 392948, 4219742, 523839, 6259716, 241868, 1480404, 5768961, 9551907, 5608147, 419918, 8640266, 2461226, 203876, 8351682, 5879327, 1323810, 5204584, 6847305, 6981556, 6354276, 8329559, 4993026, 527176, 5960561, 8289947, 3548286, 5919075, 29649, 1707398, 2289587, 5599929, 699155, 1703925, 9630014, 778669, 3023493, 5744701, 6106473, 9781967, 3602607, 9637550, 3042238, 8256315, 354959, 3136129, 972646, 3080800, 1136552, 9245581, 1421673, 6621775, 3799365, 4905572, 6651029, 899037, 8050887, 7805073, 2336253, 2649628, 8034568, 7320613, 594344, 3906624, 1803202, 4057961, 7987119, 6033926, 2896316, 7968484, 6197072, 6929222, 5202378, 7450007, 4891860, 7892459, 185738, 7021335, 3117992, 6194544, 571923, 5593193, 9631290, 6513953, 8288178, 136328, 9972551, 1732339, 7373626, 2271079, 1433051, 6359389, 9161781, 8984482, 7589441, 6387712, 2500944, 7883226, 7198102, 5085745, 3628276, 3632793, 5352320, 6452062, 6320526, 736923, 1634674, 1377581, 2650764, 4580526, 1913989, 1761093, 6289494, 6634867, 9512247, 236251, 3970148, 9453667, 5799106, 471000, 3326108, 3293354, 9751793, 601032, 4977857, 8143761, 6742396, 631859, 3932328, 6826561, 6145488, 2172986, 5225673, 4242354, 4483085, 2439760, 3361913, 6043913, 4421622, 54281, 3299734, 6765820, 8133441, 8913415, 1509453, 7148582, 5655572, 8488791, 2636768, 6761256, 4059960, 7758868, 4685163, 6833484, 9567870, 9318983, 3718786, 2918167, 8292629, 6806261, 7163105, 9425478, 5960844, 1823145, 2618162, 1263051, 2043899, 1824206, 3969777, 3166818, 4278552, 9230096, 8197644, 8647631, 4422138, 7284003, 7229713, 6040805, 3252837, 8515023, 3740773, 3455897, 6707179, 3199292, 4323014, 6589488, 1526014, 3962710, 1221032, 4596236, 2830758, 6520429, 385319, 6067506, 6283212, 8071870, 9761556, 8667644, 9455272, 2706658, 1065216, 8256722, 5698204, 8905620, 1804875, 693746, 2939420, 1486326, 6858798, 5503682, 4742903, 5314900, 5800696, 9284324, 1584263, 2313869, 8279541, 3626053, 59462, 6045670, 9914020, 9863563, 98129, 8088685, 6415066, 1282377, 9525808, 5305863, 2460583, 559762, 5793634, 2259448, 8159853, 4104679, 7149885, 3293718, 9556696, 7754483, 5677058, 631352, 7267280, 3795343, 4441394, 5311124, 1629215, 2527096, 6771607, 3671153, 6907031, 6677164, 7041724, 6043634, 4526234, 4689985, 871836, 7100348, 5763768, 5812750, 8076789, 3019661, 3307190, 5154586, 8602611, 3535364, 3408958, 4853484, 1100893, 2512640),925), 5)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.maximumLength(List(1608698, 597159, 1860777, 1854067, 8731126, 2728129, 3538328, 8098830, 5654737, 9773627, 7531389, 7337223, 8689125, 463077, 1681161, 1613389, 1844165, 9625060, 7376295, 9311636, 1631975, 2730294, 1292510, 1757084, 3177948, 906302, 4232122, 1475456, 9647903, 8940944, 7625594, 9519055, 9999733, 6201007, 7990088, 6281304, 2612437, 5782281, 9717014, 383260, 2346438, 8014529, 5085816, 507585, 4945370, 1590682, 5655709, 4593744, 2346279, 5976913, 675006, 3401244, 7340105, 2708039, 8401197, 7040778, 8226547, 2292463, 1665152, 9933068, 5788884, 1247690, 1761166, 7445796, 4969453, 3308964, 8795620, 7885584, 3382335, 7792574, 7489385, 9709608, 1626098, 6376403, 1379708, 4684642, 8008931, 5014800, 3736110, 717193, 3072181, 9740144, 708299, 1052672, 5943695, 2648850, 683975, 5466214, 9455437, 8396142, 575713, 7521214, 4105229, 8229078, 2955451, 3537251, 8908243, 4998375, 9541586, 5179535, 6514125, 1042498, 8583702, 4823299, 7565473, 6593173, 9477479, 6025885, 7730302, 4045900, 3300740, 6038089, 4839978, 3099194, 26493, 5312770, 9540080, 425197, 7791210),9), 20)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.maximumLength(List(8041098, 5646447, 9493175, 9444602, 2324381, 8828340, 4263939, 8141072, 5752540, 9874456, 2708035, 7763626, 486352, 1646010, 8963719, 2124576, 1360254, 7491753, 798282, 7700708, 1914852, 7105947, 2841075, 2792564, 4594234, 1783367, 8513655, 8520532, 6931558, 8042976, 8263465, 3801380, 2970576, 7560746, 4373670, 4973846, 703893, 8414909, 8931855, 2386620, 4177362, 5217054, 6100706, 9711158, 8416795, 7669684, 4286902, 2349805, 7574286, 1694314, 2577312, 9050670, 8433847, 1864429, 5651388, 9814996, 9823327, 4303102, 7670976, 9716466, 4350859, 7377391, 431246, 533114, 5564950, 6073326, 3842952, 9956163, 3945690, 1381686, 5532055, 7839476, 8990053, 8906297, 6241662, 5133997, 870674, 1140433, 9591589, 8110202, 731013, 8126537, 50094, 5523317, 7501259, 9485484, 5636868, 290632, 6217640, 8686524, 476542, 654427, 8893050, 3331479, 9211577, 2121489, 2364713, 5617474, 5601255, 4284850, 4545593, 3830011, 8066824, 6006295, 8554643, 5287826, 2861752, 3636408, 7307197, 4833071, 5153611, 6384031, 6831113, 8225712, 7180019, 9197675, 2297581, 9852330, 68475, 1804872, 7287074, 1653932, 2599301, 9963122, 7669980, 7160877, 4373257, 2680100, 4708513, 9733407, 6767741, 7227108, 5281985, 1848647, 7067965, 5453221, 1257797, 1960892, 7447670, 5639598, 3233499, 1771673, 5711637, 1169935, 4463255, 3272357, 675336, 4520681, 653900, 8711516, 597605, 8572347, 8393899, 1832286, 7089754, 2898094, 3797598, 9840682, 331882, 6915611, 4899021, 5324356, 5613778, 3515791, 6816739, 9659667, 9907274, 2433244, 9445760, 2101661, 2434403, 7019539, 7188598, 8911776, 417102, 1735409, 7235577, 115499, 7115129, 8208128, 2773372, 8652493, 2132879, 9078071, 1410443, 5659892, 3513163, 2291963, 1746874, 4633838, 8679057, 3209519, 3240317, 744878, 3715906, 6019322, 7668580, 5348626, 5130421, 4621716, 8832551, 1741672, 7889223, 1035838, 1902605, 8649966, 3800223, 3313548, 4037330, 7062566, 9604200, 1030747, 6538617, 404287, 8796080, 3226373, 3026786, 9171862, 697788, 8470806, 3346403, 4339767, 5023662, 6398709, 3027483, 770881, 209520, 1840012, 7233066, 4630277, 2363808, 7702142, 8229973, 6597327, 1023406, 749572, 6265374, 5441975, 3060186, 7005950, 3033712, 5823736, 3847250, 4465670, 9353498, 9444316, 3001300, 4591070, 9126995, 4649102, 212854, 4436278, 6083090, 6660255, 8472050, 5173402, 8276659, 4878677, 4504708, 9935953, 402530, 4767180, 3082989, 8570553, 1283293, 4918489, 6971528, 5412525, 9635257, 8101028, 3498003, 959719, 6850930, 4136430, 4280311, 3076934, 4381228, 1550966, 1694794, 6343537, 9451634, 5019140, 6712186, 7152979, 7266145, 798489, 663789, 6109619, 6748510, 1963059, 9123419, 4574574, 2349215, 6299692, 5509001, 3837979, 8854637, 6873903, 6237377, 1205890, 3961540, 92455, 1067335, 4734781, 7889854, 30434, 89654, 6867864, 331848, 4563253, 3813207, 5726428, 5901391, 3463054, 3508153, 3289068, 3420918, 3816683, 2433151, 3872317, 1171727, 1298912, 532139, 9663158, 8579322, 3127854, 4678200, 9852536, 2630594, 4340898, 5034391, 3601053, 8022483, 1445743, 7120693, 7935900, 3336025, 7570738, 1305255, 747576, 319016, 8752559, 9748208, 9708220, 3725252, 6378615, 8403959, 9384186, 2227123, 7424, 6467110, 7011212, 7554705, 1933505, 8771706, 7535328, 828749, 6338993, 2818428, 7737290, 1850147, 7697876, 505808, 6420901, 2112050, 1245106, 494853, 5761411, 2707540, 8868106, 3011161, 7114211, 3245139, 3564243, 7228613, 1945983, 9669509, 2902357, 2991391, 8714470, 6652391, 1073009, 2227227, 2365305, 5900958, 8046092, 9559809, 3143813, 1400341, 2555788, 1514876, 238925, 1912494, 2828790, 9921539, 8093724, 9059720, 2273147, 406200, 5179191, 8524846, 6626925, 3894407, 5806081, 7369856, 3617205, 6608532, 6353307, 8034817, 3232883, 9420357, 7633124, 1932562, 5140868, 9035562, 8320704, 6697681, 6630297, 4165787, 1184691, 8362300, 9464738, 3637463, 6020268, 3974372, 2411821, 8627347, 7487287, 5967599, 9710825, 2058485, 1924920, 6179004, 484908, 3131215, 2090627, 8008225, 7602419, 9365229, 1845687, 1491958, 1890614, 635450, 1257442, 4425184, 2237316, 8076550, 1157496, 6113809, 2080462, 8801841, 5445774, 3916178, 9646430, 7288539, 3113312, 2259082, 4732395, 559204, 7633763, 603867, 2034133, 2163787, 4488857, 2510371, 6781124, 5280302, 7987517, 9715900, 8362428, 6796109, 5773443, 819383, 1036279, 1173048, 4384237, 2162901, 2179607, 4159504, 3427268, 1348756, 5409731, 4631008, 6306157, 6075272, 9303350, 579513, 8258755, 8018787, 8510392, 9728239, 6259271, 6004612, 9190121, 5726601, 6092971, 2214298, 7111071, 4049025, 836435, 8752448, 6792866, 7695800, 1528742, 5360945, 7864186, 796726, 2343261, 5089398, 1512994, 6151580, 9119311, 5145379, 6160110, 5125772, 3238527, 3912519, 2795215, 7128408, 4700097, 8837566, 6653405, 8988487, 8617618, 303636, 444680, 8283585, 6233017, 8065604, 2548259, 7623200, 9944801, 1885741, 8587249, 318421, 9863054, 2806568, 5719917, 450740, 1385444, 7657517, 8853882, 2973076, 6869632, 352441, 6479457, 6299721, 9809482, 5318382, 8618163, 6736408, 4451365, 2359811, 4932775, 8951082, 8085886, 4041514, 6132805, 1751179, 5068495, 3734119, 5587355, 3589140, 4102002, 1430564, 2132892, 3494123, 1744595, 1338414, 549220, 9051050, 731569, 1269349, 9826642, 6247503, 7818187, 4776205, 5998147, 4754492, 4486845, 5060881, 2304124, 2790152, 7243079, 5289284, 6467418, 9951070, 9752437, 362341, 9737030, 741290, 388377, 5383089, 6052922, 7173224, 7476280, 8758489, 8042129, 8404471, 1999786, 8704228, 8245228, 640936, 9079089, 7627672, 1681234, 2394053, 8910000, 9250740, 1555142, 863796, 3747668, 7889358, 6492568, 9496825, 1204400, 705999, 9269561, 555453, 2647906, 6955866, 3671916, 1977544, 526011, 5667956, 6545874, 5546512, 3856055, 6430935, 6932272, 1134158, 9117709, 7106760, 6620403, 4115093, 748959, 7469027, 5748637, 131026, 8362064, 158816, 7961754, 8669273, 4961767, 220757, 1589475, 7193561, 2745289, 9979412, 1334244, 8333179, 5939596, 9721609, 2110175, 9836156, 7192819, 5669883, 2319450, 1839825, 5917678, 9504534, 2576401, 9562624, 852102, 2546372, 4808819, 1846685, 768103, 9794926, 9822110, 5885528, 621221, 2594215, 2114031, 5022959, 3323594, 3317715, 7418041, 6866844, 5719488, 3257650, 8928833, 719042, 2040750, 2038912, 5732142, 8591701, 588642, 498363, 4921086, 269420, 8945049, 1374582, 3266726, 4605088, 7617802, 3342628, 9241395, 1216960, 6771075, 1084257, 3010866, 6293405, 1657131, 4405833, 9685567, 9289107, 3754583, 3889445, 5324107, 4090660, 8475780, 5572172, 3785738, 2406877, 5298268, 6744139, 6794473, 9904669, 404498, 9345628, 1505666, 8055577, 3752513, 4074278, 6157580, 9922983, 4729647, 7877399, 2526017, 3247595, 724640, 267178, 2588408, 7038502, 4811319, 2615403, 9014807, 5501180, 5528533, 914522, 855861, 1330353, 74322, 6763154, 8875257, 4324606, 7767154, 5170540, 2528522, 1868393, 5367855, 7086505, 6696617, 350085, 9570545, 523880, 1504460, 2288534, 3508833, 5369103, 1633783, 6656673, 5990846, 7797892, 9366146, 9528666, 5382819, 3142196, 2701750, 3771845, 8203406, 982719, 3183927, 3942619, 9429660, 1341748, 1653178, 7597273, 1873824, 5155694, 4509652, 7743866, 7083824, 671105, 5639055, 6080997, 6856376, 6449936, 9434224, 4995628, 3258289, 551403, 1430132, 480743, 9865766, 4536628, 1694740, 5437861, 9746206, 4381627, 2523101, 7716783, 8176256, 9566510, 2096564, 1349920, 6358331, 4316682, 7422181, 1896415, 6589647, 6169564, 7563372, 3862914, 1845710, 3661981, 5885629, 5390677, 168052, 4473211, 2833023, 2042024, 7937137, 4602560, 3795131, 8807585, 6465776, 4577846, 2356789, 1085069, 7446293, 1556861, 9400877, 9392523, 4883816, 8542686, 8519479, 7297141, 9742373, 937832, 889990, 3022052, 4852896, 722783, 7713666, 4143371, 195949, 3163099, 6231973, 120670, 6922905),417), 11)
42
+ }
43
+
44
+ }